:root {
  color-scheme: light;
  --brand-primary: #1f2937;
  --brand-primary-dark: #111827;
  --brand-accent: #475467;
  --surface: #ffffff;
  --surface-warm: #f8fafc;
  --surface-alt: #f1f5f9;
  --text-primary: #182438;
  --text-muted: #607086;
  --border: #dce4ec;
  --success: #16715a;
  --success-bg: #e8f6f1;
  --danger: #b43a32;
  --danger-bg: #fff0ed;
  --warning: #8b5d08;
  --warning-bg: #fff6dc;
  --radius-sm: .65rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --shadow-sm: 0 .25rem 1rem rgba(24, 36, 56, .07);
  --shadow-md: 0 1rem 2.5rem rgba(15, 23, 42, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--surface-warm);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--surface-warm); }
body, button, input, select, textarea { font: inherit; }
a { color: var(--brand-primary); }
img { max-width: 100%; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -.025em; }
h3 { color: var(--brand-primary); }
form { margin: 0; }
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 3px; }

.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem; min-height: 5rem; padding: .65rem max(1rem, calc((100% - 90rem) / 2)); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.customer-brand { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 3rem; }
.customer-brand img { display: block; width: 11.5rem; height: 3.3rem; object-fit: contain; object-position: left center; }
.customer-brand__text { max-width: 16rem; color: var(--brand-primary); font-weight: 900; line-height: 1.05; text-decoration: none; }
.topbar-context { display: grid; margin-left: auto; text-align: right; line-height: 1.2; }
.topbar-context strong { font-size: .9rem; }
.topbar-context span { color: var(--text-muted); font-size: .75rem; }
.logout-form { margin-left: .5rem; }
.link-button, .danger-link { min-height: 2.75rem; padding: .55rem .8rem; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; color: inherit; font-weight: 750; }
.link-button:hover { background: var(--surface-alt); color: var(--brand-primary); }
.danger-link { color: var(--danger); }

.staff-sidebar { position: fixed; top: 5rem; bottom: 0; left: 0; z-index: 20; display: flex; flex-direction: column; width: 16rem; padding: 1.35rem 1rem; border-right: 1px solid var(--border); background: var(--surface); }
.staff-nav { display: grid; gap: .35rem; }
.staff-nav { scrollbar-width: none; }
.staff-nav::-webkit-scrollbar { display: none; }
.staff-nav a { display: flex; align-items: center; gap: .75rem; min-height: 3rem; padding: .7rem .85rem; border-radius: .8rem; color: #34445a; font-weight: 700; text-decoration: none; }
.staff-nav a span { display: grid; place-items: center; width: 1.5rem; color: var(--brand-primary); font-size: 1.1rem; }
.staff-nav a:hover { background: var(--surface-alt); color: var(--brand-primary); }
.staff-nav a.active { background: var(--brand-primary); color: white; box-shadow: 0 .4rem 1rem rgba(15,23,42,.2); }
.staff-nav a.active span { color: white; }
.powered-by { margin: auto 0 0; color: var(--text-muted); font-size: .75rem; text-align: center; }
.powered-by strong { color: var(--brand-primary); letter-spacing: .03em; }
.powered-by small { display: block; margin-top: .25rem; font-size: .62rem; letter-spacing: .06em; }
.role-owner .app-shell, .role-admin .app-shell, .role-instructor .app-shell { width: calc(100% - 16rem); margin-left: 16rem; }
.role-owner .messages, .role-admin .messages, .role-instructor .messages { margin-left: 16rem; }

.student-nav { display: flex; align-items: center; gap: .25rem; margin: 0 auto 0 1rem; }
.student-nav a { display: flex; align-items: center; gap: .35rem; min-height: 2.8rem; padding: .55rem .75rem; border-radius: .75rem; color: #44536a; font-size: .88rem; font-weight: 700; text-decoration: none; }
.student-nav a span { color: var(--brand-primary); }
.student-nav a:hover, .student-nav a.active { background: var(--surface-alt); color: var(--brand-primary); }

.app-shell { min-height: calc(100vh - 5rem); padding: clamp(1rem, 3vw, 2.75rem); background: linear-gradient(145deg, var(--surface-warm), #fff 58%, var(--surface-alt)); }
.panel { width: min(100%, 52rem); margin: auto; padding: clamp(1.25rem, 3vw, 2.4rem); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel.wide { width: min(100%, 78rem); }
.eyebrow { margin: 0; color: var(--brand-accent); font-size: .76rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.page-title { margin: .35rem 0 .7rem; color: var(--brand-primary); font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.02; letter-spacing: -.055em; }
.page-intro { max-width: 42rem; margin: 0; color: var(--text-muted); font-size: 1.02rem; }
.muted { color: var(--text-muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .7rem 1rem; border: 1px solid var(--brand-primary); border-radius: .75rem; background: var(--brand-primary); color: #fff; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); background: var(--brand-primary-dark); box-shadow: 0 .45rem 1rem rgba(15,23,42,.18); }
.button.secondary { background: #fff; color: var(--brand-primary); }
.button.secondary:hover { background: var(--surface-alt); }
.button.danger { border-color: var(--danger); background: var(--danger); }
.button.danger:hover { background: #932d27; }
.touch { min-height: 3.25rem; }
.text-link, .section-heading > a { color: var(--brand-primary); font-weight: 800; text-decoration: none; }
.title-row, .user-row, .user-actions, .form-actions, .page-actions { display: flex; align-items: center; gap: .75rem; }
.title-row { justify-content: space-between; margin-bottom: 1.3rem; }
.title-row > div:first-child { min-width: 0; }
.user-actions, .form-actions, .page-actions { flex-wrap: wrap; }
.form-actions, .page-actions { justify-content: flex-end; }
.messages { position: relative; z-index: 35; padding: .75rem clamp(1rem, 3vw, 2.75rem) 0; background: var(--surface-warm); }
.message { width: min(100%, 78rem); margin: 0 auto; padding: .8rem 1rem; border: 1px solid #b8dfd1; border-radius: .8rem; background: var(--success-bg); color: var(--success); font-weight: 700; }
.message.error { border-color: #f0c5bf; background: var(--danger-bg); color: var(--danger); }
.message.warning { border-color: #ecd68d; background: var(--warning-bg); color: var(--warning); }
.notice-info, .notice-success { padding: .8rem 1rem; border-radius: .8rem; background: var(--surface-alt); color: var(--brand-primary-dark); }
.notice-success { background: var(--success-bg); color: var(--success); }

.dashboard-shell { width: auto; max-width: 88rem; margin-right: auto; }
.dashboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 0 auto 1.5rem; }
.date-chip { display: grid; min-width: 7rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 1rem; background: white; text-align: center; box-shadow: var(--shadow-sm); }
.date-chip span { color: var(--text-muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.date-chip strong { color: var(--brand-primary); font-size: 1.25rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.kpi-card { position: relative; overflow: hidden; display: grid; padding: 1.2rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-sm); }
.kpi-card::after { content: ""; position: absolute; width: 3rem; height: 3rem; right: -.9rem; top: -.9rem; border-radius: 50%; background: var(--surface-alt); }
.kpi-card span { color: var(--text-muted); font-size: .82rem; font-weight: 750; }
.kpi-card strong { margin: .2rem 0; color: var(--brand-primary); font-size: 2.2rem; line-height: 1; }
.kpi-card small { color: var(--text-muted); }
.tomorrow-board { padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--radius-lg); background: var(--brand-primary); color: white; box-shadow: var(--shadow-md); }
.tomorrow-board .eyebrow { color: color-mix(in srgb, var(--brand-accent) 55%, white); }
.tomorrow-board__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1.2rem; border-bottom: 1px solid rgba(255,255,255,.2); }
.tomorrow-board__heading h2 { margin: .2rem 0; font-size: clamp(2rem, 5vw, 3rem); text-transform: uppercase; }
.tomorrow-board__heading p { margin: 0; color: rgba(255,255,255,.82); }
.tomorrow-total { display: grid; min-width: 8rem; text-align: right; }
.tomorrow-total strong { font-size: 3rem; line-height: .9; }
.tomorrow-total span { color: rgba(255,255,255,.82); }
.tomorrow-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.2rem 0; }
.tomorrow-group { padding: 1rem; border-radius: 1rem; background: rgba(255,255,255,.1); }
.tomorrow-group__title, .tomorrow-group dl div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tomorrow-group__title h3 { margin: 0; color: white; font-size: 1.05rem; text-transform: uppercase; }
.tomorrow-group__title > span { display: grid; place-items: center; min-width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--brand-accent); font-weight: 850; }
.tomorrow-group dl { margin: .7rem 0 0; }
.tomorrow-group dl div { padding: .45rem 0; border-top: 1px solid rgba(255,255,255,.14); }
.tomorrow-group dt { color: rgba(255,255,255,.86); }
.tomorrow-group dd { margin: 0; font-weight: 850; }
.tomorrow-board .empty-state { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: white; }
.tomorrow-board .empty-state p { color: rgba(255,255,255,.82); }
.board-link { margin-top: 1rem; border-color: white!important; }
.quick-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; padding: 1.2rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: white; }
.quick-actions > div { display: flex; gap: .75rem; }
.dashboard-section { margin: 1.5rem 0; }
.time-window-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.time-window-card { padding: 1.15rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-sm); }
.time-window-card.disabled { border-color: #e5b8b2; background: #fffafa; }
.time-window-card > header, .slot-activity-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.time-window-card h2 { margin-top: .2rem; color: var(--brand-primary); font-size: 2.2rem; }
.schedule-source { margin: .2rem 0 1rem; color: var(--text-muted); font-size: .78rem; }
.schedule-matrix-wrap { contain: layout inline-size; overflow-x: auto; margin: 1rem 0; }
.schedule-matrix { width: 100%; min-width: 680px; border-collapse: collapse; }
.schedule-matrix th, .schedule-matrix td { padding: .75rem; border-bottom: 1px solid var(--border); text-align: center; }
.schedule-matrix thead th { color: var(--brand-primary); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.schedule-matrix tbody th { text-align: left; }
.schedule-matrix tbody th strong, .schedule-matrix tbody th small { display: block; }
.schedule-matrix tbody th small { color: var(--text-muted); font-weight: 500; }
.schedule-toggle { display: inline-flex; cursor: pointer; }
.schedule-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-toggle span { display: inline-grid; place-items: center; min-width: 3.5rem; min-height: 2rem; border: 1px solid #d7a5a0; border-radius: 999px; background: #fff3f2; color: #8d2f27; font-size: .72rem; font-weight: 850; }
.schedule-toggle span::after { content: "OFF"; }
.schedule-toggle input:checked + span { border-color: #8ac6a5; background: #edf9f2; color: #17633c; }
.schedule-toggle input:checked + span::after { content: "ON"; }
.schedule-toggle input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand-accent) 35%, transparent); outline-offset: 2px; }
.schedule-exceptions > .detail-grid { margin-top: 1rem; }
.schedule-exception-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .35rem .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.schedule-exception-row small { grid-column: 1 / -1; color: var(--text-muted); }
.slot-counts { padding: .8rem; border-radius: .9rem; background: var(--surface-alt); }
.slot-counts > strong { color: var(--brand-primary); font-size: 1.2rem; }
.slot-counts dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .7rem 0 0; }
.slot-counts dl div { display: grid; padding: .45rem; border-radius: .6rem; background: white; }
.slot-counts dt { color: var(--text-muted); font-size: .7rem; }
.slot-counts dd { margin: 0; font-weight: 900; }
.modality-breakdown { margin-top: .9rem; }
.modality-breakdown h3 { margin: 0 0 .4rem; }
.modality-breakdown > div { display: grid; padding: .55rem 0; border-top: 1px solid var(--border); }
.modality-breakdown span, .slot-activity span, .instructor-mini-card span { color: var(--text-muted); font-size: .8rem; }
.time-window-card details { margin-top: .9rem; border-top: 1px solid var(--border); }
.time-window-card summary { padding: .8rem 0 .2rem; color: var(--brand-primary); font-weight: 850; cursor: pointer; }
.slot-activities, .instructor-dashboard-list { display: grid; gap: .65rem; margin-top: .65rem; }
.slot-activity { padding: .75rem; border: 1px solid var(--border); border-radius: .8rem; }
.slot-activity-heading > div { display: grid; }
.slot-activity-heading a { font-size: .8rem; font-weight: 800; text-decoration: none; }
.slot-activity > p { color: var(--text-muted); font-size: .78rem; }
.compact-participants { gap: .5rem; }
.compact-participants .participant-identity { padding-top: .5rem; border-top: 1px solid var(--border); }
.instructor-mini-card { display: grid; grid-template-columns: auto 1fr; gap: .7rem; padding: .7rem; border: 1px solid var(--border); border-radius: .8rem; }
.instructor-mini-card > div { display: grid; gap: .15rem; }
.availability-state { width: max-content; margin-top: .25rem; padding: .2rem .45rem; border-radius: 99rem; font-weight: 800; }
.state-available { background: var(--success-bg); color: var(--success)!important; }
.state-unavailable { background: var(--danger-bg); color: var(--danger)!important; }
.state-unconfigured { background: var(--warning-bg); color: var(--warning)!important; }

.daily-dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; margin-bottom: 1rem; }
.daily-dashboard-header .page-title { margin: .15rem 0 .55rem; }
.daily-date-label { margin: .45rem 0 0; color: var(--brand-primary); font-size: .9rem; font-weight: 900; letter-spacing: .08em; }
.daily-summary { display: flex; flex-wrap: wrap; gap: .45rem 1rem; color: var(--text-muted); font-size: .88rem; }
.daily-summary span { display: inline-flex; align-items: baseline; gap: .25rem; }
.daily-summary strong { color: var(--text-primary); font-size: 1rem; }
.daily-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.daily-controls .date-picker { display: flex; align-items: flex-end; gap: .6rem; }
.daily-warnings { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.daily-warnings span { padding: .35rem .6rem; border-radius: 99rem; background: var(--warning-bg); color: var(--warning); font-size: .76rem; font-weight: 800; }
.daily-slot-table { width: 100%; }
.daily-slot-table-head, .daily-slot-summary { display: grid; grid-template-columns: 5.5rem repeat(var(--activity-columns), minmax(8rem, 1fr)) minmax(7.5rem, .7fr) minmax(9rem, .9fr); }
.daily-slot-table-head { padding: 0 .85rem .5rem; color: var(--text-muted); font-size: .7rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.daily-slot-table-head span { padding: 0 .65rem; }
.daily-slot-table-head span:first-child { padding-left: 0; }
.daily-slot-table-body { display: grid; gap: .55rem; }
.daily-slot { overflow: hidden; border: 1px solid var(--border); border-radius: .9rem; background: white; }
.daily-slot.disabled { border-color: #e5b8b2; background: #fffafa; }
.daily-slot-summary { min-height: 6.3rem; padding: .75rem .85rem; }
.daily-slot-time { display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding-right: .65rem; }
.daily-slot-time > strong { color: var(--brand-primary); font-size: 1.4rem; }
.slot-state { color: var(--text-muted); font-size: .68rem; font-weight: 750; line-height: 1.2; }
.slot-state.unavailable { color: var(--danger); }
.slot-state.empty { color: var(--text-muted); }
.daily-slot-cell { min-width: 0; padding: .25rem .65rem; border-left: 1px solid var(--border); }
.daily-activity-cell { display: grid; align-content: center; gap: .4rem; }
.daily-activity-line { display: grid; min-width: 0; gap: .08rem; }
.daily-activity-line + .daily-activity-line { padding-top: .4rem; border-top: 1px solid var(--border); }
.daily-activity-line strong { font-size: .86rem; }
.daily-activity-line span, .daily-activity-line small { overflow: hidden; color: var(--text-muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.daily-student-cell { display: flex; flex-direction: column; justify-content: center; gap: .25rem; }
.daily-student-cell > strong { color: var(--brand-primary); font-size: .9rem; }
.daily-student-cell small { color: var(--text-muted); font-size: .72rem; white-space: nowrap; }
.daily-student-cell abbr { color: var(--text-primary); font-weight: 850; text-decoration: none; }
.daily-instructor-cell { display: grid; align-content: center; gap: .35rem; }
.daily-instructor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .25rem; color: var(--text-primary); font-size: .76rem; }
.daily-instructor strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-instructor b { color: var(--success); }
.daily-instructor small { grid-column: 1 / -1; color: var(--text-muted); font-size: .66rem; }
.daily-instructor.state-available, .daily-instructor.state-unavailable, .daily-instructor.state-unconfigured { background: transparent; }
.daily-instructor.state-unavailable b { color: var(--danger); }
.daily-instructor.state-unconfigured b { color: var(--warning); }
.daily-cell-empty { align-self: center; color: var(--text-muted); font-size: .74rem; }
.daily-slot-detail { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-alt) 55%, white); }
.daily-slot-detail > summary { display: flex; justify-content: space-between; gap: .75rem; padding: .65rem .85rem; color: var(--brand-primary); font-size: .78rem; font-weight: 800; cursor: pointer; list-style-position: inside; }
.daily-slot-detail > summary span { color: var(--text-muted); font-weight: 700; }
.daily-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; padding: 0 .85rem .85rem; }
.daily-detail-session { min-width: 0; padding: .8rem; border: 1px solid var(--border); border-radius: .75rem; background: white; }
.daily-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .65rem; }
.daily-detail-heading > div { display: grid; gap: .1rem; }
.daily-detail-heading > div > span, .daily-detail-session > p { color: var(--text-muted); font-size: .75rem; }
.daily-detail-session > p { margin: .55rem 0; }
.daily-detail-participants { display: grid; gap: .35rem; margin-bottom: .6rem; }
.daily-detail-participants .participant-identity { padding-top: .35rem; border-top: 1px solid var(--border); }
.daily-detail-participants .profile-photo { width: 2.25rem; height: 2.25rem; }
.daily-detail-participants small { display: block; color: var(--text-muted); font-size: .7rem; }

@media (max-width: 950px) {
  .daily-dashboard-header { flex-direction: column; }
  .daily-dashboard-header .page-actions { width: 100%; justify-content: flex-start; }
  .daily-controls { align-items: stretch; flex-direction: column; }
  .daily-warnings { justify-content: flex-start; }
  .daily-slot-table-head { display: none; }
  .daily-slot-summary { display: grid; grid-template-columns: 1fr; min-height: 0; padding: .75rem; }
  .daily-slot-time { align-items: center; flex-direction: row; justify-content: space-between; padding: 0 0 .55rem; }
  .daily-slot-cell { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .2rem .55rem; padding: .5rem 0; border-top: 1px solid var(--border); border-left: 0; }
  .daily-slot-cell::before { content: attr(data-label); grid-row: 1 / span 20; color: var(--text-muted); font-size: .68rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
  .daily-slot-cell > * { grid-column: 2; }
  .daily-activity-line span, .daily-activity-line small, .daily-instructor strong { overflow: visible; text-overflow: clip; white-space: normal; }
  .daily-detail-list { grid-template-columns: 1fr; }
}

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin-top: .2rem; }
.section-heading > a { font-size: .9rem; }
.summary, .session-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin: 1.25rem 0; }
.summary div, .session-facts div { padding: 1rem; border: 1px solid var(--border); border-radius: .9rem; background: var(--surface-alt); }
.summary dt, .session-facts dt { color: var(--text-muted); font-size: .73rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.summary dd, .session-facts dd { margin: .25rem 0 0; font-weight: 800; }
.badge { display: inline-flex; align-items: center; justify-content: center; width: max-content; padding: .35rem .65rem; border-radius: 99rem; background: var(--surface-alt); color: var(--brand-primary-dark); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.status-cancelled { background: var(--danger-bg); color: var(--danger); }
.status-published, .status-present { background: var(--success-bg); color: var(--success); }
.status-draft { background: var(--warning-bg); color: var(--warning); }
.status-completed { background: #eef0f6; color: #515b73; }
.status-absent { background: var(--danger-bg); color: var(--danger); }

.nav-cards, .student-grid, .session-grid, .user-list { display: grid; gap: .75rem; }
.nav-cards a, .student-card, .session-card, .user-row { border: 1px solid var(--border); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-sm); }
.nav-cards a { padding: 1rem; font-weight: 750; text-decoration: none; }
.student-card, .session-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1rem; padding: 1rem; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.session-card { grid-template-columns: 5rem 1fr auto; }
.student-card:hover, .session-card:hover { transform: translateY(-1px); border-color: #afc5e5; box-shadow: var(--shadow-md); }
.student-card span, .session-card span, .session-card small { display: block; margin-top: .18rem; color: var(--text-muted); }
.session-date { display: grid; place-items: center; min-height: 4rem; padding: .5rem; border-radius: .75rem; background: var(--surface-alt); color: var(--brand-primary); text-align: center; }
.session-date strong { font-size: 1.15rem; }
.session-date span { color: var(--brand-primary-dark); font-size: .8rem; }
.card-action { color: var(--brand-primary)!important; font-weight: 800; }
.instructor-session { grid-template-columns: 5.5rem 1fr auto; }
.balance { text-align: right; }
.balance b, .balance small { display: block; }
.user-row { justify-content: space-between; padding: 1rem; }
.student-card-identity, .profile-heading { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.student-card-identity > div { display: grid; gap: .15rem; }
.profile-photo { display: grid; flex: 0 0 auto; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; background: var(--surface-alt); color: var(--brand-primary); font-weight: 900; }
.profile-photo.large { width: 6rem; height: 6rem; font-size: 2rem; }
.profile-photo.placeholder { border: 1px solid var(--border); }
.student-list-head, .student-card.student-card-v2 { display: grid; grid-template-columns: minmax(13rem, 1.45fr) minmax(7.5rem, .72fr) minmax(6.5rem, .58fr) minmax(8.5rem, .8fr) minmax(7.5rem, .7fr) auto; gap: .85rem; }
.student-list-head { align-items: end; padding: 0 1rem .45rem; color: var(--text-muted); font-size: .68rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.student-card.student-card-v2 { align-items: center; }
.student-card-v2 > * { min-width: 0; }
.student-card-v2 .student-card-identity strong { overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.student-classification { display: grid!important; gap: .05rem; }
.student-classification b { color: var(--brand-primary); font-size: .76rem; }
.student-classification small, .student-overview-cell small { color: var(--text-muted); font-size: .7rem; }
.student-overview-cell { display: grid; align-content: center; gap: .12rem; min-width: 0; }
.student-overview-cell strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.student-overview-cell small { display: block; margin: 0; }
.student-empty-value { margin: 0!important; color: var(--text-muted); font-size: .74rem; line-height: 1.25; }
.student-balance strong { color: var(--brand-primary); font-size: .9rem; }
.emergency-indicator.configured strong { color: var(--success); }
.emergency-indicator strong span { display: inline; margin: 0; color: inherit; }
.student-status-cell { display: grid; justify-items: end; }
.contact-details { display: grid; gap: .7rem; margin: 1rem 0 0; }
.contact-details div { display: grid; gap: .15rem; }
.contact-details dt { color: var(--text-muted); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.contact-details dd { margin: 0; font-weight: 750; }
.instructor-profile-grid { display: grid; grid-template-columns: minmax(16rem, .75fr) minmax(24rem, 1.25fr); gap: 1rem; }
.availability-table { display: grid; gap: .7rem; }
.availability-table fieldset { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding: .75rem; border: 1px solid var(--border); border-radius: .8rem; }
.availability-table legend { color: var(--brand-primary); font-weight: 850; }
.availability-table fieldset > div { display: grid; gap: .2rem; }
.empty-state { width: 100%; padding: 1.5rem; border: 1px dashed #b8c7d8; border-radius: 1rem; background: rgba(255,255,255,.75); color: var(--text-primary); text-align: center; }
.empty-state p { margin: .35rem 0 0; color: var(--text-muted); }
.empty-state.compact { padding: 1rem; }

.filter-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: .7rem; align-items: end; margin: 1rem 0 1.5rem; padding: 1rem; border-radius: 1rem; background: var(--surface-alt); }
.filter-grid > * { min-width: 0; }
.session-filters { grid-template-columns: repeat(5, 1fr) auto; }
.filter-grid label, .compact label { display: grid; gap: .35rem; color: var(--text-muted); font-size: .78rem; font-weight: 750; }
.filter-grid input, .filter-grid select, .compact input, .compact select { width: 100%; min-width: 0; min-height: 3rem; padding: .65rem .75rem; border: 1px solid #aab9ca; border-radius: .7rem; background: white; color: var(--text-primary); }
.quick-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.quick-filters a { padding: .55rem .85rem; border: 1px solid var(--border); border-radius: 99rem; background: white; color: var(--brand-primary); font-weight: 750; text-decoration: none; }
.quick-filters a:hover, .quick-filters a.active { border-color: var(--brand-primary); background: var(--brand-primary); color: white; }
.date-picker { display: flex; align-items: end; gap: .7rem; margin: 1rem 0 1.5rem; }
.day-group { margin-top: 1.5rem; }
.day-group h2 { margin-bottom: .75rem; }

.form-panel { width: min(100%, 68rem); }
.form-heading { margin-bottom: 1.5rem; }
.stacked-form { display: grid; gap: 1rem; text-align: left; }
.stacked-form > div, .form-grid > div { display: grid; gap: .38rem; }
.stacked-form label, .form-grid label { color: #35455a; font-size: .85rem; font-weight: 800; }
.stacked-form input:not([type=checkbox]):not([type=radio]), .stacked-form select, .stacked-form textarea { width: 100%; min-height: 3.1rem; padding: .7rem .8rem; border: 1px solid #9dadbf; border-radius: .7rem; background: #fff; color: var(--text-primary); }
.stacked-form textarea { min-height: 7rem; resize: vertical; }
.stacked-form input:focus, .stacked-form select:focus, .stacked-form textarea:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent); outline: none; }
.stacked-form ul:not(.errorlist) { display: grid; gap: .45rem; margin: 0; padding: .8rem; border-radius: .75rem; background: var(--surface-alt); list-style: none; }
.stacked-form ul:not(.errorlist) label { display: flex; align-items: center; gap: .55rem; min-height: 2rem; }
.stacked-form input[type=checkbox], .stacked-form input[type=radio] { width: 1.25rem; height: 1.25rem; accent-color: var(--brand-primary); }
.field-help { display: block; color: var(--text-muted); font-size: .78rem; }
.form-errors, .errorlist { margin: .2rem 0; padding: .7rem .9rem; border-radius: .65rem; background: var(--danger-bg); color: var(--danger); font-size: .84rem; }
.notice-error { margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid #f0b6a8; border-radius: .75rem; background: var(--danger-bg); color: var(--danger); }
.form-section { margin: 0; padding: 1.15rem; border: 1px solid var(--border); border-radius: 1rem; }
.form-section legend { padding: 0 .45rem; color: var(--brand-primary); font-size: 1rem; font-weight: 850; }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two-columns { grid-template-columns: repeat(2, 1fr); }
.form-grid.three-columns { grid-template-columns: repeat(3, 1fr); }
.form-grid .full-width { grid-column: 1 / -1; }
.draft-toggle { display: grid!important; grid-template-columns: auto 1fr; align-content: start; gap: .75rem!important; min-height: 100%; padding: .9rem; border: 1px solid #c6d6e7; border-radius: .8rem; background: var(--surface-alt); }
.draft-toggle input { margin-top: .15rem; }
.sticky-actions { position: sticky; bottom: .75rem; z-index: 10; padding: .8rem; border: 1px solid var(--border); border-radius: 1rem; background: rgba(255,255,255,.96); box-shadow: var(--shadow-md); }

.section-card { margin-bottom: 1rem; padding: 1.2rem; border: 1px solid var(--border); border-radius: 1rem; background: white; }
.section-card h2 { margin-top: 0; color: var(--brand-primary); }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.balance-card > strong { display: block; color: var(--brand-primary); font-size: 3rem; line-height: 1; }
.ledger { margin: 1.5rem 0; }
.ledger > div { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.pre-line { white-space: pre-line; }

.session-detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.session-subtitle { margin: 0; color: var(--text-muted); font-size: 1.05rem; }
.session-facts { grid-template-columns: repeat(3, 1fr); }
.attendance-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.participant-count { padding: .45rem .75rem; border-radius: 99rem; background: var(--surface-alt); color: var(--brand-primary); font-weight: 800; }
.participant-list { display: grid; gap: .75rem; }
.participant-card { display: grid; grid-template-columns: minmax(13rem, 1fr) auto; align-items: center; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 1rem; background: #fff; }
.participant-identity { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.participant-identity > div { display: grid; }
.participant-identity small { color: var(--text-muted); }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--surface-alt); color: var(--brand-primary); font-weight: 900; }
.attendance-choice { display: grid; grid-template-columns: repeat(2, minmax(7.5rem, 1fr)); gap: .5rem; margin: 0; padding: 0; border: 0; }
.attendance-option { display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 3.1rem; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: .75rem; background: #fff; color: var(--text-muted); font-weight: 800; cursor: pointer; }
.attendance-option input { position: absolute; opacity: 0; pointer-events: none; }
.attendance-option span { font-size: 1.15rem; }
.attendance-option.present:has(input:checked) { border-color: var(--success); background: var(--success-bg); color: var(--success); box-shadow: 0 0 0 2px rgba(22,113,90,.12); }
.attendance-option.absent:has(input:checked) { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); box-shadow: 0 0 0 2px rgba(180,58,50,.1); }
.attendance-option:focus-within { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.attendance-result { display: grid; justify-items: end; font-weight: 850; }
.attendance-result small { font-weight: 500; }
.attendance-save { display: flex; justify-content: flex-end; margin-top: 1rem; }
.page-actions { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

.student-home { width: min(100%, 72rem); margin: auto; padding-bottom: 7rem; }
.student-welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.profile-menu { position: relative; min-width: 13rem; }
.profile-menu summary { display: grid; padding: .75rem 2.2rem .75rem .9rem; border: 1px solid var(--border); border-radius: .9rem; background: white; cursor: pointer; list-style: none; box-shadow: var(--shadow-sm); }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary::after { content: "⌄"; position: absolute; right: .9rem; top: 1rem; color: var(--brand-primary); }
.profile-menu summary span { color: var(--text-muted); font-size: .7rem; font-weight: 750; text-transform: uppercase; }
.profile-menu summary strong { color: var(--brand-primary); }
.profile-menu nav { position: absolute; right: 0; z-index: 30; display: grid; width: max(100%, 15rem); margin-top: .4rem; padding: .45rem; border: 1px solid var(--border); border-radius: .9rem; background: white; box-shadow: var(--shadow-md); }
.profile-menu nav a { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem; border-radius: .65rem; color: var(--text-primary); font-weight: 700; text-decoration: none; }
.profile-menu nav a:hover, .profile-menu nav a.active { background: var(--surface-alt); color: var(--brand-primary); }
.profile-menu nav a span { color: var(--success); font-size: .72rem; }
.student-dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.next-class-card, .hours-card { padding: clamp(1.2rem, 3vw, 1.7rem); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.next-class-card { background: var(--brand-primary); color: white; }
.next-class-card .card-label { color: rgba(255,255,255,.8); }
.next-class-card h2 { margin: .45rem 0; color: white; font-size: clamp(1.4rem, 3vw, 2rem); }
.next-class-card p { color: rgba(255,255,255,.82); }
.next-class-card .next-class-date { margin: .9rem 0 .2rem; color: #fff; font-size: 1.05rem; font-weight: 850; }
.next-class-card .text-link { color: white; }
.next-class-card .button { border-color: white; background: white; color: var(--brand-primary); }
.hours-card { display: flex; flex-direction: column; background: linear-gradient(145deg, #fff, var(--surface-alt)); border: 1px solid #c9daed; }
.hours-card .card-label { color: var(--brand-primary); }
.hours-card > strong { margin-top: auto; color: var(--brand-primary); font-size: clamp(2.8rem, 7vw, 4.4rem); line-height: 1; letter-spacing: -.06em; }
.hours-card > span { color: var(--text-muted); }
.hours-card .text-link { margin-top: 1rem; }
.card-label { font-size: .78rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.upcoming-section { margin-top: 1.5rem; }
.compact-bookings { display: grid; gap: .65rem; }
.compact-bookings > a { display: grid; grid-template-columns: 3.5rem 1fr auto; align-items: center; gap: .9rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 1rem; background: white; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); }
.compact-bookings time { display: grid; place-items: center; min-height: 3.5rem; border-radius: .7rem; background: var(--surface-alt); color: var(--brand-primary); text-transform: uppercase; }
.compact-bookings time strong { font-size: 1.25rem; line-height: 1; }
.compact-bookings time span { font-size: .7rem; }
.compact-bookings > a > span:nth-child(2) { display: grid; }
.compact-bookings small { margin-top: .15rem; color: var(--text-muted); }
.student-profile-details { margin-top: 1.5rem; }
.student-profile-details > details > summary { padding: 1rem; border: 1px solid var(--border); border-radius: .9rem; background: white; color: var(--brand-primary); font-weight: 800; cursor: pointer; }
.student-profile-details details[open] > summary { margin-bottom: .8rem; }
.student-profile-details .section-card p { display: flex; justify-content: space-between; gap: 1rem; }
.profile-switcher { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; padding: .7rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface-alt); }
.profile-switcher strong { margin-right: .25rem; }
.profile-switcher a { padding: .55rem .8rem; border: 1px solid #afbed0; border-radius: 99rem; background: white; color: var(--brand-primary); font-weight: 750; text-decoration: none; }
.profile-switcher a.active { border-color: var(--brand-primary); background: var(--brand-primary); color: white; }
.profile-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }

.report-panel { width: min(100%, 82rem); }
.report-tabs { margin-bottom: .75rem; }
.report-filters { grid-template-columns: 1.1fr repeat(2, 1fr) 1.5fr auto; margin-bottom: .7rem; }
.report-filters [hidden] { display: none; }
.period-label { margin: 0 0 1.25rem; color: var(--text-muted); font-size: .84rem; }
.report-list, .report-history { display: grid; gap: .75rem; }
.report-row { display: grid; grid-template-columns: minmax(12rem, 1.25fr) minmax(28rem, 3fr) auto; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 1rem; background: white; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
.report-row:hover { transform: translateY(-1px); border-color: #afc5e5; box-shadow: var(--shadow-md); }
.report-identity { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.report-metrics { display: grid; grid-template-columns: repeat(4, minmax(6rem, 1fr)); gap: .5rem; margin: 0; }
.report-metrics.instructor { grid-template-columns: repeat(5, minmax(5.5rem, 1fr)); }
.report-metrics div, .report-summary div { padding: .7rem; border-radius: .75rem; background: var(--surface-alt); }
.report-metrics dt, .report-summary dt, .history-values dt { color: var(--text-muted); font-size: .7rem; font-weight: 750; text-transform: uppercase; }
.report-metrics dd, .report-summary dd, .history-values dd { margin: .15rem 0 0; color: var(--brand-primary); font-size: 1.15rem; font-weight: 900; }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1rem 0 1.75rem; }
.report-summary.instructor { grid-template-columns: repeat(5, 1fr); }
.report-summary div { padding: 1rem; }
.report-summary dd { font-size: 1.75rem; }
.report-history { margin-top: 1rem; }
.history-card { display: grid; grid-template-columns: 7rem minmax(12rem, 1.5fr) minmax(15rem, 1fr) auto; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 1rem; background: white; box-shadow: var(--shadow-sm); }
.history-card time { display: grid; padding: .65rem; border-radius: .75rem; background: var(--surface-alt); color: var(--brand-primary); text-align: center; }
.history-card time span { font-size: .8rem; }
.history-main { display: grid; gap: .18rem; }
.history-main span, .history-main small { color: var(--text-muted); }
.history-values { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 0; }
.report-data-head, .report-data-row dl { display: grid; grid-template-columns: 1fr .75fr 1fr 1.1fr 1fr .8fr 1.2fr 1.2fr .9fr; gap: .55rem; align-items: center; }
.report-data-head { padding: 0 .8rem; color: var(--text-muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.report-data-row { padding: .8rem; border: 1px solid var(--border); border-radius: .85rem; background: white; box-shadow: var(--shadow-sm); }
.report-data-row dl { margin: 0; }
.report-data-row dl > div { min-width: 0; }
.report-data-row dt { display: none; color: var(--text-muted); font-size: .7rem; font-weight: 750; text-transform: uppercase; }
.report-data-row dd { margin: 0; overflow-wrap: anywhere; }
.report-data-row dd small { display: block; color: var(--text-muted); }
.invitation-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.invitation-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.invitation-actions form { margin: 0; }
.invitation-ready { max-width: 48rem; }
.invitation-ready label { display: grid; gap: .4rem; font-weight: 750; }
.invitation-ready input[readonly] { width: 100%; }

.login-shell { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 100vh; background: var(--surface-warm); }
.login-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem, 6vw, 5rem); background: linear-gradient(145deg, var(--surface-warm), var(--surface-alt)); }
.login-brand-panel::before, .login-brand-panel::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-brand-panel::before { width: 34rem; height: 34rem; right: -17rem; bottom: -12rem; border: 5rem solid color-mix(in srgb, var(--brand-primary) 8%, transparent); }
.login-brand-panel::after { width: 13rem; height: 13rem; right: 7%; top: 14%; border: 2rem solid color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.login-brand-panel > img { position: relative; z-index: 1; width: min(18rem, 70%); }
.login-brand-panel > div { position: relative; z-index: 1; max-width: 34rem; }
.temporary-product-mark { display: grid; gap: .35rem; width: max-content; padding: 1rem; border: 2px dashed var(--brand-accent); border-radius: .9rem; background: rgba(255,255,255,.74); }
.temporary-product-mark strong { color: var(--brand-primary); font-size: 1.35rem; }
.temporary-product-mark span { color: var(--text-muted); font-size: .68rem; font-weight: 850; letter-spacing: .08em; }
.login-brand-panel h1 { margin: .5rem 0 1rem; color: var(--brand-primary); font-size: clamp(3rem, 7vw, 5.5rem); line-height: .88; letter-spacing: -.065em; text-transform: uppercase; }
.login-brand-panel h1 span { color: var(--brand-accent); font-family: Georgia, serif; font-size: .72em; font-style: italic; font-weight: 500; text-transform: none; }
.login-brand-panel > div > p:last-child { color: var(--text-muted); font-size: 1.1rem; }
.login-card-wrap { display: grid; place-items: center; padding: 2rem; background: white; }
.login-card { width: min(100%, 26rem); }
.login-card h2 { margin: .45rem 0; color: var(--brand-primary); font-size: 2rem; }
.login-card .stacked-form { margin-top: 1.5rem; }
.login-card .button { width: 100%; margin-top: .5rem; }
.login-powered { margin-top: 2rem; text-align: left; }

.confirmation-dialog { width: min(calc(100% - 2rem), 30rem); padding: 0; border: 0; border-radius: 1.25rem; color: var(--text-primary); background: white; box-shadow: 0 1.5rem 4rem rgba(24,36,56,.3); }
.confirmation-dialog::backdrop { background: rgba(24,36,56,.68); backdrop-filter: blur(3px); }
.confirmation-dialog__content { padding: clamp(1.25rem, 5vw, 2rem); }
.confirmation-dialog__content h2 { margin-top: 0; color: var(--brand-primary); }
.confirmation-dialog__actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; }

@media (max-width: 1100px) {
  .staff-sidebar { width: 13.5rem; }
  .role-owner .app-shell, .role-admin .app-shell, .role-instructor .app-shell { width: calc(100% - 13.5rem); margin-left: 13.5rem; }
  .role-owner .messages, .role-admin .messages, .role-instructor .messages { margin-left: 13.5rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .session-filters { grid-template-columns: repeat(3, 1fr); }
  .report-row { grid-template-columns: 1fr; }
  .report-metrics, .report-metrics.instructor { grid-template-columns: repeat(4, 1fr); }
  .report-row .card-action { justify-self: end; }
  .report-filters { grid-template-columns: repeat(2, 1fr); }
  .student-list-head { display: none; }
  .student-card.student-card-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .student-card-v2 .student-card-identity { grid-column: 1 / -1; }
  .student-overview-cell, .student-status-cell { display: grid; grid-template-columns: 7.75rem minmax(0, 1fr); gap: .1rem .5rem; padding-top: .55rem; border-top: 1px solid var(--border); }
  .student-overview-cell::before, .student-status-cell::before { content: attr(data-label); grid-row: 1 / span 2; color: var(--text-muted); font-size: .65rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
  .student-overview-cell > *, .student-status-cell > * { grid-column: 2; }
  .student-status-cell { justify-items: stretch; }
}
@media (max-width: 800px) {
  .topbar { min-height: 4.5rem; }
  .customer-brand img { width: 9rem; height: 2.8rem; }
  .topbar-context { display: none; }
  .staff-sidebar { position: static; width: auto; padding: .5rem 1rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .staff-nav { display: flex; overflow-x: auto; padding-bottom: .2rem; }
  .staff-nav a { flex: 0 0 auto; min-height: 2.75rem; }
  .staff-sidebar .powered-by { display: none; }
  .role-owner .app-shell, .role-admin .app-shell, .role-instructor .app-shell { width: 100%; margin-left: 0; }
  .role-owner .messages, .role-admin .messages, .role-instructor .messages { margin-left: 0; }
  .student-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 60; justify-content: space-around; gap: 0; margin: 0; padding: .4rem max(.35rem, env(safe-area-inset-right)) calc(.4rem + env(safe-area-inset-bottom)) max(.35rem, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: rgba(255,255,255,.98); box-shadow: 0 -.4rem 1.4rem rgba(24,36,56,.08); }
  .student-nav a { flex: 1; flex-direction: column; gap: .05rem; min-width: 0; min-height: 3.6rem; padding: .35rem .2rem; font-size: .66rem; }
  .student-nav a span { font-size: 1.15rem; }
  .role-student .logout-form { margin-left: auto; }
  .student-dashboard-grid { grid-template-columns: 1fr; }
  .report-summary, .report-summary.instructor { grid-template-columns: repeat(2, 1fr); }
  .history-card { grid-template-columns: 5.5rem 1fr auto; }
  .history-values { grid-column: 2 / -1; }
  .report-data-head { display: none; }
  .report-data-row dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-data-row dt { display: block; }
  .hours-card { min-height: 12rem; }
  .tomorrow-groups { grid-template-columns: 1fr; }
  .time-window-grid, .instructor-profile-grid { grid-template-columns: 1fr; }
  .filter-grid, .session-filters, .detail-grid, .session-facts, .form-grid.two-columns, .form-grid.three-columns { grid-template-columns: 1fr; }
  .participant-card { grid-template-columns: 1fr; }
  .attendance-result { justify-items: start; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 18rem; padding: 2rem; }
  .login-brand-panel h1 { margin-top: 2rem; font-size: clamp(2.5rem, 12vw, 4rem); }
  .login-brand-panel > div > p:last-child { display: none; }
  .login-card-wrap { align-items: start; padding: 2rem 1.25rem 3rem; }
}
@media (max-width: 600px) {
  .app-shell { padding: 1rem; }
  .panel { padding: 1rem; border-radius: 1.15rem; }
  .page-title { font-size: 2.15rem; }
  .dashboard-hero, .student-welcome { align-items: stretch; flex-direction: column; }
  .date-chip { display: none; }
  .profile-menu { width: 100%; }
  .profile-menu nav { right: auto; left: 0; width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .kpi-card { padding: .9rem; }
  .kpi-card strong { font-size: 1.8rem; }
  .tomorrow-board { padding: 1.1rem; border-radius: 1.2rem; }
  .tomorrow-total { min-width: 5rem; }
  .tomorrow-total strong { font-size: 2.3rem; }
  .quick-actions { align-items: stretch; flex-direction: column; }
  .quick-actions > div { display: grid; }
  .title-row { align-items: stretch; flex-direction: column; }
  .title-row .button { width: 100%; }
  .daily-dashboard-header .page-actions { display: grid; grid-template-columns: 1fr; }
  .daily-dashboard-header .button { width: 100%; }
  .daily-controls .date-picker { align-items: stretch; flex-direction: column; }
  .daily-controls .date-picker .button { width: 100%; }
  .user-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .user-actions .button { width: 100%; }
  .student-card, .session-card, .instructor-session { grid-template-columns: 4.5rem 1fr; }
  .student-card.student-card-v2 { grid-template-columns: minmax(0, 1fr); }
  .student-card-v2 .student-card-identity { grid-column: auto; }
  .student-overview-cell, .student-status-cell { grid-template-columns: 7.25rem minmax(0, 1fr); }
  .student-card > .badge, .session-card > .badge, .session-card > .card-action, .session-card > form { grid-column: 1 / -1; }
  .balance { text-align: left; }
  .session-date { min-height: 3.7rem; }
  .form-actions, .page-actions { display: grid; grid-template-columns: 1fr; }
  .form-actions .button, .page-actions .button, .page-actions form, .page-actions form .button { width: 100%; }
  .sticky-actions { position: static; }
  .attendance-choice { grid-template-columns: 1fr 1fr; width: 100%; }
  .session-facts { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .session-facts div { padding: .75rem; }
  .attendance-save .button { width: 100%; }
  .confirmation-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .confirmation-dialog__actions .button { width: 100%; }
  .ledger > div { grid-template-columns: 1fr auto; }
  .ledger time { grid-column: 1 / -1; }
  .date-picker { align-items: stretch; flex-direction: column; }
  .availability-table fieldset { grid-template-columns: repeat(2, 1fr); }
  .compact-bookings > a { grid-template-columns: 3.25rem 1fr auto; }
  .report-metrics, .report-metrics.instructor { grid-template-columns: repeat(2, 1fr); }
  .report-row .card-action { justify-self: stretch; }
  .history-card { grid-template-columns: 4.75rem 1fr; }
  .history-card > .badge { grid-column: 1 / -1; justify-self: start; }
  .history-values { grid-column: 1 / -1; }
  .report-data-row dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 390px) {
  .topbar { padding-inline: .75rem; }
  .customer-brand img { width: 8.25rem; }
  .link-button { padding-inline: .55rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card span { min-height: 2.2em; }
  .attendance-choice { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto!important; transition: none!important; } }
