/* ═══════════════════════════════════════════
   EyeDrop Local – Design System
   Dark Glassmorphism + Micro-animations
═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Tokens ── */
:root {
  --bg: #050914;
  --bg2: #0c1225;
  --surface: rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.08);
  --border-bright: rgba(255,255,255,0.15);
  --text: #e8eaf0;
  --text-muted: #8892a4;
  --text-dim: #4a5568;
  --green: #00e676;
  --green-dim: rgba(0,230,118,0.12);
  --red: #ff4d6d;
  --red-dim: rgba(255,77,109,0.12);
  --amber: #ffc107;
  --amber-dim: rgba(255,193,7,0.12);
  --accent: #7c3aed;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --nav-h: 68px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Mesh Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124,58,237,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0,200,255,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 60% 40%, rgba(0,230,118,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ════════════════════════
   NAVIGATION
════════════════════════ */
#nav-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
  padding: 0 24px;
  background: rgba(5,9,20,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 22px; }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.logo-text span { color: var(--accent); }
.nav-actions { display: flex; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  border: none; background: transparent;
  color: var(--text-muted); font-family: inherit;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.nav-btn svg { flex-shrink: 0; }
.nav-btn:hover { background: var(--surface); color: var(--text); }
.nav-btn.active { background: rgba(124,58,237,0.2); color: #a78bfa; }

/* ════════════════════════
   VIEWS
════════════════════════ */
#main-content { flex: 1; padding: 28px 24px 48px; max-width: 760px; margin: 0 auto; width: 100%; }
.view { display: none; animation: fadeUp 0.3s ease; }
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════
   BANNERS
════════════════════════ */
.notif-banner {
  background: linear-gradient(135deg, rgba(255,193,7,0.12), rgba(255,193,7,0.05));
  border: 1px solid rgba(255,193,7,0.25);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.notif-banner.hidden { display: none; }
.notif-banner-inner {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
}
.notif-bell { color: var(--amber); flex-shrink: 0; }
.notif-text { flex: 1; }
.notif-text strong { display: block; font-size: 14px; font-weight: 600; color: var(--amber); margin-bottom: 2px; }
.notif-text span { font-size: 12px; color: var(--text-muted); }
.btn-enable-notif {
  padding: 9px 18px; border-radius: 8px;
  background: var(--amber); color: #1a1200;
  border: none; font-family: inherit;
  font-size: 13px; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
  transition: var(--transition);
}
.btn-enable-notif:hover { background: #ffe066; transform: scale(1.03); }

.quiet-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  background: rgba(100,116,139,0.12);
  border: 1px solid rgba(100,116,139,0.2);
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 20px;
}
.quiet-banner.hidden { display: none; }

/* ════════════════════════
   DASHBOARD
════════════════════════ */
.dash-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
}
.dash-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.dash-date { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 400; }

/* SVG Ring */
.overall-ring-wrap { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.ring-svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 5; }
.ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4,0,0.2,1);
}
.ring-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text);
}

/* Dose Cards */
.dose-list { display: flex; flex-direction: column; gap: 16px; }

.med-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}
.med-card:hover { border-color: var(--border-bright); transform: translateY(-2px); box-shadow: var(--shadow); }

.med-card-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px 14px;
}
.med-color-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 10px currentColor;
}
.med-name { font-size: 17px; font-weight: 700; flex: 1; }
.med-week-badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  background: rgba(124,58,237,0.18); color: #a78bfa;
}
.med-card-actions { margin-left: auto; display: flex; gap: 6px; }
.btn-edit-med, .btn-delete-med {
  padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-size: 12px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--transition);
}
.btn-edit-med:hover { background: var(--surface-hover); color: var(--text); }
.btn-delete-med:hover { background: var(--red-dim); color: var(--red); border-color: var(--red); }

.dose-slots { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 8px; }

.dose-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: var(--transition);
}
.dose-slot.done { background: var(--green-dim); border-color: rgba(0,230,118,0.2); }
.dose-slot.missed { background: var(--red-dim); border-color: rgba(255,77,109,0.2); }
.dose-slot.upcoming { border-color: rgba(124,58,237,0.15); }

.dose-time { font-size: 15px; font-weight: 600; color: var(--text); min-width: 52px; }
.dose-status-icon { font-size: 16px; flex-shrink: 0; }
.dose-label { font-size: 12px; color: var(--text-muted); flex: 1; }

.btn-tick {
  margin-left: auto;
  padding: 7px 16px; border-radius: 8px;
  border: 1px solid rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.12);
  color: #a78bfa; font-family: inherit;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-tick:hover { background: rgba(124,58,237,0.25); transform: scale(1.04); }
.btn-tick.ticked {
  background: var(--green-dim); border-color: rgba(0,230,118,0.4);
  color: var(--green); cursor: default;
}
.btn-tick:active { transform: scale(0.96); }

/* Empty State */
.empty-state {
  text-align: center; padding: 60px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state.hidden { display: none; }
.empty-icon { font-size: 52px; margin-bottom: 4px; }
.empty-state h2 { font-size: 20px; font-weight: 700; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* ════════════════════════
   FORM
════════════════════════ */
.view-header { margin-bottom: 28px; }
.view-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; }

.activity-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label, .label-lg {
  font-size: 13px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.3px;
}
.label-lg { font-size: 14px; color: var(--text); }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type="text"], input[type="date"], input[type="time"], input[type="number"] {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 14px;
  transition: var(--transition); outline: none; width: 100%;
  color-scheme: dark;
}
input:focus { border-color: rgba(124,58,237,0.6); background: rgba(124,58,237,0.06); box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
input::placeholder { color: var(--text-dim); }

/* Color picker row */
.color-row { display: flex; align-items: center; gap: 10px; }
input[type="color"] {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border); padding: 3px;
  background: rgba(255,255,255,0.05);
  cursor: pointer; flex-shrink: 0;
}
.color-preview-label { font-size: 13px; color: var(--text-muted); }

/* Toggle */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; margin-top: 2px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-knob {
  position: absolute; inset: 0; border-radius: 13px;
  background: rgba(255,255,255,0.1); cursor: pointer; transition: var(--transition);
}
.toggle-knob::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-radius: 50%;
  left: 3px; top: 3px; background: #fff;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-knob { background: var(--accent); }
.toggle-switch input:checked + .toggle-knob::before { transform: translateX(20px); }

/* Taper grid */
.taper-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.taper-cell { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.week-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.taper-cell input { text-align: center; padding: 10px 4px; }
.unit { font-size: 11px; color: var(--text-dim); }

/* Alarm list */
.alarm-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.btn-add-alarm {
  padding: 7px 14px; border-radius: 8px;
  background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3);
  color: #a78bfa; font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-add-alarm:hover { background: rgba(124,58,237,0.25); }
.alarm-list { display: flex; flex-direction: column; gap: 8px; }
.alarm-row { display: flex; align-items: center; gap: 10px; }
.alarm-row input { flex: 1; }
.btn-remove-alarm {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--red); font-size: 14px;
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.btn-remove-alarm:hover { background: var(--red-dim); }

/* Form actions */
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 6px; }
.btn-primary {
  padding: 12px 28px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border: none; color: #fff; font-family: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
.btn-primary:hover { background: linear-gradient(135deg, #8b5cf6, #7c3aed); transform: translateY(-1px); box-shadow: 0 6px 28px rgba(124,58,237,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  padding: 12px 22px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-family: inherit;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--surface-hover); color: var(--text); }

/* ════════════════════════
   HISTORY
════════════════════════ */
.badge-alltime {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  background: rgba(124,58,237,0.15); color: #a78bfa;
  font-size: 12px; font-weight: 600;
}
.history-list { display: flex; flex-direction: column; gap: 12px; }

.history-day-group { }
.history-day-label {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.6px; text-transform: uppercase;
  padding: 0 4px 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.history-entries { display: flex; flex-direction: column; gap: 6px; }
.history-entry {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
}
.history-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.history-med { font-size: 13px; font-weight: 600; flex: 1; }
.history-time { font-size: 12px; color: var(--text-muted); }
.history-status {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.history-status.taken { background: var(--green-dim); color: var(--green); }
.history-status.missed { background: var(--red-dim); color: var(--red); }

/* ════════════════════════
   ALARM MODAL
════════════════════════ */
.alarm-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.alarm-overlay.hidden { display: none; }
.alarm-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 201; width: min(420px, 90vw);
  background: linear-gradient(145deg, rgba(15,20,40,0.97), rgba(10,14,26,0.97));
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 24px; padding: 40px 32px;
  text-align: center; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(30px);
}
.alarm-modal.hidden { display: none; }

.alarm-pulse-ring {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid rgba(124,58,237,0.5);
  animation: pulse-ring 1.4s cubic-bezier(0.2,0,0,1) infinite;
}
.alarm-pulse-ring.delay { animation-delay: 0.7s; }
@keyframes pulse-ring {
  0% { transform: translateX(-50%) scale(0.8); opacity: 1; }
  100% { transform: translateX(-50%) scale(2.5); opacity: 0; }
}
.alarm-emoji { font-size: 48px; margin-bottom: 14px; }
.alarm-modal h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 8px; }
.alarm-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.alarm-week-badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  background: rgba(124,58,237,0.18); color: #a78bfa;
  font-size: 12px; font-weight: 600; margin-bottom: 24px;
}
.alarm-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-alarm-take {
  padding: 14px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #00e676, #00c853);
  border: none; color: #002200; font-family: inherit;
  font-size: 15px; font-weight: 800; cursor: pointer;
  transition: var(--transition); box-shadow: 0 4px 20px rgba(0,230,118,0.35);
}
.btn-alarm-take:hover { transform: scale(1.02); box-shadow: 0 6px 28px rgba(0,230,118,0.5); }
.btn-alarm-dismiss {
  padding: 11px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-family: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.btn-alarm-dismiss:hover { background: var(--surface-hover); color: var(--text); }

/* ════════════════════════
   TOAST
════════════════════════ */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(20,28,50,0.95); border: 1px solid var(--border-bright);
  color: var(--text); font-size: 13px; font-weight: 500;
  padding: 12px 22px; border-radius: 40px;
  box-shadow: var(--shadow); z-index: 300;
  backdrop-filter: blur(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.hidden { display: none; }
.toast.show { animation: toastIn 0.3s ease; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ════════════════════════
   DASHBOARD TWO-COLUMN
════════════════════════ */
.dash-columns {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.dash-main { min-width: 0; }

/* ════════════════════════
   NOTES SIDEBAR
════════════════════════ */
.notes-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  max-height: calc(100vh - var(--nav-h) - 56px);
}

/* Clock */
.sidebar-clock {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  background: rgba(124,58,237,0.05);
}
.sidebar-time {
  font-size: 28px; font-weight: 800; letter-spacing: 1px;
  color: var(--text); font-variant-numeric: tabular-nums;
  font-family: 'Inter', monospace;
  text-shadow: 0 0 20px rgba(124,58,237,0.4);
}
.sidebar-date {
  font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 500;
}

/* Daily Summary */
.sidebar-summary {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.summary-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 12px;
}
.summary-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.summary-stat {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.summary-stat span:first-child {
  font-size: 22px; font-weight: 800; line-height: 1;
}
.stat-label { font-size: 10px; font-weight: 600; color: var(--text-muted); }
.summary-stat.taken    { background: var(--green-dim);  border-color: rgba(0,230,118,0.15); }
.summary-stat.taken span:first-child    { color: var(--green); }
.summary-stat.remaining{ background: rgba(124,58,237,0.08); border-color: rgba(124,58,237,0.15); }
.summary-stat.remaining span:first-child{ color: #a78bfa; }
.summary-stat.missed   { background: var(--red-dim);    border-color: rgba(255,77,109,0.15); }
.summary-stat.missed span:first-child   { color: var(--red); }

/* Progress bar */
.summary-bar-wrap { display: flex; flex-direction: column; gap: 5px; }
.summary-bar {
  height: 6px; border-radius: 3px; overflow: hidden;
  background: rgba(255,255,255,0.06);
  display: flex;
}
.summary-bar-seg {
  height: 100%; transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
}
.taken-seg  { background: var(--green); border-radius: 3px 0 0 3px; }
.missed-seg { background: var(--red); }
.summary-bar-label {
  font-size: 11px; color: var(--text-muted); text-align: right;
  font-weight: 500;
}

.notes-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.notes-title-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.notes-title-row svg { color: var(--accent); flex-shrink: 0; }
.notes-count {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(124,58,237,0.18); color: #a78bfa;
  min-width: 24px; text-align: center;
}

/* Input area */
.notes-input-area {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.note-textarea {
  width: 100%; resize: none;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text); font-family: inherit;
  font-size: 13px; line-height: 1.55;
  transition: var(--transition); outline: none;
  color-scheme: dark;
}
.note-textarea:focus {
  border-color: rgba(124,58,237,0.5);
  background: rgba(124,58,237,0.05);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.note-textarea::placeholder { color: var(--text-dim); font-size: 12px; }

.notes-input-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.note-char-count { font-size: 11px; color: var(--text-dim); }
.btn-add-note {
  padding: 7px 16px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(91,33,182,0.3));
  border: 1px solid rgba(124,58,237,0.4);
  color: #c4b5fd; font-family: inherit;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn-add-note:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.5), rgba(91,33,182,0.5));
  color: #fff; transform: scale(1.03);
}
.btn-add-note:active { transform: scale(0.97); }

/* Notes list */
.notes-list {
  overflow-y: auto; flex: 1;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.notes-list::-webkit-scrollbar { width: 4px; }
.notes-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Individual note card */
.note-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: var(--transition);
  animation: fadeUp 0.25s ease;
  position: relative;
}
.note-card:hover { border-color: var(--border-bright); background: rgba(255,255,255,0.07); }
.note-card.pinned {
  background: rgba(124,58,237,0.08);
  border-color: rgba(124,58,237,0.25);
}
.note-card.pinned::before {
  content: '📌';
  position: absolute; top: 8px; right: 36px;
  font-size: 11px;
}

.note-text {
  font-size: 13px; color: var(--text); line-height: 1.55;
  word-break: break-word; white-space: pre-wrap;
  margin-bottom: 8px;
}
.note-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.note-timestamp { font-size: 10px; color: var(--text-dim); }
.note-actions { display: flex; gap: 4px; }
.btn-note-pin, .btn-note-delete {
  padding: 3px 7px; border-radius: 6px;
  background: transparent; border: 1px solid transparent;
  cursor: pointer; font-size: 12px; line-height: 1;
  transition: var(--transition);
}
.btn-note-pin { color: var(--text-dim); }
.btn-note-pin:hover { background: rgba(124,58,237,0.15); border-color: rgba(124,58,237,0.3); color: #a78bfa; }
.btn-note-pin.active { color: #a78bfa; background: rgba(124,58,237,0.15); }
.btn-note-delete { color: var(--text-dim); }
.btn-note-delete:hover { background: var(--red-dim); border-color: rgba(255,77,109,0.3); color: var(--red); }

/* Empty state */
.notes-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px;
  padding: 28px 16px; color: var(--text-dim);
  font-size: 12px;
}

/* ════════════════════════
   INLINE DELETE CONFIRM
════════════════════════ */
.delete-confirm-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(255,77,109,0.08);
  border-top: 1px solid rgba(255,77,109,0.2);
  animation: fadeUp 0.2s ease;
}
.delete-confirm-text {
  flex: 1; font-size: 13px; color: var(--text-muted); min-width: 180px;
}
.delete-confirm-text strong { color: var(--text); }
.btn-confirm-yes {
  padding: 7px 16px; border-radius: 8px;
  background: var(--red); border: none;
  color: #fff; font-family: inherit;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn-confirm-yes:hover { background: #ff6b85; transform: scale(1.03); }
.btn-confirm-no {
  padding: 7px 14px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-family: inherit;
  font-size: 12px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.btn-confirm-no:hover { background: var(--surface-hover); color: var(--text); }

/* ════════════════════════
   UTILITIES
════════════════════════ */
.hidden { display: none !important; }

/* ════════════════════════
   RESPONSIVE
════════════════════════ */
/* ════════════════════════
   RESPONSIVE
════════════════════════ */
@media (max-width: 900px) {
  .dash-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .notes-sidebar {
    position: static;
    max-height: none;
    order: 2; /* Move notes below main dashboard */
  }
  .dash-main { order: 1; }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 64px;
  }

  #main-content {
    padding: 16px 16px 100px; /* Extra bottom padding for bottom nav */
  }

  /* Bottom Navigation for Mobile */
  #nav-bar {
    position: fixed;
    top: auto;
    bottom: 0;
    width: 100%;
    height: var(--nav-h);
    padding: 0 12px;
    border-top: 1px solid var(--border);
    border-bottom: none;
    background: rgba(10, 15, 30, 0.9);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }

  .nav-logo { display: none; } /* Hide logo on mobile bottom nav */
  
  .nav-actions {
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  .nav-btn {
    flex-direction: column;
    gap: 4px;
    padding: 8px 4px;
    font-size: 10px;
    flex: 1;
    border-radius: 0;
  }

  .nav-btn svg { width: 20px; height: 20px; }
  .nav-btn.active { background: transparent; color: var(--accent); }
  .nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 30px; height: 3px;
    background: var(--accent);
    border-radius: 0 0 4px 4px;
  }

  /* Dashboard Adjustments */
  .dash-header { flex-direction: column; gap: 16px; align-items: flex-start; }
  .dash-title { font-size: 22px; }
  .overall-ring-wrap { width: 56px; height: 56px; }

  /* Card Adjustments */
  .med-card-header { padding: 16px 16px 12px; gap: 10px; flex-wrap: wrap; }
  .med-name { font-size: 15px; width: 100%; }
  .med-card-actions { width: 100%; justify-content: flex-start; margin-top: 4px; }
  .dose-slots { padding: 0 16px 16px; }
  .dose-slot { padding: 10px 12px; gap: 8px; }
  .dose-time { font-size: 13px; min-width: 48px; }

  /* Form Adjustments */
  .form-row { grid-template-columns: 1fr; }
  .taper-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .form-actions { flex-direction: column-reverse; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }

  /* Notes Sidebar Mobile Refinement */
  .sidebar-clock { padding: 20px 16px; }
  .sidebar-time { font-size: 32px; }
  .summary-stats { gap: 6px; }
  .summary-stat span:first-child { font-size: 18px; }

  /* Alarm Modal Mobile */
  .alarm-modal { padding: 32px 20px; border-radius: 20px; }
  .alarm-emoji { font-size: 40px; }
  .alarm-modal h2 { font-size: 20px; }
}

/* Safe areas for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  #nav-bar {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

