/* Canonical Lowkick visual tokens and components. site.css supplies feature geometry. */
:root {
  color-scheme: dark;
  --bg: #101012;
  --surface: #1c1c1f;
  --surface-raised: #252528;
  --surface-muted: #171719;
  --field: #131315;
  --line: #3d3d42;
  --ink: #f0ede6;
  --muted: #b6b2ac;
  --brand: #f4483a;
  --brand-dark: #ff6a5e;
  --action: #c92f27;
  --action-hover: #a92620;
  --action-text: #fff;
  --nav-bg: #111113;
  --nav-ink: #f0ede6;
  --nav-muted: #b6b2ac;
  --subtle-accent: #35201f;
  --event-bg: #3b2623;
  --event-line: #9d4c43;
  --focus-ring: rgba(244, 72, 58, .25);
  --lk-deep: #0a0a0b;
  --lk-raised: var(--surface-raised);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1eb;
  --surface: #fffdf8;
  --surface-raised: #f2eee7;
  --surface-muted: #e9e4dc;
  --field: #fff;
  --line: #c9c2b9;
  --ink: #1b1a1a;
  --muted: #5b5651;
  --brand: #ad2923;
  --brand-dark: #91221d;
  --action: #b52b24;
  --action-hover: #90211c;
  --nav-muted: #c9c4bd;
  --subtle-accent: #f7dfdc;
  --event-bg: #f6e6e2;
  --event-line: #c75a4e;
  --focus-ring: rgba(173, 41, 35, .22);
  --lk-deep: #e9e4dc;
}

html { font-size: 15px; }
body, .admin-body, .tenant-body, .access-body {
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
::selection { color: #fff; background: #b93129; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.text-muted, .small.text-muted, .text-secondary { color: var(--muted) !important; }
.text-dark, .text-reset { color: var(--ink) !important; }
.skip-link { color: #fff; background: #a92620; border-radius: 4px; }

h1, h2, h3, .section-title, .calendar-period-title {
  color: var(--ink);
  letter-spacing: -.025em;
}
h1, .display-5, .display-6, .hero-card h1 {
  font-family: Impact, 'Arial Narrow', 'Arial Black', sans-serif;
  font-weight: 900 !important;
  line-height: .98;
  text-transform: uppercase;
  letter-spacing: -.02em;
}
.display-5 { font-size: clamp(2.8rem, 5vw, 5rem); }
.display-6 { font-size: clamp(2.5rem, 4vw, 4.3rem); }
.eyebrow, .section-label, .menu-kicker {
  color: var(--brand);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.lead { color: var(--muted) !important; }

.app-shell { background: var(--nav-bg); border-bottom: 1px solid #2b2b2e; box-shadow: none; }
.admin-nav { min-height: 78px; display: flex; align-items: center; gap: 1.2rem; }
.admin-nav-divider { height: 28px; border-left: 1px solid #45454a; }
.admin-nav-label, .admin-nav-user { color: var(--nav-muted); font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.admin-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.admin-nav-link { color: var(--nav-ink); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.admin-nav-link:hover, .admin-nav-link:focus-visible { color: var(--brand); }
.admin-content { min-height: calc(100vh - 145px); padding-top: 2.5rem; padding-bottom: 3rem; }
.tenant-guest-header { background: var(--nav-bg); border-bottom: 1px solid #2b2b2e; }
.tenant-guest-nav { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tenant-guest-actions, .topbar-actions { display: flex; align-items: center; gap: 1rem; }
.tenant-body:has(.tenant-guest-header) .tenant-app-shell { min-height: calc(100vh - 78px); }
.brand-mark { color: #fff; font-family: 'Arial Black', Impact, sans-serif; font-size: 1.35rem; font-weight: 900; letter-spacing: -.065em; }
.brand-mark:hover { color: #fff; }
.brand-icon { display: block; width: 37px; height: 37px; flex-shrink: 0; }
.brand-symbol { width: 37px; height: 37px; color: #fff; background: #f4483a; border-radius: 0; font-family: 'Arial Black', Impact, sans-serif; font-size: 1rem; letter-spacing: -.14em; transform: skew(-9deg); }
.brand-dot { color: #171717; }

.tenant-sidebar { color: var(--nav-ink); background: var(--nav-bg); border-right: 1px solid #303034; box-shadow: none; }
.sidebar-brand { padding-block: 1.25rem; border-bottom: 1px solid #303034; }
.sidebar-tenant { background: #1b1b1e; border-color: #333337; border-radius: 6px; }
.sidebar-tenant-label { color: #ff766b; font-weight: 900; }
.sidebar-link, .sidebar-group summary, .sidebar-logout { color: var(--nav-muted); border-radius: 4px; }
.sidebar-link i, .sidebar-group summary > span > i, .sidebar-chevron { color: #aaa6a0; }
.sidebar-link:hover, .sidebar-group summary:hover, .sidebar-logout:hover,
.sidebar-link:focus-visible, .sidebar-group summary:focus-visible, .sidebar-logout:focus-visible { color: #fff; background: #29292d; }
.sidebar-link.is-active { color: #fff; background: #36201f; box-shadow: inset 3px 0 #f4483a; }
.sidebar-link.is-active i { color: #ff766b; }
.sidebar-group { margin-top: .45rem; }
.sidebar-group summary { color: var(--nav-ink); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-subnav, .sidebar-footer { border-color: #333337; }
.sidebar-collapse { color: var(--nav-ink); background: #29292d; border-radius: 4px; }
.sidebar-close { color: var(--nav-ink); }
.tenant-topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-page { color: var(--ink); font-weight: 800; }
.topbar-home, .sidebar-toggle { color: var(--ink); }
.topbar-home:hover, .sidebar-toggle:hover { color: var(--brand); }
.tenant-main { padding-top: 2.5rem; }
.footer { color: var(--muted); background: var(--surface-muted); border-color: var(--line); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.footer .text-muted { color: var(--muted) !important; }
.theme-toggle { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: .5rem; padding: .4rem .7rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); background: var(--surface-raised); }
.app-shell .theme-toggle, .tenant-guest-header .theme-toggle { color: var(--nav-ink); background: #242427; border-color: #55545a; }
.app-shell .theme-toggle:hover, .tenant-guest-header .theme-toggle:hover { color: #fff; border-color: #f4483a; }
.app-shell .btn-outline-light { color: #fff; border-color: #78767a; background: transparent; }
.app-shell .btn-outline-light:hover { color: #fff; background: #a92620; border-color: #a92620; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }

.hero-card, .panel-card, .stat-card, .menu-card, .quick-action,
.crud-list, .academy-item, .empty-state, .login-brand-badge,
.selected-class-card, .modal-selected-class-card {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  backdrop-filter: none;
}
.hero-card { position: relative; overflow: hidden; border-top: 3px solid var(--brand); }
.hero-card::before { content: ''; position: absolute; width: 18rem; height: 18rem; top: -12rem; right: -5rem; border: 1px solid var(--event-line); border-radius: 50%; opacity: .28; pointer-events: none; }
.hero-card > * { position: relative; }
.stat-card { border-left: 2px solid var(--brand); }
.financial-applied-period {
  margin: 0 0 1.25rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-raised);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.1rem, 1rem + .5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}
.stats-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.hero-card .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.stats-grid .stat-card { min-width: 0; }
.stat-card span { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .11em; }
.stat-card strong { overflow-wrap: anywhere; font-family: Impact, 'Arial Narrow', sans-serif; font-size: clamp(1.6rem,2.4vw,2.5rem); font-weight: 900; }
.dashboard-hero-copy { max-width: 50rem; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; margin-top: 1.75rem; }
.dashboard-stats .stat-card { min-width: 0; padding: 1rem; }
.dashboard-stats .stat-card strong { overflow-wrap: anywhere; font-size: clamp(1.75rem,2.5vw,2.5rem); }
.menu-card:hover, .quick-action:hover, .academy-item:hover, .crud-icon-button:hover { background: var(--lk-raised); border-color: var(--brand); box-shadow: none; }
.menu-card h2, .section-title { font-weight: 800; text-transform: uppercase; }
.menu-card p, .quick-action small, .dashboard-metric-row span { color: var(--muted); }
.muted-card { opacity: .8; }
.quick-action-icon { color: var(--brand); background: var(--subtle-accent); border-radius: 4px; }
.quick-action > i, .dashboard-metric-row i { color: var(--brand); }
.tenant-hero, .class-calendar-shell, .class-session-modal { border-color: var(--line); }
.academy-item { gap: 1rem; }
.tenant-entry, .login-link { color: var(--brand); }
.empty-state { border-style: dashed; }
.crud-icon-button { color: var(--ink); background: var(--surface-raised); border-color: var(--line); border-radius: 4px; }
.status-toggle-label { color: var(--muted); }

.btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: .35rem; border-radius: 4px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.btn-sm, .btn-group-sm > .btn { min-height: 34px; }
.btn-lg { min-height: 48px; }
.btn-brand, .btn-tenant, .btn-primary { color: var(--action-text); background: var(--action); border: 1px solid var(--action); }
.btn-brand:hover, .btn-brand:focus, .btn-tenant:hover, .btn-tenant:focus,
.btn-primary:hover, .btn-primary:focus { color: #fff; background: var(--action-hover); border-color: var(--action-hover); box-shadow: none; }
.btn-outline-dark, .btn-outline-light, .btn-outline-primary, .btn-outline-secondary, .btn-secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn-outline-dark:hover, .btn-outline-light:hover, .btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-secondary:hover { color: var(--ink); border-color: var(--brand); background: var(--subtle-accent); }
.btn-outline-danger { color: #e86a67; border-color: #a94b49; background: transparent; }
.btn-outline-danger:hover { color: #fff; border-color: #a12525; background: #a12525; }
:root[data-theme="light"] .btn-outline-danger { color: #a12525; border-color: #a12525; }
.btn-light { color: var(--ink); background: var(--surface-raised); border-color: var(--line); }
.btn-link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled, .btn.disabled, .btn[aria-disabled="true"] { opacity: .48; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible, .theme-toggle:focus-visible, .form-control:focus-visible, .form-select:focus-visible, .form-check-input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.form-label, label { color: var(--ink); }
.form-control, .form-select, .input-group-text, .form-check-input,
.form-control:disabled, .form-select:disabled {
  color: var(--ink);
  background-color: var(--field);
  border-color: var(--line);
  border-radius: 4px;
}
.form-control, .form-select { min-height: 40px; }
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-control:focus, .form-select:focus, .form-check-input:focus { color: var(--ink); background: var(--field); border-color: var(--brand); box-shadow: 0 0 0 .2rem var(--focus-ring); }
.form-check-input:checked { background-color: var(--action); border-color: var(--action); }
.form-control:disabled, .form-select:disabled { opacity: .6; background: var(--surface-raised); }
.form-text { color: var(--muted); }
.text-danger, .field-validation-error { color: #ff8580 !important; }
:root[data-theme="light"] .text-danger, :root[data-theme="light"] .field-validation-error { color: #a12525 !important; }

.table { --bs-table-color: var(--ink); --bs-table-bg: transparent; --bs-table-border-color: var(--line); --bs-table-hover-color: var(--ink); --bs-table-hover-bg: var(--surface-raised); color: var(--ink); }
.table > :not(caption) > * > * { color: var(--ink); background: transparent; border-bottom-color: var(--line); padding: .85rem .7rem; vertical-align: middle; }
.table thead th { color: var(--muted) !important; background: var(--surface-raised) !important; font-size: .69rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-raised); }
.crud-list .table-responsive { border-radius: inherit; }
.panel-card:has(> .table) { overflow-x: auto; }
.panel-card:has(> .table) > .table { min-width: 640px; }
.alert { border-radius: 6px; }
.alert-danger { color: #ffd3cf; background: #462320; border-color: #9d4c42; }
.alert-warning { color: #f4ddb1; background: #3b3020; border-color: #90704a; }
.alert-success { color: #d7f4df; background: #1e3d31; border-color: #3a8361; }
:root[data-theme="light"] .alert-danger { color: #84231e; background: #f8e2df; border-color: #ce7970; }
:root[data-theme="light"] .alert-warning { color: #624012; background: #f9edce; border-color: #b89759; }
:root[data-theme="light"] .alert-success { color: #15532a; background: #dff1e3; border-color: #69a878; }
.badge, .status-pill { border-radius: 4px; font-weight: 800; letter-spacing: .03em; }
.card, .list-group-item, .dropdown-menu, .modal-content, .accordion-item, .toast {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  border-radius: 8px;
}
.dropdown-item, .list-group-item-action { color: var(--ink); }
.dropdown-item:hover, .dropdown-item:focus, .list-group-item-action:hover { color: var(--ink); background: var(--subtle-accent); }
.modal-header, .modal-footer, .accordion-button { color: var(--ink); background: var(--surface); border-color: var(--line); }
.accordion-button:not(.collapsed) { color: var(--brand); background: var(--subtle-accent); box-shadow: none; }
.page-link { color: var(--ink); background: var(--surface); border-color: var(--line); border-radius: 4px !important; }
.page-link:hover, .page-item.active .page-link { color: #fff; background: var(--action); border-color: var(--action); }
.progress { background: var(--surface-raised); border-radius: 4px; }
.progress-bar { background: var(--action); }
.nav-tabs { border-color: var(--line); }
.nav-tabs .nav-link { color: var(--muted); border-radius: 4px 4px 0 0; }
.nav-tabs .nav-link:hover { color: var(--ink); border-color: var(--line); }
.nav-tabs .nav-link.active { color: var(--ink); background: var(--surface); border-color: var(--line) var(--line) var(--surface); }
.spinner-border { color: var(--brand); }
.placeholder { background: var(--surface-raised); }
.loading-state { display: flex; align-items: center; justify-content: center; gap: .75rem; min-height: 8rem; padding: 1.5rem; color: var(--muted); }
.status-active { color: #d4f5dd; background: #1f4832; }
.status-pending { color: #f8e8b8; background: #554322; }
.status-cancelled { color: #ffd6d3; background: #65302d; }
.status-inactive, .status-suspended { color: #e1deda; background: #45454b; }
:root[data-theme="light"] .status-active { color: #15532a; background: #d9efdf; }
:root[data-theme="light"] .status-pending { color: #684712; background: #f7eac6; }
:root[data-theme="light"] .status-cancelled { color: #8e2520; background: #f5d8d4; }
:root[data-theme="light"] .status-inactive, :root[data-theme="light"] .status-suspended { color: #4e4b49; background: #e3dfd9; }

.login-page-shell { padding-top: 3rem; padding-bottom: 4rem; }
.login-side { background: var(--surface); border-top: 3px solid var(--brand); }
.login-side::after { border: 1px solid rgba(244,72,58,.18); background: none; }
.login-side-admin, .login-side-tenant { background: var(--surface); }
.login-form-card { background: var(--surface); }
.login-feature-list { color: var(--muted); }
.login-feature-list > div { padding-top: 1rem; border-top: 1px solid var(--line); }
.login-brand-badge { border-left: 2px solid var(--brand); }
.login-brand-badge span { color: var(--brand); }
.login-brand-badge strong { color: var(--ink); }
.login-form-card .form-label { font-size: .72rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }

/* Calendar: keep its interaction geometry; theme and layout come from these rules. */
.class-calendar-shell { overflow: hidden; }
.class-calendar-toolbar { align-items: flex-start; gap: 1.5rem; }
.class-calendar-toolbar > div:first-child { max-width: 38rem; }
.class-calendar-toolbar-actions { align-items: center; gap: .75rem; }
.calendar-date-nav { display: flex; align-items: center; gap: .45rem; padding-right: .75rem; border-right: 1px solid var(--line); }
.class-calendar-summary { display: grid; grid-template-columns: minmax(180px,1.25fr) repeat(4,minmax(130px,1fr)); align-items: stretch; gap: .65rem; padding: .8rem; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; }
.class-calendar-summary > div:first-child { display: flex; flex-direction: column; justify-content: center; padding: .4rem .6rem; }
.calendar-period-label, .calendar-selection-label { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .1em; }
.calendar-period-title { color: var(--ink); font-size: 1.25rem; line-height: 1.2; }
.calendar-summary-chip { min-width: 0; padding: .7rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.calendar-summary-hours { margin-left: 0; }
.calendar-summary-chip strong { color: var(--ink); font-size: clamp(1rem, 1.5vw, 1.3rem); line-height: 1.15; }
.calendar-summary-chip span { color: var(--muted); font-size: .76rem; line-height: 1.35; margin-top: .3rem; }
.calendar-selection-banner { flex-direction: row; align-items: center; padding: 1rem 1.1rem; background: var(--surface-raised); border: 1px solid var(--brand); border-left: 4px solid var(--brand); border-radius: 8px; }
.calendar-selection-banner strong, .calendar-selection-banner .small { color: var(--ink) !important; }
.calendar-selection-label { color: var(--brand); }
.class-calendar-grid { min-width: 0; overflow-x: auto; padding-bottom: .5rem; }
.time-column { position: sticky; z-index: 4; left: 0; background: var(--surface); }
.time-slot-label, .calendar-day-head span, .month-cell-head small { color: var(--muted); }
.calendar-columns.is-week-view { grid-template-columns: repeat(var(--calendar-day-count), minmax(0,1fr)); }
.calendar-day-head, .calendar-day-body, .month-cell, .calendar-draft-popover-card, .class-session-modal,
.schedule-builder-form-card, .schedule-preview-card { color: var(--ink); background: var(--surface); border-color: var(--line); }
.calendar-day-head { border-radius: 6px 6px 0 0; }
.calendar-day-head.is-selected, .month-cell.is-selected { background: var(--subtle-accent); border-color: var(--brand); }
.calendar-day-body { background: var(--surface-muted); border-radius: 0 0 6px 6px; }
.calendar-hour-line { border-top-color: var(--line); }
.calendar-block, .month-item { color: var(--ink); background: var(--event-bg); border: 1px solid var(--event-line); border-radius: 5px; box-shadow: none; }
.calendar-block:hover, .month-item:hover { color: var(--ink); border-color: var(--brand); filter: brightness(1.06); }
.calendar-block.is-selected { outline: 2px solid var(--brand); outline-offset: 2px; }
.calendar-block span, .month-item span { color: var(--muted); font-weight: 700; }
.month-cell { border-radius: 6px; }
.month-cell.is-muted { opacity: .7; }
.month-cell.is-selected { box-shadow: none; }
.calendar-draft-selection, .schedule-preview-block.is-draft { background: var(--subtle-accent); border-color: var(--brand); }
.calendar-draft-popover-card { backdrop-filter: none; border-radius: 8px; box-shadow: 0 18px 40px rgba(0,0,0,.2); }
.class-session-modal { border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.class-session-modal .modal-header, .class-session-modal .modal-body { color: var(--ink); background: var(--surface); border-color: var(--line); }
:root:not([data-theme="light"]) .btn-close { filter: invert(1) grayscale(100%); }
.selection-metadata div { border-color: var(--line); }
.selection-metadata dt { color: var(--muted); }
.selected-class-card, .modal-selected-class-card { background: var(--surface-raised); }
.floating-toast { border-radius: 6px; }
.modal-backdrop { --bs-backdrop-bg: #000; }

.access-main { min-height: calc(100vh - 165px); padding-block: clamp(3rem,7vw,7rem); }
.access-main > h1 { max-width: 700px; }
.access-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-top: 2rem; }
.access-card { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; min-height: 235px; }
.access-card h2 { margin: .3rem 0 0; font-weight: 800; text-transform: uppercase; }
.access-card p { color: var(--muted); }
.access-card .btn { margin-top: auto; }
.calendar-scroll-hint { display: none; color: var(--muted); font-size: .76rem; font-weight: 700; margin: 0 0 .6rem; }

@media (max-width: 1399.98px) {
  .class-calendar-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .class-calendar-summary > div:first-child { grid-column: 1 / -1; }
  .class-calendar-toolbar-actions { justify-content: flex-start; }
}

@media (max-width: 991.98px) {
  .class-calendar-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calendar-columns.is-week-view { min-width: max(100%, calc(var(--calendar-day-count) * 174px)); grid-template-columns: repeat(var(--calendar-day-count), minmax(174px,1fr)); overflow: visible; }
  .class-calendar-grid { grid-template-columns: 56px minmax(0,1fr); }
  .calendar-date-nav { padding-right: 0; border-right: 0; }
  .calendar-scroll-hint { display: block; }
}

@media (max-width: 767.98px) {
  .admin-nav { flex-wrap: wrap; gap: .65rem; padding-block: .9rem; }
  .admin-nav-actions { width: 100%; margin-left: 0; gap: .9rem; flex-wrap: wrap; }
  .admin-nav-user { display: none; }
  .admin-content { padding-top: 1.5rem; }
  .academy-item { align-items: flex-start; flex-direction: column; }
  .academy-item > .text-end { width: 100%; text-align: left !important; }
  .academy-item .justify-content-end { justify-content: flex-start !important; }
  .access-grid { grid-template-columns: 1fr; }
  .tenant-guest-actions .admin-nav-label, .theme-toggle [data-theme-label] { display: none; }
  .theme-toggle { min-width: 38px; }
  .class-calendar-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .class-calendar-summary > div:first-child { grid-column: 1 / -1; }
  .class-calendar-toolbar-actions { width: 100%; justify-content: flex-start; }
  .class-calendar-grid { display: grid; grid-template-columns: 48px minmax(0,1fr); }
  .time-column { display: block; }
  .calendar-columns.is-week-view { min-width: calc(var(--calendar-day-count) * 174px); grid-template-columns: repeat(var(--calendar-day-count), minmax(174px,1fr)); overflow: visible; }
  .calendar-columns.is-day-view { min-width: 0; grid-template-columns: minmax(0,1fr); }
  .calendar-selection-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid, .hero-card .stats-grid { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .class-calendar-summary { grid-template-columns: 1fr; }
  .class-calendar-toolbar-actions { align-items: flex-start; flex-direction: column; }
  .calendar-date-nav { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Contextual tasks: one modal drawer, using the shared theme in both modes. */
.task-drawer { --bs-offcanvas-width: min(640px, 100vw); --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--ink); --bs-offcanvas-border-color: var(--line); }
.task-drawer .offcanvas-header { gap: 1rem; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.task-drawer .offcanvas-header > div { min-width: 0; overflow-wrap: anywhere; }
.task-drawer .btn-close { flex-shrink: 0; }
:root:not([data-theme="light"]) .task-drawer .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.task-drawer-content { display: flex; flex: 1; min-height: 0; overflow: auto; }
.task-drawer-message:empty { display: none; }
.task-drawer-message { padding: .75rem 1rem; flex-shrink: 0; overflow-wrap: anywhere; }
.task-drawer-confirm { padding: 1rem; border-bottom: 1px solid var(--line); background: var(--surface-raised); flex-shrink: 0; }
@media (max-width: 767.98px) { .task-drawer { --bs-offcanvas-width: 100vw; } }

/* Instructor identity is independent from class status. */
:root .class-calendar-shell .calendar-block, :root .class-calendar-shell .month-item {
  color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line);
  border-inline-start: 5px solid var(--instructor-accent, #858585);
}
.class-calendar-shell .calendar-block.is-selected, .class-calendar-shell .month-item.is-selected,
.class-calendar-shell .calendar-block:focus-visible, .class-calendar-shell .month-item:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
}
.class-calendar-shell .is-busy { --instructor-accent: #858585; cursor: default; }
.calendar-color-swatch { display: inline-block; width: 1rem; height: 1rem; flex: 0 0 1rem; border-radius: 3px; background: var(--instructor-accent, #858585); }
.calendar-color-choice input:focus-visible + .calendar-color-swatch { outline: 3px solid var(--ink); outline-offset: 3px; }
.calendar-color-choice input:checked + .calendar-color-swatch { outline: 2px solid var(--ink); outline-offset: 2px; }
.calendar-instructor-legend { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: .75rem; margin-bottom: 1rem; }

.task-drawer-footer { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:.75rem; padding:1rem; border-top:1px solid var(--line); background:var(--surface); flex-shrink:0; }
.task-drawer fieldset { min-width:0; }
.task-drawer select, .task-drawer input, .task-drawer textarea { max-width:100%; }

/* The drag copy lives outside the calendar shell and keeps its instructor stripe. */
.calendar-drag-preview.calendar-block, .calendar-drag-preview.month-item { color:var(--ink); background:var(--event-bg); opacity:.88; border:2px dashed var(--brand); border-inline-start:5px solid var(--instructor-accent); box-shadow:0 .3rem 1rem #0004; }

.calendar-slot-eye { color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:4px; text-decoration:none; }
.calendar-slot-eye:hover, .calendar-slot-eye:focus-visible { color:var(--ink); border-color:var(--brand); outline:2px solid var(--brand); outline-offset:1px; }

.calendar-slot-trash { color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:4px; }
.calendar-slot-trash:hover, .calendar-slot-trash:focus-visible { color:var(--brand); border-color:var(--brand); outline:2px solid var(--brand); outline-offset:1px; }

/* Academy display names can use the full validated length without widening headers. */
.page-heading > div { min-width:0; max-width:100%; overflow-wrap:anywhere; }


/* Brazilian manual date entry plus an opt-in native calendar control. */
.date-field { display: flex; align-items: stretch; gap: .5rem; width: 100%; }
.date-field > .form-control { flex: 1 1 auto; min-width: 0; }
.date-field-calendar { position: relative; display: inline-flex; flex: 0 0 2.75rem; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--field); }
.date-field-calendar:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.date-field-calendar:has(input:disabled) { opacity: .6; }
.date-field-calendar svg { pointer-events: none; }
.date-field-calendar input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; color-scheme: dark; }
.date-field-calendar input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
:root[data-theme="light"] .date-field-calendar input { color-scheme: light; }
