@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

/* ============================================================
   AMIGO DESIGN SYSTEM — navy identity (reverted from lilac), tokens
   ============================================================ */
:root {
  /* Brand — navy family (per approved mockup) */
  --color-primary:        #1a3a6b;
  --color-primary-dark:   #123059;
  --color-primary-darker: #0a1830;
  --color-primary-light:  #e8eef7;
  --color-primary-soft:   #4a6fa5;
  --gradient-primary: linear-gradient(160deg, #0f2240 0%, #1a3a6b 100%);
  --color-gold:        #D9A441;
  --color-gold-dark:   #B07F22;
  --color-gold-tint:   #FAEFD7;

  /* Neutrals — cream/off-white surface, per approved mockup */
  --color-bg:           #FAF6ED;
  --color-surface:      #FFFFFF;
  --color-surface-alt:  #F1EADC;
  --color-border:       #E4DCC7;
  --color-border-soft:  #EFE9DA;
  --color-text:         #22283A;
  --color-text-secondary: #5E6577;
  --color-text-muted:   #96A0AC;
  --color-on-primary:   #FFFFFF;

  /* Semantic (unchanged meanings, kept recognizable) */
  --color-danger:      #EF4444;
  --color-danger-bg:   #FEE2E2;
  --color-danger-text: #DC2626;
  --color-warning:     #CA8A04;
  --color-warning-bg:  #FEF9C3;
  --color-success:     #16A34A;
  --color-success-bg:  #DCFCE7;
  --color-info:        #1d4ed8;
  --color-info-bg:     #DBEAFE;
  --color-plum:        #1a3a6b;
  --color-plum-bg:     #e8eef7;

  /* Spacing */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;

  /* Radius */
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px; --radius-xl: 20px; --radius-full: 999px;

  /* Shadow — soft, matching approved mockup */
  --shadow-sm: 0 1px 2px rgba(34,40,58,0.05), 0 6px 20px rgba(34,40,58,0.06);
  --shadow-md: 0 2px 10px rgba(34,40,58,0.09);
  --shadow-lg: 0 8px 28px rgba(34,40,58,0.14);
  --shadow-xl: 0 24px 64px rgba(10,24,48,0.28);

  /* Type */
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;

  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
}

.amigo {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Mobile drawer — invisible/out-of-flow by default; the mobile media query
   below gives it its real fixed positioning and slide-in behavior. */
.mobile-drawer-overlay,
.mobile-drawer { display: none; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 220px;
  background: var(--gradient-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  top: -60px;
  right: -60px;
}

.sidebar::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  bottom: 80px;
  left: -40px;
}

.sidebar {
  width: 220px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--color-border-soft);
}

.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--color-border-soft);
  position: relative;
  z-index: 1;
}

.logo-group { display: flex; align-items: center; gap: 10px; }
.mobile-settings-btn {
  display: none;
  background: none; border: none; cursor: pointer;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 8px;
  margin: 12px 0 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all var(--transition-fast);
  text-transform: capitalize;
}

.nav-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(26,58,107,0.25);
}

.nav-item i { font-size: 16px; }

.nav-badge {
  margin-left: auto;
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.sidebar-profile {
  padding: 14px 16px;
  border-top: 1px solid var(--color-border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-info p { font-size: 13px; font-weight: 600; color: var(--color-text); }
.profile-info span { font-size: 11px; color: var(--color-text-muted); }

/* ============================================================
   MAIN
   ============================================================ */
.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.topbar {
  padding: 16px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-date { font-size: 13px; color: var(--color-text-secondary); }
.topbar-icons { display: flex; gap: 8px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.icon-btn:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }

/* Icon button variant used on dark surfaces (calendar header) */
.icon-btn-on-dark {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}
.icon-btn-on-dark:hover { background: rgba(255,255,255,0.28); color: #fff; }

.content { padding: 16px 24px 24px; flex: 1; }

.greeting { margin-bottom: 16px; }
.greeting h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--color-text); letter-spacing: -0.3px; }
.greeting p { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; }

/* ============================================================
   FOCUS CARD
   ============================================================ */
.focus-card {
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.focus-card::before {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  top: -50px;
  right: -50px;
}

.focus-card::after {
  content: '';
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  bottom: -20px;
  left: 40px;
}

.focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.focus-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.focus-date { font-size: 12px; color: rgba(255,255,255,0.6); }

.focus-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.focus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
}

.focus-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-red { background: #FCA5A5; }
.dot-amber { background: #FCD34D; }
.dot-blue { background: #BAE6FD; }

.focus-item-text { font-size: 13px; color: #fff; flex: 1; }

.focus-item-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.tag-high { background: rgba(239,68,68,0.28); color: #FCA5A5; }
.tag-med { background: rgba(245,158,11,0.28); color: #FCD34D; }
.tag-low { background: rgba(96,165,250,0.28); color: #BAE6FD; }
.focus-empty { font-size: 13px; color: rgba(255,255,255,0.6); text-align: center; padding: 12px; }
/* Light-surface variant of focus-empty, used on white cards (search/folder/todo empty states) */
.focus-empty-light { font-size: 13px; color: var(--color-text-muted); text-align: center; padding: 12px; }

/* ============================================================
   LIVE CLASS WIDGET (homepage — current/next class from Timetable)
   ============================================================ */
#liveClassZone { margin-bottom: 16px; }

.live-class-card {
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}
.live-class-card::before {
  content: '';
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  top: -40px; right: -40px;
}
.live-class-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
}
.live-class-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #FCA5A5;
  background: rgba(239,68,68,0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #FCA5A5;
  animation: liveDotPulse 1.4s ease-in-out infinite;
}
@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
.live-class-time { font-size: 12px; color: rgba(255,255,255,0.65); }
.live-class-subject {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  position: relative; z-index: 1;
  margin-bottom: 8px;
}
.live-class-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(255,255,255,0.75);
  position: relative; z-index: 1;
  margin-bottom: 14px;
}
.live-class-meta span { display: inline-flex; align-items: center; gap: 5px; }
.live-class-progress-track {
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  position: relative; z-index: 1;
  overflow: hidden;
}
.live-class-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.next-class-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.next-class-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.next-class-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.next-class-subject { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--color-text); }
.next-class-time { font-size: 12px; color: var(--color-text-secondary); flex-shrink: 0; }
.next-class-room {
  margin-top: 6px; font-size: 12px; color: var(--color-text-secondary);
  display: flex; align-items: center; gap: 5px;
}
.next-class-done {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--color-success);
  justify-content: center;
}
.next-class-cta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--color-primary);
  justify-content: center;
  cursor: pointer;
}
.next-class-cta:hover { border-color: var(--color-primary); background: var(--color-primary-light); }

.today-classes-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.class-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  min-width: 100px;
}
.class-chip-now { border-color: var(--color-primary); background: var(--color-primary-light); }
.class-chip-time { font-size: 10.5px; color: var(--color-text-muted); }
.class-chip-subject { font-size: 12.5px; font-weight: 600; color: var(--color-text); }

@media (max-width: 600px) {
  .live-class-card { padding: 14px; }
  .live-class-subject { font-size: 17px; }
  .next-class-card { padding: 12px 14px; }
}

/* ============================================================
   AI BAR
   ============================================================ */
.ai-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-md);
}

.ai-input-row { display: flex; gap: 8px; align-items: center; }
/* Row variant for the multi-step flow prompts (subject/date/note inputs) */
.ai-flow-row { display: flex; gap: 8px; margin-top: 6px; }
.ai-flow-row-tight { display: flex; gap: 8px; margin-top: 6px; }
.ai-flow-row .ai-input-boxed, .ai-flow-row-tight .ai-input-boxed { flex: 1; }
.ai-flow-skip { margin-top: 6px; }

.ai-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--color-text);
  background: transparent;
  font-family: var(--font-body);
}
/* Boxed variant, used for the flow's step inputs and various form fields across the app */
.ai-input-boxed {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--color-text);
  outline: none;
  background: var(--color-surface);
  transition: border-color var(--transition-fast);
}
.ai-input-boxed:focus { border-color: var(--color-primary); }

.ai-input::placeholder, .ai-input-boxed::placeholder { color: var(--color-text-muted); }

.ai-send {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  box-shadow: 0 2px 8px rgba(91,63,191,0.3);
  transition: opacity var(--transition-fast);
}

.ai-send:hover { opacity: 0.9; }

.ai-status { font-size: 12px; color: var(--color-primary-dark); min-height: 16px; }
.ai-flow { display: flex; flex-direction: column; gap: 8px; }
.ai-question { font-size: 13px; color: var(--color-text); font-weight: 500; }
.ai-options { display: flex; gap: 6px; flex-wrap: wrap; }

.ai-opt {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.ai-opt:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.ai-opt.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  bottom: -20px;
  right: -20px;
}

.stat-icon { font-size: 18px; margin-bottom: 8px; position: relative; z-index: 1; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--color-text); letter-spacing: -0.5px; font-family: var(--font-display); position: relative; z-index: 1; }
.stat-label { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; position: relative; z-index: 1; }

/* ============================================================
   UPCOMING / LISTS
   ============================================================ */
.upcoming-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

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

.section-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.section-meta { font-size: 12px; color: var(--color-text-muted); }

/* Stacked blocks on the merged Tasks page (Assignments/Quizzes/Mids/Presentations/Finals/Notices) */
.task-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.task-block:last-child { margin-bottom: 0; }
.task-block .section-title { display: flex; align-items: center; gap: 6px; }
.task-block .section-title i { font-size: 14px; color: var(--color-primary); }
.task-block-header { cursor: pointer; }
.task-block-chevron { font-size: 14px; color: var(--color-text-secondary); transition: transform var(--transition-fast); }
.task-block-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}

.task-list { display: flex; flex-direction: column; gap: 6px; }

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--color-border-soft);
  transition: background var(--transition-fast);
}
.task-list .task-item:last-child { border-bottom: none; }

.task-item:hover { background: var(--color-surface-alt); }
/* Variant used for search-result rows (sits on white surface, not the tinted list surface) */
.task-item-on-surface { background: var(--color-surface); }

.task-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
/* Larger variant used in the task detail sheet */
.task-icon-lg { width: 40px; height: 40px; border-radius: var(--radius-md); font-size: 18px; }

.ti-assign { background: var(--color-primary-light); color: var(--color-primary-dark); }
.ti-quiz { background: var(--color-warning-bg); color: var(--color-warning); }
.ti-pres { background: var(--color-plum-bg); color: var(--color-plum); }
.ti-final { background: var(--color-danger-bg); color: var(--color-danger-text); }
.ti-notice { background: var(--color-success-bg); color: var(--color-success); }

.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 500; color: var(--color-text); }
.task-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 1px; }
.task-due { font-size: 11px; color: var(--color-text-secondary); margin-right: 6px; white-space: nowrap; }

.urgency {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.urgency-sm { font-size: 11px; }
.u-high { background: var(--color-danger-bg); color: var(--color-danger-text); }
.u-med { background: var(--color-warning-bg); color: var(--color-warning); }
.u-low { background: var(--color-success-bg); color: var(--color-success); }

/* ============================================================
   UPLOADS / FOLDERS / FILES
   ============================================================ */
.upload-box {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  background: var(--color-surface-alt);
}

.uploads-toolbar { display: flex; gap: 8px; margin-bottom: 20px; }
.uploads-toolbar .ai-input-boxed { flex: 1; }
.folders-list { display: flex; flex-direction: column; gap: 12px; }

.folder-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
}

.folder-header:hover { background: var(--color-surface-alt); }
.folder-header { flex-wrap: wrap; gap: 8px; }
.folder-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 140px; }
.folder-header-left .folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.folder-header-right { display: flex; gap: 6px; align-items: center; flex-shrink: 0; margin-left: auto; }
.folder-upload-btn { white-space: nowrap; }
.folder-icon { font-size: 18px; color: var(--color-primary); }
.folder-name { font-size: 14px; font-weight: 500; color: var(--color-text); }

.folder-count {
  font-size: 11px;
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.folder-upload-btn {
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.folder-chevron { font-size: 14px; color: var(--color-text-secondary); transition: transform var(--transition-fast); }

.folder-files {
  border-top: 1px solid var(--color-border-soft);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--color-surface-alt);
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
}

.file-icon { font-size: 16px; color: var(--color-primary); flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 11px; color: var(--color-text-muted); margin-top: 1px; }

/* ============================================================
   TODO
   ============================================================ */
.todo-toolbar { display: flex; gap: 8px; margin-bottom: 16px; }
.todo-toolbar .ai-input-boxed { flex: 1; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-alt);
}

.todo-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.todo-text { flex: 1; font-size: 13px; color: var(--color-text); }
.todo-text.done { text-decoration: line-through; color: var(--color-text-muted); }

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; position: relative; z-index: 1; }
.cal-month-label { font-size: 14px; font-weight: 500; color: #fff; }
.cal-weekday-row { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-bottom: 8px; position: relative; z-index: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; position: relative; z-index: 1; }

.cal-day-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 6px 0;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  color: #FFFFFF;
  position: relative;
  transition: all var(--transition-fast);
}

.cal-cell:hover {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
}

.cal-cell.today {
  background: rgba(255,255,255,0.95);
  color: var(--color-primary-dark);
  font-weight: 700;
}

.cal-cell.today:hover { opacity: 0.9; }

.cal-cell.other-month { color: rgba(255,255,255,0.35); }

.cal-cell.has-event::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #FFFFFF;
  position: absolute;
  bottom: 3px;
}

.cal-cell.today.has-event::after { background: var(--color-primary); }

.reminder-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}
.reminder-modal-label { font-size: 13px; font-weight: 500; color: var(--color-text); margin-bottom: 12px; }
.reminder-modal-label span { color: var(--color-primary); }
.reminder-modal-body { display: flex; flex-direction: column; gap: 8px; }
.reminder-modal-row { display: flex; gap: 8px; }
.reminder-modal-actions { display: flex; gap: 8px; }
.reminder-select {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text);
  font-family: var(--font-body);
  background: var(--color-surface);
}
.reminder-time-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text);
  font-family: var(--font-body);
}

.del-reminder {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.del-reminder:hover { color: var(--color-danger); background: var(--color-danger-bg); }
.del-reminder-lg { font-size: 20px; flex-shrink: 0; }

.edit-reminder {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.edit-reminder:hover { color: var(--color-primary); background: var(--color-primary-bg, rgba(124,58,237,0.1)); }

.task-block-add {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 15px;
  padding: 4px 6px;
  margin-left: auto;
  margin-right: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.task-block-add:hover { color: #fff; background: var(--color-primary); }

.schedule-day-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: 10px 4px 4px;
}
.schedule-day-header:first-child { padding-top: 4px; }

.quick-add-title { margin-top: 4px; }
.quick-add-input-row { margin-top: 10px; }
.quick-add-close { margin-top: 14px; width: 100%; }
.task-detail-btn-edit { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-primary); }

/* Small layout-context utility classes (replace one-off inline positioning) */
.main-relative { position: relative; }
.icon-btn-anchor { position: relative; }
.upcoming-section-mt { margin-top: 16px; }
.focus-card-mb { margin-bottom: 16px; }
.ai-sparkle-icon { color: var(--color-primary); font-size: 16px; }
.ai-send-full { width: 100%; padding: 12px; font-size: 13px; }
.stat-icon-assign { color: var(--color-primary); }
.stat-icon-quiz   { color: var(--color-warning); }
.stat-icon-pres   { color: var(--color-plum); }
.stat-icon-final  { color: var(--color-danger-text); }
.feedback-form .ai-input-boxed,
.settings-field .ai-input-boxed { width: 100%; margin-top: 6px; }
.notif-badge-dot {
  display: none; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px;
  background: var(--color-danger); border-radius: 50%; border: 2px solid #fff;
  animation: pulseDot 2s infinite;
}
.notif-badge-count {
  display: none; position: absolute; top: -4px; right: -4px; background: var(--color-danger);
  color: #fff; font-size: 9px; font-weight: 600; padding: 2px 5px; border-radius: var(--radius-full);
}
/* Note: "pulseDot" animation is referenced (below) exactly as in the original CSS/HTML,
   but was never defined there either — this is a pre-existing no-op, not something
   introduced in this pass. Left as-is; flagged in the Phase 1 report instead of "fixed". */

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-screen {
  position: fixed; inset: 0;
  background: var(--gradient-primary);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.auth-decor { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.06); }
.auth-decor-1 { width: 300px; height: 300px; top: -80px; right: -80px; }
.auth-decor-2 { width: 200px; height: 200px; bottom: -60px; left: -60px; background: rgba(255,255,255,0.05); }
.auth-decor-3 { width: 150px; height: 150px; top: 40%; left: -40px; background: rgba(255,255,255,0.05); }

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%; max-width: 400px; margin: 20px;
  box-shadow: var(--shadow-xl);
  position: relative; z-index: 1;
}
.auth-card-head { text-align: center; margin-bottom: 28px; }
.auth-logo {
  width: 72px; height: 72px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-family: var(--font-display);
  font-size: 32px; font-weight: 700; color: #fff;
  box-shadow: 0 8px 24px rgba(91,63,191,0.35);
}
.auth-card-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--color-text); letter-spacing: -0.5px; margin-bottom: 4px; }
.auth-card-head p { font-size: 13px; color: var(--color-text-secondary); }

.auth-tabs { display: flex; gap: 4px; background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 4px; margin-bottom: 24px; }
.auth-tab {
  flex: 1; padding: 9px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--color-text-secondary);
  font-family: var(--font-body); transition: all var(--transition-base);
}
.auth-tab.active { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }

.auth-form-body { display: flex; flex-direction: column; gap: 10px; }
.auth-field { position: relative; }
.auth-field-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); font-size: 16px; }
.auth-input {
  width: 100%; padding: 11px 14px 11px 38px;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font-body); outline: none; box-sizing: border-box;
  transition: border-color var(--transition-fast);
}
.auth-input:focus { border-color: var(--color-primary); }

.auth-msg { font-size: 12px; display: none; padding: 8px 12px; border-radius: var(--radius-sm); }
.auth-msg.show { display: block; }
.auth-msg-error   { color: var(--color-danger-text); background: var(--color-danger-bg); }
.auth-msg-success { color: var(--color-success); background: var(--color-success-bg); }
.auth-msg-info    { color: var(--color-primary-dark); background: var(--color-primary-light); }

/* Generic status-color utilities — reused by feedback-status and anywhere else that
   needs the same error/success/info palette without pulling in auth-msg's sizing */
.msg-error   { color: var(--color-danger-text); background: var(--color-danger-bg); }
.msg-success { color: var(--color-success); background: var(--color-success-bg); }
.msg-info    { color: var(--color-primary-dark); background: var(--color-primary-light); }

.auth-submit {
  padding: 12px; background: var(--gradient-primary); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); box-shadow: 0 4px 14px rgba(91,63,191,0.35); letter-spacing: 0.2px;
  transition: opacity var(--transition-fast);
}
.auth-submit:hover { opacity: 0.92; }

.auth-forgot { text-align: center; font-size: 12px; color: var(--color-text-secondary); margin-top: 8px; cursor: pointer; }
.auth-forgot span { color: var(--color-primary-dark); font-weight: 500; }
.auth-terms { text-align: center; font-size: 11px; color: var(--color-text-muted); margin-top: 14px; }
.auth-reset-head { text-align: center; margin-bottom: 16px; }
.auth-reset-head p:first-child { font-size: 14px; font-weight: 500; color: var(--color-text); }
.auth-reset-head p:last-child { font-size: 12px; color: var(--color-text-secondary); margin-top: 4px; }

/* ============================================================
   SEARCH PANEL
   ============================================================ */
.search-panel { padding: 0 24px 12px; }
.search-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 8px 14px;
}
.search-icon { color: var(--color-text-muted); font-size: 16px; }
.search-results { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }

/* ============================================================
   NOTIFICATION PANEL
   ============================================================ */
.notif-panel {
  position: fixed; top: 60px; right: 12px;
  width: min(320px, calc(100vw - 24px));
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  z-index: 9999; overflow: hidden;
}
.notif-panel-header {
  padding: 12px 16px; border-bottom: 1px solid var(--color-border-soft);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--color-surface-alt);
}
.notif-panel-title { display: flex; align-items: center; gap: 8px; }
.notif-panel-title i { font-size: 15px; color: var(--color-primary); }
.notif-panel-title span { font-size: 13px; font-weight: 600; color: var(--color-text); }
.notif-list { max-height: 70vh; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; }

.notif-card {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 6px;
  transition: opacity var(--transition-fast);
}
.notif-card.today    { background: var(--color-warning-bg); border: 1px solid #FED7AA; }
.notif-card.upcoming { background: var(--color-info-bg);    border: 1px solid #BFDBFE; }
.notif-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-card.today    .notif-icon { background: #FEF3C7; }
.notif-card.upcoming .notif-icon { background: #DBEAFE; }
.notif-card.today    .notif-icon i { color: var(--color-warning); font-size: 16px; }
.notif-card.upcoming .notif-icon i { color: var(--color-info); font-size: 16px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-card.today    .notif-title { color: #92400E; }
.notif-card.upcoming .notif-title { color: #1e3a5f; }
.notif-sub { font-size: 11px; margin-top: 2px; }
.notif-card.today    .notif-sub { color: #B45309; }
.notif-card.upcoming .notif-sub { color: #3B5FA0; }
.notif-date-badge { font-size: 9px; font-weight: 700; border-radius: var(--radius-full); padding: 2px 8px; flex-shrink: 0; letter-spacing: 0.3px; }
.notif-date-badge.today-badge { color: #92400E; background: #FDE68A; }
.notif-date-badge.upcoming-badge { color: var(--color-info); background: var(--color-info-bg); font-weight: 600; }
.notif-empty { padding: 20px; text-align: center; color: var(--color-text-muted); font-size: 13px; }
.notif-empty small { font-size: 11px; }
.notif-section-hdr { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; padding: 4px 4px 6px; }
.notif-section-hdr.today-hdr { color: var(--color-warning); padding-top: 4px; }
.notif-section-hdr.upcoming-hdr { color: var(--color-primary-dark); padding-top: 10px; }

/* ============================================================
   TASK DETAIL SHEET
   ============================================================ */
.task-detail-overlay {
  position: fixed; inset: 0; background: rgba(34,28,53,0.5);
  z-index: 999; display: flex; align-items: flex-end; justify-content: center;
}
.task-detail-sheet {
  background: var(--color-surface); border-radius: 20px 20px 0 0;
  padding: 24px; width: 100%; max-width: 500px; box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
}
.task-detail-handle { width: 36px; height: 4px; background: var(--color-border); border-radius: 2px; margin: 0 auto 20px; }
.task-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.task-detail-title { font-size: 16px; font-weight: 600; color: var(--color-text); }
.task-detail-subject { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.task-detail-info {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px;
}
.task-detail-info-row { display: flex; justify-content: space-between; align-items: center; }
.task-detail-info-label { font-size: 12px; color: var(--color-text-secondary); }
.task-detail-info-value { font-size: 12px; font-weight: 500; color: var(--color-text); text-transform: capitalize; }
.task-detail-actions { display: flex; gap: 8px; }
.task-detail-btn {
  flex: 1; padding: 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: var(--font-body);
}
.task-detail-btn-close { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-secondary); }
.task-detail-btn-delete { border: none; background: var(--color-danger-bg); color: var(--color-danger-text); }

/* ============================================================
   SETTINGS / FEEDBACK
   ============================================================ */
.settings-avatar-row { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.settings-avatar-wrap { position: relative; }
.settings-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 600; color: #fff; overflow: hidden;
}
.settings-avatar-edit {
  position: absolute; bottom: 0; right: 0; width: 22px; height: 22px;
  background: var(--color-surface); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: var(--shadow-md);
}
.settings-avatar-edit i { font-size: 11px; color: var(--color-primary); }
.settings-avatar-name { font-size: 15px; font-weight: 600; color: #fff; }
.settings-avatar-hint { font-size: 12px; color: rgba(255,255,255,0.7); }
.settings-field { margin-bottom: 14px; }
.settings-field:last-of-type { margin-bottom: 16px; }
.settings-label { font-size: 13px; font-weight: 500; color: var(--color-primary-dark); }
.settings-select {
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 8px 12px;
  width: 100%; margin-top: 6px; font-size: 13px; color: var(--color-text);
  font-family: var(--font-body); background: var(--color-surface); outline: none;
}

.feedback-banner {
  background: var(--gradient-primary); border-radius: var(--radius-md); padding: 14px 18px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.feedback-banner-emoji { font-size: 28px; }
.feedback-banner-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.feedback-banner-sub { font-size: 12px; color: rgba(255,255,255,0.75); }
.feedback-form { display: flex; flex-direction: column; gap: 12px; }
.feedback-field-label { font-size: 13px; font-weight: 500; color: var(--color-primary-dark); }
.feedback-textarea {
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 8px 12px;
  width: 100%; margin-top: 6px; font-size: 13px; font-family: var(--font-body);
  resize: none; height: 120px; outline: none; color: var(--color-text);
  transition: border-color var(--transition-fast);
}
.feedback-textarea:focus { border-color: var(--color-primary); }
.feedback-status { font-size: 13px; display: none; padding: 10px 14px; border-radius: var(--radius-sm); }
.feedback-status.show { display: block; }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .amigo { flex-direction: column; height: 100vh; overflow: hidden; }

  #appScreen {
    flex-direction: column !important;
    width: 100% !important;
    height: 100vh !important;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100% !important;
    height: 60px !important;
    flex-direction: row !important;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    padding: 0;
    z-index: 500;
    box-shadow: 0 -2px 12px rgba(15,34,64,0.18);
  }

  .sidebar-logo {
    display: flex !important;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    padding: 0 16px;
    background: var(--gradient-primary);
    border-bottom: none;
    border-right: none;
    z-index: 501;
    justify-content: space-between;
  }

  .sidebar-logo .logo-text { color: #fff; }
  .sidebar-logo .logo-mark { background: rgba(255,255,255,0.18); }

  .mobile-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 16px;
  }
  .mobile-settings-btn:active { background: rgba(255,255,255,0.28); }

  .sidebar::before, .sidebar::after { display: none; }

  .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    padding: 4px 4px;
    gap: 2px;
    flex: 1;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    justify-content: space-around;
  }

  .nav-label { display: none !important; }

  .nav-item {
    flex-direction: column !important;
    gap: 2px;
    padding: 6px 8px;
    font-size: 9px;
    white-space: nowrap;
    margin-bottom: 0;
    flex-shrink: 0;
    min-width: fit-content;
    text-transform: capitalize;
  }

  .nav-item i { font-size: 18px; }
  .nav-badge { display: none !important; }
  /* These five now live in the hamburger drawer instead of crowding the
     bottom tab bar — Home/Tasks/Timetable/To-Do/Notes stay as the 5 primary
     tabs since those are what's reached for constantly; the rest are one
     tap away instead of a sixth/seventh/eighth icon squeezed into a row. */
  .nav-item[onclick*="uploads"],
  .nav-item[onclick*="calendar"],
  .nav-item[onclick*="timer"],
  .nav-item[onclick*="feedback"],
  .nav-item[onclick*="settings"] { display: none !important; }

  /* Mobile "more" drawer */
  .mobile-drawer-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 600;
  }
  .mobile-drawer-overlay.open { display: block; }
  .mobile-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 78vw;
    max-width: 300px;
    background: var(--color-surface);
    z-index: 601;
    padding: 16px 12px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .mobile-drawer.open { transform: translateX(0); }
  .mobile-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px 16px;
    border-bottom: 1px solid var(--color-border-soft);
    margin-bottom: 10px;
  }
  .mobile-drawer-close { background: none; border: none; color: var(--color-text-secondary); font-size: 18px; cursor: pointer; }
  .mobile-drawer .nav-item {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 10px;
    font-size: 14px !important;
  }
  .mobile-drawer .nav-item i { font-size: 18px; }

  .sidebar-profile {
    display: flex !important;
    flex-shrink: 0;
    padding: 6px 8px;
    border-top: none;
    border-left: 0.5px solid rgba(255,255,255,0.15);
    align-items: center;
    gap: 4px;
    height: 100%;
  }

  .profile-info { display: none !important; }
  .avatar { display: none !important; }

  .main {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    min-height: 0;
    display: flex !important;
    flex-direction: column;
    padding-top: 48px;
  }

  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stat-card { padding: 8px 6px; }
  .stat-icon { font-size: 14px; margin-bottom: 4px; }
  .stat-num { font-size: 16px; }
  .stat-label { font-size: 9px; }
  .content { padding: 12px 14px 76px; }
  .topbar { padding: 12px 14px 0; }

  .notif-panel {
    right: 8px;
    width: calc(100vw - 16px);
    top: 50px;
  }

  .focus-card { padding: 14px; }
  .ai-bar { padding: 12px; }
  .upcoming-section { padding: 12px; }

  .greeting h2 { font-size: 18px; }
  .task-item {
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
  }
  .task-info { flex: 1; min-width: 0; }
  .task-title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .task-sub { font-size: 10px; }
  .task-due { display: inline !important; font-size: 10px; color: var(--color-text-secondary); background: var(--color-surface-alt); padding: 2px 6px; border-radius: var(--radius-full); white-space: nowrap; }
  .urgency { font-size: 9px; padding: 2px 6px; }

  /* Auth card + settings/feedback tighten up on small screens */
  .auth-card { padding: 26px 22px; margin: 16px; }
  .settings-avatar { width: 56px; height: 56px; font-size: 20px; }
  .feedback-banner { padding: 12px 14px; }
  .uploads-toolbar, .todo-toolbar { flex-direction: column; }
  .reminder-modal-row { flex-direction: column; }
}

@media (max-width: 420px) {
  .auth-card { padding: 22px 18px; }
  .stats-grid { gap: 4px; }
  .stat-card { padding: 6px 4px; }
  .stat-num { font-size: 14px; }
  .stat-label { font-size: 8px; }
}
/* ============================================================
   NEW: item checkbox + overdue label (task completion feature)
   ============================================================ */
.item-checkbox {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.6px solid var(--color-border);
  flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: all var(--transition-fast);
}
.item-checkbox i { font-size: 13px; }
.item-checkbox.checked { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.task-item-done .task-title { text-decoration: line-through; color: var(--color-text-muted); }
.task-due-overdue { color: var(--color-danger-text); font-weight: 600; }

/* ============================================================
   NEW: Home stat row + quick add button
   ============================================================ */
.greeting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.home-quick-add-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stat-row {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: var(--space-3); margin: var(--space-4) 0;
}
.stat-card {
  background: var(--color-surface); border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg); padding: var(--space-4);
  border-top: 3px solid var(--color-primary);
}
.stat-card-red   { border-top-color: var(--color-danger); }
.stat-card-green { border-top-color: var(--color-success); }
.stat-label { font-size: 12px; color: var(--color-text-secondary); font-weight: 600; margin-bottom: 8px; }
.stat-num { font-size: 26px; font-weight: 700; font-family: var(--font-display); color: var(--color-text); }
.stat-card-red .stat-num   { color: var(--color-danger-text); }
.stat-card-green .stat-num { color: var(--color-success); }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2,1fr); } }

/* ============================================================
   NEW: Tasks page type filter
   ============================================================ */
.filter-row { margin-bottom: var(--space-4); }
.type-filter {
  padding: 9px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-surface);
  font-size: 13px; font-weight: 600; color: var(--color-text); cursor: pointer;
}

/* ============================================================
   NEW: Notes (sticky note board)
   ============================================================ */
.notes-board { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--space-3); }
@media (max-width: 900px) { .notes-board { grid-template-columns: repeat(2,1fr); } }
.sticky {
  border-radius: var(--radius-lg); padding: 16px; min-height: 130px;
  display: flex; flex-direction: column; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform var(--transition-fast);
}
.sticky:hover { transform: translateY(-2px); }
.note-amber { background: var(--color-gold-tint); }
.note-teal  { background: #E1F0EE; }
.note-pink  { background: #FBE4E1; }
.note-blue  { background: var(--color-primary-light); }
.sticky-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.sticky-title { font-weight: 700; font-size: 14px; color: var(--color-text); }
.sticky-del { color: rgba(15,23,42,0.4); cursor: pointer; }
.sticky-body { font-size: 13px; color: rgba(15,23,42,0.72); line-height: 1.5; white-space: pre-wrap; }
.sticky-new {
  border: 1.6px dashed var(--color-border); border-radius: var(--radius-lg);
  min-height: 130px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; color: var(--color-text-muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.sticky-new:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ============================================================
   NEW: Focus timer page
   ============================================================ */
.timer-page-wrap { display: flex; flex-direction: column; align-items: center; padding: 60px 0 30px; }
.timer-big { font-family: var(--font-display); font-size: 72px; font-weight: 700; margin-bottom: 24px; letter-spacing: -0.02em; }
.preset-row { display: flex; gap: 10px; margin-bottom: 28px; }
.preset-btn {
  padding: 9px 20px; border-radius: var(--radius-full); border: 1px solid var(--color-border);
  background: var(--color-surface); font-size: 13px; font-weight: 600; color: var(--color-text-secondary); cursor: pointer;
}
.preset-btn.active { background: var(--color-primary-light); color: var(--color-primary-dark); border-color: var(--color-primary-light); }
.timer-actions { display: flex; gap: 10px; }

/* ============================================================
   NEW: Settings toggle rows
   ============================================================ */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px; border-top: 1px solid var(--color-border-soft); margin-top: 6px;
}
.toggle-label { font-size: 14px; font-weight: 600; color: var(--color-text); }
.toggle-desc { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }
.switch {
  width: 40px; height: 22px; border-radius: var(--radius-full);
  background: var(--color-border); position: relative; cursor: pointer;
  flex-shrink: 0; transition: background var(--transition-fast);
}
.switch::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  position: absolute; top: 3px; left: 3px; transition: left var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch.on { background: var(--color-primary); }
.switch.on::after { left: 21px; }

/* ============================================================
   DARK MODE — toggled via document root's data-theme attribute
   ============================================================ */
:root[data-theme="dark"] {
  --color-bg:             #0F1B2B;
  --color-surface:        #16243A;
  --color-surface-alt:    #1D2E46;
  --color-border:         #2A3E56;
  --color-border-soft:    #22344A;
  --color-text:           #EAF1F8;
  --color-text-secondary: #A8B8C7;
  --color-text-muted:     #71838F;
  --color-primary-light:  #1F3A57;

  /* --color-primary / --color-primary-dark / --color-plum are the light-mode
     navy tones. --color-primary-light and --color-plum-bg above are already
     flipped to dark surfaces — but the light-mode navy TEXT that sits on top
     of them (folder icons, settings labels, "ai-status", notif headers, stat
     icons, msg-info boxes, preset toggles) was still using the unflipped
     dark navy, which is nearly invisible on a dark surface. Lightened here
     so that text stays readable without changing any light-mode value. */
  --color-primary:        #6FA3E0;
  --color-primary-dark:   #BBD6F2;
  --color-plum:           #C3B0EA;
  --color-plum-bg:        #2A2347;
}
:root[data-theme="dark"] body { background: var(--color-bg); color: var(--color-text); }
.custom-timer-row { display: flex; align-items: center; gap: 8px; }
.custom-timer-row input { width: 70px; text-align: center; }
.custom-timer-unit { font-size: 13px; color: var(--color-text-secondary); }

/* ============================================================
   GLOBAL TOAST — replaces the old #aiStatus element that was
   deleted along with the home AI bar, which had left task-save,
   upload, and settings-saved confirmations silently going nowhere.
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 900;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { background: var(--color-danger); }
@media (max-width: 768px) { .toast { bottom: 76px; } }
/* ── "Install Amigo app" link on the login page ── */
.auth-install { text-align: center; margin-top: 16px; }
.auth-install button {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--color-primary-soft);
  background: var(--color-primary-light);
  border: 1px solid transparent;
  padding: 7px 16px; border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.auth-install button:hover { background: #dbe5f3; color: var(--color-primary-dark); }
.auth-install button svg { width: 15px; height: 15px; flex: none; }
.install-help-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(10, 20, 40, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.install-help-card {
  background: #fff; color: #1a2233; border-radius: 16px;
  max-width: 340px; width: 100%; padding: 22px 22px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.install-help-card h3 { font-size: 16px; margin-bottom: 12px; }
.install-help-card ol { padding-left: 20px; font-size: 13.5px; line-height: 1.6; color: #475467; }
.install-help-card li { margin-bottom: 6px; }
.install-help-card button {
  margin-top: 10px; width: 100%; border: none; border-radius: 10px; cursor: pointer;
  padding: 10px; font-size: 14px; font-weight: 600; color: #fff; background: #1a3a6b;
}

/* ── "Save to Amigo" dialog for files shared in from other apps ── */
.share-file-list { list-style: none; margin: 0 0 14px; padding: 0; max-height: 140px; overflow: auto; font-size: 13px; color: var(--color-text); }
.share-file-list li { padding: 6px 0; border-bottom: 1px solid var(--color-surface-alt); word-break: break-word; }
.share-file-list li:last-child { border-bottom: none; }
.share-size { color: var(--color-text-secondary); font-size: 12px; margin-left: 6px; white-space: nowrap; }