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

:root {
  --sidebar-bg: #0f172a;
  --sidebar-width: 240px;
  --main-bg: #f8fafc;
  --accent: #5b5ef9;
  --accent-hover: #4345e8;
  --accent-light: rgba(91, 94, 249, 0.1);
  --emerald: #00c47a;
  --emerald-light: rgba(0, 196, 122, 0.12);
  --red: #ff3b30;
  --red-light: #fff0ee;
  --orange: #ff6b00;
  --orange-light: #fff3eb;
  --yellow: #ffcc00;
  --yellow-light: #fffbe6;
  --teal: #00c4b4;
  --teal-light: rgba(0, 196, 180, 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: 20px 24px;
}

/* ======================== 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-section {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 14px 4px;
  list-style: none;
}

.theme-switcher {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

/* ---- THEMES ---- */
/* Beach — IBM blue sidebar + warm cream main (distinctive, not generic blue) */
body.theme-beach {
  --main-bg: #fefce8;
  --card-bg: #ffffff;
  --border: #e7e5d5;
  --accent: #0f62fe;
  --accent-hover: #002d9c;
  --accent-light: rgba(15, 98, 254, 0.08);
}
body.theme-beach #sidebar {
  background: linear-gradient(180deg, #002d9c 0%, #0f62fe 55%, #4589ff 100%);
}
body.theme-beach .nav-item.active {
  background: rgba(255,255,255,0.2);
  border-left-color: #fde047;
}
body.theme-beach .nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}
body.theme-beach .nav-item { color: rgba(255,255,255,0.82); }
body.theme-beach .nav-emoji { filter: drop-shadow(0 0 2px rgba(255,255,255,0.6)); }
body.theme-beach .nav-item.active { color: white; }
body.theme-beach .sidebar-subtitle { color: rgba(255,255,255,0.55); }
body.theme-beach .sidebar-title { color: white; }
body.theme-beach .nav-section { color: rgba(255,255,255,0.45); }

/* Sunshine — bright yellow sidebar, dark text for readability */
body.theme-sunshine {
  --main-bg: #fffef5;
  --card-bg: #ffffff;
  --border: #f3e9c1;
  --accent: #a16207;
  --accent-hover: #854d0e;
  --accent-light: rgba(161, 98, 7, 0.08);
}
body.theme-sunshine #sidebar {
  background: linear-gradient(180deg, #fde047 0%, #facc15 55%, #eab308 100%);
}
body.theme-sunshine .nav-item { color: rgba(40, 22, 4, 0.72); }
body.theme-sunshine .nav-item:hover {
  background: rgba(40, 22, 4, 0.08);
  color: #281604;
}
body.theme-sunshine .nav-item.active {
  background: rgba(40, 22, 4, 0.12);
  border-left-color: #422006;
  color: #281604;
  font-weight: 600;
}
body.theme-sunshine .nav-emoji { filter: none; }
body.theme-sunshine .sidebar-title { color: #281604; }
body.theme-sunshine .sidebar-subtitle { color: rgba(40, 22, 4, 0.55); }
body.theme-sunshine .nav-section { color: rgba(40, 22, 4, 0.45); }

/* Sunset */
body.theme-sunset {
  --main-bg: #fff8f3;
  --card-bg: #ffffff;
  --border: #f5d5bf;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-light: rgba(234, 88, 12, 0.1);
}
body.theme-sunset #sidebar {
  background: linear-gradient(180deg, #7c2d12 0%, #c2410c 50%, #ea580c 100%);
}
body.theme-sunset .nav-item.active {
  background: rgba(255,255,255,0.2);
  border-left-color: #fbbf24;
}
body.theme-sunset .nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
body.theme-sunset .nav-item { color: rgba(255,255,255,0.7); }
body.theme-sunset .nav-item.active { color: white; }
body.theme-sunset .sidebar-subtitle { color: rgba(255,255,255,0.5); }
body.theme-sunset .sidebar-title { color: white; }
body.theme-sunset .nav-section { color: rgba(255,255,255,0.4); }

/* Forest */
body.theme-dark {
  --main-bg: #f0faf2;
  --card-bg: #ffffff;
  --border: #b8e0c4;
  --accent: #15803d;
  --accent-hover: #166534;
  --accent-light: rgba(21, 128, 61, 0.1);
}
body.theme-dark #sidebar {
  background: linear-gradient(180deg, #14532d 0%, #166534 40%, #15803d 100%);
}
body.theme-dark .nav-item { color: rgba(255,255,255,0.75); }
body.theme-dark .nav-item.active { color: white; background: rgba(255,255,255,0.15); border-left-color: #86efac; }
body.theme-dark .nav-item:hover { color: white; background: rgba(255,255,255,0.1); }
body.theme-dark .sidebar-title { color: white; }
body.theme-dark .sidebar-subtitle { color: rgba(255,255,255,0.5); }
body.theme-dark .nav-section { color: rgba(255,255,255,0.35); }
body.theme-dark .nav-emoji { filter: drop-shadow(0 0 2px rgba(255,255,255,0.4)); }

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

.nav-label { flex: 1; }

.nav-badge {
  background: #ff6b6b;
  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;
}
.priority-dot.p1 { background: var(--red); }
.priority-dot.p2 { background: var(--orange); }
.priority-dot.p3 { background: var(--yellow); }
.priority-dot-empty { width: 10px; height: 10px; display: inline-block; }
.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);
}

/* ======================== JOURNAL LOG ======================== */

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

.journal-compose textarea {
  width: 100%;
  min-height: 120px;
  border: none;
  outline: none;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: transparent;
  resize: vertical;
  font-family: inherit;
  padding: 0;
}
.journal-compose textarea::placeholder { color: var(--text-muted); }

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

.journal-compose-fields {
  display: flex;
  gap: 8px;
  flex: 1;
}
.journal-compose-fields input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--main-bg);
  outline: none;
}
.journal-compose-fields input:focus { border-color: var(--accent); }

.jlog-list { max-width: 720px; }

.jlog-day { margin-bottom: 24px; }

.jlog-day-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.jlog-entry {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 6px;
  transition: all var(--transition);
}
.jlog-entry:hover { border-color: var(--accent); }
.jlog-entry.jlog-expanded { border-color: var(--accent); box-shadow: var(--card-shadow); }

.jlog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.jlog-time {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 64px;
  flex-shrink: 0;
}

.jlog-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jlog-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.jlog-expand {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.jlog-preview {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 74px;
  cursor: pointer;
  line-height: 1.5;
}

.jlog-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 10px;
  padding: 12px 0 8px 74px;
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.jlog-actions {
  display: flex;
  gap: 8px;
  padding-left: 74px;
  margin-top: 8px;
}

.jlog-empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 0;
  font-style: italic;
}

.agenda-show-past {
  margin-bottom: 12px;
  color: var(--text-muted);
}

/* ======================== 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; }

/* ==================== UTILITY BAR (top-right) ==================== */

.utility-bar {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 9500;
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}
.util-btn {
  pointer-events: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  color: var(--text-secondary);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.util-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.util-btn.util-undo {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}
.util-btn.util-undo.disabled {
  background: var(--card-bg);
  color: var(--text-muted);
  border-color: var(--border);
  font-weight: 500;
  opacity: 0.55;
  cursor: not-allowed;
}
.util-btn.util-undo.disabled:hover {
  transform: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.util-btn.util-add {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  padding: 4px 12px;
  min-width: 32px;
}
.util-btn.util-bug:hover { background: var(--red-light); color: var(--red); }
.util-btn.util-feat:hover { background: var(--accent-light); color: var(--accent); }

/* ======================== 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;
}

.inline-date {
  font-family: inherit;
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 6px;
  outline: none;
  cursor: pointer;
  width: 120px;
}
.inline-date:hover { border-color: var(--border); background: var(--main-bg); }
.inline-date:focus { border-color: var(--accent); background: white; box-shadow: 0 0 0 2px rgba(99,102,241,0.12); }
.inline-date::-webkit-calendar-picker-indicator { opacity: 0.4; cursor: pointer; }
.inline-date[value=""] { color: var(--text-muted); }

.inline-area {
  font-size: 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 4px;
  outline: none;
  cursor: pointer;
  width: 48px;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}
.inline-area:hover { border-color: var(--border); background: var(--main-bg); }
.inline-area:focus { border-color: var(--accent); background: white; }

/* ======================== 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: 56px;
    min-width: 56px;
  }

  .sidebar-header { padding: 12px 0; justify-content: center; }
  .sidebar-logo { font-size: 20px; }
  .sidebar-logo img { width: 28px !important; height: 28px !important; }
  .sidebar-title, .sidebar-subtitle { display: none; }

  .nav-item { justify-content: center; padding: 8px; border-left: none; }
  .nav-item.active { border-left: none; background: rgba(255,255,255,0.15); }
  .nav-label, .nav-badge { display: none; }
  .nav-section { display: none; }
  #nav-more { display: block !important; }
  .nav-emoji { width: auto; font-size: 18px; }
  .theme-switcher { flex-direction: column; gap: 4px; }
  .theme-switcher span { font-size: 14px !important; }

  #main { padding: 12px; }

  /* Today page */
  .today-grid { grid-template-columns: 1fr !important; }
  .today-col-right { order: -1; }

  /* Calendar */
  .cal-toolbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .cal-nav { justify-content: center; flex-wrap: wrap; }
  .cal-nav-label { font-size: 15px !important; min-width: auto; }
  .cal-week-grid { height: auto !important; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
  .cal-week-col { min-height: 120px; }
  .cal-week-day-num { font-size: 14px !important; }
  .cal-week-event, .cal-week-task { font-size: 9px !important; padding: 2px 3px !important; }
  .cal-day { padding: 3px !important; }
  .cal-day-num { font-size: 11px !important; }
  .cal-tooltip { max-height: 40vh; }

  /* Tasks */
  .task-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .task-tab { white-space: nowrap; font-size: 12px; padding: 6px 12px; }
  .area-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .area-tab { white-space: nowrap; }
  .task-filters { flex-wrap: wrap; }
  .tasks-table { font-size: 12px; }
  .tasks-table th, .tasks-table td { padding: 8px 6px; }
  .inline-date { width: 100px !important; }
  .poc-inline-input { width: 70px !important; }
  .status-select { font-size: 11px !important; min-width: 100px !important; }
  /* Hide less-essential columns on mobile so title is always visible */
  .tasks-table th:nth-child(4), .tasks-table td:nth-child(4) { display: none; } /* Category */
  .tasks-table th:nth-child(6), .tasks-table td:nth-child(6) { display: none; } /* Owner */
  .tasks-table th:nth-child(8), .tasks-table td:nth-child(8) { display: none; } /* W/L/M scores */
  .task-title-cell { min-width: 150px !important; }

  /* Tables */
  .table-wrap { overflow-x: auto; }
  table { min-width: 500px; }

  /* Cards */
  .card-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 8px; }
  .stat-card { padding: 10px 12px; }

  /* Modal */
  .modal-box { max-width: 95vw; padding: 16px; }
  .task-edit-grid { grid-template-columns: 1fr !important; }
  .te-field-wide { grid-column: span 1 !important; }

  /* Forms */
  .form-row { flex-direction: column; }
  .quick-add { padding: 12px; }
}

@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);
}

.snooze-btn { opacity: 0; transition: opacity var(--transition); }
tr:hover .snooze-btn { opacity: 1; }

.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 99999;
}

.defer-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  cursor: default;
}

.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-search-bar {
  position: relative;
  margin-bottom: 12px;
}

.task-search-input {
  width: 100%;
  font-size: 14px;
  padding: 9px 36px 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  outline: none;
  font-family: inherit;
}

.task-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,94,249,0.1); }

.task-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px;
  line-height: 1;
}
.task-search-clear:hover { color: var(--text-primary); }

.task-title-cell { max-width: 360px; min-width: 120px; }
.task-title-row { display: block; }
.task-title-row .task-text {
  display: inline-block;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  cursor: pointer;
}
.task-chips-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 3px;
}
.task-chips-row:empty { display: none; }

/* "Tasks need a due date / category" inline-fill banner.
   Desktop: 6-column grid. Mobile: stacked with task title on its own line
   so it never gets squeezed to 0px on narrow viewports. */
.needs-banner-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 80px 110px 140px;
  gap: 4px;
}
.needs-banner-row > [data-col="task"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .needs-banner-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 0 !important;
  }
  .needs-banner-row.needs-banner-header { display: none; }
  .needs-banner-row > [data-col="task"] {
    font-size: 14px !important;
    font-weight: 600;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .needs-banner-row > [data-col]::before {
    content: attr(data-label) ":";
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #c2410c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
    min-width: 60px;
  }
  .needs-banner-row > [data-col="task"]::before { display: none; }
}

.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;
}

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

.task-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--card-shadow-hover);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

.task-dd-item {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.task-dd-item:last-child { border-bottom: none; }
.task-dd-item:hover { background: var(--accent-light); color: var(--accent); }
.task-dd-clear { color: var(--text-muted); font-size: 12px; }

.draft-task-link {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  display: inline-block;
}
.draft-task-link:hover { text-decoration: underline; }

.poc-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.poc-link:hover { color: var(--accent-hover); }

.poc-cell { position: relative; vertical-align: middle; }

.poc-inline-input {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  width: 100%;
  outline: none;
  cursor: text;
}
.poc-inline-input:hover { border-bottom-color: var(--border); }
.poc-inline-input:focus {
  border-bottom-color: var(--accent);
  background: var(--main-bg);
  border-radius: 4px 4px 0 0;
  padding: 2px 6px;
}
.poc-inline-input::placeholder { color: var(--text-muted); font-style: italic; }

/* ======================== AREA TABS ======================== */

.area-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border);
}

.area-tab {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

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

.area-tab-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 2px;
}

.area-select-inline {
  font-family: inherit;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 2px;
  background: var(--main-bg);
  cursor: pointer;
  outline: none;
  width: 100%;
  max-width: 52px;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  overflow: hidden;
}
.area-select-inline:focus { border-color: var(--accent); }

/* Task edit modal grid */
.task-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 12px;
}

.te-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.te-field-wide {
  grid-column: span 2;
}

.te-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.te-field input,
.te-field select,
.te-field textarea {
  font-size: 13px;
  padding: 7px 10px;
}

.te-field textarea {
  min-height: 70px;
  resize: vertical;
}

.contact-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.field-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

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

.area-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
  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: no color coding, let priority dot speak */
.task-meta-cell {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

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

.today-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.today-date {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.today-time {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.today-motivation {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 5px;
  max-width: 420px;
  line-height: 1.5;
}

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

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

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

/* Two-column layout: primary (tasks) left, secondary (meds/recs) right */
.today-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 12px;
  align-items: start;
}

@media (max-width: 800px) {
  .today-grid { grid-template-columns: 1fr; }
}

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

.today-section:last-child { margin-bottom: 0; }

.today-col-left > .today-section:last-child { margin-bottom: 0; }
.today-col-right > .today-section:last-child { margin-bottom: 0; }

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

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

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

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

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

.today-task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.today-task-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.today-task-text.priority-urgent {
  font-weight: 500;
}

.today-task-poc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.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: 8px;
  padding: 6px 0;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--border);
}

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

.med-icon { font-size: 14px; flex-shrink: 0; }

.med-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

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

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

.inline-time-input {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  width: 70px;
  padding: 2px 0;
  cursor: pointer;
  outline: none;
}
.inline-time-input:focus {
  border-bottom: 1px solid var(--accent);
  color: var(--text-primary);
}

.med-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.med-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  text-align: left;
  box-shadow: var(--card-shadow);
}
.med-preset-btn:hover {
  border-color: var(--emerald);
  background: var(--emerald-light);
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-hover);
}
.med-preset-btn:active { transform: translateY(0); }

.med-preset-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.med-preset-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.med-counter-btns {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.med-counter-btn {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--main-bg);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.med-counter-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.med-counter-undo { color: var(--text-muted); }
.med-counter-undo:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* Meal expiry rows */
tr.expired td { background: #fff5f5 !important; }
tr.expiring-soon td { background: #fffbf0 !important; }

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

.today-event {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.today-event:last-child { border-bottom: none; }
.today-event-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  min-width: 60px;
}
.today-event-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}
.today-event-loc {
  font-size: 11px;
  color: var(--text-muted);
  width: 100%;
  padding-left: 70px;
}

.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); }

/* ---- Priority buttons (universal) ---- */
.pri-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 5px;
  font-size: 16px;
  line-height: 1;
  border-radius: 6px;
  opacity: 0.25;
  transition: opacity 0.15s, transform 0.1s;
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pri-btn.active { opacity: 1; }
.pri-btn:hover { opacity: 0.85; transform: scale(1.2); }

/* legacy alias kept for any stray references */
.today-pri-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.med-check[onclick] { transition: background var(--transition); border-radius: 8px; padding: 6px 8px; margin: -2px -4px; }
.med-check[onclick]:hover { background: var(--accent-light); }

.affirmation-section {
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(99,102,241,0.03) 100%);
}

.today-rec {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.today-rec:last-child { border-bottom: none; }

.today-affirmation {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--accent-light);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  font-style: italic;
  line-height: 1.5;
}

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

/* Priority cell in tasks table */
.pri-cell {
  width: 44px;
  min-width: 44px;
  cursor: pointer;
  text-align: center;
  padding: 0 8px;
}

/* Calendar event chip */
/* ── Calendar Toolbar ── */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-nav-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.cal-nav-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 180px;
  text-align: center;
}

.cal-nav-today {
  font-size: 12px; font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.cal-nav-today:hover { border-color: var(--accent); color: var(--accent); }

.cal-toolbar-right { display: flex; align-items: center; gap: 10px; }

.cal-toggle-btn {
  display: flex; align-items: center; gap: 5px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border: 1px solid var(--border);
  border-radius: 20px; background: var(--card-bg);
  color: var(--text-muted); cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.cal-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-toggle-btn.active { background: var(--red-light); border-color: var(--red); color: var(--red); }

.cal-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.cal-view-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.cal-view-btn:hover { color: var(--text-primary); }
.cal-view-btn.active { background: var(--accent); color: white; }

/* ── Month Layout ── */
.cal-month-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.cal-month-grid {
  min-width: 0; /* prevent grid blowout */
}

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

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

.cal-grid-header { gap: 2px; margin-bottom: 2px; }

.cal-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  flex: 1;
  min-height: 0;
}

.cal-day {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 5px;
  min-height: 0;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cal-day:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.cal-day.cal-past { opacity: 0.55; }
.cal-day.cal-past:hover { opacity: 0.85; }
.cal-day.cal-other-month { opacity: 0.6; }
.cal-day.cal-other-month:hover { opacity: 0.85; }
.cal-day.cal-today { border-color: transparent; background: var(--card-bg); }
.cal-day.cal-today .cal-day-num { background: #facc15; color: #1a1a1a; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.cal-day.cal-selected { border-color: var(--border); background: #f0f9ff; }

.cal-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.cal-today .cal-day-num { font-weight: 800; }

/* Custody badge — compact circle with N or F */
.cal-custody-badge {
  font-size: 9px;
  font-weight: 800;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.cal-custody-n { background: var(--accent-light); color: var(--accent); }
.cal-custody-f { background: var(--teal-light); color: var(--teal); }

/* Day detail panel */
.cal-day-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  z-index: 200;
  overflow-y: auto;
  padding: 20px;
  animation: slideInRight 0.2s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.cal-day-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cal-day-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.dp-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dp-event {
  padding: 7px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: var(--main-bg);
}

.dp-time {
  font-size: 11px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.dp-title {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.dp-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.dp-task:last-child { border-bottom: none; }

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

.jurate-badge {
  font-size: 9px;
  font-weight: 700;
  background: #fff3e0;
  color: #e65100;
  border-radius: 10px;
  padding: 1px 5px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Custody tint on day cells */
.cal-day.cal-custody-n { background: rgba(99,102,241,0.15); border-left: 3px solid var(--accent); }
.cal-day.cal-custody-f { background: rgba(20,184,166,0.15); border-left: 3px solid var(--teal); }
.cal-day.cal-custody-n.cal-today { background: rgba(99,102,241,0.25); }
.cal-day.cal-custody-f.cal-today { background: rgba(20,184,166,0.22); }
.cal-day.cal-chemo { border-left: 3px solid var(--red); }

/* Calendar tooltip (replaces always-visible sidebar) */
.cal-tooltip {
  position: relative;
  margin-bottom: 10px;
  width: 100%;
  max-height: 40vh;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 500;
  padding: 4px;
}
.cal-tooltip .cal-detail-panel { display: flex; flex-wrap: wrap; gap: 12px; }
.cal-tooltip .cal-detail-header { width: 100%; }
.cal-tooltip .cal-detail-section { flex: 1; min-width: 200px; }
.cal-tooltip-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 1;
}
.cal-tooltip-close:hover { background: var(--red-light); color: var(--red); }
@media (max-width: 768px) {
  .cal-tooltip {
    max-height: 40vh;
  }
}

/* Visual bars — each event/task is a small colored line */
.cal-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.cal-bar {
  height: 4px;
  border-radius: 2px;
  width: 100%;
}
.cal-bar-event { background: var(--accent); opacity: 0.5; }
.cal-bar-task { background: var(--text-muted); opacity: 0.4; }
.cal-bar-p1 { background: var(--red); opacity: 0.7; }
.cal-bar-p2 { background: var(--orange); opacity: 0.6; }
.cal-bar-p3 { background: var(--emerald); opacity: 0.4; }

.cal-day-body { flex: 1; display: flex; flex-direction: column; gap: 2px; margin-top: 3px; overflow: hidden; }

.cal-ev-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.5;
}
.cal-ev-pill:hover { opacity: 0.8; }

.cal-ev-more {
  font-size: 10px;
  color: var(--text-muted);
  padding: 1px 2px;
}

.cal-task-dot-row {
  display: flex;
  gap: 2px;
  align-items: center;
  margin-top: 2px;
  flex-wrap: wrap;
}

.cal-task-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

.cal-chip-time { opacity: 0.7; font-size: 9px; }

/* ── Week Layout ── */
.cal-week-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
  height: calc(100vh - 130px);
}

.cal-week-col {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
  min-width: 0;
}
.cal-week-col:hover { border-color: var(--accent); }
.cal-week-col.cal-today { border-top: 3px solid #facc15; }
.cal-week-col.cal-today .cal-week-day-num { background: #facc15; color: #1a1a1a; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.cal-week-col.cal-selected { background: #f0f9ff; }
.cal-week-col.cal-custody-col-n { border-top: 3px solid var(--accent); }
.cal-week-col.cal-custody-col-f { border-top: 3px solid var(--teal); }
.cal-week-col.cal-custody-n { background: rgba(99,102,241,0.08); }
.cal-week-col.cal-custody-f { background: rgba(20,184,166,0.08); }
.cal-week-col.cal-custody-n .cal-week-col-header { background: rgba(99,102,241,0.06); }
.cal-week-col.cal-custody-f .cal-week-col-header { background: rgba(20,184,166,0.06); }

.cal-week-col-header {
  padding: 6px 6px 4px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cal-week-day-name { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.cal-week-day-num { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.cal-week-day-num.today-num { color: #1a1a1a; }

.cal-week-col-body {
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}
.cal-week-event {
  font-size: 12px; background: var(--accent-light); color: var(--accent);
  border-radius: 4px; padding: 3px 6px; line-height: 1.4; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.cal-week-task {
  font-size: 12px; color: var(--text-secondary); padding: 3px 6px;
  border-radius: 4px; cursor: pointer; border-left: 2px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  margin-bottom: 2px;
}
.cal-week-task:hover { background: var(--main-bg); border-left-color: var(--accent); color: var(--text-primary); }
.cal-week-empty { font-size: 11px; color: var(--text-muted); opacity: 0.5; text-align: center; padding: 12px 0; }

/* ── Day Layout ── */
.cal-day-layout { max-width: 640px; }

/* ── Sidebar Detail Panel ── */
.cal-sidebar {
  position: sticky;
  top: 20px;
}

.cal-detail-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.cal-detail-header {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-today-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-detail-custody {
  font-size: 12px;
  color: var(--teal);
  font-weight: 600;
  padding: 6px 10px;
  background: var(--teal-light);
  border-radius: 6px;
  margin-bottom: 12px;
}

.cal-detail-section { margin-bottom: 16px; }
.cal-detail-section:last-of-type { margin-bottom: 12px; }

.cal-detail-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.cal-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.cal-detail-item:last-child { border-bottom: none; }
.cal-detail-event { color: inherit; }
.cal-detail-time { font-size: 11px; opacity: 0.6; white-space: nowrap; min-width: 56px; }
.cal-detail-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-detail-actions { display: flex; gap: 2px; flex-shrink: 0; }
.cal-detail-task.p1 { color: var(--red); font-weight: 600; }
.cal-detail-task.p2 { color: var(--orange); }
.cal-detail-empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; font-style: italic; }

/* Quick add in detail panel */
.cal-quick-add {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cal-quick-add input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  background: var(--main-bg);
  color: var(--text-primary);
  outline: none;
}
.cal-quick-add input:focus { border-color: var(--accent); }

/* ── Agenda View ── */
.agenda-list {
  max-width: 720px;
}

.agenda-day {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.agenda-day.agenda-past { opacity: 0.6; }
.agenda-day.agenda-today { border-color: var(--accent); }

.agenda-day-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--main-bg);
  border-bottom: 1px solid var(--border);
}

.agenda-day-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 32px;
}

.agenda-day-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.agenda-today .agenda-day-num { color: var(--accent); }

.agenda-day-body {
  padding: 8px 16px 12px;
}

.agenda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.agenda-item:last-of-type { border-bottom: none; }

.agenda-event { color: var(--accent); }
.agenda-task.p1 { color: var(--red); font-weight: 600; }
.agenda-task.p2 { color: var(--orange); }

.agenda-time {
  font-size: 12px;
  opacity: 0.6;
  white-space: nowrap;
  min-width: 64px;
}

.agenda-title {
  flex: 1;
  min-width: 0;
}

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

.agenda-add {
  margin-top: 6px;
}
.agenda-add input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  background: var(--main-bg);
  color: var(--text-primary);
  outline: none;
}
.agenda-add input:focus { border-color: var(--accent); }

/* ── Calendar Mobile ── */
@media (max-width: 1100px) {
  .cal-month-layout, .cal-week-layout { grid-template-columns: 1fr; }
  .cal-sidebar { position: static; margin-top: 16px; }
}
@media (max-width: 768px) {
  .cal-nav-label { font-size: 15px; min-width: auto; }
  .cal-week-col { min-height: 200px; }
  .cal-week-day-num { font-size: 14px; }
  .cal-day { padding: 4px; }
  .cal-day-num { font-size: 11px; }
}
@media (max-width: 600px) {
  .cal-toolbar { flex-direction: column; align-items: stretch; }
  .cal-nav { justify-content: center; }
  .cal-view-tabs { justify-content: center; }
}

.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); }

/* ── Task Tag Pills ── */
.task-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--card-bg, #ffffff);
  color: var(--accent, #6366f1);
  border: 1px solid var(--accent, #6366f1);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  user-select: none;
}
.task-tag-pill:hover {
  background: var(--accent-light, #e0e7ff);
  transform: translateY(-1px);
}
.task-tag-pill-active {
  background: var(--accent, #6366f1) !important;
  color: white !important;
  border-color: var(--accent, #6366f1) !important;
}
.task-tag-pill-active:hover {
  background: var(--accent, #6366f1) !important;
  color: white !important;
}

/* Mapa Markdown link style */
.mapa-link {
  color: var(--accent, #4f46e5);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color .15s, opacity .15s;
  white-space: nowrap;
}
.mapa-link:hover {
  border-bottom-color: var(--accent, #4f46e5);
  opacity: .8;
}
