/* ============================================================
   MAPA DASHBOARD — style.css
   ============================================================ */

:root {
  --sidebar-bg: #0f172a;
  --sidebar-width: 240px;
  --main-bg: #f8fafc;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.1);
  --emerald: #10b981;
  --emerald-light: rgba(16, 185, 129, 0.1);
  --red: #ef4444;
  --red-light: #fef2f2;
  --orange: #f97316;
  --orange-light: #fff7ed;
  --yellow: #eab308;
  --yellow-light: #fefce8;
  --teal: #14b8a6;
  --teal-light: rgba(20, 184, 166, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --transition: 0.15s ease;
  --radius: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--main-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

/* ======================== LAYOUT ======================== */

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding-bottom: 24px;
}

#main {
  flex: 1;
  overflow-y: auto;
  background: var(--main-bg);
  padding: 32px;
}

/* ======================== SIDEBAR ======================== */

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}

.sidebar-logo {
  font-size: 28px;
  line-height: 1;
}

.sidebar-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-subtitle {
  color: #64748b;
  font-size: 12px;
  margin-top: 1px;
}

.nav-list {
  list-style: none;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  color: #94a3b8;
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: #ffffff;
  border-left-color: var(--accent);
  background: var(--accent-light);
}

.nav-emoji {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label { flex: 1; }

.nav-badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  display: none;
}

.nav-badge.visible { display: inline-block; }

/* ======================== MAIN CONTENT ======================== */

.view-header {
  margin-bottom: 24px;
}

.view-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

/* ======================== STATS BAR ======================== */

.stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  min-width: 100px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ======================== FORMS ======================== */

.quick-add {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.quick-add-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.form-row:last-child { margin-bottom: 0; }

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.flex-1 { flex: 1; min-width: 120px; }
.flex-2 { flex: 2; min-width: 180px; }

/* ======================== BUTTONS ======================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--main-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
}

.btn-ghost:hover { color: var(--red); background: var(--red-light); }

.btn-emerald {
  background: var(--emerald);
  color: white;
  font-size: 12px;
  padding: 6px 12px;
}

.btn-emerald:hover { background: #059669; }

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-danger {
  background: var(--red-light);
  color: var(--red);
}

.btn-danger:hover { background: #fecaca; }

/* ======================== FILTER TABS ======================== */

.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ======================== TABLE ======================== */

.table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: #f8fafc; }

.today-row td { background: rgba(99,102,241,0.04); }

/* Priority dots */
.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.p1 { background: var(--red); }
.p2 { background: var(--orange); }
.p3 { background: var(--yellow); }
.p4 { background: var(--teal); }

/* Status toggle */
.status-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.status-btn:hover { border-color: var(--emerald); }
.status-btn.done { border-color: var(--emerald); background: var(--emerald); color: white; }

.task-done { text-decoration: line-through; color: var(--text-muted); }

/* ======================== CARDS ======================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  position: relative;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ======================== BADGES ======================== */

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-sent { background: var(--emerald-light); color: #059669; }
.badge-unsent { background: var(--orange-light); color: var(--orange); }
.badge-meal { background: #ede9fe; color: #7c3aed; }
.badge-snack { background: #fce7f3; color: #be185d; }
.badge-prep { background: #dcfce7; color: #166534; }
.badge-category {
  background: var(--accent-light);
  color: var(--accent);
}

/* ======================== GROCERY ======================== */

.grocery-list {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.grocery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid #f1f5f9;
  transition: background var(--transition);
}

.grocery-item:last-child { border-bottom: none; }
.grocery-item:hover { background: #f8fafc; }

.grocery-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--emerald);
  flex-shrink: 0;
}

.grocery-item.done .grocery-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.grocery-item.done { opacity: 0.65; }

.grocery-text { flex: 1; font-size: 14px; }

.grocery-delete {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all var(--transition);
}

.grocery-item:hover .grocery-delete { opacity: 1; }
.grocery-delete:hover { color: var(--red); background: var(--red-light); }

/* ======================== HEALTH CARDS ======================== */

.health-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  border-left: 4px solid var(--border);
}

.health-card.sleep-good { border-left-color: var(--emerald); }
.health-card.sleep-ok { border-left-color: var(--yellow); }
.health-card.sleep-poor { border-left-color: var(--red); }

.health-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.health-sleep {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.sleep-hours {
  font-size: 13px;
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 600;
}

.sleep-hours.good { background: var(--emerald-light); color: #059669; }
.sleep-hours.ok { background: var(--yellow-light); color: #854d0e; }
.sleep-hours.poor { background: var(--red-light); color: var(--red); }

.health-detail {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.health-detail span {
  font-weight: 500;
  color: var(--text-primary);
}

/* ======================== MEDS ======================== */

.date-group {
  margin-bottom: 24px;
}

.date-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  padding-left: 2px;
}

/* ======================== LOADING / EMPTY ======================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 12px;
  font-size: 14px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ======================== TOAST ======================== */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease, fadeOut 0.3s ease 2.5s forwards;
  pointer-events: auto;
  max-width: 320px;
}

.toast.success::before { content: "✅"; }
.toast.error::before { content: "❌"; }
.toast.info::before { content: "ℹ️"; }

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* ======================== MODAL ======================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-overlay.open { display: flex !important; }

.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
  line-height: 1;
}

.modal-close:hover { background: var(--red-light); color: var(--red); }

/* ======================== INLINE EDIT ======================== */

.editable-cell {
  cursor: text;
  min-width: 60px;
}

.editable-cell:hover {
  background: var(--accent-light);
  border-radius: 4px;
  padding: 1px 4px;
  margin: -1px -4px;
}

.inline-edit-input {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: white;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  min-width: 100px;
}

/* ======================== OURA BANNER ======================== */

.oura-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.oura-banner .oura-icon { font-size: 20px; }
.oura-banner strong { font-weight: 600; }

/* ======================== MEALS EXPIRY ======================== */

.meal-card { cursor: default; }

.meal-card.expired { border-color: var(--red); background: var(--red-light); }
.meal-card.expiring-soon { border-color: var(--orange); background: var(--orange-light); }

.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.dot-green { background: var(--emerald); }
.dot-orange { background: var(--orange); }
.dot-red { background: var(--red); }

/* ======================== HEADER NOTE ======================== */

.info-note {
  background: var(--accent-light);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 20px;
}

/* ======================== RESPONSIVE ======================== */

@media (max-width: 768px) {
  #sidebar {
    width: 60px;
    min-width: 60px;
  }

  .sidebar-header { padding: 16px 0; justify-content: center; }
  .sidebar-logo { font-size: 22px; }
  .sidebar-title, .sidebar-subtitle { display: none; }

  .nav-item { justify-content: center; padding: 10px; border-left: none; border-bottom: 3px solid transparent; }
  .nav-item.active { border-left: none; border-bottom-color: var(--accent); }
  .nav-label, .nav-badge { display: none; }
  .nav-emoji { width: auto; }

  #main { padding: 16px; }

  .card-grid { grid-template-columns: 1fr; }

  .stats-bar { gap: 8px; }
  .stat-card { padding: 12px 14px; }
}

@media (max-width: 480px) {
  table { font-size: 13px; }
  th, td { padding: 10px 10px; }
}

/* ======================== TASKS V2 ======================== */

.task-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.task-tab {
  padding: 8px 20px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-tab:hover { color: var(--text-primary); }
.task-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.task-tab-count {
  background: var(--main-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.task-tab.active .task-tab-count {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.task-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  cursor: pointer;
  outline: none;
}

.filter-select:focus { border-color: var(--accent); }

.task-title-cell { max-width: 360px; }

.task-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: italic;
}

.cat-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--main-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.poc-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.poc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.poc-contact {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
}

.poc-contact:hover { text-decoration: underline; }

.status-select {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  background: var(--main-bg);
  cursor: pointer;
  outline: none;
  color: var(--text-secondary);
  width: 100%;
  min-width: 140px;
}

.row-overdue td { background: #fff5f5 !important; }
.row-overdue:hover td { background: #fee2e2 !important; }
.date-overdue { color: var(--red) !important; font-weight: 700; }
.date-today { color: var(--accent) !important; font-weight: 700; }
.row-due-today td { background: rgba(99,102,241,0.03) !important; }

/* ======================== TODAY VIEW ======================== */

.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.today-date {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.today-score {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.score-pill {
  background: var(--emerald-light);
  color: #059669;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: default;
}

.grocery-pill {
  background: var(--accent-light);
  color: var(--accent);
  cursor: pointer;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.today-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
}

.urgent-section {
  border-left: 4px solid var(--red);
}

.today-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.today-section-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.today-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.today-task:last-child { border-bottom: none; }

.today-task-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

.today-task-text.priority-urgent {
  font-weight: 600;
  color: var(--red);
}

.today-task-poc {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--main-bg);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.overdue-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-light);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.today-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
  font-style: italic;
}

.med-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.med-check:last-child { border-bottom: none; }

.med-icon { font-size: 18px; }

.med-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.med-time {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  background: var(--emerald-light);
  padding: 2px 8px;
  border-radius: 10px;
}

.med-time.missing-label {
  color: var(--text-muted);
  background: var(--main-bg);
  font-weight: 400;
}

.today-sleep {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.8;
}

.today-draft {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition);
}

.today-draft:last-child { border-bottom: none; }
.today-draft:hover { color: var(--accent); }

/* ======================== CALENDAR VIEW ======================== */

.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.cal-header-day {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.cal-day {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-height: 60px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.cal-day:hover { border-color: var(--accent); box-shadow: var(--card-shadow); }
.cal-day.cal-past { opacity: 0.45; }
.cal-day.cal-today {
  border-color: var(--accent);
  background: var(--accent-light);
}

.cal-day.expanded {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
  z-index: 10;
  position: relative;
}

.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cal-today .cal-day-num {
  color: var(--accent);
  font-weight: 700;
}

.cal-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-more {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.cal-task-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  position: absolute;
  left: -1px;
  right: -1px;
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 8px;
  z-index: 20;
  box-shadow: var(--card-shadow-hover);
}

.cal-task-item {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.cal-task-item:last-child { border-bottom: none; }
.cal-task-item.p1 { color: var(--red); font-weight: 600; }
.cal-task-item.p2 { color: var(--orange); }

.upcoming-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 24px;
}

.upcoming-title-bar {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--main-bg);
  border-bottom: 1px solid var(--border);
}

.upcoming-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.upcoming-row:last-child { border-bottom: none; }
.upcoming-row:hover { background: #f8fafc; }

.upcoming-due {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--main-bg);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 70px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.upcoming-due.urgent {
  color: var(--red);
  background: var(--red-light);
}

.upcoming-title {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.upcoming-poc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ======================== MISC ======================== */

.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ---- Inline editing ---- */
.inline-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: var(--text);
  outline: none;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.inline-select {
  padding: 4px 8px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  background: white;
  color: var(--text);
  outline: none;
}
.task-note-add {
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
tr:hover .task-note-add { opacity: 1; }
.poc-text { font-size: 12px; color: var(--text-muted); }
th[onclick]:hover { color: var(--accent); }
