/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.header {
  background: #2563eb;
  padding: 14px 24px;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 16px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.2;
}

/* ===== MAIN ===== */
.main {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ===== INPUT CARD ===== */
.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.input-card {
  margin-bottom: 20px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s;
  background: #f8fafc;
}

.task-input:focus {
  border-color: #2563eb;
  background: white;
}

.task-input::placeholder {
  color: #94a3b8;
}

/* Add button */
.btn-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  background: #4b5f82;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}

.btn-add:hover {
  background: #2563eb;
}

/* ===== CONTENT AREA ===== */
.content-area {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* ===== TASK SECTION ===== */
.task-section {
  flex: 1;
  min-width: 0;
}

/* TABS */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 9px;
  width: fit-content;
}

.tab {
  padding: 7px 20px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  transition: all 0.18s;
}

.tab.active {
  background: white;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* TASK LIST */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
}

.task-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.task-item.completed {
  opacity: 0.75;
}

/* Checkbox */
.checkbox-wrap {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-wrap input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  background: white;
}

.custom-checkbox.checked {
  background: #2563eb;
  border-color: #2563eb;
}

/* Task name */
.task-name {
  flex: 1;
  font-size: 14px;
  color: #334155;
  font-weight: 400;
}

.task-name.strikethrough {
  text-decoration: line-through;
  color: #94a3b8;
}

/* Task actions */
.task-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 7px;
  background: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.action-btn:hover {
  background: #e2e8f0;
}

/* ===== STATS CARD ===== */
.stats-card {
  width: 220px;
  flex-shrink: 0;
  background: white;
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.stats-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrap.blue  { background: #eff6ff; }
.stat-icon-wrap.green { background: #f0fdf4; }
.stat-icon-wrap.orange{ background: #fff7ed; }

.stat-label {
  flex: 1;
  font-size: 13px;
  color: #475569;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: #94a3b8;
}

.footer-link {
  color: #2563eb;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 14px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  color: #1e293b;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.btn-cancel {
  padding: 9px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  color: #64748b;
  transition: background 0.15s;
}

.btn-cancel:hover {
  background: #f1f5f9;
}

.btn-save {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-save:hover {
  background: #1d4ed8;
}

/* ===== EMPTY STATE ===== */
.empty-msg {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 32px 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .content-area {
    flex-direction: column;
  }
  .stats-card {
    width: 100%;
  }
  .input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-add {
    justify-content: center;
  }
}