/* ============================================================
   SchoolPlan — Design System
   Theme: Physical Academic Planner / School Organizer
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=Caveat:wght@400;600;700&display=swap');

/* --- Custom Properties --- */
:root {
  /* Sidebar (dark leather cover feel) */
  --sb-bg:        #2C2416;
  --sb-text:      #C8B8A2;
  --sb-muted:     #6E5E4E;
  --sb-hover:     rgba(255, 255, 255, 0.065);
  --sb-active-bg: #F5F0E8;
  --sb-active-tx: #2C2416;
  --sb-width:     224px;

  /* Paper / content */
  --paper:        #F5F0E8;
  --paper-dark:   #EDE8DC;
  --white:        #FFFFFF;
  --border:       #E0D5C4;
  --border-dark:  #C8B8A8;

  /* Ink / text */
  --ink:          #2C2416;
  --ink-2:        #574535;
  --ink-3:        #8B7B6B;
  --ink-4:        #B0A090;

  /* Accents */
  --red:          #D94033;
  --red-bg:       #FEF2F0;
  --blue:         #2B5FAA;
  --blue-bg:      #EDF3FF;
  --green:        #3A8A5C;
  --green-bg:     #EDFAF3;
  --amber:        #C8840A;
  --amber-bg:     #FEF9EE;

  /* Shape */
  --r-sm:   3px;
  --r-md:   6px;
  --r-lg:   10px;
  --r-xl:   14px;

  /* Shadow */
  --sh-xs: 0 1px 3px rgba(44,36,22,.07);
  --sh-sm: 0 2px 8px rgba(44,36,22,.09);
  --sh-md: 0 4px 20px rgba(44,36,22,.12);
  --sh-lg: 0 8px 40px rgba(44,36,22,.16);

  /* Typography */
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
  --font-hand:  'Caveat', cursive;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

button { font-family: var(--font-sans); }

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

#app {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sb-width);
  min-height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-header {
  padding: 22px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.055);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--red);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: .015em;
}

.sidebar-school {
  font-family: var(--font-hand);
  font-size: 14.5px;
  color: var(--sb-text);
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 1px;
}

/* Navigation */
.nav-section {
  padding: 14px 0 2px;
}

.nav-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sb-muted);
  padding: 0 16px;
  margin-bottom: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  width: 100%;
  border: none;
  background: none;
  color: var(--sb-text);
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background .14s, color .14s;
  border-left: 2.5px solid transparent;
  position: relative;
}

.nav-item:hover {
  background: var(--sb-hover);
  color: #FFF;
}

.nav-item.active {
  background: var(--sb-active-bg);
  color: var(--sb-active-tx);
  font-weight: 500;
  border-left-color: var(--red);
}

.nav-item.active .nav-icon { color: var(--red); }

.nav-item--gold { color: #F0C96A; }
.nav-item--gold:hover { color: #FFE09A; }
.nav-item--gold.active { color: var(--sb-active-tx); }

.nav-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: .9;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.055);
}

/* --- Main content --- */
.main-content {
  margin-left: var(--sb-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top accent stripe */
.main-content::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #D94033 0%, #E07B39 45%, #D4A017 100%);
  flex-shrink: 0;
}

/* --- Page header --- */
.page-header {
  padding: 26px 36px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* --- Page body --- */
.page-body {
  padding: 26px 36px 40px;
  flex: 1;
}

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

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--sh-xs);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

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

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--sh-xs);
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.stat-lbl {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 500;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 17px;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .14s, transform .12s, box-shadow .12s;
  white-space: nowrap;
  letter-spacing: .01em;
  text-decoration: none;
}

.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--ink);
  color: #FFF;
}
.btn-primary:hover:not(:disabled) {
  background: #3E3020;
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

.btn-red {
  background: var(--red);
  color: #FFF;
}
.btn-red:hover:not(:disabled) {
  background: #C0362A;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(217,64,51,.3);
}

.btn-outline {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--paper);
  border-color: var(--border-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-3);
  padding: 5px 9px;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--paper);
  color: var(--ink);
}

.btn-danger-text {
  background: transparent;
  border: none;
  color: var(--sb-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 4px 0;
  width: 100%;
  text-align: left;
  transition: color .14s;
}
.btn-danger-text:hover { color: #FF8080; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: var(--r-lg); }

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

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 8px 11px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43,95,170,.11);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238B7B6B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
  cursor: pointer;
}

.form-hint {
  font-size: 11.5px;
  color: var(--ink-4);
  margin-top: 4px;
}

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

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   COLOR PICKER
   ============================================================ */

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform .12s, border-color .12s;
  outline: none;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  border-color: var(--ink);
  transform: scale(1.1);
}

/* ============================================================
   ITEM LIST
   ============================================================ */

.item-list { display: flex; flex-direction: column; }

.item-row {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.item-row:last-child { border-bottom: none; }

.item-name { font-weight: 500; color: var(--ink); font-size: 13.5px; }
.item-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.item-actions { display: flex; gap: 3px; flex-shrink: 0; }

/* ============================================================
   SUBJECT CHIP
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}

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

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 15px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.alert-warning { background: var(--amber-bg); color: #7A4D00; border-color: #F0D090; }
.alert-error   { background: var(--red-bg);   color: #8B0000; border-color: #F5C5C2; }
.alert-success { background: var(--green-bg); color: #1A5C38; border-color: #A0E0C0; }
.alert-info    { background: var(--blue-bg);  color: #1A3C7A; border-color: #B0CCF0; }

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--ink-3);
}
.empty-icon { font-size: 34px; margin-bottom: 10px; opacity: .4; }
.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.empty-state p { font-size: 13px; }

/* ============================================================
   SETUP PROGRESS
   ============================================================ */

.progress-steps {
  display: flex;
  margin-bottom: 22px;
}

.progress-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-right: none;
  background: var(--white);
}
.progress-step:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.progress-step:last-child  { border-right: 1px solid var(--border); border-radius: 0 var(--r-md) var(--r-md) 0; }
.progress-step.done  { background: var(--green-bg); border-color: #A8DFC0; }
.progress-step.todo  { opacity: .55; }

.step-badge {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.done  .step-badge { background: var(--green); color: #FFF; }
.todo  .step-badge { background: var(--paper-dark); color: var(--ink-3); }

.step-lbl { font-size: 12px; font-weight: 500; color: var(--ink); }

/* ============================================================
   GENERATE SECTION
   ============================================================ */

.generate-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xs);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.generate-section h2 {
  font-family: var(--font-serif);
  font-size: 19px;
  margin-bottom: 8px;
}
.generate-section p { color: var(--ink-3); font-size: 13px; max-width: 310px; margin-bottom: 22px; }

/* ============================================================
   VIEW SELECTOR (by class / by teacher toggle)
   ============================================================ */

.view-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  width: fit-content;
}
.view-btn {
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: var(--white);
  color: var(--ink-3);
  transition: background .12s, color .12s;
  font-family: var(--font-sans);
}
.view-btn + .view-btn { border-left: 1px solid var(--border); }
.view-btn.active { background: var(--ink); color: #FFF; }

/* ============================================================
   CLASS TABS (Assignments sidebar)
   ============================================================ */

.class-tabs { display: flex; flex-direction: column; }

.class-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 11px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  transition: background .12s;
}
.class-tab:hover { background: var(--paper); }
.class-tab.active { background: var(--ink); color: #FFF; font-weight: 500; }
.class-tab.active:hover { background: var(--ink); }

.tab-count {
  font-size: 10.5px;
  background: rgba(0,0,0,.13);
  border-radius: 100px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

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

.asgn-table { width: 100%; border-collapse: collapse; }
.asgn-table th {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 5px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.asgn-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
}
.asgn-table tr:last-child td { border-bottom: none; }

/* ============================================================
   CHECKBOX GROUP
   ============================================================ */

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 190px;
  overflow-y: auto;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--paper);
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}
.checkbox-item input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--red);
  cursor: pointer;
}

/* ============================================================
   TIMETABLE GRID
   ============================================================ */

.tt-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--white);
  box-shadow: var(--sh-xs);
}

.tt-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tt-grid thead th {
  background: var(--sb-bg);
  color: var(--sb-text);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.06);
}

.tt-grid thead th:first-child {
  background: #1C1410;
  width: 78px;
  text-align: left;
  padding-left: 12px;
}

.tt-grid td {
  border: 1px solid var(--border);
  padding: 0;
  vertical-align: top;
  min-width: 100px;
}

.tt-period-label {
  padding: 8px 10px 8px 12px;
  background: var(--paper);
  border-right: 1px solid var(--border-dark);
}
.period-num  { font-weight: 700; font-size: 11.5px; color: var(--ink); }
.period-time { font-family: var(--font-hand); font-size: 13px; color: var(--ink-3); line-height: 1.2; }

.tt-cell {
  height: 60px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: filter .14s;
}
.tt-cell:hover { filter: brightness(.95); }
.tt-cell-empty { background: var(--paper); }
.tt-cell-subject { border-left: 3px solid; }
.cell-subj { font-weight: 600; font-size: 12px; line-height: 1.3; margin-bottom: 2px; }
.cell-info { font-size: 10.5px; color: var(--ink-3); }

.tt-break-row td {
  background: var(--paper-dark);
  height: 36px;
}
.tt-break-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

/* ============================================================
   LEGEND
   ============================================================ */

.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,36,22,.48);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: modalIn .18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-3);
  padding: 3px 7px;
  border-radius: var(--r-sm);
  transition: background .12s;
}
.modal-close-btn:hover { background: var(--paper); color: var(--ink); }

.modal-body {
  padding: 18px 22px;
  max-height: 58vh;
  overflow-y: auto;
}
.modal-foot {
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--paper);
}

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

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--ink);
  color: #FFF;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ============================================================
   UTILITIES
   ============================================================ */

.flex   { display: flex; }
.items-c { align-items: center; }
.just-b { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.mt-1   { margin-top: 4px; }
.mt-2   { margin-top: 8px; }
.mt-3   { margin-top: 12px; }
.mb-2   { margin-bottom: 8px; }
.mb-3   { margin-bottom: 12px; }
.mb-4   { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-sm   { font-size: 12px; }
.text-muted { color: var(--ink-3); }
.text-red   { color: var(--red); }
.text-green { color: var(--green); }
.font-serif { font-family: var(--font-serif); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

.fade-in {
  animation: fadeIn .2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .sidebar, .no-print { display: none !important; }

  .main-content { margin-left: 0; }
  .main-content::before { display: none; }

  body, .page-body { background: #FFF; }

  .tt-grid thead th {
    background: #2C2416 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .tt-cell-subject {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .tt-break-row td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-break { page-break-after: always; }
  .print-watermark {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Number input no spinner */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ============================================================
   ONBOARDING OVERLAY
   ============================================================ */

#onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 22, 0.62);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .3s ease;
}
#onboarding-overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.onboard-card {
  background: var(--white);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(44,36,22,.3);
  overflow: hidden;
  animation: modalIn .22s ease;
}

.onboard-header {
  background: var(--ink);
  padding: 28px 28px 22px;
  text-align: center;
}
.onboard-logo {
  width: 54px;
  height: 54px;
  background: rgba(255,255,255,.1);
  border-radius: 14px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.onboard-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 6px;
}
.onboard-sub {
  font-size: 13.5px;
  color: rgba(255,255,255,.65);
  line-height: 1.5;
}

.onboard-body {
  padding: 24px 28px 20px;
}
.onboard-intro {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 20px;
  text-align: center;
}

.onboard-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.onboard-step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  transition: background .15s;
}
.onboard-step:hover { background: var(--paper-dark); }

.onboard-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFF;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboard-step-text {
  flex: 1;
}
.onboard-step-text strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}
.onboard-step-text span {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
}

.onboard-step-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.onboard-footer {
  padding: 14px 28px 22px;
  text-align: center;
}
.onboard-footer p {
  font-size: 11.5px;
  color: var(--ink-4);
  margin-top: 10px;
}

/* ============================================================
   TOOLTIP — disabled button
   ============================================================ */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}
.tooltip-wrap .tooltip-box {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #FFF;
  font-size: 12px;
  line-height: 1.45;
  padding: 7px 12px;
  border-radius: 7px;
  white-space: nowrap;
  max-width: 240px;
  white-space: normal;
  text-align: center;
  box-shadow: var(--sh-md);
  transition: opacity .15s, visibility .15s;
  z-index: 100;
}
.tooltip-wrap .tooltip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.tooltip-wrap:hover .tooltip-box {
  visibility: visible;
  opacity: 1;
}

/* ============================================================
   TODAY COLUMN HIGHLIGHT  (S4)
   ============================================================ */
.tt-grid th.today-col {
  background: rgba(212,160,23,.13) !important;
  color: var(--amber) !important;
  position: relative;
}
.tt-grid th.today-col::after {
  content: '▸ Today';
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .3px;
  opacity: .8;
  margin-top: 2px;
}
.tt-grid td.today-col {
  background: rgba(212,160,23,.04) !important;
}

/* ============================================================
   PERIOD BADGE INSIDE CELL  (S2)
   ============================================================ */
.cell-period-num {
  font-size: 9px;
  font-weight: 700;
  color: rgba(44,36,22,.28);
  letter-spacing: .4px;
  line-height: 1;
  margin-bottom: 3px;
  font-family: var(--font-sans);
}

/* ============================================================
   LOADING OVERLAY  (L10)
   ============================================================ */
#gen-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,36,22,.55);
  backdrop-filter: blur(3px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
#gen-loading-overlay.hidden { display: none; }

.gen-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.gen-loading-text {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}
.gen-loading-sub {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  text-align: center;
}

/* ============================================================
   WORKLOAD SUMMARY CARD IN TIMETABLE (T4/T5)
   ============================================================ */
.teacher-workload-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.teacher-workload-bar:last-child { border-bottom: none; }

/* ============================================================
   LOCK BUTTON STATE (P7)
   ============================================================ */
.tt-locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
}

