/* ════════════════════════════════════════════════════════════════
   CBSE Class 9 Study Dashboard — Design System & Account Login UI
   ════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  --bg:          #0a0a0a;
  --panel:       #121212;
  --panel-2:     #161616;
  --panel-3:     #151515;
  --border:      #2a2a2a;
  --border-soft: #1f1f1f;

  --text-primary: #f2f2f2;
  --text-dim:     #9a9a9a;
  --text-faint:   #6a6a6a;

  --ring-fill:  #ffffff;
  --ring-track: #232323;

  --danger:  #ff6b6b;
  --success: #22c55e;
  --warning: #f59e0b;
  --info:    #3b82f6;

  --teach-color:   #0891b2; /* cyan/blue for Teach */
  --revised-color: #7c3aed; /* purple for Revised */
  --classwork-color: var(--warning); /* amber for Classwork/Notebook */
  --homework-color:  var(--danger);  /* red for Homework Submitted */

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --footer-h: 52px;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -10%, #171717 0%, #0a0a0a 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  padding-bottom: calc(var(--footer-h) + 20px);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

/* ══════════════════════════════════════════════════════════════════
   NAVIGATION TABS & ACCOUNT BAR
   ══════════════════════════════════════════════════════════════════ */
.tabs-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.tabs-inner {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.tab-btn:hover  { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.tab-btn.active { background: #ffffff; color: #000000; font-weight: 600; }

/* Account & Cloud Sync Controls */
.account-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 50px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.account-email {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-btn {
  padding: 7px 14px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
}

.btn-signin {
  background: var(--teach-color);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(8, 145, 178, 0.25);
}
.btn-signin:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-signout {
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.3);
}
.btn-signout:hover { background: var(--danger); color: #000; }

/* ══════════════════════════════════════════════════════════════════
   AUTHENTICATION MODAL OVERLAY
   ══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: #141414;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close-btn:hover { color: var(--text-primary); }

.modal-header { margin-bottom: 18px; }

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  background: #0f0f0f;
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  margin-bottom: 18px;
  border: 1px solid var(--border-soft);
}

.auth-tab-btn {
  flex: 1;
  padding: 7px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.auth-tab-btn.active {
  background: var(--panel);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.auth-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.auth-input {
  background: #090909;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.auth-input:focus {
  border-color: var(--teach-color);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.2);
}

.auth-error {
  padding: 8px 12px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 11.5px;
  margin-bottom: 14px;
}
.auth-error.hidden { display: none; }

.auth-submit {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--teach-color) 0%, #0284c7 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.3);
}
.auth-submit:hover { opacity: 0.92; transform: translateY(-1px); }

.modal-footer-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 10.5px;
  color: var(--text-faint);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════
   DYNAMIC HEADER
   ══════════════════════════════════════════════════════════════════ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 32px 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.header-left { display: flex; flex-direction: column; gap: 6px; }

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-dim);
  width: fit-content;
}
.header-badge.class-badge { color: #d8d8d8; font-weight: 700; }

.header-center { text-align: center; }

.header-greeting {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.header-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.header-right { text-align: right; }

.clock-time {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.clock-date {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════════
   MAIN WRAPPER
   ══════════════════════════════════════════════════════════════════ */
.main-wrapper {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px 20px;
}

.view { display: none; }
.view.active { display: block; }

/* ══════════════════════════════════════════════════════════════════
   TOP SUMMARY GRID
   ══════════════════════════════════════════════════════════════════ */
.top-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.top-panel {
  background: linear-gradient(135deg, var(--panel) 0%, #0f0f0f 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.top-panel-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.ring-pct {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  font-variant-numeric: tabular-nums;
}

.ring-ratio {
  font-size: 11px;
  color: var(--text-faint);
  display: block;
}

.ring-track { fill: none; stroke: var(--ring-track); }
.ring-fill  {
  fill: none;
  stroke: var(--ring-fill);
  stroke-linecap: round;
  transform-origin: center;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4,0,0.2,1);
}
.ring-fill-week { stroke: #a78bfa; }

/* Bar Chart */
.bar-chart-panel {
  background: linear-gradient(135deg, var(--panel) 0%, #0f0f0f 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-chart-area {
  display: flex;
  gap: 6px;
  position: relative;
}

.bar-y-axis {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
}

.bar-y-label {
  font-size: 9px;
  color: var(--text-faint);
  text-align: right;
  padding-right: 4px;
  line-height: 1;
}

.bar-chart-cols {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  flex: 1;
  margin-left: 36px;
  border-left: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 0 4px 0;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}

.bar-pct-text {
  font-size: 8px;
  color: var(--text-faint);
  position: absolute;
  bottom: calc(var(--bar-h, 0%) + 2px);
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  width: 100%;
  height: 100%;
  background: #1c1c1c;
  border-radius: 4px 4px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(to top, #888 0%, #f2f2f2 100%);
  border-radius: 3px 3px 0 0;
  transition: height 0.6s cubic-bezier(0.4,0,0.2,1);
}

.bar-labels-row {
  display: flex;
  gap: 4px;
  margin-left: 36px;
}

.bar-label {
  flex: 1;
  font-size: 8px;
  color: var(--text-faint);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════
   SECTION HEADER & LEGEND
   ══════════════════════════════════════════════════════════════════ */
.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

.section-legend {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.legend-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid var(--border-soft);
  background: var(--panel);
}
.legend-tag.tag-teach     { color: var(--teach-color); border-color: rgba(8, 145, 178, 0.4); }
.legend-tag.tag-classwork { color: var(--classwork-color); border-color: rgba(245, 158, 11, 0.4); }
.legend-tag.tag-homework  { color: var(--homework-color); border-color: rgba(255, 107, 107, 0.4); }
.legend-tag.tag-revised   { color: var(--revised-color); border-color: rgba(124, 58, 237, 0.4); }

/* ══════════════════════════════════════════════════════════════════
   SUBJECT CARDS GRID
   ══════════════════════════════════════════════════════════════════ */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.subject-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent, #7c3aed);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  gap: 10px;
}

.card-head-info { flex: 1; min-width: 0; }

.card-subject-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-ratio {
  font-size: 11px;
  color: var(--text-faint);
}

.card-ring-wrap {
  position: relative;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-ring-pct {
  position: absolute;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  pointer-events: none;
}

.card-section { border-top: 1px solid var(--border-soft); }

.card-section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: var(--panel-3);
  flex-wrap: wrap;
  gap: 4px;
}

.card-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.cb-column-labels {
  display: flex;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-right: 4px;
  flex-wrap: wrap;
}
.cb-col-tag {
  padding: 1px 5px;
  border-radius: 4px;
}
.cb-col-teach     { color: var(--teach-color); background: rgba(8, 145, 178, 0.12); }
.cb-col-classwork { color: var(--classwork-color); background: rgba(245, 158, 11, 0.12); }
.cb-col-homework  { color: var(--homework-color); background: rgba(255, 107, 107, 0.12); }
.cb-col-revised   { color: var(--revised-color); background: rgba(124, 58, 237, 0.12); }

.card-list {
  list-style: none;
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
}

.chapter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  transition: background 0.15s;
}
.chapter-row:hover { background: rgba(255,255,255,0.025); }

.cb-pair {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.cb-topic {
  width: 13px;
  height: 13px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 3px;
}

.cb-teach     { accent-color: var(--teach-color); }
.cb-classwork { accent-color: var(--classwork-color); }
.cb-homework  { accent-color: var(--homework-color); }
.cb-revised   { accent-color: var(--revised-color); }

.chapter-label {
  font-size: 11.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s, text-decoration-color 0.2s;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chapter-topic-link {
  font-size: 10px;
  color: var(--text-faint);
  display: block;
  margin-top: 2px;
}

.badge-state {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: auto;
  white-space: nowrap;
}
.badge-teach-only   { color: var(--teach-color); background: rgba(8, 145, 178, 0.15); }
.badge-partial      { color: var(--classwork-color); background: rgba(245, 158, 11, 0.15); }
.badge-revised-only { color: var(--revised-color); background: rgba(124, 58, 237, 0.15); }
.badge-done-both    { color: #22c55e; background: rgba(34, 197, 94, 0.15); }

.chapter-label.label-done {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

.weekly-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 12px;
  transition: background 0.15s;
}
.weekly-row:hover { background: rgba(255,255,255,0.025); }

.cb-weekly {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: #a78bfa;
  flex-shrink: 0;
  margin-top: 2px;
}

.weekly-label {
  font-size: 11.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s;
  flex: 1;
  word-break: break-word;
}

.weekly-label.done {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

.list-empty {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
}

/* Subject-wise Daily To-Do checkbox (reuses .weekly-row layout) */
.cb-subj-daily { accent-color: var(--success); }

/* ══════════════════════════════════════════════════════════════════
   PRIORITY 1 STUDY PLANNER
   ══════════════════════════════════════════════════════════════════ */
.planner-section {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 20px;
}

.planner-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.planner-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.planner-overall-text {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.planner-reset-note {
  font-size: 10px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.planner-days-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.planner-day {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  overflow: hidden;
}

.planner-day.is-today {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.15);
}

.planner-day.is-past { opacity: 0.6; }

.planner-day-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}

.planner-day-headleft {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.planner-day-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}

.planner-today-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--revised-color);
  padding: 2px 7px;
  border-radius: 20px;
}

.planner-day-progress {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.planner-toggle-icon {
  font-size: 11px;
  color: var(--text-faint);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.planner-day.open .planner-toggle-icon { transform: rotate(180deg); }

.planner-item-list {
  list-style: none;
}

.planner-today-only {
  max-height: none;
  overflow: visible;
}

.planner-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
}
.planner-item-row:hover { background: rgba(255,255,255,0.025); }

.cb-planner {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: var(--revised-color);
  flex-shrink: 0;
}

.planner-item-label {
  font-size: 11.5px;
  color: var(--text-dim);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.planner-item-label.done {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

.planner-subj-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════
   DAILY ROUTINE
   ══════════════════════════════════════════════════════════════════ */
.daily-section {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 20px;
}

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

.daily-reset-note {
  font-size: 10px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.daily-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.daily-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 50px;
  background: var(--panel-2);
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.daily-pill:hover { background: rgba(255,255,255,0.04); border-color: var(--border); }
.daily-pill.done  { background: rgba(255,255,255,0.02); border-color: var(--border-soft); }

.cb-daily {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: #22c55e;
  flex-shrink: 0;
}

.daily-pill-label {
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}

.daily-pill.done .daily-pill-label {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

/* ══════════════════════════════════════════════════════════════════
   FIXED MOTIVATIONAL FOOTER
   ══════════════════════════════════════════════════════════════════ */
.mot-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  background: #0c0c0c;
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  z-index: 50;
  padding: 0 16px;
  overflow: hidden;
}

.mot-item {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.mot-pipe {
  font-size: 11px;
  color: var(--border);
  margin: 0 10px;
}

/* ══════════════════════════════════════════════════════════════════
   CONNECTION STATUS
   ══════════════════════════════════════════════════════════════════ */
#connection-status {
  position: fixed;
  bottom: calc(var(--footer-h) + 12px);
  left: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 50px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: pulse 2s ease-in-out infinite;
}

.conn-online    .conn-dot { background: #22c55e; }
.conn-connecting .conn-dot { background: #f59e0b; }
.conn-offline   .conn-dot { background: #ff6b6b; animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: calc(var(--footer-h) + 12px);
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }

.toast-success { background: #22c55e; color: #000; }
.toast-error   { background: #ff6b6b; color: #000; }
.toast-info    { background: #3b82f6; color: #fff; }
.toast-warning { background: #f59e0b; color: #000; }

/* ══════════════════════════════════════════════════════════════════
   TASK MANAGER
   ══════════════════════════════════════════════════════════════════ */
.task-manager { display: flex; flex-direction: column; gap: 20px; }

.tm-panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.tm-panel-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.tm-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.tm-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tm-input {
  flex: 1;
  min-width: 140px;
  background: #0f0f0f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.tm-input:focus { border-color: var(--border); box-shadow: 0 0 0 2px rgba(255,255,255,0.06); }
.tm-input::placeholder { color: var(--text-faint); }

select.tm-input {
  cursor: pointer;
  flex: 0 0 auto;
  width: 180px;
}

.tm-add-btn {
  padding: 9px 18px;
  background: var(--text-primary);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.tm-add-btn:hover { opacity: 0.85; }

.tm-list { list-style: none; padding: 4px 0; max-height: 280px; overflow-y: auto; }

.tm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s;
}
.tm-item:last-child  { border-bottom: none; }
.tm-item:hover { background: rgba(255,255,255,0.025); }

.tm-item-text {
  font-size: 12px;
  color: var(--text-dim);
  flex: 1;
  word-break: break-word;
}

.tm-item-sub {
  font-size: 10px;
  color: var(--text-faint);
  display: block;
  margin-top: 2px;
}

.tm-del-btn {
  padding: 4px 10px;
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.3);
  border-radius: 6px;
  color: var(--danger);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.tm-del-btn:hover { background: var(--danger); color: #000; }

.tm-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 18px;
}

.tm-sub-section { display: flex; flex-direction: column; gap: 8px; }

.tm-sub-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.tm-subj-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.tm-subj-tab {
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-faint);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tm-subj-tab:hover { color: var(--text-dim); border-color: var(--border); }
.tm-subj-tab.active {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border-color: var(--border);
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .tabs-nav { flex-direction: column; gap: 10px; align-items: stretch; }
  .account-nav-bar { justify-content: space-between; }
  .top-grid { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; padding: 14px 16px 12px; }
  .header-center { text-align: left; }
  .header-right  { text-align: left; }
  .main-wrapper  { padding: 0 12px 20px; }
  .tm-sub-grid   { grid-template-columns: 1fr; }
  .mot-footer    { gap: 0; }
  .mot-item      { font-size: 10px; }
  .mot-pipe      { margin: 0 6px; }
}

@media (max-width: 560px) {
  .tabs-inner    { gap: 2px; }
  .tab-btn       { padding: 7px 14px; font-size: 12px; }
  .subject-grid  { grid-template-columns: 1fr; }
  .header-title  { font-size: 20px; }
  .daily-pills   { flex-direction: column; }
  .bar-chart-cols { height: 110px; }
}
