

/* ═══════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════ */
:root {
  /* ── Brand ─────────────────────────────── */
  --brand:           #ed1c24;   /* MMS red                  */
  --brand-dark:      #c0151b;   /* pressed / hover state    */
  --brand-light:     #fdeaea;   /* tinted red backgrounds   */
  --brand-border:    #f8b4b6;   /* red-tinted borders       */

  /* ── Surfaces ───────────────────────────── */
  --color-bg:           #F6F6F6;   /* page background          */
  --color-surface:      #FFFFFF;   /* cards / topbar           */
  --color-surface-alt:  #F0F0F0;   /* inner rows, chip fills   */
  --color-border:       #E8E8E8;   /* card borders             */
  --color-border-mid:   #D4D4D4;   /* dividers, input borders  */

  /* ── Typography ─────────────────────────── */
  --color-text-primary:   #1A1A1A;   /* headings, names — near black */
  --color-text-secondary: #555555;   /* sub-labels, descriptions     */
  --color-text-muted:     #888888;   /* timestamps, hints            */
  --color-text-hint:      #AAAAAA;   /* placeholders, empty states   */

  /* ── Accent (was black, now brand red) ──── */
  --color-accent:         #ed1c24;
  --color-accent-inv:     #FFFFFF;

  /* ── Semantic ───────────────────────────── */
  --color-danger:         #ed1c24;
  --color-danger-bg:      #fdeaea;
  --color-danger-border:  #f8b4b6;

  --color-success-bg:     #E6F4EA;
  --color-success-text:   #2E7D45;
  --color-warning-bg:     #FEF3E2;
  --color-warning-text:   #9C6000;
  --color-info-bg:        #E8F1FB;
  --color-info-text:      #1557A0;

  /* ── Avatar palette (warm, brand-harmonised) */
  --av-0-bg: #fdeaea; --av-0-txt: #b01018;
  --av-1-bg: #E6F4EA; --av-1-txt: #2E7D45;
  --av-2-bg: #FEF3E2; --av-2-txt: #9C6000;
  --av-3-bg: #E8F1FB; --av-3-txt: #1557A0;
  --av-4-bg: #F0EFF8; --av-4-txt: #4B3FA8;
  --av-5-bg: #E4F5F2; --av-5-txt: #1A7A6A;
  --av-6-bg: #F5F0E8; --av-6-txt: #7A5C2E;

  /* ── Typography ─────────────────────────── */
  --font-sans: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   12px;
  --space-lg:   16px;
  --space-xl:   20px;
  --space-2xl:  24px;

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.12s ease;
  --transition-mid:  0.2s ease;

  /* Layout */
  --topbar-height:  auto;
  --bottomnav-height: 68px;
}

/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: var(--font-sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select { font-family: var(--font-sans); }
input:focus, select:focus, button:focus { outline: none; }

/* ═══════════════════════════════════════
   APP SHELL
═══════════════════════════════════════ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  position: relative;
  background: var(--color-bg);
  overflow: hidden;
}

.brand-bar {
  background: var(--brand);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  z-index: 10;
}

/* Sidebar — hidden on mobile */
.side-nav { display: none; }

/* main-area is transparent on mobile (contents layout) */
.main-area { display: contents; }

/* ── TABLET 768px+ ── */
@media (min-width: 768px) {
  body { background: #EDEDED; overflow: hidden; }

  .app {
    flex-direction: row;
    max-width: 1440px;
    margin: 0 auto;
    height: 100vh;
    box-shadow: 0 0 60px rgba(0,0,0,.14);
  }

  /* Brand bar moves into sidebar — hide the top strip */
  .brand-bar { display: none; }

  /* Show sidebar */
  .side-nav {
    display: flex;
    flex-direction: column;
    width: 220px;
    min-width: 220px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    height: 100vh;
    flex-shrink: 0;
    z-index: 200;
  }

  .side-nav__brand {
    background: var(--brand);
    padding: 16px 18px;
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
  }
  .side-nav__brand-text {
    font-size: 13px; font-weight: 700;
    color: #fff; line-height: 1.3;
  }
  .side-nav__items {
    flex: 1; padding: 12px 10px;
    display: flex; flex-direction: column; gap: 2px;
    overflow-y: auto;
  }
  .side-nav__section {
    font-size: 10px; font-weight: 600; color: var(--color-text-hint);
    text-transform: uppercase; letter-spacing: .8px;
    padding: 12px 12px 4px;
  }
  .side-nav__item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer; font-size: 13px; font-weight: 500;
    color: var(--color-text-secondary);
    background: none; border: none;
    font-family: var(--font-sans); width: 100%; text-align: left;
    transition: background var(--transition-fast), color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
  }
  .side-nav__item:hover { background: var(--color-surface-alt); }
  .side-nav__item.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
  .side-nav__item.active svg { stroke: var(--brand) !important; }
  a.side-nav__item { text-decoration: none; }
  .side-nav__item--danger { color: var(--brand); }
  .side-nav__item--danger:hover { background: var(--brand-light); color: var(--brand); }
  .side-nav__item svg { flex-shrink: 0; }
  .side-nav__footer {
    padding: 12px 10px;
    border-top: 1px solid var(--color-border);
  }

  /* Main content takes remaining space */
  .main-area {
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
  }

  /* Hide bottom nav */
  .bottom-nav { display: none !important; }

  /* Screen wrap fills main area */
  .screen-wrap { flex: 1; overflow: hidden; }

  /* Widen content on tablet */
  .scroll-body  { padding-left: 28px; padding-right: 28px; }
  .topbar       { padding-left: 28px; padding-right: 28px; }
  .stat-grid    { grid-template-columns: repeat(4, 1fr); }
  .card         { margin-left: 0; margin-right: 0; }
  .section-label { padding-left: 0; padding-right: 0; }
  .bk-card, .class-card { margin-left: 0; margin-right: 0; }
  .tab-bar { margin-left: 0; margin-right: 0; }
  .bk-search { margin-left: 0; margin-right: 0; }
  .stu-selector { margin-left: 0; margin-right: 0; }
  .pkg-card { margin-left: 0; margin-right: 0; }
  .month-nav { padding-left: 24px; padding-right: 24px; }
  .week-strip { padding-left: 20px; padding-right: 20px; }
  .cal-grid-wrap { padding: 0 24px; }
}

/* ── DESKTOP 1024px+ ── */
@media (min-width: 1024px) {
  .side-nav { width: 240px; min-width: 240px; }
  .side-nav__item { font-size: 14px; padding: 11px 14px; }
  .scroll-body { padding-left: 36px; padding-right: 36px; }
  .topbar { padding-left: 36px; padding-right: 36px; }
}

/* ── LARGE DESKTOP 1280px+ ── */
@media (min-width: 1280px) {
  .side-nav { width: 260px; min-width: 260px; }
  .scroll-body { padding-left: 48px; padding-right: 48px; }
  .topbar { padding-left: 48px; padding-right: 48px; }
  .stat-tile__num { font-size: 34px; }
}


/* ═══════════════════════════════════════
   SCREENS
═══════════════════════════════════════ */
.screen-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.screen {
  display: none;
  flex-direction: column;
  background: var(--color-bg);
  position: absolute;
  inset: 0;
}
.screen.active { display: flex; }

/* Optional app-like transitions (enable by adding .app--transitions on .app) */
.app--transitions .screen {
  display: flex;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity var(--transition-mid), transform 0.22s ease;
  will-change: opacity, transform;
  pointer-events: none;
}
.app--transitions .screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.app--transitions .screen.screen--leaving {
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
}

/* ═══════════════════════════════════════
   TOPBAR
═══════════════════════════════════════ */
.topbar {
  padding: var(--space-sm) var(--space-xl) var(--space-md);
  background: var(--color-surface);
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border);
}

/* Optional polish pack (enable by adding .app--polish on .app) */
.app--polish .topbar {
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.app--polish .topbar,
.app--polish .brand-bar {
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
}

.topbar__back {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  margin-bottom: var(--space-xs);
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.topbar__back-arrow { font-size: 20px; line-height: 1; }

.topbar__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.topbar__label {
  font-size: 10px;
  font-weight: 500;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.topbar__title {
  font-size: 23px;
  font-weight: 500;
  color: var(--color-text-primary);
  letter-spacing: -0.4px;
}

/* ═══════════════════════════════════════
   SCROLLABLE BODY
═══════════════════════════════════════ */
.scroll-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-lg);
}

/* ═══════════════════════════════════════
   SECTION LABEL
═══════════════════════════════════════ */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: var(--space-lg) var(--space-xl) var(--space-sm);
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin: 0 var(--space-lg) var(--space-sm);
  overflow: hidden;
}

.card--pad { padding: var(--space-lg) 18px; }

/* ═══════════════════════════════════════
   INSTRUCTOR SELECTOR ROW
═══════════════════════════════════════ */
.instr-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding: 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.instr-row__avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.instr-row__name { font-size: 14px; font-weight: 600; flex: 1; color: var(--color-text-primary); }
.instr-row__chev { color: var(--color-text-muted); font-size: 16px; }

/* ═══════════════════════════════════════
   AVATAR
═══════════════════════════════════════ */
.avatar {
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 500;
  flex-shrink: 0;
}
.avatar--sm  { width: 32px; height: 32px; font-size: 11px; }
.avatar--md  { width: 40px; height: 40px; font-size: 13px; }
.avatar--lg  { width: 48px; height: 48px; font-size: 15px; }

.avatar--0 { background: var(--av-0-bg); color: var(--av-0-txt); }
.avatar--1 { background: var(--av-1-bg); color: var(--av-1-txt); }
.avatar--2 { background: var(--av-2-bg); color: var(--av-2-txt); }
.avatar--3 { background: var(--av-3-bg); color: var(--av-3-txt); }
.avatar--4 { background: var(--av-4-bg); color: var(--av-4-txt); }
.avatar--5 { background: var(--av-5-bg); color: var(--av-5-txt); }
.avatar--6 { background: var(--av-6-bg); color: var(--av-6-txt); }

/* ═══════════════════════════════════════
   BADGE / PILL
═══════════════════════════════════════ */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge--dark    { background: var(--brand); color: #fff; }
.badge--neutral { background: var(--color-surface-alt); color: var(--color-text-secondary); }
.badge--muted   { background: var(--color-surface-alt); color: var(--color-text-muted); }
.badge--success { background: var(--color-success-bg);  color: var(--color-success-text); }
.badge--warning { background: var(--color-warning-bg);  color: var(--color-warning-text); }
.badge--info    { background: var(--color-info-bg);     color: var(--color-info-text); }
.badge--admin   { background: var(--color-surface-alt); color: var(--color-text-secondary); font-size: 9px; }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-sm);
  font-size: 14px; font-weight: 500;
  border-radius: var(--radius-md);
  padding: 13px var(--space-lg);
  border: none;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn--fill   { background: var(--brand); color: #fff; }
.btn--fill:active { background: var(--brand-dark); }
.btn--outline { background: var(--color-surface); color: var(--brand); border: 1.5px solid var(--brand); }
.btn--outline:active { background: var(--brand-light); }
.btn--full   { width: 100%; }
.btn--sm     { font-size: 12px; padding: 7px 14px; border-radius: var(--radius-full); }
.btn--icon   { gap: 5px; }

/* ═══════════════════════════════════════
   ACTING INSTRUCTOR SWITCHER
═══════════════════════════════════════ */
.acting-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(247,248,250,1) 100%);
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  border-left: 4px solid var(--brand);
  position: sticky;
  top: 0;
  z-index: 100;
}
.acting-bar__left { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acting-bar__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.acting-bar__current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
  background: rgba(59, 130, 246, .10);
  border: 1px solid rgba(59, 130, 246, .18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acting-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.acting-modal__close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border-mid);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.acting-modal__close:hover { background: var(--color-surface-alt); }
.acting-modal__close:active { border-color: var(--brand); color: var(--brand); }
.acting-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
}
.acting-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.acting-opt:hover { background: var(--color-surface-alt); }
.acting-opt.is-active {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
}
.acting-opt__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acting-opt__av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  flex: 0 0 auto;
}
.acting-opt.is-active .acting-opt__av { background: rgba(59, 130, 246, .14); color: var(--brand); }
.acting-opt__name { font-size: 14px; font-weight: 700; color: var(--color-text-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acting-opt.is-active .acting-opt__name { color: var(--brand); }
.acting-opt__meta { font-size: 11px; color: var(--color-text-muted); font-weight: 600; }
.acting-opt__check { color: var(--brand); font-size: 16px; opacity: 0; }
.acting-opt.is-active .acting-opt__check { opacity: 1; }

@media (min-width: 768px) {
  .acting-bar { position: sticky; top: 0; }
}

/* ═══════════════════════════════════════
   BOTTOM NAV
═══════════════════════════════════════ */
.bottom-nav {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  padding: 10px 0 18px;
  flex-shrink: 0;
  z-index: 100;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-item__bar {
  width: 18px; height: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background var(--transition-fast);
}
.nav-item__label {
  font-size: 11px; font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.3px;
  transition: color var(--transition-fast);
}
.nav-item__icon { display: flex; align-items: center; justify-content: center; }
.nav-item__icon svg { transition: stroke var(--transition-fast); }

.nav-item:hover .nav-item__label { color: var(--color-text-primary); }

.nav-item.active .nav-item__bar    { background: var(--brand); }
.nav-item.active .nav-item__label  { color: var(--brand); font-weight: 700; }
.nav-item.active .nav-item__icon svg { stroke: var(--brand) !important; }

/* ═══════════════════════════════════════
   SAVE BAR
═══════════════════════════════════════ */
.save-bar {
  padding: var(--space-md) var(--space-lg) var(--space-xl);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
.save-bar__hint {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-hint);
  margin-top: var(--space-sm);
}

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast {
  position: absolute;
  bottom: calc(var(--bottomnav-height) + 16px);
  left: 50%; transform: translateX(-50%) translateY(8px);
  background: #1A1A1A;
  color: #fff;
  font-size: 12px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 500;
  transition: opacity var(--transition-mid), transform var(--transition-mid);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.app--polish .toast {
  background: rgba(15,15,15,.92);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
  padding: 10px 14px;
  border-radius: 16px;
  max-width: min(92%, 420px);
  white-space: normal;
}
.app--polish .toast__inner {
  display: flex;
  gap: 10px;
  align-items: center;
}
.app--polish .toast__msg {
  font-size: 12px;
  line-height: 1.25;
}
.app--polish .toast--success { border-color: rgba(46,125,69,.55); }
.app--polish .toast--error   { border-color: rgba(237,28,36,.55); }
.app--polish .toast--info    { border-color: rgba(255,255,255,.12); }

/* Skeleton shimmer */
.app--polish .sk-wrap { padding: 12px 16px; }
.app--polish .sk {
  display: inline-block;
  border-radius: 10px;
  background: linear-gradient(90deg, #eee 25%, #f6f6f6 45%, #eee 65%);
  background-size: 220% 100%;
  animation: skShimmer 1.2s ease-in-out infinite;
}
.app--polish .sk--num { width: 44px; height: 18px; }
.app--polish .sk-line {
  height: 12px;
  border-radius: 8px;
  margin: 10px 0;
  background: linear-gradient(90deg, #eee 25%, #f6f6f6 45%, #eee 65%);
  background-size: 220% 100%;
  animation: skShimmer 1.2s ease-in-out infinite;
}
.app--polish .sk-card {
  height: 96px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: linear-gradient(90deg, #eee 25%, #f6f6f6 45%, #eee 65%);
  background-size: 220% 100%;
  animation: skShimmer 1.2s ease-in-out infinite;
  margin-bottom: 12px;
}
@keyframes skShimmer {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════
   TOGGLE SWITCH
═══════════════════════════════════════ */
.toggle {
  position: relative;
  width: 40px; height: 22px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.toggle__track {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--color-border-mid);
  transition: background var(--transition-mid);
}
.toggle__thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform var(--transition-mid);
}
.toggle.on .toggle__track  { background: var(--brand); }
.toggle.on .toggle__thumb  { transform: translateX(18px); }

/* ═══════════════════════════════════════
   SEARCH BOX
═══════════════════════════════════════ */
.search-box {
  display: flex; align-items: center; gap: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: var(--space-md) var(--space-lg) 0;
}
.search-box input {
  flex: 1; border: none; background: transparent;
  font-size: 16px; color: var(--color-text-primary);
  font-family: var(--font-sans); outline: none;
}
.search-box input::placeholder { color: var(--color-text-hint); }

/* ═══════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════ */
.progress {
  background: var(--color-surface-alt);
  border-radius: 3px;
  height: 3px;
  overflow: hidden;
  margin-top: 10px;
}
.progress__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
  transition: width var(--transition-mid);
}

/* ═══════════════════════════════════════
   MENU LIST ITEM
═══════════════════════════════════════ */
.menu-item {
  display: flex; align-items: center; gap: var(--space-md);
  padding: 14px var(--space-lg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.menu-item + .menu-item { border-top: 1px solid var(--color-border); }
.menu-item:active { background: var(--color-surface-alt); }
.menu-item__icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--color-surface-alt);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.menu-item__label { font-size: 14px; color: var(--color-text-primary); flex: 1; font-weight: 500; }
.menu-item__chev  { color: var(--brand); font-size: 18px; }
.menu-item--danger .menu-item__label { color: var(--color-danger); }
.menu-item--danger .menu-item__icon  { background: var(--color-danger-bg); }

/* ═══════════════════════════════════════
   DIVIDER
═══════════════════════════════════════ */
.divider { height: 1px; background: var(--color-border); margin: var(--space-md) 0; }

/* ════════════════════════════════════════════════════
   SCREEN 1 — HOME DASHBOARD
════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg) 0;
}
.stat-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.stat-tile:hover {
  border-color: var(--brand-light);
  background: var(--color-surface-alt);
  transform: translateY(-1px);
}

.stat-tile:active {
  transform: translateY(0);
  border-color: var(--brand);
}
.stat-tile__dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}
.stat-tile__num {
  font-family: var(--font-mono);
  font-size: 30px; font-weight: 400;
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: -1px;
}
.stat-tile__num span { font-size: 15px; color: var(--color-text-muted); }
.stat-tile__lbl { font-size: 12px; color: var(--color-text-secondary); margin-top: 6px; font-weight: 500; }

/* booking row */
.booking-row {
  display: flex; align-items: center; gap: var(--space-md);
  padding: 12px 18px;
}
.booking-row + .booking-row { border-top: 1px solid var(--color-border); }
.booking-row__time {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--color-text-muted);
  min-width: 38px; font-weight: 500;
}
.booking-row__dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.booking-row__info { flex: 1; }
.booking-row__name { font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.booking-row__desc { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }

/* ════════════════════════════════════════════════════
   SCREEN 2 — MY STUDENTS (list)
════════════════════════════════════════════════════ */
.student-list { flex: 1; overflow-y: auto; padding: 0 var(--space-lg) var(--space-lg); }

.student-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px var(--space-lg);
  margin-bottom: var(--space-sm);
  display: flex; align-items: center; gap: var(--space-md);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition-fast);
}
.student-card:active { border-color: #DDD; background: var(--color-surface-alt); }
.student-card__info  { flex: 1; min-width: 0; }
.student-card__name  { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-text-primary); }
.student-card__email { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-card__meta  { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.student-card__phone { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); }
.student-card__edit,
.student-card__btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--brand);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.student-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto; /* pushes actions to the right side */
}

.student-card__btn--delete {
  color: var(--color-danger);
  border-color: var(--color-danger-bg);
  background: var(--color-danger-bg);
}

.student-card__chev  { color: var(--brand); font-size: 18px; flex-shrink: 0; }

/* pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: var(--space-sm) var(--space-lg) var(--space-md);
  flex-shrink: 0;
}
.pg-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 12px; font-weight: 500;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pg-btn.active { background: var(--color-text-primary); color: var(--color-accent-inv); border-color: var(--color-text-primary); }
.pg-next { font-size: 12px; color: var(--color-text-secondary); font-weight: 500; cursor: pointer; }

/* ════════════════════════════════════════════════════
   SCREEN 3 — STUDENT DETAIL
════════════════════════════════════════════════════ */
.student-hero {
  display: flex; align-items: center; gap: 14px;
  margin-top: var(--space-sm);
}
.student-hero__name  { font-size: 18px; font-weight: 300; letter-spacing: -.3px; }
.student-hero__email { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.student-hero__phone { font-family: var(--font-mono); font-size: 11px; color: #AAA; margin-top: 2px; }

.hours-banner {
  margin: var(--space-md) var(--space-lg) 0;
  background: var(--brand);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  display: flex; align-items: center; justify-content: space-between;
}
.hours-banner__label { font-size: 10px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.hours-banner__val   { font-family: var(--font-mono); font-size: 30px; font-weight: 300; color: #fff; letter-spacing: -1px; }
.hours-banner__unit  { font-size: 13px; color: rgba(255,255,255,.4); margin-left: 2px; }
.hours-banner__icon  { opacity: .12; }

.pkg-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-lg); margin: 0 var(--space-lg) var(--space-sm); }
.pkg-card__top  { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-md); }
.pkg-card__name { font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
.pkg-card__date { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.pkg-card__expiry { font-size: 11px; color: var(--color-text-secondary); background: var(--color-surface-alt); padding: 3px 8px; border-radius: var(--radius-sm); font-weight: 500; }
.pkg-stats { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: var(--space-sm); }
.pkg-stat__label { font-size: 10px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; font-weight: 600; }
.pkg-stat__val   { font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--color-text-primary); }
.pkg-stat__val--used     { color: var(--color-text-secondary); }
.pkg-stat__val--deducted { color: var(--color-text-muted); }
.pkg-stat__val--expired  { color: var(--color-border-mid); }
.pkg-prog { margin-top: var(--space-md); }
.pkg-prog__labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--color-text-muted); margin-bottom: 4px; }

.fab {
  position: absolute;
  bottom: 20px;
  right: var(--space-xl);
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--brand);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 50;
}
.fab:active { background: var(--brand-dark); }

/* ════════════════════════════════════════════════════
   SCREEN 4 — BOOKING CALENDAR
════════════════════════════════════════════════════ */
.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-xl) var(--space-sm);
}
.month-nav__label { font-size: 14px; font-weight: 600; color: var(--color-text-primary); letter-spacing: .02em; }
.month-nav__btns  { display: flex; gap: 6px; }
.month-nav__btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 14px; color: var(--color-text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.week-strip {
  display: flex;
  padding: 0 var(--space-lg) var(--space-md);
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.week-strip::-webkit-scrollbar { display: none; }

.day-pill {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 42px; padding: 8px 0;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.day-pill__dow  { font-size: 11px; font-weight: 600; color: var(--color-text-secondary); letter-spacing: .3px; }
.day-pill__num  { font-family: var(--font-mono); font-size: 17px; font-weight: 500; color: var(--color-text-primary); line-height: 1; }
.day-pill__dot  { width: 4px; height: 4px; border-radius: var(--radius-full); background: transparent; }
.day-pill.has-booking .day-pill__dot { background: var(--color-text-muted); }
.day-pill.today  { border-color: var(--brand); background: rgba(237,28,36,.05); }
.day-pill.active { background: var(--brand); border-color: var(--brand); }
.day-pill.active .day-pill__dow { color: rgba(255,255,255,.7); }
.day-pill.active .day-pill__num { color: #fff; }
.day-pill.active .day-pill__dot { background: rgba(255,255,255,.5); }

.timeline-wrap { flex: 1; overflow-y: auto; position: relative; background: var(--color-surface); border-top: 1px solid var(--color-border); }
.timeline-inner { position: relative; }

.hour-row {
  position: absolute; left: 0; right: 0;
  height: 60px;
  display: flex; align-items: flex-start;
  cursor: pointer;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}
.hour-row:nth-child(odd) { background: rgba(0,0,0,.01); }
.hour-row:nth-child(even) { background: rgba(0,0,0,.03); }
.hour-row:hover { background: rgba(237,28,36,.06); }
.hour-row:hover .hour-row__line { border-color: rgba(237,28,36,.25); }
.hour-row:hover .hour-row__label { color: var(--brand); }
.hour-row:active { background: rgba(237,28,36,.12); }
.hour-row__label {
  width: 44px; padding: 0 10px 0 14px;
  font-family: var(--font-mono); font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary); line-height: 1;
  margin-top: -4px; flex-shrink: 0;
}
.hour-row__line { flex: 1; border-top: 1px solid var(--color-border-mid); }

.booking-block {
  position: absolute;
  left: 52px; right: 14px;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  border-left: 3px solid var(--brand);
  background: var(--brand-light);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition-fast);
  z-index: 2;
  overflow: hidden;
}
.booking-block:active { transform: scale(.98); }
.booking-block__row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.booking-block__av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.booking-block__main { min-width: 0; flex: 1; }
.booking-block__line1 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.booking-block__line1 .booking-block__student {
  margin-top: 0;
}
.booking-block__source { opacity: .95; }

.booking-block--sm {
  padding: 6px 8px;
}
.booking-block--sm .booking-block__av {
  width: 18px;
  height: 18px;
  font-size: 8px;
}
.booking-block--sm .booking-block__status {
  font-size: 8px;
  margin-bottom: 0;
  letter-spacing: .5px;
}
.booking-block--sm .booking-block__student {
  font-size: 11px;
  font-weight: 600;
}
.booking-block--sm .booking-block__time {
  font-size: 12px;
  line-height: 1.15;
}
.booking-block--sm .booking-block__duration {
  font-size: 10px;
  margin-top: 0;
}
.booking-block--sm .booking-block__student,
.booking-block--sm .booking-block__duration {
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.booking-block__status {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 2px; color: var(--brand);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.booking-block__time {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  line-height: 1.2; color: var(--color-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.booking-block__student {
  font-size: 12px; color: var(--color-text-secondary);
  margin-top: 2px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.booking-block__duration {
  font-size: 11px; color: var(--color-text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.empty-day {
  position: absolute; left: 52px; right: 14px;
  top: 50%; transform: translateY(-50%);
  text-align: center;
}
.empty-day__lbl { font-size: 13px; color: var(--color-text-hint); margin-top: var(--space-sm); }

/* ════════════════════════════════════════════════════
   SCREEN 5 — UNAVAILABLE DATES
════════════════════════════════════════════════════ */
.cal-grid-wrap { padding: 0 var(--space-lg); }
.dow-row {
  display: grid; grid-template-columns: repeat(7,1fr);
  margin-bottom: 4px;
}
.dow-cell { text-align: center; font-size: 10px; font-weight: 500; color: var(--color-text-hint); padding: 4px 0; letter-spacing: .5px; }

.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--color-text-primary);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.cal-day:active { transform: scale(.9); }
.cal-day.empty  { cursor: default; pointer-events: none; }
.cal-day.today  { border-color: var(--color-border-mid); }
.cal-day.past   { color: var(--color-border-mid); cursor: default; pointer-events: none; }
.cal-day.blocked { background: var(--brand); color: #fff; border-color: var(--brand); }

.blocked-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex; align-items: center;
  padding: 12px 14px; margin-bottom: 6px;
}
.blocked-item__date { font-family: var(--font-mono); font-size: 13px; flex: 1; }
.blocked-item__day  { font-size: 11px; color: var(--color-text-muted); margin-left: var(--space-sm); }
.blocked-item__del  {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--color-text-hint);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.blocked-item__del:active { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger-border); }

/* ════════════════════════════════════════════════════
   SCREEN 6 — WORKING HOURS
════════════════════════════════════════════════════ */
.day-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin: 0 var(--space-lg) var(--space-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.day-card.expanded { border-color: var(--brand); }
.day-card.unavailable { opacity: .5; }

.day-card__header {
  display: flex; align-items: center;
  padding: 14px var(--space-lg);
  cursor: pointer; gap: var(--space-md);
  -webkit-tap-highlight-color: transparent;
}
.day-card__name { font-size: 15px; font-weight: 600; min-width: 85px; color: var(--color-text-primary); }
.day-card__preview { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.day-card__expand-icon { color: var(--color-text-hint); font-size: 18px; transition: transform var(--transition-mid); flex-shrink: 0; }
.day-card.expanded .day-card__expand-icon { transform: rotate(90deg); }

.slot-chip { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-secondary); background: var(--color-surface-alt); padding: 3px 8px; border-radius: var(--radius-sm); white-space: nowrap; }
.off-chip  { font-size: 10px; color: var(--color-text-hint); background: var(--color-surface-alt); padding: 3px 10px; border-radius: var(--radius-sm); }

.day-card__body { display: none; border-top: 1px solid var(--color-border); padding: var(--space-md) 14px 14px; }
.day-card.expanded .day-card__body { display: block; }

.unavail-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.unavail-row__label { font-size: 12px; color: var(--color-text-secondary); }

.slot-row { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.slot-time-group {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
}
.slot-time-group input[type="time"] {
  border: none; background: transparent;
  font-size: 13px; font-family: var(--font-mono);
  color: var(--color-text-primary);
  width: 72px; cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.slot-sep { font-size: 11px; color: var(--color-text-hint); flex-shrink: 0; }
.slot-end { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-muted); }
.slot-dur {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  font-size: 12px; color: var(--color-text-secondary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
}
.slot-del {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--color-text-hint);
  cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.slot-del:active { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger-border); }

.add-slot-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  border: 1px dashed var(--color-border-mid);
  border-radius: var(--radius-md);
  background: transparent;
  font-size: 12px; color: var(--color-text-hint);
  width: 100%; margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
}
.add-slot-btn:active { background: var(--color-surface-alt); color: var(--color-text-secondary); }
/* ════════════════════════════════════════════════════
   SCREEN: BOOKING LIST
════════════════════════════════════════════════════ */

.bk-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin: 0 var(--space-lg) var(--space-sm);
  overflow: hidden;
}
.bk-card__header {
  padding: 12px var(--space-lg) 10px;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.bk-card__pkg { font-size: 14px; font-weight: 600; color: var(--color-text-primary); flex: 1; }
.bk-card__status {
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: .4px;
  flex-shrink: 0;
}
.bk-card__status--pending   { background: var(--color-warning-bg);  color: var(--color-warning-text); }
.bk-card__status--confirmed { background: var(--color-info-bg);     color: var(--color-info-text); }
.bk-card__status--completed { background: var(--color-success-bg);  color: var(--color-success-text); }
.bk-card__status--cancelled { background: var(--color-danger-bg);   color: var(--brand); }
.bk-card__status--latecancel { background: #f5f0ff;                color: #5b3ea6; }
.bk-card__status--noshow    { background: #f5f0ff;                  color: #5b3ea6; }

.bk-card--latecancel { border-color: #d8c9ff; background: #fbf9ff; box-shadow: 0 0 0 2px rgba(91,62,166,.06); }
.bk-card--latecancel .bk-card__header { border-bottom-color: rgba(216,201,255,.75); }
.bk-card--latecancel .bk-card__body { position: relative; }
.bk-card--latecancel .bk-card__body:before { content: ""; position: absolute; left: -16px; top: 0; bottom: 0; width: 3px; background: #5b3ea6; border-radius: 0 6px 6px 0; }

.bk-card__body { padding: 10px var(--space-lg); }
.bk-card__row  { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 8px; }
.bk-card__row:last-child { margin-bottom: 0; }
.bk-card__ico  {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.bk-card__lbl { font-size: 10px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 1px; }
.bk-card__val { font-size: 13px; font-weight: 500; color: var(--color-text-primary); line-height: 1.3; }
.bk-card__val--mono { font-family: var(--font-mono); font-size: 12px; color: var(--brand); font-weight: 500; }

.bk-card__footer {
  padding: 10px var(--space-lg) 12px;
  border-top: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.bk-action {
  font-size: 12px; font-weight: 600;
  padding: 6px 13px; border-radius: var(--radius-full);
  border: none; cursor: pointer;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}
.bk-action--notes    { background: var(--color-surface-alt); color: var(--color-text-secondary); }
.bk-action--notes:active { background: var(--color-border-mid); }
.bk-action--cancel   { background: var(--brand-light); color: var(--brand); }
.bk-action--cancel:active { background: var(--brand-border); }
.bk-action--status   { background: var(--color-info-bg); color: var(--color-info-text); }
.bk-action--status:active { background: #d0e4f7; }

.bk-summary {
  margin: 0 var(--space-lg) var(--space-lg);
  padding: 11px var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; color: var(--color-text-secondary);
  text-align: center;
}
.bk-summary span { color: var(--brand); }

/* Notes modal */
.modal-overlay {
  display: none;
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: flex-end;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px var(--space-xl) 32px;
  width: 100%;
}
.modal-sheet__handle {
  width: 36px; height: 4px;
  background: var(--color-border-mid);
  border-radius: 2px;
  margin: 0 auto 18px;
}
.modal-sheet__title { font-size: 16px; font-weight: 700; color: var(--color-text-primary); margin-bottom: 14px; }
.modal-textarea {
  width: 100%; min-height: 110px;
  border: 1.5px solid var(--color-border-mid);
  border-radius: var(--radius-md);
  padding: 12px; font-size: 16px;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: var(--color-surface-alt);
  resize: none; outline: none;
  transition: border var(--transition-fast);
}
.modal-textarea:focus { border-color: var(--brand); }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }

/* Status picker sheet */
.status-options { display: flex; flex-direction: column; gap: 8px; }
.status-opt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px var(--space-lg);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  font-size: 14px; font-weight: 500;
  font-family: var(--font-sans);
  background: var(--color-surface);
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.status-opt.selected { border-color: var(--brand); background: var(--brand-light); color: var(--brand); }
.status-opt__check { color: var(--brand); font-size: 16px; opacity: 0; }
.status-opt.selected .status-opt__check { opacity: 1; }



/* student selector */
.stu-selector {
  margin: var(--space-md) var(--space-lg) 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex; align-items: center;
  padding: 0 14px; overflow: hidden;
}
.stu-selector select {
  flex: 1; padding: 13px 0;
  font-size: 16px; font-weight: 500;
  border: none; background: transparent;
  color: var(--color-text-primary);
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  font-family: var(--font-sans);
}
.stu-selector__chev { color: var(--color-text-muted); font-size: 16px; pointer-events: none; }

/* tab bar */
.tab-bar {
  display: flex;
  margin: var(--space-md) var(--space-lg) 0;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: 3px;
}
.tab-btn {
  flex: 1;
  padding: 9px 0;
  font-size: 13px; font-weight: 500;
  border: none; background: transparent;
  color: var(--color-text-muted);
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}
.tab-btn.active {
  background: var(--color-surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* class card */
.class-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin: 0 var(--space-lg) var(--space-sm);
  overflow: hidden;
}
.class-card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px var(--space-lg) 10px;
  border-bottom: 1px solid var(--color-border);
}
.class-card__package {
  font-size: 14px; font-weight: 600;
  color: var(--color-text-primary);
}
.class-card__status-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.class-card__body { padding: 12px var(--space-lg); }
.class-card__row {
  display: flex; align-items: flex-start;
  gap: 10px; margin-bottom: 9px;
}
.class-card__row:last-child { margin-bottom: 0; }
.class-card__icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.class-card__field-lbl {
  font-size: 10px; font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 1px;
}
.class-card__field-val {
  font-size: 13px; font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.3;
}
.class-card__footer {
  padding: 10px var(--space-lg) 13px;
  border-top: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.class-card__datetime {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  color: var(--brand);
}
.class-card__cancel {
  font-size: 12px; font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  border: none; border-radius: var(--radius-full);
  padding: 6px 14px; cursor: pointer;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}
.class-card__cancel:active { background: var(--brand-border); }

/* past class — muted style */
.class-card--past { opacity: .75; }
.class-card--past .class-card__package { color: var(--color-text-secondary); }
.class-card--past .class-card__datetime { color: var(--color-text-muted); font-family: var(--font-mono); font-size: 12px; }
.class-card--past.class-card--latecancel { border-color: #d8c9ff; background: #fbf9ff; opacity: .95; box-shadow: 0 0 0 2px rgba(91,62,166,.06); }
.class-card--past.class-card--latecancel .class-card__header { border-bottom-color: rgba(216,201,255,.75); }

/* empty state */
.classes-empty {
  text-align: center;
  padding: 48px 24px;
}
.classes-empty__icon { margin-bottom: 12px; }
.classes-empty__lbl {
  font-size: 14px; font-weight: 500;
  color: var(--color-text-muted);
}
.classes-empty__sub {
  font-size: 12px; color: var(--color-text-hint);
  margin-top: 4px;
}

/* ════════════════════════════════
   PROFILE SETTINGS
════════════════════════════════ */
.profile-avatar-section {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 0 16px;
}
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: var(--radius-full);
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; font-family: var(--font-mono);
  margin-bottom: 10px;
}
.profile-avatar-change {
  font-size: 12px; font-weight: 600; color: var(--brand);
  background: none; border: none; cursor: pointer; font-family: var(--font-sans);
}
.form-group { padding: 0 var(--space-lg) var(--space-md); }
.form-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--color-text-muted); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--color-border-mid);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: var(--color-surface);
  outline: none;
  transition: border-color var(--transition-fast);
}
.form-input:focus { border-color: var(--brand); }

/* ════════════════════════════════
   CALENDAR ADD/EDIT CLASS MODAL
════════════════════════════════ */
.cal-modal-overlay {
  display: none; position: absolute; inset: 0;
  background: rgba(0,0,0,.45); z-index: 300; align-items: flex-end;
}
.cal-modal-overlay.open { display: flex; }
.cal-modal-sheet {
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px var(--space-xl) 32px; width: 100%;
  max-height: 90vh; overflow-y: auto;
}
.cal-modal-handle {
  width: 36px; height: 4px; background: var(--color-border-mid);
  border-radius: 2px; margin: 0 auto 16px;
}
.cal-modal-title { font-size: 17px; font-weight: 700; color: var(--color-text-primary); margin-bottom: 4px; }
.cal-modal-sub   { font-size: 12px; color: var(--color-text-muted); margin-bottom: 18px; }
.cal-form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.cal-form-col    { display: flex; flex-direction: column; gap: 5px; }
.cal-form-lbl    { font-size: 10px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .5px; }
.cal-form-input, .cal-form-select {
  padding: 11px 8px;
  border: 1.5px solid var(--color-border-mid);
  border-radius: var(--radius-md);
  font-size: 13px; /* 16px prevents iOS zoom */
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: var(--color-surface);
  outline: none;
  width: 100%;
  transition: border-color var(--transition-fast);
}
.cal-form-input:focus, .cal-form-select:focus { border-color: var(--brand); }
.cal-form-select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.cal-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.cal-modal-danger  { background: var(--brand-light); color: var(--brand); border: none;
  border-radius: var(--radius-md); padding: 12px; font-size: 13px; font-weight: 600;
  font-family: var(--font-sans); cursor: pointer; width: 100%; margin-top: 10px;
  -webkit-tap-highlight-color: transparent;
}
.cal-modal-danger:active { background: var(--brand-border); }

/* ════════════════════════════════
   SEARCHABLE STUDENT COMBO
════════════════════════════════ */
.combo-wrap {
  position: relative;
  margin-top: 5px;
}
.combo-input-row {
  display: flex; align-items: center;
  border: 1.5px solid var(--color-border-mid);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.combo-input-row:focus-within { border-color: var(--brand); }
.combo-search {
  flex: 1; padding: 11px 12px;
  border: none; background: transparent;
  font-size: 16px; font-family: var(--font-sans);
  color: var(--color-text-primary); outline: none;
}
.combo-search::placeholder { color: var(--color-text-hint); }
.combo-clear {
  padding: 0 12px; font-size: 18px;
  color: var(--color-text-muted);
  background: none; border: none; cursor: pointer; line-height: 1;
  display: none;
}
.combo-clear.visible { display: block; }
.combo-dropdown {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--color-surface);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-md);
  max-height: 200px; overflow-y: auto;
  z-index: 400;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.combo-dropdown.open { display: block; }
.combo-option {
  padding: 11px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  -webkit-tap-highlight-color: transparent;
}
.combo-option:last-child { border-bottom: none; }
.combo-option:hover, .combo-option.focused { background: var(--brand-light); color: var(--brand); }
.combo-option mark {
  background: transparent; color: var(--brand); font-weight: 700;
}
.combo-empty {
  padding: 14px;
  font-size: 13px; color: var(--color-text-hint);
  text-align: center;
}


.bk-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-mid);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 10px 16px 0;
  transition: border-color var(--transition-fast);
}
.bk-search:focus-within { border-color: var(--brand); }
.bk-search input {
  flex: 1; border: none; background: transparent;
  font-size: 16px; color: var(--color-text-primary);
  font-family: var(--font-sans); outline: none;
}
.bk-search input::placeholder { color: var(--color-text-hint); }

.bk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.bk-badge--lesson {
  border: 1px solid rgba(0,0,0,.06);
}

.bk-badge--calendar {
    background: #EEF4FF;
    color: #1D4ED8;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 6px;
    margin-left: 6px;
}

.booking-block__lesson {
  font-weight: 700;
}

@media only screen and (max-width: 480px){
  /*.scroll-body {
    margin-bottom: 120px;
  }*/
  .app--transitions .screen.active {padding-bottom: 130px;}
  .modal-overlay {align-items: center;}
  .cal-modal-overlay {align-items: flex-start;}
  .modal-sheet, .cal-modal-sheet {
  border-radius: var(--radius-md);
}
}

/* Student dashboard shell guard.
   WordPress themes/plugins commonly ship generic .app, .screen and .main-area
   rules. Keep the dashboard body visible even when those global rules load late. */
.wstdl-student-dashboard-ui {
  display: block;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
}

.wstdl-student-dashboard-ui .app {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  max-width: none !important;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  margin: 0 !important;
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: none !important;
}

.wstdl-student-dashboard-ui .main-area {
  display: contents !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.wstdl-student-dashboard-ui .screen-wrap {
  display: block !important;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.wstdl-student-dashboard-ui .screen {
  width: 100%;
  min-width: 0;
  visibility: visible;
}

.wstdl-student-dashboard-ui .screen.active {
  display: flex !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: auto !important;
}

@media (min-width: 768px) {
  .wstdl-student-dashboard-ui .app {
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
  }

  .wstdl-student-dashboard-ui .side-nav {
    display: flex !important;
    flex: 0 0 220px;
  }

  .wstdl-student-dashboard-ui .main-area {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
    background: var(--color-bg);
  }

  .wstdl-student-dashboard-ui .screen-wrap {
    height: auto;
  }
}

@media (min-width: 1024px) {
  .wstdl-student-dashboard-ui .side-nav {
    flex-basis: 240px;
  }
}

@media (min-width: 1280px) {
  .wstdl-student-dashboard-ui .side-nav {
    flex-basis: 260px;
  }
}

@supports selector(body:has(.wstdl-student-dashboard-ui)) {
  body:has(.wstdl-student-dashboard-ui) .ct-section:has(.wstdl-student-dashboard-ui),
  body:has(.wstdl-student-dashboard-ui) .ct-section-inner-wrap:has(.wstdl-student-dashboard-ui),
  body:has(.wstdl-student-dashboard-ui) .oxy-post-content:has(.wstdl-student-dashboard-ui),
  body:has(.wstdl-student-dashboard-ui) .entry-content:has(.wstdl-student-dashboard-ui) {
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 0 !important;
  }
}
