/**
 * Admin Management Styles - Carolina Language Academy
 * Standalone CSS for the admin management panel
 */

/* ==========================================================================
   CSS Variables - Same Brand Colors as Teacher Portal
   ========================================================================== */
:root {
    --primary: #222E66;
    --primary-dark: #1a2452;
    --primary-light: #2d3a7a;
    --primary-lighter: #f0f4ff;
    --accent: #F16C13;
    --accent-dark: #d85a0a;
    --accent-light: #fff7ed;
    --accent-hover: #e05d08;
    --secondary: #2EA3F2;
    --secondary-light: #e8f4fd;
    --success: #15803d;
    --success-light: #dcfce7;
    --warning: #ca8a04;
    --warning-light: #fef9c3;
    --error: #dc2626;
    --error-light: #fee2e2;
    --info: #0284c7;
    --info-light: #e0f2fe;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #1e293b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
select, input, textarea { font-family: inherit; }

.admin-app { min-height: 100vh; }

/* ==========================================================================
   Auth Screen
   ========================================================================== */
.admin-auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 2rem;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.auth-logo {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.25rem;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.auth-card > p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.auth-form { text-align: left; }

.auth-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.auth-hint i { color: var(--accent); }

.auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--error-light);
    color: var(--error);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.input-icon input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.input-icon input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(34, 46, 102, 0.1);
}

select, .filter-select {
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

select:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    resize: vertical;
    color: var(--text-primary);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.search-box input {
    padding: 0.625rem 1rem 0.625rem 2.375rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    width: 200px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-fast);
    border: none;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-secondary:hover { background: var(--border-light); }

.btn-full { width: 100%; }

.btn-approve {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-approve:hover { background: #12692f; }

.btn-deny {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--error);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-deny:hover { background: #b91c1c; }

.btn-revert {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--info);
    transition: var(--transition-fast);
}

.btn-revert:hover { background: #0369a1; }

.btn-delete-res {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--error);
    transition: var(--transition-fast);
}
.btn-delete-res:hover { background: #b91c1c; }

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 0.8125rem;
}

.btn-icon.approve { color: var(--success); }
.btn-icon.approve:hover { background: var(--success-light); }
.btn-icon.deny { color: var(--error); }
.btn-icon.deny:hover { background: var(--error-light); }
.btn-icon.edit { color: var(--primary); }
.btn-icon.edit:hover { background: var(--primary-lighter); }
.btn-icon.email { color: var(--info); }
.btn-icon.email:hover { background: var(--info-light); }
.btn-icon.undo { color: var(--warning); }
.btn-icon.undo:hover { background: var(--warning-light); }

/* ==========================================================================
   Header
   ========================================================================== */
.admin-header {
    background: var(--primary);
    color: var(--text-inverse);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 700;
}

.header-brand i { font-size: 1.25rem; color: var(--accent); }


.nav-tab {
    padding: 0.6rem 0.7rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.nav-tab:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-inverse); }
.nav-tab.active { background: rgba(255, 255, 255, 0.15); color: var(--text-inverse); }

/* Hamburger toggle — hidden on wide screens, shown when the inline nav would overlap */
.admin-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: var(--transition-fast);
    margin-left: auto;
}
.admin-nav-toggle:hover { background: rgba(255, 255, 255, 0.22); }

/* Current-tab label shown next to the hamburger (collapsed mode only) so the admin
   always knows which page they're on. Hidden on wide screens. */
.admin-current-tab {
    display: none;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-inverse);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55vw;
}
.admin-current-tab i { color: var(--accent); font-size: 0.9rem; }



/* --------------------------------------------------------------------------
   Left navigation rail

   Always open. 22 pages in one flat list meant scrolling to reach half of them,
   so the rail lists the eight CATEGORIES and a category opens to reveal its
   pages — one at a time, so what is on screen stays short however many tabs
   exist.

   ⚠️ The open/close animation sizes ONE grid row (0fr -> 1fr). That only works
   with a SINGLE child, which is why the buttons live in .rail-group-inner. The
   first version put them straight in .rail-group-items, so rows 2..n kept their
   auto height and every category rendered permanently open.
   -------------------------------------------------------------------------- */
:root {
    --rail-w: 264px;
}

.admin-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    z-index: 1200;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.12);
}

/* ---- head ---- */
.rail-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    height: 60px;
    flex: none;
    padding: 0 1rem 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}
.rail-head > i { color: var(--accent); font-size: 1.35rem; flex: none; }

/* ---- the scrolling list ---- */
.rail-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.6rem 0.6rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.rail-nav::-webkit-scrollbar { width: 6px; }
.rail-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 3px; }

/* ---- category header ---- */
.rail-group-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.62rem 0.65rem;
    border-radius: var(--radius-md);
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-fast);
}
.rail-group-head:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-inverse); }
.rail-group-icon { width: 22px; flex: none; text-align: center; font-size: 1rem; }
.rail-group-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }

.rail-group-count {
    flex: none;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    line-height: 1.5;
}
.rail-caret {
    flex: none;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.18s ease;
}
.rail-group.expanded > .rail-group-head .rail-caret { transform: rotate(180deg); }

/* the category holding the current page stays marked even when closed */
.rail-group.has-active > .rail-group-head { color: var(--text-inverse); }
.rail-group.has-active > .rail-group-head .rail-group-icon { color: var(--accent); }

/* ---- the pages inside a category ---- */
.rail-group-items {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease;
}
.rail-group-inner { overflow: hidden; min-height: 0; }
.rail-group.expanded > .rail-group-items { grid-template-rows: 1fr; }

.admin-rail .nav-tab {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.46rem 0.65rem;
    border-radius: var(--radius-md);
    font-size: 0.83rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.62);
    white-space: nowrap;
    transition: var(--transition-fast);
}
.admin-rail .rail-group-inner .nav-tab { padding-left: 1.6rem; }
.admin-rail .rail-group-inner .nav-tab i { width: 17px; flex: none; text-align: center; font-size: 0.82rem; }
.admin-rail .nav-tab > span:first-of-type { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.admin-rail .nav-tab:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-inverse); }
.admin-rail .nav-tab.active { background: rgba(255, 255, 255, 0.16); color: var(--text-inverse); }
.admin-rail .rail-group-inner .nav-tab.active { box-shadow: inset 3px 0 0 var(--accent); }

/* a category with a single page reads as a plain row */
.admin-rail .rail-solo { padding: 0.62rem 0.65rem; font-size: 0.86rem; font-weight: 600; color: rgba(255, 255, 255, 0.78); }
.admin-rail .rail-solo i { width: 22px; flex: none; text-align: center; font-size: 1rem; }

.admin-rail button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.beta-badge {
    margin-left: auto;
    background: var(--accent, #EA5B0C);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.08rem 0.3rem;
    border-radius: 3px;
    line-height: 1.4;
    flex-shrink: 0;
}

/* ---- header + content sit to the right of the rail ---- */
body.has-rail .admin-header {
    left: var(--rail-w);
    padding: 0 2rem;
    justify-content: flex-start;
    gap: 0.9rem;
}
body.has-rail .admin-panel { padding-left: var(--rail-w); }
body.has-rail .admin-current-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}
body.has-rail .admin-nav-toggle { display: none; }

.admin-rail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1150;
}
.admin-rail-backdrop.open { opacity: 1; visibility: visible; }

/* ---- narrow screens: the rail slides in over the page ---- */
@media (max-width: 900px) {
    .admin-rail {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        box-shadow: 6px 0 28px rgba(0, 0, 0, 0.3);
    }
    .admin-rail.open { transform: translateX(0); }
    body.has-rail .admin-header { left: 0; padding: 0 1rem; }
    body.has-rail .admin-panel { padding-left: 0; }
    body.has-rail .admin-nav-toggle { display: flex; margin-left: 0; }
}

.btn-lock {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-lock:hover { background: var(--error); color: white; }

/* ==========================================================================
   Main Content
   ========================================================================== */
/* Every page fills the width beside the rail, with a small gutter. The old
   1400px cap left a wide screen with more empty margin than table — on a 2500px
   monitor a quarter of the pixels were doing nothing. */
.admin-content {
    padding: 78px 1.5rem 2rem;
    width: 100%;
}

/* Every page now carries a title AND a line of description, so the left block is
   two lines tall. Centring the controls against it floats them oddly low; they
   line up with the title instead. */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
}
.section-header > :first-child { min-width: 0; }
.section-sub {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    max-width: 78ch;
}
/* the controls sit on the title's line */
.section-header > .filter-bar,
.section-header > .btn-primary,
.section-header > .btn-secondary,
.section-header > div:not(:first-child) { margin-top: 0.15rem; }

.section-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   KPI Grid
   ========================================================================== */
.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--border-medium);
}

.kpi-card.kpi-pending { border-left-color: var(--warning); }
.kpi-card.kpi-today { border-left-color: var(--info); }
.kpi-card.kpi-week { border-left-color: var(--primary); }
.kpi-card.kpi-denied { border-left-color: var(--error); }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.kpi-pending .kpi-icon { background: var(--warning-light); color: var(--warning); }
.kpi-today .kpi-icon { background: var(--info-light); color: var(--info); }
.kpi-week .kpi-icon { background: var(--primary-lighter); color: var(--primary); }
.kpi-denied .kpi-icon { background: var(--error-light); color: var(--error); }

.kpi-data { display: flex; flex-direction: column; }
.kpi-number { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.kpi-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

/* ==========================================================================
   Dashboard Grid
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.admin-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i { color: var(--primary); }

.card-body { padding: 1rem 1.25rem; min-height: 200px; }

/* Other Services "needs attention" card (dashboard) */
.os-attention-card {
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--warning);
}
.os-attention-card .card-header { background: var(--warning-light); }
.os-attention-card .card-header h3 i { color: var(--warning); }
.os-attention-card .card-body { min-height: 0; padding: 0.5rem 0.75rem; }
.os-attention-badge { background: var(--warning); }

.os-attn-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.os-attn-item:hover { background: var(--warning-light); }
.os-attn-item + .os-attn-item { border-top: 1px solid var(--border-light); }

.os-attn-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--warning-light);
    color: var(--warning);
    font-size: 0.9375rem;
}
.os-attn-info { flex: 1 1 auto; min-width: 0; }
.os-attn-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}
.os-attn-type { color: var(--text-secondary); font-weight: 500; }
.os-attn-detail {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}
.os-attn-meta {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}
.os-attn-overdue {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.os-attn-chev { color: var(--text-muted); font-size: 0.8125rem; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.header-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Pending Queue (Dashboard)
   ========================================================================== */
.pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-light);
}

.pending-item:last-child { border-bottom: none; }

.pending-info { flex: 1; }
.pending-teacher { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.pending-detail { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.125rem; }
.pending-detail i { margin-right: 0.25rem; }

.pending-actions {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

/* ==========================================================================
   Today's Schedule (Dashboard)
   ========================================================================== */
.schedule-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.schedule-item:last-child { border-bottom: none; }

.schedule-day-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.schedule-day-header:first-child { margin-top: 0; }

.schedule-day-today {
    color: var(--primary);
}

.schedule-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 100px;
}

.schedule-room {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-inverse);
    background: var(--primary);
    padding: 0.2rem 0.625rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.schedule-details { flex: 1; }
.schedule-course { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.schedule-teacher { font-size: 0.75rem; color: var(--text-secondary); }

/* ==========================================================================
   Reservations Table
   ========================================================================== */
.reservations-table-wrap { overflow-x: auto; }

/* The frame lives on the wrapper, not the table. `overflow: hidden` on the
   table itself would kill position:sticky for the header row, and a wide table
   would push the whole page sideways instead of scrolling on its own. Every
   table gets wrapped as it renders — see ensureTableFrames(). */
.table-frame {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    background: var(--bg-primary);
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
}
/* a table that has not been wrapped still looks right on its own */
.admin-table:not(.table-frame > *) { border-radius: var(--radius-lg); }

.admin-table thead { background: var(--bg-secondary); }

.admin-table th {
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
    background: var(--bg-secondary);
}
/* NOTE: no `position: sticky` on the header row. The frame around every table
   sets overflow-x, and per spec the other axis then computes to `auto` too —
   which makes the frame the scroll container, so a sticky header would pin to
   the frame (which never scrolls vertically) instead of the page, i.e. do
   nothing. Pinning it would mean giving every table a max-height and a second
   scrollbar inside a page that already scrolls; not worth it. */

.admin-table td {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

/* Figures line up column to column, which matters most on the money pages. */
.admin-table td, .admin-table th { font-variant-numeric: tabular-nums; }

/* A whisper of banding — enough to follow a row across a wide table, faint
   enough that the hover state still reads as the stronger signal. */
.admin-table tbody tr { transition: background var(--transition-fast); }
.admin-table tbody tr:nth-child(even) { background: rgba(15, 23, 42, 0.018); }
.admin-table tbody tr:hover { background: var(--bg-secondary); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table td:first-child, .admin-table th:first-child { padding-left: 1.1rem; }
.admin-table td:last-child,  .admin-table th:last-child  { padding-right: 1.1rem; }

.table-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.table-status-badge.status-pending { background: var(--warning-light); color: var(--warning); }
.table-status-badge.status-approved { background: var(--success-light); color: var(--success); }
.table-status-badge.status-denied { background: var(--error-light); color: var(--error); }
.table-status-badge.status-cancelled { background: var(--bg-tertiary); color: var(--text-muted); }
.table-status-badge.status-scheduled { background: var(--info-light); color: var(--info); }

.table-actions { display: flex; gap: 0.25rem; }

/* ==========================================================================
   Availability Gantt
   ========================================================================== */
.avail-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 3px;
}

.view-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.view-btn.active {
    background: var(--bg-primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.view-btn:hover:not(.active) { color: var(--text-primary); }

.location-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.location-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
}

.location-btn.active {
    background: var(--bg-primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.location-btn:hover:not(.active) { color: var(--text-primary); }

.avail-nav { display: flex; align-items: center; gap: 0.5rem; }

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.calendar-nav-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.calendar-today-btn {
    padding: 0.375rem 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition-fast);
}

.calendar-today-btn:hover { background: var(--primary-lighter); }

.calendar-date-jump {
    padding: 0.25rem 0.375rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--primary);
    background: var(--bg-primary);
    cursor: pointer;
    width: 130px;
}
.calendar-date-jump:hover { border-color: var(--primary); }
.calendar-date-jump:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(241, 108, 19, 0.15); }

.avail-date-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 200px;
    text-align: center;
}

.avail-gantt-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

/* Gantt Day View — Draggable Blocks */
.gantt-day { min-width: 900px; }

.gantt-header {
    display: grid;
    grid-template-columns: 130px repeat(28, 1fr);
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 2;
}

.gantt-corner { padding: 0.625rem; font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; }
.gantt-time-cell {
    padding: 0.625rem 0;
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    border-left: 1px solid var(--border-light);
}
.gantt-time-cell.hour { font-weight: 600; border-left-color: var(--border-medium); }
.gantt-time-cell.half { border-left: 1px dashed #eee; }

.gantt-body-drag { position: relative; }

.gantt-row {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    min-height: 56px;
}

.gantt-row-unassigned {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(245, 158, 11, 0.04) 8px,
        rgba(245, 158, 11, 0.04) 16px
    );
    border-top: 2px dashed var(--warning);
}

.gantt-room-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.5rem 0.875rem;
    background: var(--bg-secondary);
    border-right: 2px solid var(--border-light);
    position: sticky;
    left: 0;
    z-index: 1;
    width: 130px;
    min-width: 130px;
    flex-shrink: 0;
}

.gantt-room-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.gantt-room-cap { font-size: 0.65rem; color: var(--text-muted); }

/* Slots area — contains background grid and overlay blocks */
.gantt-row-slots {
    flex: 1;
    position: relative;
    min-height: 56px;
}

.gantt-bg-grid {
    display: grid;
    grid-template-columns: repeat(28, 1fr);
    position: absolute;
    inset: 0;
}

.gantt-bg-cell {
    border-left: 1px solid #f0f0f0;
    min-height: 56px;
}

.gantt-bg-cell.hour-line { border-left: 1px solid var(--border-light); }

/* Booking blocks layer — positioned over the grid */
.gantt-blocks-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Individual draggable booking block */
.gantt-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    overflow: hidden;
    cursor: grab;
    pointer-events: all;
    transition: box-shadow 0.15s, opacity 0.15s;
    z-index: 1;
    user-select: none;
}

.gantt-block:hover {
    box-shadow: var(--shadow-md);
    z-index: 5;
}

.gantt-block.block-approved {
    background: var(--success-light);
    border: 2px solid var(--success);
    color: var(--success);
}

.gantt-block.block-pending {
    background: var(--warning-light);
    border: 2px solid var(--warning);
    color: var(--warning);
}

.gantt-block.block-denied {
    background: var(--error-light);
    border: 2px solid var(--error);
    color: var(--error);
    opacity: 0.5;
}

.gantt-block.dragging {
    cursor: grabbing;
    opacity: 0.85;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

body.gantt-dragging { cursor: grabbing !important; user-select: none; }
body.gantt-dragging * { cursor: grabbing !important; }

.gantt-block-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 0.375rem;
    overflow: hidden;
    min-width: 0;
}

.gantt-block-name {
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.gantt-block-time {
    font-size: 0.575rem;
    font-weight: 600;
    opacity: 0.8;
    white-space: nowrap;
}

.gantt-block-course {
    font-size: 0.525rem;
    font-weight: 400;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Resize handles */
.gantt-block-resize-l,
.gantt-block-resize-r {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    z-index: 2;
    pointer-events: all;
}

.gantt-block-resize-l { left: 0; border-radius: 6px 0 0 6px; }
.gantt-block-resize-r { right: 0; border-radius: 0 6px 6px 0; }

.gantt-block-resize-l:hover,
.gantt-block-resize-r:hover {
    background: rgba(0, 0, 0, 0.08);
}

.gantt-block-resize-l::after,
.gantt-block-resize-r::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.15s;
}

.gantt-block-resize-l::after { left: 2px; }
.gantt-block-resize-r::after { right: 2px; }

.gantt-block:hover .gantt-block-resize-l::after,
.gantt-block:hover .gantt-block-resize-r::after {
    opacity: 0.4;
}

/* Drag tooltip — shows updated time while dragging */
.gantt-drag-tooltip {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    color: var(--text-inverse);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    z-index: 200;
    box-shadow: var(--shadow-md);
}

/* Now line */
.gantt-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    z-index: 10;
    pointer-events: none;
}

.gantt-now-line::before {
    content: 'NOW';
    position: absolute;
    top: -18px;
    left: -14px;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-light);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Legend */
.gantt-legend {
    display: flex;
    gap: 1.25rem;
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.gantt-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.gantt-legend-hint {
    margin-left: auto;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.6875rem;
}

.gantt-legend-hint i { margin-right: 0.125rem; }

.gantt-legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid var(--border-light);
}

.gantt-legend-dot.approved { background: var(--success-light); border-color: var(--success); }
.gantt-legend-dot.pending { background: var(--warning-light); border-color: var(--warning); }
.gantt-legend-dot.denied { background: var(--error-light); border-color: var(--error); }
.gantt-legend-dot.free { background: white; }

/* Gantt Week View */
.gantt-week { min-width: 700px; }

.gantt-week-header {
    display: grid;
    grid-template-columns: 130px repeat(7, 1fr);
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-secondary);
}

.gantt-day-header {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-left: 1px solid var(--border-light);
}

.gantt-day-name { font-size: 0.6875rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.gantt-day-date { font-size: 0.75rem; color: var(--text-primary); font-weight: 600; margin-top: 0.125rem; }
.gantt-day-header.today { background: var(--primary-lighter); }
.gantt-day-header.today .gantt-day-name { color: var(--primary); }

.gantt-week-row {
    display: grid;
    grid-template-columns: 130px repeat(7, 1fr);
    border-bottom: 1px solid var(--border-light);
    min-height: 70px;
}

.gantt-week-row.gantt-row-unassigned {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(245, 158, 11, 0.04) 8px,
        rgba(245, 158, 11, 0.04) 16px
    );
    border-top: 2px dashed var(--warning);
}

.gantt-week-cell {
    border-left: 1px solid var(--border-light);
    padding: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gantt-week-cell.today { background: rgba(34, 46, 102, 0.02); }

.week-booking-bar {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
}

.week-bar-time {
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.week-bar-teacher {
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.2;
}

.week-bar-course {
    font-size: 0.55rem;
    font-weight: 400;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.week-bar-type {
    display: inline-block;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 0 3px;
    border-radius: 2px;
    background: rgba(0,0,0,0.08);
    vertical-align: middle;
}

.week-booking-bar:hover { transform: scale(1.02); box-shadow: var(--shadow-sm); }

.week-booking-bar.approved { background: var(--success-light); color: var(--success); border-left: 3px solid var(--success); }
.week-booking-bar.pending { background: var(--warning-light); color: var(--warning); border-left: 3px solid var(--warning); }
.week-booking-bar.denied { background: var(--error-light); color: var(--error); border-left: 3px solid var(--error); opacity: 0.6; }

/* ==========================================================================
   Master Calendar
   ========================================================================== */
#masterCalendarGrid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.master-location-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.master-location-header {
    padding: 0.875rem 1.25rem;
    background: var(--primary-lighter, #eef2ff);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border-light);
}

.master-location-header i { margin-right: 0.5rem; color: var(--accent, #e97a1f); }

.master-location-grid { overflow-x: auto; }

.master-calendar-header,
.master-calendar-row {
    display: grid;
    grid-template-columns: 100px repeat(7, 1fr);
    border-bottom: 1px solid var(--border-light);
}

.master-day-slot {
    padding: 0.375rem;
    border-left: 1px solid var(--border-light);
    min-height: 56px;
}

.master-room-col {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-left: none;
    min-height: auto;
}

.master-day-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: auto;
    padding: 0.5rem;
}

.master-day-header.today { background: var(--primary-lighter, #eef2ff); }

.master-day-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 70px;
}

.master-day-cell.today { background: rgba(34, 46, 102, 0.02); }

/* ==========================================================================
   Availability — Month View
   ========================================================================== */
.avail-month-grid {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.avail-month-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.avail-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.avail-month-dow {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0.625rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.avail-month-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.avail-month-cell {
    min-height: 120px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 0.375rem;
    display: flex;
    flex-direction: column;
}

.avail-month-cell:nth-child(7n) { border-right: none; }

.avail-month-cell.blank {
    background: var(--bg-secondary);
    opacity: 0.4;
}

.avail-month-cell.today {
    background: rgba(34, 46, 102, 0.04);
}

.avail-month-cell.today .avail-month-day-num {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avail-month-cell.weekend {
    background: var(--bg-secondary);
}

.avail-month-day-num {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.avail-month-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}


.avail-month-more {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1px 5px;
    cursor: default;
}

/* ==========================================================================
   Room Directory
   ========================================================================== */
.rooms-directory {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Location group */
.room-dir-location-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.room-dir-loc-header {
    padding-bottom: 0.625rem;
    margin-bottom: 0;
}

.room-dir-loc-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.room-dir-loc-title i {
    font-size: 1rem;
    color: var(--primary);
}

.room-dir-loc-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.room-dir-loc-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Room directory table layout */
.room-dir-table {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.room-dir-table-head {
    display: grid;
    grid-template-columns: 140px 100px 90px 80px 1fr 70px;
    gap: 0;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-light);
}

.room-dir-th {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.room-dir-row {
    display: grid;
    grid-template-columns: 140px 100px 90px 80px 1fr 70px;
    gap: 0;
    padding: 0.625rem 1rem;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

.room-dir-row:last-child { border-bottom: none; }
.room-dir-row:hover { background: var(--bg-secondary); }

.room-dir-td {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.room-dir-td-name {
    gap: 0.5rem;
}

.room-dir-td-name strong {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.room-dir-row-icon {
    color: var(--primary);
    opacity: 0.5;
    font-size: 0.8rem;
}

.room-dir-td-cap {
    font-weight: 600;
    color: var(--text-primary);
}

.room-dir-td-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-dir-td-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
    opacity: 0;
    transition: var(--transition-fast);
}

.room-dir-row:hover .room-dir-td-actions { opacity: 1; }

.room-dir-size {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-dir-size.small { background: var(--info-light); color: var(--info); }
.room-dir-size.medium { background: var(--warning-light); color: var(--warning); }
.room-dir-size.large { background: var(--success-light); color: var(--success); }


/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    padding: 1rem;
}
/* Confirm dialog must sit ABOVE any other modal it's launched from (e.g. the
   Other Services detail modal) — all overlays share z-index 2000, so DOM order
   would otherwise put this earlier-declared modal behind. */
.modal-overlay#confirmModal {
    z-index: 2200;
}
/* Same problem: the New/Edit Service modal is declared BEFORE the detail modal, so when
   "Edit" is clicked from an open detail modal it would render behind it. */
.modal-overlay#osModal {
    z-index: 2100;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition-normal);
    position: relative;
}

.modal-overlay.active .modal-container { transform: scale(1); }

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 1;
}

.modal-close:hover { background: var(--error-light); color: var(--error); }

.modal-header {
    padding: 1.5rem 2rem 1rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.modal-header h2 i { color: var(--primary); }

/* Review Modal */
.review-modal {
    max-width: 680px;
    width: 100%;
    padding: 0 2rem 2rem;
}

.review-content { margin-bottom: 1.5rem; }

.review-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.review-field { display: flex; flex-direction: column; gap: 0.125rem; }
.review-field-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.review-field-value { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }

.review-status-current {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.review-status-label { font-size: 0.8125rem; color: var(--text-secondary); }

.review-notes-display {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Room Picker */
.room-picker {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.375rem;
    background: var(--bg-secondary);
}

.room-pick-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.room-pick-option:hover:not(.unavailable) {
    border-color: var(--primary-light);
    background: var(--primary-lighter);
}

.room-pick-option.selected {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.room-pick-option.unavailable {
    opacity: 0.55;
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

.room-pick-status {
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.room-pick-option:not(.unavailable) .room-pick-status { color: var(--success); }
.room-pick-option.unavailable .room-pick-status { color: var(--error); }
.room-pick-option.selected .room-pick-status { color: var(--primary); }
.room-pick-option.selected .room-pick-status i::before { content: "\f058"; } /* fa-check-circle filled */

.room-pick-info {
    flex: 1;
    min-width: 0;
}

.room-pick-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.room-pick-top strong {
    color: var(--text-primary);
}

.room-pick-cap {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.room-pick-cap i {
    font-size: 0.6rem;
    margin-right: 2px;
}

.room-pick-conflict {
    display: block;
    font-size: 0.6875rem;
    color: var(--error);
    margin-top: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-pick-conflict i {
    margin-right: 3px;
    font-size: 0.6rem;
}

.room-pick-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    white-space: nowrap;
}

.room-pick-option:not(.unavailable) .room-pick-badge {
    background: var(--success-light);
    color: var(--success);
}

.room-pick-option.unavailable .room-pick-badge {
    background: var(--error-light);
    color: var(--error);
}

.room-pick-option.selected .room-pick-badge {
    background: var(--primary-lighter);
    color: var(--primary);
}

.room-change-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--warning-light);
    color: var(--warning);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    justify-content: flex-end;
}

.review-actions button { flex: none; padding: 0.6rem 1.25rem; white-space: nowrap; }

/* Past reservation: locked approve button + explanatory note */
.btn-approve.is-locked,
.btn-approve:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 1;
}
.review-past-note {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.1rem;
    padding: 0.7rem 0.9rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
}
.review-past-note i { color: #94a3b8; }

/* Confirm Modal */
.confirm-modal {
    max-width: 440px;
    width: 100%;
    padding: 2rem;
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--warning-light);
    color: var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.confirm-icon.confirm-icon-danger { background: #fee2e2; color: #dc2626; }
.confirm-modal h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.confirm-modal p, .confirm-modal .confirm-body { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.confirm-modal p code, .confirm-modal .confirm-body code { background: var(--bg-secondary); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.8rem; }

.confirm-actions { display: flex; gap: 0.75rem; }
.confirm-actions button { flex: 1; }

/* Drag Confirm Details */
.drag-confirm-details {
    text-align: left;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.75rem;
}

.drag-confirm-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light);
}

.drag-confirm-field:last-child,
.drag-confirm-change:last-child { border-bottom: none; }

.drag-confirm-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
}

.drag-confirm-value {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.drag-confirm-change {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
}

.drag-confirm-arrow {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.3rem;
    font-size: 0.875rem;
}

.drag-confirm-arrow i {
    color: var(--accent);
    font-size: 1rem;
}

.drag-confirm-old {
    color: var(--text-secondary);
    text-decoration: line-through;
    font-weight: 400;
}

.drag-confirm-new {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-lighter);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    animation: toastSlideIn 0.3s ease;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--error); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--primary); }

.toast-icon { font-size: 1.125rem; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.8125rem; margin-bottom: 0.125rem; }
.toast-message { font-size: 0.75rem; color: var(--text-secondary); }

.toast-close {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px;
}

.toast-close:hover { color: var(--text-primary); }
.toast.toast-hiding { animation: toastSlideOut 0.3s ease forwards; }

/* Full-screen blocking spinner for long-running actions (above modals + toasts) */
.blocking-spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 12000;
}
.blocking-spinner-overlay.active { display: flex; }
.blocking-spinner-box {
    background: #fff;
    padding: 1.25rem 1.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.blocking-spinner-box i { color: var(--primary, #ea7600); font-size: 1.5rem; }

@keyframes toastSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastSlideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ==========================================================================
   Empty States
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.empty-state p { font-size: 0.875rem; }

/* ==========================================================================
   Other Services tab
   ========================================================================== */
.os-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}
.os-type-badge.os-type-trans { background: var(--info-light); color: var(--info); }
.os-type-badge.os-type-interp { background: var(--warning-light); color: var(--warning); }

/* Clickable service rows with a type accent + chevron */
.os-table tbody tr.os-row { cursor: pointer; }
.os-row-trans td:first-child { box-shadow: inset 3px 0 0 var(--info, #2EA3F2); }
.os-row-interp td:first-child { box-shadow: inset 3px 0 0 var(--warning, #f59e0b); }
.os-row-chevron { color: var(--text-muted); text-align: center; width: 36px; }
.os-table tbody tr.os-row:hover .os-row-chevron { color: var(--primary, #2EA3F2); }

/* Detail modal info grid */
.os-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
    margin-top: 1.25rem;
}
.os-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-light);
}
.os-detail-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.os-detail-val { font-size: 0.9rem; color: var(--text-primary); }
.os-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.os-status-bar strong { color: var(--text-primary); }
.os-books-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary, #2EA3F2);
    text-decoration: none;
    white-space: nowrap;
}
.os-books-link:hover { text-decoration: underline; }
@media (max-width: 700px) {
    .os-detail-grid { grid-template-columns: 1fr; }
}

/* ---- Other Services: Invoices section ---- */
.os-invoices-wrap { margin-top: 0.25rem; }
.os-inv-loading, .os-inv-empty, .os-inv-fully {
    font-size: 0.8125rem; color: var(--text-muted); padding: 0.5rem 0.1rem;
}
.os-inv-balance {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
    padding: 0.6rem 0.85rem; margin-bottom: 0.6rem;
    background: var(--bg-secondary); border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}
.os-inv-balance > div { display: flex; flex-direction: column; gap: 0.1rem; }
.os-inv-b-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); font-weight: 600; }
.os-inv-b-val { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.os-inv-b-remain .os-inv-b-val { color: var(--primary, #ea7600); }

.os-inv-list { display: flex; flex-direction: column; gap: 0.4rem; }
.os-inv-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-light); border-radius: var(--radius-md);
    background: #fff;
}
.os-inv-row-main { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 0.1rem; }
.os-inv-ref { font-weight: 600; color: var(--text-primary); font-size: 0.82rem; }
.os-inv-num { font-size: 0.68rem; color: var(--text-muted); font-family: monospace; }
.os-inv-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-primary); }
.os-inv-pill { font-size: 0.62rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.os-inv-pill-paid { background: #dcfce7; color: #166534; }
.os-inv-pill-open { background: #dbeafe; color: #1e40af; }
.os-inv-pill-warn { background: #fef3c7; color: #92400e; }
.os-inv-pill-draft { background: #f1f5f9; color: #475569; }
.os-inv-pill-muted { background: #f1f5f9; color: #94a3b8; }
.os-inv-row-actions { display: flex; gap: 0.3rem; }
.os-inv-iconbtn {
    width: 30px; height: 30px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); background: var(--bg-secondary);
    color: var(--text-secondary); transition: var(--transition-fast); font-size: 0.8rem;
}
.os-inv-iconbtn:hover { background: var(--border-light); color: var(--text-primary); }
.os-inv-iconbtn.os-inv-del:hover { background: #fee2e2; color: #dc2626; }
.os-inv-newbtn { margin-top: 0.65rem; }
.os-inv-hint { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }
.os-inv-li-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; white-space: pre-line; }

/* New-invoice form: "use remaining" shortcut + live after-balance preview */
.os-inv-amt-labelrow { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.3rem; }
.os-inv-fill-link {
    font-size: 0.72rem; font-weight: 600; color: var(--primary, #ea7600);
    background: none; border: none; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; gap: 0.3rem;
}
.os-inv-fill-link:hover { text-decoration: underline; }
.os-inv-after {
    margin-top: 0.55rem; padding: 0.6rem 0.75rem; border-radius: var(--radius-md);
    font-size: 0.8rem; line-height: 1.4;
    border: 1px solid var(--border-light); background: var(--bg-secondary); color: var(--text-secondary);
}
/* Empty + error states are a simple icon + text row */
.os-inv-after-muted, .os-inv-after-bad { display: flex; align-items: center; gap: 0.5rem; }
.os-inv-after-muted { color: var(--text-muted); }
.os-inv-after-muted i { opacity: 0.65; }
.os-inv-after-bad { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.os-inv-after-bad strong { color: #b91c1c; font-variant-numeric: tabular-nums; }
/* Success state is a titled two-stat block */
.os-inv-after-ok { background: #ecfdf5; border-color: #a7f3d0; }
.os-inv-after-head {
    display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem;
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #047857;
}
.os-inv-after-pill {
    margin-left: auto; font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
    padding: 0.1rem 0.45rem; border-radius: var(--radius-full); background: #10b981; color: #fff;
}
.os-inv-after-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.os-inv-after-col { display: flex; flex-direction: column; gap: 0.15rem; }
.os-inv-after-col + .os-inv-after-col { border-left: 1px solid #a7f3d0; padding-left: 0.9rem; }
.os-inv-after-cap { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; color: #059669; font-weight: 600; }
.os-inv-after-val { font-size: 1rem; font-weight: 700; color: #065f46; font-variant-numeric: tabular-nums; }
.os-inv-after-val small { font-size: 0.72rem; font-weight: 500; color: #047857; opacity: 0.8; }
.os-inv-after-remain { font-size: 1.1rem; }

/* Invoice list: align amount + running "remaining after" columns under a header */
.os-inv-amt { min-width: 86px; text-align: right; }
.os-inv-remaincol { min-width: 86px; text-align: right; font-size: 0.82rem; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-inv-remaincol strong { color: var(--primary, #ea7600); font-weight: 700; }
.os-inv-pillcol { display: flex; justify-content: flex-end; min-width: 66px; }
.os-inv-row-actions { min-width: 66px; justify-content: flex-end; }
.os-inv-head { background: var(--bg-secondary); border-style: dashed; padding-top: 0.35rem; padding-bottom: 0.35rem; }
.os-inv-head > *, .os-inv-head .os-inv-row-main > span {
    font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); font-weight: 700;
}
.os-inv-head .os-inv-row-main { cursor: default; }

/* Main Other Services table — "Remaining" column (filled async, shown bold) */
.os-rowremain { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-rem-open { color: var(--primary, #ea7600); font-weight: 700; }
.os-rem-zero { color: #059669; font-weight: 700; }
.os-rem-dash, .os-rem-loading { color: var(--text-muted); }

/* Invoice timeline (newest first) — date/time rail + card per invoice */
.os-timeline { display: flex; flex-direction: column; }
.os-tl-item { display: grid; grid-template-columns: 88px 22px 1fr; gap: 0 0.55rem; position: relative; padding-bottom: 0.7rem; }
.os-tl-item:last-child { padding-bottom: 0; }
.os-tl-when { text-align: right; padding-top: 0.6rem; display: flex; flex-direction: column; gap: 0.1rem; }
.os-tl-date { font-size: 0.72rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.os-tl-time { font-size: 0.66rem; color: var(--text-muted); }
.os-tl-rail { position: relative; }
.os-tl-rail::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--border-light); }
.os-tl-item:first-child .os-tl-rail::before { top: 16px; }
.os-tl-item:last-child .os-tl-rail::before { bottom: calc(100% - 16px); }
.os-tl-dot {
    position: absolute; left: 4px; top: 9px; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 3px solid var(--primary, #ea7600); box-sizing: border-box; z-index: 1;
}
.os-tl-dot-paid { border-color: #16a34a; }
.os-tl-dot-sent { border-color: #2563eb; }
.os-tl-dot-warn { border-color: #d97706; }
.os-tl-dot-muted { border-color: #94a3b8; }
.os-tl-dot-draft { border-color: #94a3b8; }
.os-tl-body {
    background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 0.55rem 0.7rem; cursor: pointer; transition: var(--transition-fast); min-width: 0;
}
.os-tl-body:hover { border-color: var(--primary, #ea7600); box-shadow: var(--shadow-sm); }
.os-tl-line1 { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.os-tl-ref { font-weight: 700; color: var(--text-primary); font-size: 0.86rem; }
.os-tl-num { font-size: 0.66rem; color: var(--text-muted); font-family: monospace; margin-top: 0.1rem; }
.os-tl-line3 { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.45rem; flex-wrap: wrap; }
.os-tl-amt { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.os-tl-remain { font-size: 0.73rem; color: var(--text-secondary); }
.os-tl-remain strong { color: var(--primary, #ea7600); font-variant-numeric: tabular-nums; }
.os-tl-actions { margin-left: auto; display: flex; gap: 0.3rem; }

/* Mark-as-Completed blocking screen (processing → success/error) */
.osc-overlay {
    position: fixed; inset: 0; z-index: 12000; display: none;
    align-items: center; justify-content: center; padding: 1rem;
    background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(2px);
}
.osc-overlay.active { display: flex; }
.osc-card {
    width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; background: #fff;
    border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); padding: 1.6rem 1.5rem 1.3rem;
    text-align: center; animation: oscPop 0.18s ease-out;
}
@keyframes oscPop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.osc-spin { font-size: 2rem; color: var(--primary, #ea7600); }
.osc-head h3 { margin: 0.65rem 0 0.3rem; font-size: 1.15rem; color: var(--text-primary); }
.osc-head p { margin: 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }
.osc-steps {
    text-align: left; margin: 1.15rem 0 0.4rem; border: 1px solid var(--border-light);
    border-radius: 12px; padding: 0.3rem 0.85rem; background: var(--bg-secondary);
}
.osc-step {
    display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0;
    font-size: 0.85rem; color: var(--text-secondary); border-bottom: 1px solid var(--border-light);
}
.osc-step:last-child { border-bottom: none; }
.osc-step-active { color: var(--text-primary); font-weight: 600; }
.osc-step i { width: 16px; text-align: center; flex: none; }
.osc-ic-done { color: #16a34a; }
.osc-ic-fail { color: #ef4444; }
.osc-ic-active { color: #2563eb; }
.osc-ic-pending { color: #cbd5e1; }
.osc-note {
    margin-top: 0.85rem; font-size: 0.76rem; color: #b45309; background: #fffbeb;
    border: 1px solid #fde68a; border-radius: 8px; padding: 0.55rem 0.7rem;
    display: flex; align-items: center; gap: 0.45rem; justify-content: center; line-height: 1.4;
}
.osc-note-ok { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.osc-result-icon { font-size: 2.9rem; line-height: 1; margin-bottom: 0.1rem; }
.osc-result-icon.ok { color: #16a34a; }
.osc-result-icon.bad { color: #ef4444; }
.osc-result h3 { margin: 0.5rem 0 0.35rem; font-size: 1.2rem; color: var(--text-primary); }
.osc-result > p { margin: 0 0 0.5rem; font-size: 0.87rem; color: var(--text-secondary); line-height: 1.5; }
.osc-errmsg {
    color: #b91c1c !important; font-weight: 500; background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 8px; padding: 0.55rem 0.7rem; text-align: left;
}
.osc-errhint { font-size: 0.82rem; color: var(--text-secondary); }
.osc-summary {
    text-align: left; margin: 0.95rem 0 0; border: 1px solid var(--border-light);
    border-radius: 12px; overflow: hidden;
}
.osc-srow {
    display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border-light); font-size: 0.86rem;
}
.osc-srow:last-child { border-bottom: none; }
.osc-scap { color: var(--text-muted); font-weight: 600; }
.osc-sval { color: var(--text-primary); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.osc-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 1.1rem; }
.osc-actions .btn-primary, .osc-actions .btn-secondary { text-decoration: none; }

/* "Complete service" confirm — two separate step cards */
.osc-confirm { text-align: left; margin: 0.1rem 0; }
.osc-confirm-lead { font-size: 0.875rem; color: var(--text-secondary); margin: 0 0 0.9rem; text-align: center; }
.osc-confirm-step {
    display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.6rem;
    padding: 0.75rem 0.8rem; border: 1px solid var(--border-light); border-radius: 12px; background: var(--bg-secondary);
}
.osc-confirm-step:last-child { margin-bottom: 0; }
.osc-confirm-ic {
    flex: none; width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.osc-confirm-ic.ok { background: #e0e7ff; color: #4338ca; }
.osc-confirm-ic.warn { background: #fef3c7; color: #b45309; }
.osc-confirm-ic.muted { background: #e2e8f0; color: #64748b; }
.osc-confirm-txt { min-width: 0; }
.osc-confirm-h { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.2rem; }
.osc-confirm-d { font-size: 0.86rem; color: var(--text-primary); line-height: 1.45; }

/* Other Services detail modal — header with a prominent "Edit Service" action.
   .modal-close is absolutely positioned top-right, so reserve room for it. */
.os-detail-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.os-detail-heading { min-width: 0; }
.os-detail-edit { flex: none; margin-right: 2.75rem; white-space: nowrap; }
@media (max-width: 640px) {
    .os-detail-header { flex-direction: column; }
    .os-detail-edit { margin-right: 0; }
}

/* Other Services — Open/Completed/All status sub-tabs */
.os-subtabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-light); }
.os-subtab {
    display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1rem;
    background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
    font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); transition: var(--transition-fast);
    margin-bottom: -1px;
}
.os-subtab:hover { color: var(--text-primary); }
.os-subtab.active { color: var(--primary, #ea7600); border-bottom-color: var(--primary, #ea7600); }
.os-subtab-count {
    font-size: 0.72rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: var(--radius-full);
    background: var(--bg-secondary); color: var(--text-muted); min-width: 1.3rem; text-align: center;
}
.os-subtab.active .os-subtab-count { background: var(--primary, #ea7600); color: #fff; }

/* Send-confirmation preview popup */
.os-confirm-preview { margin: 0.75rem 0 1rem; }
.os-confirm-preview-head {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: 0.5rem 0.75rem;
}
.os-confirm-frame {
    width: 100%;
    height: 62vh;
    min-height: 460px;
    border: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: #fff;
}
/* Make the send-confirmation popup roomier than the standard os-modal */
#osConfirmModal .modal-container.os-modal {
    max-width: 1040px;
    width: 96vw;
}
#osConfirmModal .modal-header h2 { font-size: 1.5rem; }
#osConfirmModal .os-modal-sub { font-size: 0.95rem; }
.os-confirm-role {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary, #2EA3F2);
    background: var(--info-light, #e6f4ff);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: 2px;
}

/* New Service modal — wider, two-column grid */
/* NOTE: use .modal-container.os-modal (two classes) so these win over
   .announcement-modal (one class), regardless of stylesheet order. */
.modal-container.os-modal {
    max-width: 920px;
    width: 94vw;
    padding: 0 2.25rem 2.25rem;
}
.os-modal .modal-header { padding: 1.75rem 0 0.25rem; }
.os-modal .modal-header h2 { font-size: 1.4rem; }
.os-modal-sub {
    margin: 0.35rem 0 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.os-modal .os-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem 2rem;
    margin-top: 1.5rem;
}
/* the grid gap handles spacing — kill the per-field bottom margin from .announcement-modal */
.os-modal .os-form-grid .form-group { margin-bottom: 0; }
.os-modal .os-form-grid .os-full { grid-column: 1 / -1; }
.os-modal .os-form-grid textarea { min-height: 58px; }
.os-modal label { margin-bottom: 0.45rem; }
.os-modal input,
.os-modal select,
.os-modal textarea { padding: 0.7rem 0.85rem; }

.os-modal .os-section-label {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--primary, #222E66);
    padding-bottom: 0.5rem;
    margin-top: 0.6rem;
    border-bottom: 1px solid var(--border-light);
}
.os-modal .os-form-grid .os-section-label:first-child { margin-top: 0; }
.os-modal .os-section-label i { opacity: 0.85; }

@media (max-width: 700px) {
    .os-modal .os-form-grid { grid-template-columns: 1fr; }
}

/* Searchable combobox (Contact / Languages / Translator) */
.os-combo { position: relative; }
.os-combo-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8125rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}
.os-modal .os-combo .os-combo-input { padding-left: 2.15rem; }
.os-combo-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,0.15));
    max-height: 230px;
    overflow-y: auto;
    padding: 0.25rem;
}
.os-combo-menu.open { display: block; }
.os-combo-opt {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.os-combo-opt:hover { background: var(--bg-secondary); }
.os-combo-opt-main { font-size: 0.85rem; color: var(--text-primary); font-weight: 500; }
.os-combo-opt-sub { font-size: 0.7rem; color: var(--text-muted); }
.os-combo-empty {
    padding: 0.6rem 0.65rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Translator/Interpreter combo: options carry language pairs + certifications, so they're
   taller and laid out in two columns (identity+pairs left, certifications right), split by
   a blue divider. Other combos keep the compact single-column default. */
#osTranslatorMenu { max-height: 340px; }
#osTranslatorMenu .os-combo-opt {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0.7rem;
}
#osTranslatorMenu .os-combo-opt:not(:last-child) {
    border-bottom: 1px solid #93c5fd;   /* blue divider between teachers */
    border-radius: 0;
}
.os-opt-left { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.os-opt-right {
    display: flex; flex-wrap: wrap; gap: 0.25rem;
    justify-content: flex-end; align-content: flex-start;
    flex: 0 0 auto; max-width: 45%; padding-top: 0.1rem;
}
.os-opt-paircap {
    margin-top: 0.3rem; font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
}
.os-opt-paircap i { color: var(--primary, #ea7600); margin-right: 0.2rem; font-size: 0.6rem; }
.os-opt-pairs {
    margin-top: 0.1rem; font-size: 0.72rem; color: var(--text-secondary);
    white-space: pre-line;      /* keeps every line of the multi-line CRM field */
    overflow-wrap: anywhere;    /* a long pair can't overflow the left column */
    line-height: 1.35;
}
.os-opt-muted { margin-top: 0.25rem; color: var(--text-muted); font-style: italic; }
.os-opt-cert {
    font-size: 0.62rem; font-weight: 600; padding: 0.08rem 0.45rem; border-radius: 999px;
    background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; white-space: nowrap;
}
.os-combo-hint { display: block; margin-top: 0.3rem; font-size: 0.72rem; color: var(--text-muted); }
.os-hint-warn { color: #b45309; }

/* ==========================================================================
   Room Edit Modal
   ========================================================================== */
.room-edit-modal {
    max-width: 520px;
    width: 100%;
    padding: 2rem;
}

.room-edit-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.room-edit-modal .form-group {
    margin-bottom: 1rem;
}

.room-edit-modal label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.room-edit-modal input[type="text"],
.room-edit-modal input[type="number"],
.room-edit-modal select,
.room-edit-modal textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition-fast);
    font-family: inherit;
}

.room-edit-modal input:focus,
.room-edit-modal select:focus,
.room-edit-modal textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 46, 102, 0.1);
}


/* ==========================================================================
   Group Courses Tab
   ========================================================================== */
.gc-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.gc-loading i { margin-right: 0.5rem; color: var(--primary); }

.gc-course-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: var(--transition-fast);
}

.gc-course-card:hover { border-color: var(--border-medium); }
.gc-course-card.expanded { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.gc-course-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    gap: 1rem;
    user-select: none;
}

.gc-course-header:hover { background: var(--bg-secondary); }

.gc-course-main { flex: 1; min-width: 0; }

.gc-course-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-course-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.gc-course-meta i { margin-right: 0.25rem; opacity: 0.6; }

.gc-course-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.gc-course-stats {
    display: flex;
    gap: 0.5rem;
}

.gc-stat {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.gc-stat i { font-size: 0.6rem; }
.gc-stat-ok { background: var(--success-light); color: var(--success); }
.gc-stat-warn { background: var(--warning-light); color: var(--warning); }
.gc-stat-muted { background: var(--bg-tertiary); color: var(--text-muted); }

.btn-bulk-assign {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-bulk-assign:hover { background: var(--accent-dark); }

.gc-expand-icon {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

/* Course body (classes table) */
.gc-course-body {
    border-top: 1px solid var(--border-light);
    padding: 0;
    background: var(--bg-secondary);
}

.gc-classes-table { padding: 0; }

.gc-classes-head {
    display: grid;
    grid-template-columns: 140px 120px 100px 1fr 120px;
    padding: 0.5rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.gc-class-row {
    display: grid;
    grid-template-columns: 140px 120px 100px 1fr 120px;
    padding: 0.5rem 1.25rem;
    align-items: center;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

.gc-class-row:last-child { border-bottom: none; }
.gc-class-row:hover:not(.past) { background: var(--bg-primary); }

.gc-class-row.past { opacity: 0.5; }
.gc-class-row.cancelled { text-decoration: line-through; opacity: 0.4; }

.gc-class-date { font-weight: 500; color: var(--text-primary); }
.gc-class-time { color: var(--text-secondary); }
.gc-class-status { }
.gc-class-room { }
.gc-class-actions { display: flex; justify-content: flex-end; gap: 0.25rem; }

.gc-room-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.gc-room-badge.approved { background: var(--success-light); color: var(--success); }
.gc-room-badge.pending { background: var(--warning-light); color: var(--warning); }

.gc-room-unassigned {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--error);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.gc-room-unassigned i { font-size: 0.6rem; }

.btn-gc-assign {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-fast);
}

.btn-gc-assign:hover { background: var(--primary-light); }

/* Past classes toggle */
.gc-past-divider {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: var(--transition-fast);
}

.gc-past-divider:hover { color: var(--text-secondary); background: var(--bg-tertiary); }
.gc-past-divider i { font-size: 0.6rem; transition: var(--transition-fast); }

.gc-past-classes { display: none; }
.gc-past-classes.gc-past-visible { display: block; }

.gc-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-style: italic;
}

/* Bulk Assign Modal */
.bulk-assign-modal {
    width: 500px;
    max-width: 95vw;
    padding: 1.5rem;
}

.bulk-assign-info {
    padding: 0.75rem 1rem;
    background: var(--info-light);
    color: var(--info);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.bulk-assign-info p { margin: 0; }

.bulk-assign-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gc-room-loc-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.5rem 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.gc-room-loc-label:not(:first-child) {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
}

.room-pick-status.partial {
    font-size: 0.6875rem;
    color: var(--warning);
}

.room-pick-status.avail {
    font-size: 0.6875rem;
    color: var(--success);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .admin-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

@media (max-width: 768px) {
    .admin-header { padding: 0 1rem; }
    .header-brand span { display: none; }
    .nav-tab span { display: none; }
    .admin-content { padding: 80px 1rem 1rem; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .avail-controls { flex-direction: column; align-items: flex-start; }
    .room-dir-table-head { display: none; }
    .room-dir-row {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0.25rem 0.5rem;
        padding: 0.75rem 1rem;
    }
    .room-dir-td-desc { grid-column: 1 / -1; }
    .room-dir-td-actions { opacity: 1; }
    .review-info-grid { grid-template-columns: 1fr; }
    .review-actions { flex-wrap: wrap; justify-content: center; }
    .gc-course-header { flex-direction: column; align-items: flex-start; }
    .gc-course-right { width: 100%; justify-content: space-between; }
    .gc-classes-head { display: none; }
    .gc-class-row {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0.25rem 0.5rem;
    }
    .gc-class-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ==========================================================================
   Announcements Tab & Modal
   ========================================================================== */

/* Announcement Modal */
.announcement-modal {
    max-width: 580px;
    width: 100%;
    padding: 0 2rem 2rem;
}

.announcement-modal .form-group {
    margin-bottom: 1.125rem;
}

.announcement-modal label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.announcement-modal label small {
    font-weight: 400;
    color: var(--text-muted);
}

.announcement-modal input[type="text"],
.announcement-modal input[type="date"],
.announcement-modal select,
.announcement-modal textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition-fast);
    font-family: inherit;
    box-sizing: border-box;
}

.announcement-modal input:focus,
.announcement-modal select:focus,
.announcement-modal textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 46, 102, 0.1);
}

.announcement-modal textarea {
    resize: vertical;
    min-height: 80px;
}

.announcement-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.announcement-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

/* Announcement Cards List */
.ann-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: var(--transition-fast);
}

.ann-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ann-card.ann-inactive {
    opacity: 0.55;
}

.ann-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 1.25rem 0.5rem;
    gap: 1rem;
}

.ann-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.ann-card-title i {
    font-size: 1rem;
}

.ann-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.ann-card-meta i {
    margin-right: 0.2rem;
}

.ann-card-body {
    padding: 0 1.25rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.ann-card-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.ann-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ann-badge-pinned {
    background: var(--error-light);
    color: var(--error);
}

.ann-badge-active {
    background: #dcfce7;
    color: #16a34a;
}

.ann-badge-expired {
    background: #fee2e2;
    color: #dc2626;
}

.ann-badge-upcoming {
    background: #dbeafe;
    color: #2563eb;
}

/* Expired/upcoming cards are dimmed */
.ann-expired {
    opacity: 0.5;
}

.ann-upcoming {
    opacity: 0.75;
}

/* Type color accents */
.ann-type-info    { border-left-color: #3b82f6; }
.ann-type-warning { border-left-color: #f59e0b; }
.ann-type-urgent  { border-left-color: #ef4444; }
.ann-type-closure { border-left-color: #8b5cf6; }

.ann-type-info    .ann-card-title i { color: #3b82f6; }
.ann-type-warning .ann-card-title i { color: #f59e0b; }
.ann-type-urgent  .ann-card-title i { color: #ef4444; }
.ann-type-closure .ann-card-title i { color: #8b5cf6; }

/* Loading state */
.ann-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .announcement-modal .form-row {
        grid-template-columns: 1fr;
    }
    .ann-card-header {
        flex-direction: column;
    }
    .ann-card-actions {
        align-self: flex-end;
    }
}

/* ==========================================================================
   Accounting Tab
   ========================================================================== */
.acct-subtabs {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}
.acct-subtab {
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.acct-subtab:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
.acct-subtab.active {
    color: var(--primary);
    background: var(--primary-lighter);
    border-color: var(--primary-lighter);
}
.acct-subtab i { font-size: 0.875rem; }

/* Sub-tab content panels — sibling of subtab navigation */
.acct-subtab-content {
    /* visibility toggled inline by JS; this provides spacing only */
    margin-top: 0.25rem;
}

/* Header band that wraps the summary stat strip inside Payroll Preview and Missing Time */
.acct-payroll-header,
.acct-mt-header {
    margin-bottom: 0.25rem;
}

.acct-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.4rem;
    border-radius: var(--radius-full);
    background: var(--warning);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
}

/* Summary stat bar (reused by Payroll + Missing Time headers) */
.acct-summary {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}
.acct-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.acct-summary-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.acct-summary-value {
    font-size: 1.0625rem;
    color: var(--text-primary);
    font-weight: 700;
}
.acct-grand-total .acct-summary-value {
    color: var(--accent);
    font-size: 1.375rem;
}

/* Teacher payroll cards */
.acct-teacher-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1rem;
}
.acct-teacher-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.125rem 1.25rem;
}
.acct-teacher-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}
.acct-teacher-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.acct-teacher-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.acct-teacher-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.acct-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}
.acct-category-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed var(--border-light);
    font-size: 0.8125rem;
}
.acct-category-row:last-child { border-bottom: none; }
.acct-category-name { color: var(--text-primary); font-weight: 600; }
.acct-category-hours { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.acct-category-gross { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }

.acct-category-block { border-bottom: 1px dashed var(--border-light); padding-bottom: 0.35rem; }
.acct-category-block:last-child { border-bottom: none; padding-bottom: 0; }
.acct-category-block .acct-category-row { border-bottom: none; padding-bottom: 0.2rem; }

.acct-course-list { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.1rem 0 0.4rem 1rem; }
.acct-course-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    align-items: center;
    position: relative;
    padding: 0.1rem 0.35rem;
    margin: 0 -0.35rem;
    border-radius: var(--radius-sm);
    cursor: default;
    outline: none;
    transition: background 0.12s ease;
}
.acct-course-row:hover,
.acct-course-row:focus-visible { background: var(--bg-secondary); }
.acct-course-name {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.acct-course-info { font-size: 0.6rem; color: var(--text-muted); opacity: 0; transition: opacity 0.12s ease; margin-left: 0.15rem; }
.acct-course-row:hover .acct-course-info,
.acct-course-row:focus-visible .acct-course-info { opacity: 0.85; }
.acct-course-meta { color: var(--text-muted); font-size: 0.7rem; }

/* ---- Payroll course-line hover tooltip (full per-entry detail) ---- */
.acct-course-tip {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    width: min(380px, 86vw);
    max-height: 340px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(15, 23, 42, 0.18));
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
    pointer-events: none;
    text-align: left;
    cursor: default;
}
.acct-course-row:hover .acct-course-tip,
.acct-course-row:focus-visible .acct-course-tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* Flip to the right edge for the last column rows so it doesn't clip off-screen */
.acct-course-tip .acct-tip-head {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    background: var(--primary, #ea7600);
    color: #fff;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.acct-tip-title { font-weight: 700; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-tip-totals { font-size: 0.68rem; font-weight: 600; opacity: 0.92; white-space: nowrap; }
.acct-tip-body { padding: 0.35rem 0.55rem 0.5rem; }
.acct-tip-entry { padding: 0.4rem 0.15rem; border-bottom: 1px solid #f1f5f9; }
.acct-tip-entry:last-child { border-bottom: none; }
.acct-tip-line1 { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.acct-tip-date { font-weight: 600; color: var(--text-primary); font-size: 0.74rem; }
.acct-tip-amt { margin-left: auto; font-weight: 600; color: var(--text-primary); font-size: 0.74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-tip-status { font-size: 0.62rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.02em; }
.acct-tip-status.tip-st-paid { background: #dcfce7; color: #166534; }
.acct-tip-status.tip-st-open { background: #dbeafe; color: #1e40af; }
.acct-tip-status.tip-st-warn { background: #fef3c7; color: #92400e; }
.acct-tip-status.tip-st-muted { background: #f1f5f9; color: #475569; }
.acct-tip-sub { margin-top: 0.2rem; font-size: 0.68rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 0.5rem; }
.acct-tip-sub i { opacity: 0.7; margin-right: 0.15rem; }
.acct-tip-desc { margin-top: 0.2rem; font-size: 0.68rem; color: var(--text-muted); font-style: italic; line-height: 1.35; }

/* ---- Generate-Bill review modal (final check before billing) ---- */
.acct-gen-review { font-size: 0.8125rem; }
.acct-gen-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}
.acct-gen-summary > div { display: flex; flex-direction: column; gap: 0.1rem; }
.acct-gen-s-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); font-weight: 600; }
.acct-gen-s-val { font-size: 0.85rem; color: var(--text-primary); font-weight: 600; }
.acct-gen-s-total .acct-gen-s-val { color: var(--primary, #ea7600); font-size: 1.05rem; }
.acct-gen-warn {
    display: flex; flex-direction: column; gap: 0.3rem;
    padding: 0.6rem 0.85rem; margin-bottom: 0.75rem;
    background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-md);
    color: #92400e; font-size: 0.78rem;
}
.acct-gen-warn i { margin-right: 0.35rem; }
.acct-gen-note {
    padding: 0.55rem 0.85rem; margin-bottom: 0.9rem;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-md);
    color: #1e40af; font-size: 0.76rem; line-height: 1.4;
}
.acct-gen-note i { margin-right: 0.35rem; }
.acct-gen-sections { display: flex; flex-direction: column; gap: 0.9rem; max-height: 62vh; overflow-y: auto; padding-right: 0.25rem; }
.acct-gen-section { border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden; }
.acct-gen-section-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0.8rem; background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    font-weight: 700; font-size: 0.8rem; color: var(--text-primary);
}
/* Courses laid out as cards in a responsive grid to use the 80vw width */
.acct-gen-courses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 0.6rem;
    padding: 0.6rem;
    align-items: start;
    background: #eef2f7;
}
.acct-gen-course {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 0.55rem 0.7rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.acct-gen-course-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-light); margin-bottom: 0.4rem; }
.acct-gen-course-name { font-weight: 600; color: var(--text-primary); font-size: 0.8rem; }
.acct-gen-course-loc { font-weight: 500; color: var(--text-muted); font-size: 0.7rem; }
.acct-gen-course-tot { font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.acct-gen-entries { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.3rem; padding-left: 0.4rem; }
.acct-gen-entry {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.25rem 0.5rem; background: var(--bg-secondary); border-radius: var(--radius-sm);
    font-size: 0.74rem; color: var(--text-secondary);
}
.acct-gen-e-date { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.acct-gen-e-amt { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-gen-e-meta { flex-basis: 100%; color: var(--text-muted); font-size: 0.7rem; }
.acct-gen-e-desc { flex-basis: 100%; color: var(--text-muted); font-style: italic; font-size: 0.7rem; line-height: 1.35; }
.acct-course-hours { color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: right; }
.acct-course-gross { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.acct-missing-rate-inline { color: var(--warning); font-weight: 600; }

.acct-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}
.acct-meta-chip i { font-size: 0.65rem; opacity: 0.75; }

.acct-teacher-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.acct-teacher-actions button { font-size: 0.8125rem; padding: 0.5rem 0.875rem; }

/* Pills (status indicators across the tab) */
.acct-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.acct-pill i { font-size: 0.6rem; }
.acct-pill-unbilled { background: var(--bg-tertiary); color: var(--text-secondary); }
.acct-pill-draft    { background: var(--info-light);    color: var(--info); }
.acct-pill-open     { background: var(--warning-light); color: var(--warning); }
.acct-pill-paid     { background: var(--success-light); color: var(--success); }
.acct-pill-void     { background: var(--error-light);   color: var(--error); }
.acct-pill-partial  { background: var(--warning-light); color: var(--warning); }
.acct-pill-warn     { background: var(--warning-light); color: var(--warning); }

/* Category chips (for Time Entries table) */
.acct-cat-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    white-space: nowrap;
}
.acct-cat-chip.acct-cat-group           { background: #e0f2fe; color: var(--info); }
.acct-cat-chip.acct-cat-private-in-person { background: #fef9c3; color: var(--warning); }
.acct-cat-chip.acct-cat-private-online  { background: #f3e8ff; color: #7c3aed; }
.acct-cat-chip.acct-cat-corporate       { background: #fee2e2; color: var(--error); }
.acct-cat-chip.acct-cat-non-class       { background: var(--bg-tertiary); color: var(--text-secondary); }

/* Missing Time cards */
.acct-mt-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.acct-mt-teacher-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.125rem 1.25rem;
}
.acct-mt-teacher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}
.acct-mt-teacher-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.acct-mt-teacher-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}
.acct-mt-teacher-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--warning);
    text-align: right;
    line-height: 1;
}
.acct-mt-teacher-count span {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acct-mt-bucket {
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.625rem;
    border-left: 3px solid var(--border-medium);
    background: var(--bg-secondary);
}
.acct-mt-bucket.urgency-older      { border-left-color: var(--error);   background: var(--error-light); }
.acct-mt-bucket.urgency-last-week  { border-left-color: var(--warning); background: var(--warning-light); }
.acct-mt-bucket.urgency-this-week  { border-left-color: var(--info);    background: var(--info-light); }
.acct-mt-bucket-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
}
.acct-mt-bucket-count {
    background: var(--bg-primary);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
}
.acct-mt-class-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.acct-mt-class-list li {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--text-primary);
}
.acct-mt-class-date {
    color: var(--text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.acct-mt-class-name {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.acct-mt-class-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.acct-mt-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.875rem;
    flex-wrap: wrap;
}
.acct-mt-actions button,
.acct-mt-actions a { font-size: 0.8125rem; padding: 0.5rem 0.875rem; text-decoration: none; }

/* Bill review modal */
.acct-bill-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}
.acct-bill-lines {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.acct-bill-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.acct-bill-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.875rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
}
.acct-bill-line-table {
    width: 100%;
    border-collapse: collapse;
}
.acct-bill-line-table td {
    padding: 0.45rem 0.875rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.acct-bill-line-table tr:last-child td { border-bottom: none; }
.acct-bill-line-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }
.acct-bill-line-sub i { opacity: 0.7; margin-right: 0.2rem; }
.acct-bill-line-desc { font-style: italic; line-height: 1.35; }

/* Responsive */
@media (max-width: 768px) {
    .acct-teacher-cards { grid-template-columns: 1fr; }
    .acct-summary { gap: 1rem; padding: 0.875rem; }
    .acct-summary-value { font-size: 0.9375rem; }
    .acct-grand-total .acct-summary-value { font-size: 1.125rem; }
}

/* ============================================================================
   WEEKLY UPDATES tab — classes grouped by day of the week
   ============================================================================ */
.wk-summary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1.25rem; padding: 0.4rem 0.85rem;
    background: var(--accent-light); color: var(--accent-dark);
    border: 1px solid #fed7aa; border-radius: var(--radius-full);
    font-size: 0.82rem; font-weight: 600;
}
.wk-day-group { margin-bottom: 1.75rem; }
.wk-day-header {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.7rem 1rem; margin-bottom: 0.6rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff; border-radius: var(--radius-md);
    font-size: 1rem; font-weight: 700; letter-spacing: 0.01em;
}
.wk-day-header i { opacity: 0.85; }
.wk-day-check { width: 17px; height: 17px; cursor: pointer; accent-color: #E8833A; flex: 0 0 auto; }
.wk-day-title { display: inline-flex; align-items: center; gap: 0.45rem; }
.wk-day-count {
    min-width: 1.6rem; text-align: center;
    padding: 0.1rem 0.55rem; border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.22); font-size: 0.8rem; font-weight: 700;
}
/* Fixed layout + explicit column widths so EVERY day's table aligns identically
   (each day is its own <table>, so auto widths would drift row-to-row). 7 columns. */
.wk-table { table-layout: fixed; width: 100%; }
.wk-table th:nth-child(1), .wk-table td:nth-child(1) { width: 4%;  }  /* checkbox   */
.wk-table th:nth-child(2), .wk-table td:nth-child(2) { width: 18%; }  /* Class Name */
.wk-table th:nth-child(3), .wk-table td:nth-child(3) { width: 12%; }  /* Teacher    */
.wk-table th:nth-child(4), .wk-table td:nth-child(4) { width: 13%; }  /* Time       */
.wk-table th:nth-child(5), .wk-table td:nth-child(5) { width: 11%; }  /* Class Date */
.wk-table th:nth-child(6), .wk-table td:nth-child(6) { width: 12%; }  /* Location   */
.wk-table th:nth-child(7), .wk-table td:nth-child(7) { width: 13%; }  /* Room       */
.wk-table th:nth-child(8), .wk-table td:nth-child(8) { width: 17%; }  /* Students   */
.wk-table th { white-space: nowrap; }
.wk-table td { vertical-align: top; font-size: 0.85rem; word-wrap: break-word; overflow-wrap: break-word; }
.wk-nowrap { white-space: nowrap; }
.wk-name { font-weight: 600; color: var(--primary); }
.wk-muted { color: var(--text-muted); }
.wk-status {
    display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.45rem;
    border-radius: var(--radius-full); background: #fef3c7; color: #92400e;
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.wk-zoom {
    display: inline-flex; align-items: center; gap: 0.3rem;
    color: var(--accent-dark); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.wk-zoom:hover { text-decoration: underline; }
.wk-students { min-width: 180px; }
.wk-students-cell { display: inline-flex; align-items: flex-start; gap: 0.4rem; }
.wk-student-count {
    display: inline-block; min-width: 1.4rem; text-align: center; flex: none;
    padding: 0.05rem 0.4rem; border-radius: var(--radius-full);
    background: var(--primary-lighter); color: var(--primary); font-size: 0.72rem; font-weight: 700;
}
.wk-student-names { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.35; }
.wk-more { color: var(--primary); font-weight: 600; white-space: nowrap; }
.wk-online-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.1rem 0.5rem; border-radius: var(--radius-full);
    background: var(--primary-lighter); color: var(--primary);
    font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.wk-online-badge i { font-size: 0.66rem; }
.wk-no-zoom { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.wk-room-name { font-weight: 600; color: var(--text-primary); }
.wk-room-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    margin-top: 0.2rem; padding: 0.2rem 0.55rem;
    border: 1px solid var(--border); border-radius: var(--radius-full);
    background: #fff; color: var(--primary); cursor: pointer;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap; transition: all 0.15s ease;
}
.wk-room-btn:hover { border-color: var(--primary); background: var(--primary-lighter); }
.wk-room-btn.wk-room-assign { color: var(--accent-dark); border-color: #fed7aa; background: var(--accent-light); }
.wk-room-btn.wk-room-assign:hover { border-color: var(--accent); background: #ffedd5; }
.wk-room-btn i { font-size: 0.68rem; }

/* --- Filter bar --- */
.wk-filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
    margin-bottom: 1.25rem; padding: 0.75rem 0.9rem;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.wk-filter-search {
    position: relative; flex: 1 1 240px; min-width: 200px;
}
.wk-filter-search i {
    position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.8rem; pointer-events: none;
}
.wk-filter-search input {
    width: 100%; padding: 0.5rem 0.7rem 0.5rem 2rem;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    font-size: 0.85rem; color: var(--text-primary); background: var(--bg-subtle, #f8fafc);
}
.wk-filter-search input:focus {
    outline: none; border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 3px var(--primary-lighter);
}
.wk-filter-select {
    padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-md);
    font-size: 0.85rem; color: var(--text-primary); background: #fff; cursor: pointer;
    max-width: 190px;
}
.wk-filter-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-lighter); }
.wk-filter-clear {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.5rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: #fff; color: var(--text-muted); font-size: 0.82rem; font-weight: 600; cursor: pointer;
    transition: all 0.15s ease;
}
.wk-filter-clear.active { color: var(--accent-dark); border-color: #fed7aa; background: var(--accent-light); }
.wk-filter-clear:hover { border-color: var(--primary); color: var(--primary); }
.wk-summary strong { color: var(--accent-dark); }

/* Sticky day headers so the day stays visible while scrolling a long list. */
.wk-day-header { position: sticky; top: 0; z-index: 2; }

/* ===== Weekly Updates — email select + send ===== */
.wk-check { width: 34px; text-align: center; }
.wk-check input { width: 16px; height: 16px; cursor: pointer; }
.wk-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wk-email-toolbar { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wk-selall { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; cursor: pointer; }
.wk-sel-count { font-size: 13px; font-weight: 600; color: #222E66; }
.wk-email-btn { border: 0; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
    background: #222E66; color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.wk-email-btn-alt { background: #E8833A; }
.wk-email-btn:disabled { opacity: .45; cursor: not-allowed; }
.wk-email-btn:not(:disabled):hover { filter: brightness(1.08); }
/* preview modal */
.wk-email-summary { background: #eff4ff; border: 1px solid #dbe4ff; border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #1e293b; margin-bottom: 12px; }
.wk-email-skipped { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #9a3412; margin-bottom: 12px; }
.wk-email-skipped > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 7px; }
.wk-email-skipped > summary::-webkit-details-marker { display: none; }
.wk-skip-hint { font-weight: 400; color: #c2833f; font-size: 12px; }
.wk-skip-group { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #fed7aa; }
.wk-skip-reason { font-weight: 700; font-size: 12px; }
.wk-skip-reason em { font-style: normal; opacity: .7; }
.wk-skip-names { color: #b45309; font-size: 12px; margin-top: 3px; line-height: 1.5; }
.wk-email-controls { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.wk-email-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #64748b; }
.wk-email-field select { border: 1px solid #cbd5e1; border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.wk-email-recips { font-size: 13px; color: #475569; margin-bottom: 8px; }
.wk-email-subject { font-size: 13px; color: #1e293b; margin-bottom: 8px; }
.wk-email-subject span { font-weight: 700; color: #64748b; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; margin-right: 6px; }
/* two-column layout: info left, live preview right */
.wk-email-split { display: flex; gap: 22px; height: 100%; min-height: 0; }
.wk-email-left { flex: 0 0 410px; max-width: 430px; overflow-y: auto; min-height: 0; padding-right: 8px; }
/* switches — only shown for dimensions that vary across the selection */
.wk-email-switches { display: flex; flex-direction: column; gap: 16px; margin: 16px 0 4px; }
.wk-switch { display: flex; flex-direction: column; gap: 7px; }
.wk-switch-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #64748b; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.wk-chip { border: 1.5px solid #d1d9e6; background: #fff; color: #334155; border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .12s; }
.wk-chip:hover:not(.active) { border-color: #94a3b8; }
.wk-chip.active { background: #222E66; color: #fff; border-color: #222E66; }
.wk-switch-select { width: 100%; border: 1.5px solid #d1d9e6; border-radius: 9px; padding: 9px 11px; font-size: 13px; font-weight: 500; background: #fff; cursor: pointer; }
.wk-email-uniform { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 10px; padding: 11px 14px; font-size: 13px; margin: 16px 0 4px; }
.wk-email-nowview { font-size: 13px; color: #334155; margin: 16px 0 6px; }
.wk-nv-k { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-right: 7px; padding: 2px 7px; background: #eef2f7; border-radius: 5px; }
.wk-nv-count { color: #64748b; }
.wk-email-right { flex: 1 1 auto; display: flex; min-width: 0; min-height: 0; }
.wk-email-frame { flex: 1 1 auto; width: 100%; height: 100%; border: 1px solid #e2e8f0; border-radius: 10px; background: #ffffff; }
@media (max-width: 900px) {
    .wk-email-split { flex-direction: column; }
    .wk-email-left { flex: 0 0 auto; max-width: none; overflow: visible; }
    .wk-email-right { min-height: 420px; }
}
.wk-email-loading, .wk-email-error { padding: 24px; text-align: center; color: #64748b; }
.wk-email-error { color: #b91c1c; }


/* an in-page Beta chip for the tab headers themselves */
.beta-chip {
    display: inline-block;
    background: #fff7ed;
    color: #b45309;
    border: 1px solid #fed7aa;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* Destructive action in the Other Services detail modal. Secondary button
   styling with a red cast, so Delete never reads as the primary path. */
.os-danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff5f5;
}
.os-danger:hover {
    color: #7f1d1d;
    border-color: #fca5a5;
    background: #fee2e2;
}

/* --------------------------------------------------------------------------
   Administrator sign-in

   Covers the whole page until somebody is signed in — this screen used to load
   straight into the data.
   -------------------------------------------------------------------------- */
.admin-signin {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--primary) 0%, #16204a 100%);
}

.admin-signin-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-primary);
    border-radius: 14px;
    padding: 2.25rem 2rem 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.admin-signin-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 1.4rem;
}
.admin-signin-brand i { color: var(--accent); font-size: 1.2rem; }

.admin-signin-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.admin-signin-lead {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.2rem 0 1.6rem;
}

.admin-signin-card label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.admin-signin-card input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.admin-signin-card input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(234, 91, 12, 0.15);
}
#adminSignInCode {
    letter-spacing: 0.4em;
    font-size: 1.35rem;
    text-align: center;
    font-weight: 700;
}

.admin-signin-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 0.72rem 1rem;
    font-size: 0.92rem;
}

.admin-signin-back {
    display: block;
    width: 100%;
    margin-top: 0.8rem;
    background: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: underline;
}
.admin-signin-back:hover { color: var(--text-secondary); }

.admin-signin-error {
    margin: 1rem 0 0;
    padding: 0.6rem 0.75rem;
    background: var(--error-light);
    color: var(--error);
    border-radius: var(--radius-md);
    font-size: 0.83rem;
}

/* who is signed in, under the rail's title */
.rail-whoami {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.65rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex: none;
}
.rail-whoami-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rail-whoami-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-inverse);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rail-whoami-role {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}
.rail-signout {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition-fast);
}
.rail-signout:hover { background: rgba(255, 255, 255, 0.22); color: var(--text-inverse); }
