/* ==========================================================================
   School Timetable – design system (on top of Bootstrap 5.3)
   ========================================================================== */

/* Inter (variable, latin) – served locally from public/vendor, no internet needed */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../vendor/inter/inter-latin-wght-normal.woff2') format('woff2-variations'), url('../vendor/inter/inter-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --tt-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --tt-bg: #f4f6fb;
    --tt-surface: #ffffff;
    --tt-surface-2: #f8fafc;
    --tt-border: #e7ebf3;
    --tt-border-strong: #d6dce8;
    --tt-text: #0f172a;
    --tt-text-2: #334155;
    --tt-muted: #64748b;
    --tt-subtle: #94a3b8;

    --tt-primary: #4f46e5;
    --tt-primary-hover: #4338ca;
    --tt-primary-active: #3730a3;
    --tt-primary-soft: #eef0ff;
    --tt-primary-soft-2: #e0e4ff;
    --tt-violet: #7c3aed;

    --tt-success: #059669;
    --tt-success-soft: #e8f8f1;
    --tt-warning: #d97706;
    --tt-warning-soft: #fff5e1;
    --tt-danger: #dc2626;
    --tt-danger-soft: #fdeeee;
    --tt-info: #0284c7;
    --tt-info-soft: #e6f4fb;

    --tt-radius: 14px;
    --tt-radius-sm: 10px;
    --tt-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --tt-shadow-md: 0 4px 12px -2px rgba(16, 24, 40, .08);
    --tt-shadow-lg: 0 16px 36px -14px rgba(30, 27, 75, .32);
    --tt-sidebar-w: 264px;

    /* Bootstrap overrides */
    --bs-body-font-family: var(--tt-font);
    --bs-body-font-size: .925rem;
    --bs-body-color: var(--tt-text);
    --bs-body-bg: var(--tt-bg);
    --bs-border-color: var(--tt-border);
    --bs-secondary-color: var(--tt-muted);
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-primary-bg-subtle: var(--tt-primary-soft);
    --bs-primary-text-emphasis: var(--tt-primary-active);
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color: #4338ca;
    --bs-link-hover-color-rgb: 67, 56, 202;
    --bs-border-radius: 10px;
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: 14px;
    --bs-focus-ring-color: rgba(79, 70, 229, .25);
}

body {
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    background: var(--tt-bg);
}

.tabular { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0; }
.text-muted-2 { color: var(--tt-muted) !important; }
.text-subtle { color: var(--tt-subtle) !important; }
.fw-800 { font-weight: 800 !important; }
.small-caps { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--tt-muted); }
a { text-decoration: none; }

/* ------------------------------------------------------------------ App shell */

.app { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-sidebar {
    --bs-offcanvas-width: var(--tt-sidebar-w);
    width: var(--tt-sidebar-w);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(124, 58, 237, .28), transparent 40%),
        linear-gradient(180deg, #0e1335 0%, #161a44 55%, #1e1856 100%);
    color: #c7cbe6;
    display: flex;
    flex-direction: column;
    border-right: 0 !important;
}
@media (min-width: 992px) {
    .app-sidebar { position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
}

.sidebar-brand { display: flex; align-items: center; gap: .8rem; padding: 1.35rem 1.25rem 1rem; color: #fff; }
.sidebar-brand:hover { color: #fff; }
.brand-logo {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center; color: #fff; font-size: 1.2rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    box-shadow: 0 10px 22px -8px rgba(139, 92, 246, .75);
}
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; line-height: 1.15; color: #fff; }
.brand-sub { font-size: .74rem; color: #8b92c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }

.sidebar-nav { padding: .25rem .75rem 1rem; overflow-y: auto; flex: 1; }
.nav-section { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: #6a71a8; font-weight: 700; padding: 1.1rem .8rem .45rem; }
.side-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .58rem .8rem; margin-bottom: 2px; border-radius: 10px;
    color: #c3c7e5; font-weight: 500; font-size: .89rem;
    transition: background .15s, color .15s;
}
.side-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; opacity: .85; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.active {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 10px 22px -10px rgba(99, 102, 241, .9);
}
.side-link.active i { opacity: 1; }

.sidebar-footer { padding: 1rem; }
.sidebar-status {
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 12px; padding: .9rem; font-size: .8rem; color: #c3c7e5;
}
.sidebar-status .title { color: #fff; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.sidebar-status a { color: #a5b4fc; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.ok { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.status-dot.warn { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .2); }
.status-dot.off { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, .2); }

/* Top bar */
.app-topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: 1rem;
    padding: .7rem 1.5rem;
    background: rgba(244, 246, 251, .82);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--tt-border);
}
.topbar-crumb { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--tt-muted); min-width: 0; }
.topbar-crumb .current { color: var(--tt-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--tt-surface); border: 1px solid var(--tt-border);
    border-radius: 999px; padding: .32rem .75rem; font-size: .78rem; color: var(--tt-text-2); font-weight: 500;
}
.user-btn {
    display: inline-flex; align-items: center; gap: .55rem;
    background: var(--tt-surface); border: 1px solid var(--tt-border); border-radius: 999px;
    padding: .2rem .65rem .2rem .2rem; font-size: .85rem; font-weight: 600; color: var(--tt-text);
}
.user-btn:hover { border-color: var(--tt-border-strong); }

.app-content { padding: 1.5rem; flex: 1; }
@media (min-width: 1200px) { .app-content { padding: 1.75rem 2.25rem 2.5rem; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.page-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -.025em; margin: 0; }
.page-subtitle { color: var(--tt-muted); margin: .3rem 0 0; font-size: .9rem; }
.page-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Buttons */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-font-size: .86rem;
    --bs-btn-padding-x: .95rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .32rem; --bs-btn-font-size: .8rem; --bs-btn-border-radius: 8px; }
.btn-lg { --bs-btn-padding-x: 1.25rem; --bs-btn-padding-y: .75rem; --bs-btn-font-size: .95rem; --bs-btn-border-radius: 12px; }

.btn-primary {
    --bs-btn-bg: var(--tt-primary); --bs-btn-border-color: var(--tt-primary);
    --bs-btn-hover-bg: var(--tt-primary-hover); --bs-btn-hover-border-color: var(--tt-primary-hover);
    --bs-btn-active-bg: var(--tt-primary-active); --bs-btn-active-border-color: var(--tt-primary-active);
    --bs-btn-disabled-bg: var(--tt-primary); --bs-btn-disabled-border-color: var(--tt-primary);
    box-shadow: 0 1px 2px rgba(79, 70, 229, .3), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-gradient {
    color: #fff; border: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .8);
}
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(1.08); box-shadow: 0 10px 24px -8px rgba(99, 102, 241, .95); }
.btn-gradient:disabled { color: #fff; opacity: .6; }

.btn-white, .btn-light, .btn-outline-secondary {
    --bs-btn-color: var(--tt-text); --bs-btn-bg: #fff; --bs-btn-border-color: var(--tt-border-strong);
    --bs-btn-hover-color: var(--tt-text); --bs-btn-hover-bg: var(--tt-surface-2); --bs-btn-hover-border-color: #c6cede;
    --bs-btn-active-color: var(--tt-text); --bs-btn-active-bg: #eef2f7; --bs-btn-active-border-color: #c6cede;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.btn-soft-primary { --bs-btn-color: var(--tt-primary); --bs-btn-bg: var(--tt-primary-soft); --bs-btn-border-color: transparent; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--tt-primary); --bs-btn-hover-border-color: var(--tt-primary); --bs-btn-active-bg: var(--tt-primary-hover); --bs-btn-active-color: #fff; }
.btn-soft-danger { --bs-btn-color: var(--tt-danger); --bs-btn-bg: var(--tt-danger-soft); --bs-btn-border-color: transparent; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--tt-danger); --bs-btn-hover-border-color: var(--tt-danger); --bs-btn-active-bg: #b91c1c; --bs-btn-active-color: #fff; }
.btn-soft-success { --bs-btn-color: var(--tt-success); --bs-btn-bg: var(--tt-success-soft); --bs-btn-border-color: transparent; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--tt-success); }
.btn-pdf { --bs-btn-color: #fff; --bs-btn-bg: #e11d48; --bs-btn-border-color: #e11d48; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #be123c; --bs-btn-hover-border-color: #be123c; --bs-btn-active-bg: #9f1239; --bs-btn-active-color: #fff; box-shadow: 0 6px 16px -8px rgba(225, 29, 72, .8); }
.btn-icon { width: 34px; height: 34px; padding: 0 !important; }
.btn-sm.btn-icon { width: 30px; height: 30px; }
.btn-hero { background: #fff; color: #3730a3; border: 0; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .35); }
.btn-hero:hover { background: #f5f3ff; color: #312e81; }
.btn-hero-ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.btn-hero-ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* ------------------------------------------------------------------ Cards */

.card {
    --bs-card-border-color: var(--tt-border);
    --bs-card-border-radius: var(--tt-radius);
    --bs-card-inner-border-radius: calc(var(--tt-radius) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-x: 1.25rem;
    --bs-card-spacer-y: 1.25rem;
    box-shadow: var(--tt-shadow);
}
.card-header { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--tt-border); }
.card-header .card-heading { font-weight: 700; font-size: .95rem; margin: 0; letter-spacing: -.01em; }
.card-header .card-hint { color: var(--tt-muted); font-size: .8rem; margin: 0; }
.card-footer { background: var(--tt-surface-2); border-top: 1px solid var(--tt-border); padding: .9rem 1.25rem; }
.card-hover { transition: transform .15s, box-shadow .15s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--tt-shadow-lg); }

.icon-chip { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem; flex-shrink: 0; }
.icon-chip.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 1.35rem; }
.chip-primary { background: var(--tt-primary-soft); color: var(--tt-primary); }
.chip-success { background: var(--tt-success-soft); color: var(--tt-success); }
.chip-warning { background: var(--tt-warning-soft); color: var(--tt-warning); }
.chip-danger { background: var(--tt-danger-soft); color: var(--tt-danger); }
.chip-info { background: var(--tt-info-soft); color: var(--tt-info); }
.chip-violet { background: #f3edff; color: #7c3aed; }
.chip-rose { background: #ffeef2; color: #e11d48; }
.chip-slate { background: #eef2f7; color: #475569; }

.grad-indigo { background: linear-gradient(135deg, #818cf8, #4f46e5); color: #fff; }
.grad-emerald { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.grad-amber { background: linear-gradient(135deg, #fbbf24, #ea580c); color: #fff; }
.grad-sky { background: linear-gradient(135deg, #38bdf8, #0369a1); color: #fff; }
.grad-violet { background: linear-gradient(135deg, #c084fc, #7c3aed); color: #fff; }
.grad-rose { background: linear-gradient(135deg, #fb7185, #e11d48); color: #fff; }

/* Stat cards */
.stat-card { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; color: inherit; }
.stat-card:hover { color: inherit; }
.stat-card .icon-chip { box-shadow: 0 8px 18px -10px rgba(15, 23, 42, .45); }
.stat-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--tt-muted); font-size: .8rem; margin-top: .35rem; font-weight: 500; }
.stat-arrow { margin-left: auto; color: var(--tt-subtle); transition: transform .15s, color .15s; }
.card-hover:hover .stat-arrow { transform: translateX(3px); color: var(--tt-primary); }

.metric { background: var(--tt-surface-2); border: 1px solid var(--tt-border); border-radius: 12px; padding: .8rem .9rem; }
.metric .value { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric .label { font-size: .74rem; color: var(--tt-muted); font-weight: 500; }

/* Hero */
.hero {
    position: relative; overflow: hidden; color: #fff;
    border-radius: 18px; padding: 1.75rem 1.75rem 1.6rem;
    background:
        radial-gradient(circle at 88% 12%, rgba(196, 181, 253, .55), transparent 38%),
        radial-gradient(circle at 70% 120%, rgba(56, 189, 248, .35), transparent 45%),
        linear-gradient(135deg, #1e1b4b 0%, #4338ca 50%, #7c3aed 100%);
    box-shadow: var(--tt-shadow-lg);
}
.hero::after {
    content: ''; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px;
    border-radius: 50%; border: 40px solid rgba(255, 255, 255, .06);
}
.hero h2 { font-weight: 800; letter-spacing: -.03em; font-size: 1.6rem; margin: 0; }
.hero p { color: rgba(255, 255, 255, .78); margin: .35rem 0 0; }
.hero-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px; padding: .3rem .75rem; font-size: .78rem; font-weight: 500; color: #fff;
}
.hero-now { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; padding: .9rem 1rem; min-width: 220px; position: relative; z-index: 1; }
.hero-now .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .7); font-weight: 700; }
.hero-now .value { font-size: 1.15rem; font-weight: 800; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

/* ------------------------------------------------------------------ Tables */

.table {
    --bs-table-color: var(--tt-text);
    --bs-table-border-color: var(--tt-border);
    --bs-table-hover-bg: #f8f9ff;
    --bs-table-striped-bg: var(--tt-surface-2);
    margin-bottom: 0;
}
.table > thead th {
    background: var(--tt-surface-2); color: var(--tt-muted);
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    padding: .75rem 1rem; white-space: nowrap; border-bottom: 1px solid var(--tt-border);
}
.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td { padding: .85rem 1rem; }
.table-sm > tbody > tr > td, .table-sm > tbody > tr > th, .table-sm > thead > tr > th, .table-sm > tfoot > tr > td { padding: .55rem .9rem; }
.table > tbody > tr:last-child > td, .table > tbody > tr:last-child > th { border-bottom: 0; }
.table > tfoot td { background: var(--tt-surface-2); font-weight: 700; border-top: 1px solid var(--tt-border); border-bottom: 0; }
.table-card { border-radius: var(--tt-radius); overflow: hidden; }
.table .row-warning > * { background: #fffbeb !important; }
.table .row-danger > * { background: #fef2f2 !important; }

/* ------------------------------------------------------------------ Forms */

.form-label { font-weight: 600; font-size: .82rem; color: var(--tt-text-2); margin-bottom: .4rem; }
.form-control, .form-select {
    border-color: var(--tt-border-strong); border-radius: 10px;
    padding: .55rem .8rem; font-size: .9rem; color: var(--tt-text);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(79, 70, 229, .13); }
.form-control-sm, .form-select-sm { padding: .36rem .6rem; font-size: .82rem; border-radius: 8px; }
.form-select-sm { padding-right: 1.8rem; }
.form-text { color: var(--tt-subtle); font-size: .78rem; }
.input-group-text { background: var(--tt-surface-2); border-color: var(--tt-border-strong); color: var(--tt-muted); font-size: .85rem; }
.form-check-input { border-color: #c2cad8; }
.form-check-input:checked { background-color: var(--tt-primary); border-color: var(--tt-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(79, 70, 229, .13); border-color: #a5b4fc; }
.form-switch { padding-left: 3.1em; }
.form-switch .form-check-input { width: 2.5em; height: 1.35em; margin-top: .1em; margin-left: -3.1em; cursor: pointer; }
.form-control-color { height: 42px; padding: .3rem; }

.search-box { position: relative; }
.search-box i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--tt-subtle); }
.search-box .form-control { padding-left: 2.3rem; }

/* Selectable tiles (checkbox / radio cards) */
.tile-check { position: relative; }
.tile-check input { position: absolute; opacity: 0; pointer-events: none; }
.tile-check label {
    display: flex; align-items: center; gap: .6rem; cursor: pointer;
    border: 1.5px solid var(--tt-border-strong); border-radius: 12px;
    padding: .65rem .8rem; font-weight: 600; font-size: .88rem; background: #fff;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.tile-check label:hover { border-color: #a5b4fc; }
.tile-check label .tick { margin-left: auto; color: var(--tt-primary); opacity: 0; transition: opacity .15s; }
.tile-check input:checked + label { border-color: var(--tt-primary); background: var(--tt-primary-soft); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.tile-check input:checked + label .tick { opacity: 1; }
.tile-check input:focus-visible + label { box-shadow: 0 0 0 4px rgba(79, 70, 229, .25); }

/* Day toggle pills */
.day-toggle { display: inline-block; }
.day-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.day-toggle span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 3.4rem;
    padding: .42rem .7rem; border-radius: 999px; border: 1.5px solid var(--tt-border-strong);
    font-weight: 600; font-size: .8rem; cursor: pointer; background: #fff; color: var(--tt-text-2);
    transition: all .15s;
}
.day-toggle input:checked + span { background: var(--tt-primary); border-color: var(--tt-primary); color: #fff; box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .9); }
.day-toggle.amber input:checked + span { background: #f59e0b; border-color: #f59e0b; box-shadow: 0 6px 14px -8px rgba(245, 158, 11, .9); }
.day-toggle input:focus-visible + span { box-shadow: 0 0 0 4px rgba(79, 70, 229, .25); }

/* ------------------------------------------------------------------ Badges, alerts, misc */

.badge { font-weight: 600; letter-spacing: .01em; padding: .38em .65em; border-radius: 999px; }
.badge-soft-primary { background: var(--tt-primary-soft); color: var(--tt-primary-active); }
.badge-soft-success { background: var(--tt-success-soft); color: #047857; }
.badge-soft-warning { background: var(--tt-warning-soft); color: #b45309; }
.badge-soft-danger { background: var(--tt-danger-soft); color: #b91c1c; }
.badge-soft-info { background: var(--tt-info-soft); color: #0369a1; }
.badge-soft-slate { background: #eef2f7; color: #475569; }
.badge-outline { background: #fff; border: 1px solid var(--tt-border-strong); color: var(--tt-text-2); }

.subject-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .22rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
    color: #1e293b; border: 1px solid rgba(15, 23, 42, .06);
}
.subject-chip .dot, .color-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.color-square { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .03em; flex-shrink: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }

.class-tile {
    display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 .5rem;
    border-radius: 11px; font-weight: 800; font-size: .78rem; letter-spacing: -.01em;
    background: var(--tt-primary-soft); color: var(--tt-primary-active);
}

.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .78rem; color: #fff; flex-shrink: 0; letter-spacing: .02em; }
.avatar-sm { width: 28px; height: 28px; font-size: .66rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; border-radius: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.4rem; border-radius: 20px; }

.progress { --bs-progress-bg: #edf0f6; --bs-progress-border-radius: 999px; height: 8px; }
.progress-bar { border-radius: 999px; }
.progress-bar.grad { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.progress-thin { height: 6px; }

.alert { display: flex; gap: .75rem; align-items: flex-start; border-radius: 12px; padding: .85rem 1rem; font-size: .88rem; border-width: 1px; }
.alert > i { font-size: 1.1rem; line-height: 1.35; flex-shrink: 0; }
.alert ul { padding-left: 1.1rem; }
.alert-success { background: var(--tt-success-soft); border-color: #b7ebd5; color: #065f46; }
.alert-danger { background: var(--tt-danger-soft); border-color: #f6c9c9; color: #991b1b; }
.alert-warning { background: var(--tt-warning-soft); border-color: #f8dfa8; color: #92400e; }
.alert-info { background: var(--tt-info-soft); border-color: #bfe3f5; color: #075985; }
.alert-light { background: #fff; border-color: var(--tt-border); color: var(--tt-text-2); }
.alert-dismissible { padding-right: 3rem; }

.tt-toast { border: 0; border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45); overflow: hidden; min-width: 320px; }
.tt-toast .toast-body { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; font-size: .88rem; }
.tt-toast .toast-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }

.empty-state { text-align: center; padding: 2.75rem 1.5rem; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--tt-primary-soft); color: var(--tt-primary); font-size: 1.6rem; }
.empty-title { font-weight: 700; font-size: 1rem; }
.empty-text { color: var(--tt-muted); font-size: .88rem; max-width: 380px; margin: .3rem auto 0; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem 0; font-size: .875rem; border-bottom: 1px dashed var(--tt-border); }
.check-list li:last-child { border-bottom: 0; }
.check-list li > i { font-size: 1.05rem; line-height: 1.3; flex-shrink: 0; }

/* Setup steps */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: .85rem; align-items: center; padding: .62rem 0; }
.step + .step { border-top: 1px dashed var(--tt-border); }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; border: 1.5px solid var(--tt-border-strong); color: var(--tt-muted); background: #fff; }
.step.done .step-dot { background: var(--tt-success); border-color: var(--tt-success); color: #fff; }
.step.warn .step-dot { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.step .step-title { font-weight: 600; font-size: .88rem; }
.step .step-hint { font-size: .76rem; color: var(--tt-muted); }
.step a.step-link { margin-left: auto; font-size: .78rem; font-weight: 600; white-space: nowrap; }

/* Bell timeline */
.timeline { position: relative; padding-left: 1.4rem; margin: 0; list-style: none; }
.timeline::before { content: ''; position: absolute; left: .42rem; top: .7rem; bottom: .7rem; width: 2px; background: var(--tt-border); border-radius: 2px; }
.tl-item { position: relative; display: flex; align-items: center; gap: .75rem; padding: .42rem 0; font-size: .86rem; }
.tl-item::before { content: ''; position: absolute; left: -1.22rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--tt-primary); }
.tl-item.is-break::before { border-color: #f59e0b; }
.tl-item.is-now::before { background: var(--tt-primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .2); }
.tl-item .tl-time { margin-left: auto; color: var(--tt-muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-item.is-break .tl-label { color: #b45309; }

/* Day strip (proportional bell schedule) */
.day-strip { display: flex; height: 54px; border-radius: 12px; overflow: hidden; border: 1px solid var(--tt-border); background: #fff; }
.day-strip .seg { min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: .72rem; font-weight: 700; line-height: 1.15; border-right: 2px solid #fff; overflow: hidden; white-space: nowrap; }
.day-strip .seg:last-child { border-right: 0; }
.day-strip .seg small { font-weight: 500; font-size: .64rem; opacity: .8; }
.seg-period { background: var(--tt-primary-soft); color: var(--tt-primary-active); }
.seg-ec { background: #fef3c7; color: #92400e; }
.seg-break { background: repeating-linear-gradient(-45deg, #fff7e6, #fff7e6 6px, #ffedc7 6px, #ffedc7 12px); color: #b45309; }

/* Pills nav (class switcher, day tabs) */
.pill-nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill-nav .pill {
    padding: .42rem .95rem; border-radius: 999px; font-weight: 600; font-size: .84rem;
    background: #fff; border: 1px solid var(--tt-border); color: var(--tt-text-2);
    transition: all .15s; cursor: pointer;
}
.pill-nav .pill:hover { border-color: #a5b4fc; color: var(--tt-primary); }
.pill-nav .pill.active { background: var(--tt-primary); border-color: var(--tt-primary); color: #fff; box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9); }

/* Side list (allocation class picker) */
.side-list .item {
    display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 12px;
    color: var(--tt-text); border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.side-list .item:hover { background: var(--tt-surface-2); }
.side-list .item.active { background: var(--tt-primary-soft); border-color: #c7cdfd; }
.side-list .item .meta { font-size: .74rem; color: var(--tt-muted); }

/* Sections */
.section-badge {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 800; font-size: .9rem;
    background: linear-gradient(135deg, #818cf8, #4f46e5); color: #fff;
    box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .9);
}
.section-badge.sm { width: 26px; height: 26px; font-size: .75rem; border-radius: 8px; }
.section-row { transition: background .15s, border-color .15s; }
.section-row:hover { background: var(--tt-primary-soft); border-color: #c7cdfd !important; color: inherit; }

/* Allocation matrix */
.alloc-table tr.is-off td { background: var(--tt-surface-2); }
.alloc-table tr.is-off .js-teacher { opacity: .45; }
.alloc-table .form-select.is-missing { border-color: #f59e0b; background-color: #fffbeb; }

/* "Can handle" chips (teacher form) */
.assign-class + .assign-class { border-top: 1px dashed var(--tt-border); }
.assign-chip { display: inline-block; position: relative; }
.assign-chip input { position: absolute; opacity: 0; pointer-events: none; }
.assign-chip span {
    display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
    padding: .38rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: #fff; border: 1.5px solid var(--tt-border-strong); color: var(--tt-text-2);
    transition: all .15s;
}
.assign-chip span .dot { width: 8px; height: 8px; border-radius: 50%; }
.assign-chip span small { font-weight: 500; color: var(--tt-subtle); }
.assign-chip:hover span { border-color: #a5b4fc; }
.assign-chip input:checked + span { background: var(--tt-primary); border-color: var(--tt-primary); color: #fff; box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .9); }
.assign-chip input:checked + span small { color: rgba(255, 255, 255, .8); }
.assign-chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(79, 70, 229, .25); }

/* Section switcher (timetable) */
.section-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.section-group { display: inline-flex; align-items: center; gap: .25rem; background: #fff; border: 1px solid var(--tt-border); border-radius: 999px; padding: .25rem .3rem .25rem .8rem; }
.section-group .label { font-weight: 700; font-size: .8rem; margin-right: .3rem; color: var(--tt-text-2); }
.section-group a { min-width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--tt-text-2); padding: 0 .5rem; }
.section-group a:hover { background: var(--tt-primary-soft); color: var(--tt-primary); }
.section-group a.active { background: var(--tt-primary); color: #fff; box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .9); }
.section-group.has-active { border-color: #c7cdfd; background: var(--tt-primary-soft); }

/* Teacher cards */
.teacher-card .badge { white-space: normal; text-align: left; line-height: 1.3; }
.teacher-card .contact { font-size: .8rem; color: var(--tt-muted); display: flex; align-items: center; gap: .4rem; min-width: 0; }
.teacher-card .contact span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ Timetable grid (web) */

.tt-wrap { overflow-x: auto; margin: -6px; padding: 0; }
.tt-grid { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.tt-grid thead th.tt-day-head { width: 118px; }
.tt-grid th, .tt-grid td { border: 0; vertical-align: middle; text-align: center; }
.tt-grid thead th {
    background: #f1f4fb; color: var(--tt-text); border-radius: 10px;
    font-size: .74rem; font-weight: 700; padding: .55rem .4rem; white-space: nowrap;
}
.tt-grid thead th .tt-time { display: block; font-weight: 500; color: var(--tt-muted); font-size: .68rem; margin-top: .12rem; font-variant-numeric: tabular-nums; }
.tt-grid thead th.tt-day-head { background: transparent; color: var(--tt-muted); text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; text-align: left; }
.tt-grid thead th.tt-break-head { background: transparent; color: var(--tt-subtle); font-size: .6rem; font-weight: 600; width: 30px; padding: .3rem 0; line-height: 1.3; }
.tt-grid .tt-day {
    width: 118px; text-align: left; padding: .55rem .75rem; border-radius: 10px;
    background: #fff; border: 1px solid var(--tt-border); font-weight: 700; font-size: .84rem;
}
.tt-grid .tt-day .today-badge { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .85); }
.tt-grid tr.is-today .tt-day { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9); }
.tt-grid .tt-break {
    width: 30px; border-radius: 10px; color: #b45309; font-size: .64rem; font-weight: 700; letter-spacing: .2em;
    background: repeating-linear-gradient(-45deg, #fffaf0, #fffaf0 6px, #fff1d6 6px, #fff1d6 12px);
}
.tt-vlabel { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; text-transform: uppercase; }
.tt-grid .tt-cell {
    height: 68px; padding: .5rem .6rem; border-radius: 10px; text-align: left;
    font-size: .82rem; line-height: 1.25; border-left: 4px solid transparent;
    transition: transform .12s, box-shadow .12s;
}
.tt-grid .tt-cell:not(.tt-free):hover { transform: translateY(-2px); box-shadow: 0 10px 18px -12px rgba(15, 23, 42, .45); }
.tt-grid .tt-cell strong { display: block; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-grid .tt-sub { font-size: .72rem; color: #475569; margin-top: .18rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-grid .tt-sub i { font-size: .7rem; opacity: .7; margin-right: .15rem; }
.tt-grid .tt-free { background: #fff; border: 1.5px dashed var(--tt-border-strong); color: var(--tt-subtle); text-align: center; font-size: .74rem; font-weight: 500; }
.tt-grid .tt-ec { background: linear-gradient(135deg, #fff8dc, #fde68a); border-left-color: #f59e0b; color: #92400e; }
.tt-grid .tt-ec strong {
    color: #92400e; font-size: .76rem; line-height: 1.2;
    white-space: normal; overflow: visible; text-overflow: clip;
    -webkit-hyphens: manual; hyphens: manual; overflow-wrap: break-word;
}
.tt-grid .tt-ec .tt-sub { color: #a16207; }
.tt-grid.compact .tt-cell { height: 52px; padding: .4rem .5rem; font-size: .78rem; }
.tt-grid .tt-edit { background: #fff; border: 1px solid var(--tt-border); padding: .35rem; transition: background .2s, border-color .2s; }
.tt-grid .tt-edit select {
    font-size: .72rem; font-weight: 600; padding: .34rem 1.1rem .34rem .4rem;
    background-position: right .3rem center; background-size: 10px 8px;
    background-color: rgba(255, 255, 255, .82); border-color: rgba(15, 23, 42, .12); box-shadow: none;
}
.tt-grid.edit-grid thead th.tt-day-head, .tt-grid.edit-grid .tt-day { width: 108px; }

/* Phones: stack stat cards, pin the day column while the grid scrolls sideways */
@media (max-width: 575.98px) {
    .stat-card { flex-direction: column; align-items: flex-start; gap: .75rem; }
    .stat-card .stat-arrow { display: none; }
    .page-title { font-size: 1.35rem; }
    .app-content { padding: 1.1rem; }
}
@media (max-width: 767.98px) {
    .tt-grid thead th.tt-day-head, .tt-grid .tt-day { position: sticky; left: 0; z-index: 2; width: 92px; }
    .tt-grid thead th.tt-day-head { background: #fff; }
    .tt-grid .tt-day { box-shadow: 6px 0 10px -8px rgba(15, 23, 42, .35); }
    .divider-md { border-left: 0 !important; padding-left: 0 !important; margin-left: 0 !important; }
}
.stat-value { white-space: nowrap; }

.legend-chip { display: flex; align-items: center; gap: .65rem; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--tt-border); background: #fff; }
.legend-chip .sw { width: 10px; align-self: stretch; border-radius: 6px; flex-shrink: 0; }
.legend-chip .name { font-weight: 700; font-size: .86rem; }
.legend-chip .who { font-size: .76rem; color: var(--tt-muted); }
.legend-chip .count { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Login */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand {
    position: relative; overflow: hidden; color: #fff; padding: 3rem;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(circle at 80% 10%, rgba(196, 181, 253, .5), transparent 40%),
        radial-gradient(circle at 10% 100%, rgba(56, 189, 248, .35), transparent 45%),
        linear-gradient(140deg, #0e1335 0%, #312e81 55%, #6d28d9 100%);
}
.auth-brand::after { content: ''; position: absolute; right: -120px; top: 35%; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); }
.auth-brand h1 { font-weight: 800; letter-spacing: -.035em; font-size: 2.4rem; line-height: 1.1; }
.auth-brand .feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; position: relative; z-index: 1; }
.auth-brand .feature i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); flex-shrink: 0; }
.auth-brand .feature div { color: rgba(255, 255, 255, .8); font-size: .9rem; }
.auth-brand .feature strong { color: #fff; display: block; }
.mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 360px; position: relative; z-index: 1; }
.mini-grid span { height: 26px; border-radius: 7px; background: rgba(255, 255, 255, .12); }
.mini-grid span.amber { background: rgba(251, 191, 36, .55); }
.mini-grid span.indigo { background: rgba(165, 180, 252, .45); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--tt-bg); }
.auth-card { width: 100%; max-width: 410px; }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}
