* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    background: #f3f4f6;
}

a { color: inherit; }

/* ---------- Auth (login) page ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b2545 0%, #13315c 50%, #8da9c4 100%);
    padding: 20px;
}
.auth-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 14px;
    padding: 40px 36px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 28px; }
.auth-logo img { max-width: 240px; height: auto; }
.auth-title { text-align: center; font-weight: 700; font-size: 1.4rem; color: #0b2545; margin-bottom: 4px; }
.auth-sub { text-align: center; font-weight: 300; font-size: 0.95rem; color: #6b7280; margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; font-weight: 700; color: #374151; margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 11px 14px;
    border: 1px solid #d1d5db; border-radius: 8px;
    font-family: 'Lato', sans-serif; font-size: 0.95rem;
    background: #f9fafb;
    transition: border-color .15s, background .15s;
}
.field input[type=file] { padding: 10px 12px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: #0b2545; background: #fff;
}
.btn-primary {
    display: inline-block;
    padding: 11px 24px;
    border: none; border-radius: 8px;
    background: #0b2545; color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700; font-size: 0.92rem;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
}
.btn-primary.full { display: block; width: 100%; }
.btn-primary:hover { background: #13315c; }
.auth-footer { text-align: center; margin-top: 22px; font-size: 0.8rem; color: #9ca3af; }

/* ---------- App shell (sidebar + main) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 280px;
    background: #0b2545;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-logo {
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: center;
    align-items: center;
}
.sidebar-logo img { max-width: 180px; width: 100%; height: auto; display: block; }

.sidebar-menu {
    flex: 1;
    padding: 14px 0;
    overflow-y: auto;
}
.sidebar-menu a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background .12s, color .12s, border-color .12s;
}
.sidebar-menu a:hover { color: #fff; }

.menu-top {
    display: block;
    padding: 12px 24px;
    border-left: 3px solid transparent;
    white-space: nowrap;
}
.menu-top:hover { background: rgba(255,255,255,0.05); }
.menu-top-action {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-top: 1px dashed rgba(255,255,255,0.12);
    color: #94a3b8;
    padding: 12px 24px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    white-space: nowrap;
    margin-top: 8px;
}
.menu-top-action:hover { color: #fff; background: rgba(255,255,255,0.04); }
.menu-top.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: #f59e0b;
}

.menu-group { border-left: 3px solid transparent; }
.menu-group-header {
    display: flex;
    align-items: stretch;
    width: 100%;
}
.menu-group-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 8px 12px 24px;
    white-space: nowrap;
    overflow: hidden;
}
.menu-group-label-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.menu-group.current .menu-group-label-btn { color: #fff; }
.menu-group-header:hover { background: rgba(255,255,255,0.05); }
.menu-group-label.active { color: #fff; }
.menu-toggle {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 0 18px 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .12s;
    flex-shrink: 0;
    min-width: 32px;
}
.menu-toggle::before {
    content: '+';
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}
.menu-group.open .menu-toggle::before { content: '−'; }
.menu-toggle:hover { color: #fff; }

/* When viewing a round (or any of its waves), highlight the whole header bar
   including the +/- toggle so it reads as the currently-focused section. */
.menu-group.current .menu-group-header {
    background: rgba(255,255,255,0.08);
    border-left: 3px solid #f59e0b;
    margin-left: -3px;
}
.menu-group.current .menu-toggle { color: #fff; }
.menu-group.current .menu-group-label { color: #fff; }

.menu-sub {
    display: none;
    background: rgba(0,0,0,0.15);
    padding: 4px 0;
}
.menu-group.open .menu-sub { display: block; }
.menu-sub-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 24px 9px 42px;
    font-size: 0.85rem;
    font-weight: 400;
    color: #cbd5e1;
    border-left: 3px solid transparent;
    margin-left: -3px;
    white-space: nowrap;
}
.menu-sub-item:hover { background: rgba(255,255,255,0.04); }
.menu-sub-item.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-weight: 700;
    border-left-color: #f59e0b;
}
.menu-sub-action {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #94a3b8;
    padding: 9px 24px 9px 42px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    white-space: nowrap;
}

.menu-sub-default {
    font-style: italic;
    color: #94a3b8;
    border-top: 1px dashed rgba(255,255,255,0.08);
    margin-top: 4px;
    padding-top: 11px !important;
}
.menu-sub-default.active {
    font-style: normal;
}
.menu-sub-upload {
    color: #cbd5e1;
    border-top: 1px dashed rgba(255,255,255,0.08);
    margin-top: 4px;
    padding-top: 11px !important;
}
.menu-sub-delete-round {
    color: #f87171 !important;
    border-top: 1px dashed rgba(255,255,255,0.08);
    margin-top: 4px;
    padding-top: 11px !important;
}
.menu-sub-delete-round:hover:not(:disabled) { color: #fff !important; background: #991b1b !important; }
.menu-sub-delete-round:disabled { color: #6b7280 !important; cursor: not-allowed; }
.menu-sub-action:hover { color: #fff; background: rgba(255,255,255,0.04); }

.menu-count {
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.menu-count.small { padding: 1px 8px; font-size: 0.7rem; }
.menu-group-label.active .menu-count,
.menu-sub-item.active .menu-count { background: #f59e0b; color: #0b2545; }

.sidebar-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user { margin-bottom: 10px; }
.user-name { font-weight: 700; color: #fff; font-size: 0.88rem; }
.user-email { font-weight: 300; color: #94a3b8; font-size: 0.78rem; margin-top: 2px; word-break: break-all; }
.sidebar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sidebar-signout {
    display: inline-block;
    padding: 7px 14px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    transition: background .12s;
}
.sidebar-signout:hover { background: rgba(255,255,255,0.2); }
.sidebar-pw-link {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sidebar-pw-link:hover { color: #fff; }

.main {
    flex: 1;
    min-width: 0;
    padding: 28px 36px 40px;
}
.page-header { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-weight: 900; color: #0b2545; font-size: 1.6rem; }
.page-body { }

/* ---------- Card ---------- */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ---------- Wave action bar ---------- */
.wave-action-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
/* Icons inside wave-action-bar OR inline search-bar buttons — same alignment. */
.wave-action-bar > button,
.search-bar > button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1;
}
.wave-action-bar > button svg,
.search-bar > button svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke-width: 2;
}
/* Status pill + wave length rendered inline next to the page title (h1). */
.page-header h1 .wave-status-badge { margin-right: 14px; vertical-align: middle; font-size: 0.72rem; }
.wave-header-length {
    margin-left: 12px;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 400;
    vertical-align: middle;
}
.wave-header-length strong { color: #0b2545; font-weight: 800; }
.page-title-count {
    margin-left: 0;
    font-size: 0.7em;
    color: #6b7280;
    font-weight: 500;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}
.wave-action-bar .btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}
.wave-action-bar .btn-danger:disabled {
    background: #fca5a5;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.7;
}
.wave-action-hint {
    font-size: 0.82rem;
    color: #6b7280;
}
.wave-edit-btn {
    margin-left: auto;
    padding: 9px 20px;
    border: none;
    border-radius: 7px;
    background: #7c3aed;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s;
}
.wave-edit-btn:hover { background: #6d28d9; }
.wave-preview-btn,
.wave-preview-students-btn,
.wave-commit-btn,
.wave-close-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 7px;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s;
}
.wave-preview-btn { background: #0891b2; }
.wave-preview-btn:hover { background: #0e7490; }
.wave-preview-students-btn { background: #0284c7; }
.wave-preview-students-btn:hover { background: #0369a1; }
.wave-commit-btn { background: #059669; }
.wave-commit-btn:hover { background: #047857; }
.wave-close-btn { background: #0b2545; }
.wave-close-btn:hover { background: #13315c; }
.wave-accepted-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 7px;
    background: #059669;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s;
}
.wave-accepted-btn:hover { background: #047857; }
.wave-upload-paid-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 7px;
    background: #7c3aed;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s;
}
.wave-upload-paid-btn:hover { background: #6d28d9; }

.wave-send-email-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 7px;
    background: #f59e0b;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s;
}
.wave-send-email-btn:hover { background: #d97706; }

.wave-seat-confirm-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 7px;
    background: #10b981;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s;
}
.wave-seat-confirm-btn:hover { background: #059669; }

.wave-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}
.wave-status-draft   { background: #e5e7eb; color: #374151; }
.wave-status-live {
    background: #ffedd5;
    color: #9a3412;
    animation: wave-live-text-blink 2.4s ease-in-out infinite;
}
.wave-status-live::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #c2410c;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    animation: wave-live-dot 2s ease-in-out infinite;
}
@keyframes wave-live-text-blink {
    0%, 100% { color: #9a3412; opacity: 1;   }
    50%      { color: #c2410c; opacity: 0.4; }
}
@keyframes wave-live-dot {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%      { opacity: 0.25; transform: scale(0.8); }
}
.wave-status-closed  { background: #d1fae5; color: #065f46; }
.wave-status-readonly { background: #f3e8ff; color: #6b21a8; }

/* Sidebar sub-items for post-commit read-only views (Spilled / Paid / Declined) —
   match "Wave N" padding so they align visually. */
.menu-sub-item.menu-sub-view {
    padding: 9px 24px 9px 42px;
    font-size: 0.85rem;
}
.menu-sub-item.menu-sub-view.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-weight: 700;
    border-left-color: #f59e0b;
}

/* Visual divider between successive waves in the sidebar (e.g. between
   "Wave 1 — Spilled" and "Wave 2"). */
.menu-sub-divider {
    height: 1px;
    background: rgba(255,255,255,0.12);
    margin: 6px 16px 6px 24px;
}

/* "Seats remaining: X / Y" hint under the count input in the Add-to-Wave modal.
   Painted green so it stands out from the cyan "Max available" line. */
#ooMaxHint .oo-seats-remaining,
.oo-seats-remaining { color: #059669 !important; font-weight: 700; }

/* Text-button mark-paid/unpaid in the Actions column of Paid / Declined views. */
.mark-status-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    font-family: 'Lato', Arial, sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    color: #fff;
}
.mark-status-btn.btn-primary,
.mark-status-btn.mark-icon-paid.btn-primary,
.mark-status-btn.mark-icon-paid.btn-primary.active { background: #10b981; border-color: #10b981; }
.mark-status-btn.btn-primary:hover,
.mark-status-btn.mark-icon-paid.btn-primary:hover,
.mark-status-btn.mark-icon-paid.btn-primary.active:hover { background: #059669; border-color: #059669; }

.mark-status-btn.btn-danger,
.mark-status-btn.mark-icon-paid.btn-danger,
.mark-status-btn.mark-icon-paid.btn-danger.active { background: #dc2626; border-color: #dc2626; }
.mark-status-btn.btn-danger:hover,
.mark-status-btn.mark-icon-paid.btn-danger:hover,
.mark-status-btn.mark-icon-paid.btn-danger.active:hover { background: #b91c1c; border-color: #b91c1c; }

.mark-status-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
/* Force white text regardless of the grey/.active rules defined later in this file. */
.mark-status-btn,
.mark-status-btn.mark-icon-paid,
.mark-status-btn.mark-icon-paid:hover,
.mark-status-btn.mark-icon-paid.active,
.mark-status-btn.mark-icon-paid.active:hover { color: #fff; }

/* Second-step commit modal typed-phrase input */
#commitFinalModal .field { margin-bottom: 12px; }
#commitFinalInput {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
#commitFinalInput:focus { outline: 2px solid #0891b2; outline-offset: 1px; }
#commitFinalBtn:disabled { background: #fca5a5; cursor: not-allowed; opacity: 0.6; }

/* Create Wave addons grid */
.cw-addons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 12px;
    margin-top: 6px;
}
.cw-addon-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.78rem;
    color: #4b5563;
    font-weight: 700;
}
.cw-addon-field input {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
}
.cw-preview {
    background: #f3f4f6;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 0.9rem;
    color: #0b2545;
}
.cw-preview strong { color: #0891b2; font-variant-numeric: tabular-nums; }
.cw-no-seats {
    padding: 20px 24px 10px;
    text-align: center;
}
.cw-no-seats-icon {
    font-size: 2.6rem;
    margin-bottom: 6px;
}
.cw-no-seats-head {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0b2545;
    margin-bottom: 8px;
}
.cw-no-seats-body {
    font-size: 0.92rem;
    color: #4b5563;
    line-height: 1.5;
    max-width: 460px;
    margin: 0 auto 14px;
}
.cw-no-seats-actions {
    justify-content: center !important;
    gap: 10px;
}

/* Allocation modal — sizes to its content (table + summary cards),
   capped at 95vw so it never overflows the viewport. */
.modal.alloc-modal {
    width: auto;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
/* Allocation preview modal sizes to its content (the program table). The
   Community column makes the table wide enough that the 5-card summary row
   has comfortable room without forcing an artificial minimum width — and the
   table fills the modal exactly, so there's no dead strip on either side. */
#allocModal .modal.alloc-modal {
    width: auto;
}
.alloc-modal-body {
    padding: 18px 22px 22px;
    overflow-y: auto;
}
.alloc-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-weight: 300;
}
.alloc-sim-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    font-weight: 500;
}
.alloc-sim-banner strong { font-weight: 700; }
.alloc-sim-banner .alloc-sim-hint {
    color: #475569;
    font-weight: 400;
    margin-left: 8px;
}
/* "(view)" link inside the Max-available hint of the Add-to-Wave modal. */
.oo-view-matches {
    color: #0891b2;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}
.oo-view-matches:hover { text-decoration: underline; }
.alloc-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.alloc-summary > div {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 8px 14px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 280px;
    max-width: 330px;
    flex: 0 0 auto;
}
.alloc-stat-label {
    font-size: 0.68rem;
    color: #6b7280;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.alloc-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
}
/* 4-card preview view (now 5 cards incl. Community): keep them all on one row.
   The 4 plain stat cards shrink to share the row; Community gets ~2.4× a
   stat card's width to fit its 5 sub-tiles. Split/accepted view is unaffected. */
.alloc-summary.alloc-summary-4 {
    flex-wrap: nowrap;
    align-items: stretch;
}
.alloc-summary.alloc-summary-4 > div {
    min-width: 0;
    max-width: none;
    flex: 1 1 0;
}
.alloc-summary.alloc-summary-4 > div.alloc-community-card {
    flex: 2.4 1 0;
}

/* Community analytics card — holds 5 sub-tiles. */
.alloc-community-card { justify-content: flex-start; }
.alloc-comm-tiles {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.alloc-comm-tile {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    padding: 3px 2px;
}
.alloc-comm-tile-label {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #6b7280;
}
.alloc-comm-tile-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.alloc-comm-tile-pct {
    font-size: 0.58rem;
    font-weight: 600;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

/* Per-program "Community" column in the allocation table.
   Each pill keeps its label · count · % on one row, but has a fixed width so
   the 5 of them line up as a clean, even grid across every program row. */
/* 5 pills × 90px + 4 inter-pill gaps × 4px = 466px content, + 5px cell
   padding each side = 476px. Sizing the column to exactly that removes the
   stray right-hand gap. */
.alloc-table th.alloc-comm-col {
    min-width: 476px;
    text-align: center;
    padding: 6px 5px;   /* matches the body cells' horizontal padding + the new row height */
}
.alloc-table td.alloc-comm-cell {
    padding: 4px 5px;
    text-align: left;   /* override the table's default right-align */
}
.alloc-comm-cell {
    white-space: normal;
}
.alloc-comm-cell .alloc-comm-pill,
td.alloc-comm-cell .alloc-comm-pill {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    box-sizing: border-box;
    width: 90px;
    margin: 1px 4px 1px 0;
    padding: 2px 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}
.alloc-comm-cell .alloc-comm-pill:last-child { margin-right: 0; }
.alloc-comm-pill-k {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #64748b;
}
.alloc-comm-pill-n {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0b2545;
}
.alloc-comm-pill-pct {
    font-size: 0.56rem;
    font-weight: 600;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

/* Cards that expose an eye-icon button for the per-program breakdown modal. */
.alloc-summary > div.has-detail {
    position: relative;
    padding-right: 36px;
}
.alloc-stat-detail-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.alloc-stat-detail-btn:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #0b2545;
}
.alloc-stat-detail-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

/* Per-program breakdown modal (eye icon → list of rows w/ progress bar + %). */
#allocStatDetailModal .modal {
    max-width: none;
    width: min(720px, 95vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
#allocStatDetailModal .pref-modal-header {
    padding: 18px 22px 12px;
    flex: 0 0 auto;
}
.alloc-stat-detail-body {
    padding: 6px 22px 22px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.asd-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 1100px) {
    .asd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
    .asd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .asd-grid { grid-template-columns: 1fr; }
}
.asd-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 0;
}
.asd-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.asd-card-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.asd-card-code {
    font-size: 0.85rem;
    color: #0b2545;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.asd-card-name {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.asd-card-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    margin-top: 2px;
}
.asd-stat-num {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.asd-stat-den {
    font-size: 0.85rem;
    color: #9ca3af;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.asd-card-meter-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.asd-bar {
    flex: 1 1 auto;
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    min-width: 0;
}
.asd-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.25s ease;
}
.asd-meter-pct {
    flex: 0 0 auto;
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Bulk actions sit inline inside .wave-action-bar when checkboxes are selected.
   The regular buttons are hidden via JS (display:none) while bulk is active. */
.wave-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.wave-bulk-actions[hidden] { display: none; }
.wave-bulk-count {
    font-size: 0.85rem;
    color: #4b5563;
    font-weight: 700;
}
.wave-bulk-move-btn,
.wave-bulk-del-btn,
.wave-bulk-clear-btn {
    padding: 9px 20px;
    border-radius: 7px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    /* 1px transparent border matches .wave-analytics-btn / .wave-over-offer-btn so
       the bar height doesn't shift when swapping between regular and bulk buttons. */
    border: 1px solid transparent;
}
.wave-bulk-move-btn { background: #0891b2; color: #fff; }
.wave-bulk-move-btn:hover { background: #0e7490; }
.wave-bulk-del-btn { background: #dc2626; color: #fff; }
.wave-bulk-del-btn:hover { background: #b91c1c; }
.wave-bulk-clear-btn { background: #e5e7eb; color: #374151; }
.wave-bulk-clear-btn:hover { background: #d1d5db; }
.wave-bulk-move-btn:disabled,
.wave-bulk-del-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.table-wrap .bulk-col { width: 36px; text-align: center; }
.table-wrap .bulk-col input[type=checkbox] { cursor: pointer; }

/* Preview Students: green badge on the pref column that got allotted for a student. */
.alloc-detail-table td.ps-pref-cell,
.alloc-detail-table td.ps-pref-allot { white-space: nowrap; }
.alloc-detail-table td.ps-pref-allot { background: #f0fdf4; }
.ps-pref-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #d1fae5;
    color: #065f46;
    font-weight: 700;
    font-size: 0.78rem;
}
/* Allotted Program pill in the main student list (Paid / Declined sub-views). */
.allot-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}
.allot-pill-paid     { background: #d1fae5; color: #065f46; }
.allot-pill-declined { background: #fee2e2; color: #991b1b; }

/* Sliding column pills (Yes / No) — same shape as the allotted-program pill. */
.slide-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.75rem;
}
.slide-pill-yes { background: #dbeafe; color: #1e40af; }
.slide-pill-no  { background: #f3f4f6; color: #6b7280; }
.slide-pill-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-variant-numeric: tabular-nums;
}
.slide-from-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}
.slide-to-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}
.allot-pill .allot-pill-pref {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.55);
    color: inherit;
}
/* Declined view: red highlight on the allotted pref (they declined the offer). */
.alloc-detail-table td.ps-pref-allot.ps-pref-allot-declined { background: #fef2f2; }
.ps-pref-badge.ps-pref-badge-declined { background: #fee2e2; color: #991b1b; }
/* "From" badge — neutral grey-blue so the green "To" badge stands out as the
   target program. Used in the slide preview modal's From column. */
.ps-pref-badge.ps-pref-badge-from { background: #e5e7eb; color: #374151; }
/* Preference analytics trigger in the wave action bar (replaces the old Add on Seats button). */
.wave-analytics-btn {
    background: #7c3aed;
    border: 1px solid #7c3aed;
    color: #fff;
    padding: 9px 20px;
    border-radius: 7px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.wave-analytics-btn:hover { background: #6d28d9; border-color: #6d28d9; }

/* Over Offer button (draft wave action bar, between Commit and Delete). */
.wave-over-offer-btn {
    background: #f59e0b;
    border: 1px solid #f59e0b;
    color: #fff;
    padding: 9px 20px;
    border-radius: 7px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.wave-over-offer-btn:hover { background: #d97706; border-color: #d97706; }

/* Over Offer — single-entry form (history lives in a separate modal) */
.modal-form.over-offer-main-modal { max-width: 720px; width: 95vw; }
.over-offer-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    margin-top: 4px;
}
.over-offer-form-grid .field { margin-bottom: 0; }
.over-offer-short { color: #b45309; font-weight: 700; }

/* Expand Wave — "Max available: N" hint under the Count input. */
#ooMaxHint {
    font-size: 0.7rem;
    color: #0891b2;
    font-weight: 700;
    letter-spacing: 0.02em;
}
/* History modal sits on top of the Over Offer modal. */
#overOfferHistoryModal { z-index: 1100; }
#overOfferHistoryModal .modal.over-offer-history-modal {
    max-width: none;
    width: min(900px, 95vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.over-offer-history-body {
    padding: 14px 22px 22px;
    overflow-y: auto;
}

/* Preference analytics modal — card grid */
#prefAnalyticsModal .modal {
    max-width: none;
    width: min(1100px, 95vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
#prefAnalyticsModal .pref-modal-header {
    padding: 18px 22px 12px;
    flex: 0 0 auto;
}
.pref-analytics-body {
    padding: 6px 22px 22px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.pref-analytics-hint {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 14px;
}
.pref-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.pa-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .15s, box-shadow .15s;
}
.pa-card:hover {
    border-color: #0891b2;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.12);
}
.pa-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.pa-card-code {
    display: inline-block;
    padding: 3px 9px;
    background: #0b2545;
    color: #fff;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.pa-card-total {
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pa-card-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0b2545;
    line-height: 1.3;
    min-height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pa-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 6px;
}
.pa-slot {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 8px 4px;
    text-align: center;
    min-width: 0;
}
.pa-slot-label {
    font-size: 0.66rem;
    color: #6b7280;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.pa-slot-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}
.alloc-table-wrap {
    overflow-x: auto;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
}
.alloc-table-wrap::-webkit-scrollbar { height: 10px; }
.alloc-table-wrap::-webkit-scrollbar-track { background: #f3f4f6; }
.alloc-table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
.alloc-table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.alloc-table {
    /* Size to content — not 100% — otherwise the table stretches to the modal
       width and the last column (Community) absorbs all the slack as dead space. */
    width: auto;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}
.alloc-table th,
.alloc-table td {
    padding: 6px 18px;
    text-align: right;
    border-bottom: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
}
.alloc-table th:last-child,
.alloc-table td:last-child { border-right: none; }
.alloc-table th {
    text-align: center;
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
    font-size: 0.72rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
}
.alloc-table th:nth-child(1),
.alloc-table th:nth-child(2),
.alloc-table td:nth-child(1),
.alloc-table td:nth-child(2) { text-align: left; }
.alloc-code { font-weight: 700; color: #0b2545; white-space: nowrap; }
.alloc-name { color: #374151; white-space: nowrap; min-width: 240px; }
.alloc-table th:nth-child(2) { min-width: 240px; }
.alloc-total { color: #0891b2; }
.alloc-remaining-zero { color: #dc2626; font-weight: 700; }
.alloc-over-note {
    font-size: 0.72rem;
    color: #b91c1c;
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: 0.02em;
}
.alloc-prior-paid { color: #065f46; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Offer Acceptance page */
.offer-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    align-items: center;
}
.pill.overall-pct {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    border: none;
}
.pill.overall-pct strong { color: #fff; }
.offer-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.offer-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color .15s, box-shadow .15s, transform .06s;
}
.offer-card:hover {
    border-color: #0891b2;
    box-shadow: 0 8px 24px rgba(11, 37, 69, 0.08);
    transform: translateY(-1px);
}
.offer-card.state-filled  { border-color: #a7f3d0; }
.offer-card.state-filled  .offer-card-pct { color: #059669; }
.offer-card.state-over    { border-color: #fecaca; }
.offer-card.state-over    .offer-card-pct { color: #dc2626; }
.offer-card.state-partial .offer-card-pct { color: #0891b2; }
.offer-card.state-empty   .offer-card-pct { color: #9ca3af; }

.offer-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.offer-card-code {
    display: inline-block;
    padding: 3px 10px;
    background: #0b2545;
    color: #fff;
    border-radius: 5px;
    font-size: 0.76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.offer-card-pct {
    font-size: 1.8rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.02em;
}
.offer-card-pct .pct-symbol {
    font-size: 1.05rem;
    font-weight: 700;
    margin-left: 2px;
    opacity: 0.7;
}
.offer-card-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0b2545;
    line-height: 1.35;
    min-height: 2.45em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.offer-fraction {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: #374151;
    font-variant-numeric: tabular-nums;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: 0;
}
.offer-fraction .offer-fraction-label { flex-shrink: 0; }
.offer-fraction .offer-rec-tag { flex-shrink: 0; }
.offer-accepted-num {
    font-size: 1.35rem;
    font-weight: 800;
    color: #059669;
}
.offer-card.state-over    .offer-accepted-num { color: #dc2626; }
.offer-card.state-empty   .offer-accepted-num { color: #9ca3af; }
.offer-fraction-sep {
    font-size: 1rem;
    color: #9ca3af;
    font-weight: 700;
}
.offer-total-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: #6b7280;
}
.offer-fraction-label {
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 4px;
}
.offer-bar-wrap {
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}
.offer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 3px;
    transition: width .4s ease;
}
.offer-card.state-over    .offer-bar-fill { background: linear-gradient(90deg, #f87171, #dc2626); }
.offer-card.state-empty   .offer-bar-fill { background: #e5e7eb; }
.offer-card-foot {
    display: flex;
    justify-content: flex-end;
}
.offer-foot-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    white-space: nowrap;
}
.offer-foot-tag strong { color: #0891b2; font-variant-numeric: tabular-nums; }
.offer-foot-tag.full   { background: #d1fae5; color: #065f46; }
.offer-foot-tag.over   { background: #fee2e2; color: #991b1b; }
.offer-foot-tag.dropout { background: #fef3c7; color: #92400e; }
.offer-foot-tag.dropout strong { color: #92400e; }
.offer-view-students-btn {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0b2545;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.offer-view-students-btn:hover { background: #0891b2; color: #fff; border-color: #0891b2; }
.offer-card-foot { display: flex; align-items: center; gap: 8px; }

/* Preference-distribution modal (programs page) */
.modal.pref-dist-modal {
    max-width: 900px;
    width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.pref-dist-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
}
.pref-dist-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}
.pref-dist-code {
    display: inline-block;
    padding: 4px 10px;
    background: #0b2545;
    color: #fff;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.pref-dist-name { font-size: 0.95rem; font-weight: 700; color: #0b2545; flex: 1; }
.pref-dist-total { font-size: 0.82rem; color: #6b7280; font-weight: 600; }
.pref-dist-chart {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
    align-items: end;
    padding-top: 10px;
}

/* Programs page cards */
.program-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.prog-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color .15s, box-shadow .15s, transform .06s;
}
.prog-card:hover {
    border-color: #0891b2;
    box-shadow: 0 8px 24px rgba(11, 37, 69, 0.08);
    transform: translateY(-1px);
}
.prog-card.unregistered { border-color: #fde68a; background: #fffbeb; }
.prog-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.prog-card-code {
    display: inline-block;
    padding: 3px 10px;
    background: #0b2545;
    color: #fff;
    border-radius: 5px;
    font-size: 0.76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.prog-card-actions { display: flex; gap: 4px; }
.prog-card-badge.warn {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.prog-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0b2545;
    line-height: 1.35;
    min-height: 2.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.prog-card-short {
    margin-top: 6px;
    display: inline-block;
    padding: 3px 10px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    align-self: flex-start;
}
.prog-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 14px;
}
.prog-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.prog-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.prog-stat-applicants { color: #0891b2; }
.prog-stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.prog-card-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.prog-chart-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.prog-chart-bars {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3px;
    align-items: end;
}
.prog-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.prog-chart-bar-wrap {
    width: 100%;
    height: 48px;
    background: #f3f4f6;
    border-radius: 2px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.prog-chart-bar {
    width: 100%;
    background: linear-gradient(180deg, #0891b2, #0e7490);
    border-radius: 2px 2px 0 0;
    min-height: 1px;
}
.prog-chart-tick {
    font-size: 0.58rem;
    color: #9ca3af;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.alloc-accepted { color: #065f46; font-weight: 700; background: #ecfdf5; }
.alloc-accepted strong { color: #065f46; }
/* Declined column — red equivalent of .alloc-accepted */
.alloc-declined { color: #991b1b; font-weight: 700; background: #fef2f2; }
.alloc-declined strong { color: #991b1b; }
.alloc-declined .alloc-accept-pct { color: #b91c1c; }
.alloc-accept-pct {
    color: #0e7490;
    font-weight: 700;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}
.alloc-accept-denom {
    color: #6b7280;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-right: 2px;
}
.alloc-overfilled-cell {
    color: #dc2626;
    font-weight: 700;
    background: #fef2f2;
}
.alloc-overfilled-zero {
    color: #9ca3af;
    font-weight: 500;
}
.alloc-over {
    font-size: 0.72rem;
    color: #b91c1c;
    font-weight: 700;
    margin-left: 4px;
    white-space: nowrap;
}
.alloc-foot-row td {
    background: #f9fafb;
    border-top: 2px solid #e5e7eb;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.alloc-foot-label {
    text-align: right !important;
    color: #0b2545;
}
.alloc-foot-num {
    text-align: center !important;
    color: #0891b2;
}
.alloc-foot-stat {
    text-align: right !important;
    color: #0891b2;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.alloc-table td.alloc-via { white-space: nowrap; text-align: center; }
.alloc-table td.alloc-via.empty { color: #d1d5db; }
.alloc-via-num {
    border: none;
    background: transparent;
    padding: 2px 4px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    border-radius: 4px;
}
.alloc-via-real { color: #0b2545; }
.alloc-via-real:hover { background: #dbeafe; }
.alloc-via-over { color: #b45309; }
.alloc-via-over:hover { background: #fef3c7; }
.alloc-via-plus { color: #9ca3af; padding: 0 1px; }

/* Clickable cells in the matrix that drill into a per-program student list:
   the bold "offered" total, the "(N over offered)" inline badge, and the
   accepted-view "Over filled" count. They're transparent buttons that inherit
   the surrounding cell's colour so the table layout stays unchanged. */
.alloc-num-btn {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.12s ease;
}
.alloc-num-btn:hover { background: rgba(15, 23, 42, 0.06); }
.alloc-num-total { padding: 1px 5px; }
.alloc-over-btn {
    font-size: 0.72rem;
    color: #b91c1c;
    font-weight: 700;
    margin-left: 4px;
    padding: 1px 5px;
    white-space: nowrap;
}
.alloc-over-btn:hover { background: #fee2e2; }
.alloc-overfilled-btn {
    padding: 1px 6px;
}
.alloc-overfilled-btn:hover { background: #fee2e2; }
.alloc-hint {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 300;
    margin-bottom: 10px;
}
.alloc-detail-body {
    padding: 18px 22px 22px;
    overflow-y: auto;
}
.alloc-detail-pref-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
/* When badge is in the detail header, keep title tight and push close to the right. */
#allocDetailModal .pref-modal-header .modal-title { flex: 0 0 auto; }
#allocDetailModal .pref-modal-header .pref-close-btn { margin-left: auto; }
.alloc-detail-pref-badge.real      { background: #dbeafe; color: #1e40af; }
.alloc-detail-pref-badge.over-cap  { background: #fef3c7; color: #92400e; }
.alloc-empty {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}
.alloc-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.alloc-detail-table th,
.alloc-detail-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
}
.alloc-detail-table th {
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
}
.alloc-detail-table td:first-child {
    color: #0b2545;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    width: 60px;
}
.alloc-detail-overall {
    color: #0891b2;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.alloc-detail-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.alloc-detail-search-wrap {
    position: relative;
    flex: 1;
}
.alloc-detail-controls input[type=text] {
    width: 100%;
    padding: 9px 34px 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
}
.alloc-detail-controls input[type=text]:focus {
    outline: none;
    border-color: #0891b2;
}
.alloc-detail-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background: #e5e7eb;
    color: #374151;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.alloc-detail-clear:hover { background: #0b2545; color: #fff; }
.alloc-detail-clear[hidden] { display: none; }
.preview-students-prog {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
    background: #fff;
    min-width: 260px;
    max-width: 360px;
}
.preview-students-prog:focus { outline: none; border-color: #0b2545; }
/* Highlight the preference cell whose code matches the scope the modal is filtered by. */
.alloc-detail-table td.alloc-detail-pref-match { background: #fef3c7; font-weight: 700; }

/* Paid students modal — Active/Dropout tabs + per-row actions */
.paid-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 12px;
}
.paid-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-family: 'Lato', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
}
.paid-tab:hover { color: #0b2545; }
.paid-tab.active { color: #0b2545; border-bottom-color: #0b2545; }
.paid-tab-count {
    display: inline-block;
    min-width: 22px;
    padding: 1px 8px;
    background: #e5e7eb;
    color: #374151;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}
.paid-tab.active .paid-tab-count { background: #0b2545; color: #fff; }
/* Management Seats page reuses the wave page's .search-bar + .status-filter
   styling. Action cell just needs to keep buttons on one line. */
.ms-table .actions-cell { white-space: nowrap; }
.ms-table .actions-cell button { margin-right: 4px; }
/* Confirm-modal summary block (Drop / Restore / Delete) — Name + Email + Program. */
.ms-confirm-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.5;
}
.ms-confirm-summary > div { margin: 1px 0; }
.ms-confirm-label {
    color: #6b7280;
    font-weight: 600;
    margin-right: 4px;
}

/* ---- Program Groups page ---- */
.pg-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}
.pg-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 18px;
}
.pg-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.pg-card-name {
    font-size: 1.02rem;
    font-weight: 700;
    color: #0b2545;
}
.pg-card-count {
    margin-left: 6px;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.pg-card-actions { display: inline-flex; gap: 6px; }
/* Program card grid — used both for displaying members of a group and for the
   ungrouped section. Each program is a small fixed-width card with the label
   "<code> - <short_name>" centered. */
.pg-prog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.pg-prog-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pg-prog-card-ungrouped {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}
.pg-card-empty {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.88rem;
}
.pg-empty-groups {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 18px;
}
.pg-ungrouped {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 18px;
}
.pg-ungrouped h3 {
    margin: 0 0 4px;
    color: #92400e;
    font-size: 0.95rem;
    font-weight: 700;
}
.pg-ungrouped h3 .pg-card-count { color: #b45309; }

/* Program checkbox list inside the Add/Edit modal — card grid with the
   checkbox centered horizontally above the "<code> - <name>" label. Cards
   tint blue when ticked for clear visual feedback. */
.pg-progs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
/* Selector scoped under .pg-progs-list so specificity beats the generic
   `.field label { display: block }` rule used elsewhere — without that scope
   the labels would be forced to block and the children would stack vertically. */
.pg-progs-list .pg-progs-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
    text-align: left;
    margin: 0;
}
.pg-progs-list .pg-progs-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.pg-progs-list .pg-progs-item input[type="checkbox"] {
    accent-color: #0b2545;
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
}
.pg-progs-list .pg-progs-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
}
.pg-progs-list .pg-progs-item.checked {
    background: #eff6ff;
    border-color: #1e3a8a;
}
.pg-progs-list .pg-progs-item.checked .pg-progs-label { color: #1e3a8a; }

/* ---- Sliding admin page ---- */
.slide-toolbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin: 4px 0 18px;
}
.slide-state {
    color: #6b7280; font-weight: 500;
    padding: 8px 14px; background: #f9fafb; border: 1px solid #e5e7eb;
    border-radius: 8px; flex: 1 1 auto;
}
.slide-state-open {
    background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a;
}
.slide-deadline-row {
    display: inline-flex; align-items: center; gap: 8px;
}
.slide-deadline-row label { font-weight: 600; color: #374151; font-size: 0.85rem; }
.slide-deadline-row input {
    padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px;
    width: 80px; font-family: 'Lato', sans-serif;
}
.slide-section-h {
    margin: 26px 0 10px; color: #0b2545; font-size: 1rem;
}
.manual-slide-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 22px 24px; max-width: 760px;
}
.rec-detail-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 10px 0 4px;
}
.rec-detail-grid > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding: 4px 0; }
.rec-lbl { color: #6b7280; font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: .3px; min-width: 95px; }
.rec-val { color: #0b2545; font-weight: 600; font-size: 0.92rem; word-break: break-word; }
.rec-notify-row { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: #374151; cursor: pointer; margin-top: 8px; }
.rec-notify-row input { margin: 0; }
.rec-detail-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
    margin: 12px 0 4px; font-size: 0.92rem;
    background: #fff;
}
.rec-detail-table th,
.rec-detail-table td { text-align: left; padding: 10px 14px; vertical-align: middle; word-break: break-word; }
.rec-detail-table th {
    width: 38%; min-width: 130px;
    background: #f9fafb; color: #6b7280;
    font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .3px;
    border-right: 1px solid #e5e7eb;
}
.rec-detail-table td { color: #0b2545; font-weight: 600; }
.rec-detail-table tbody tr + tr th,
.rec-detail-table tbody tr + tr td { border-top: 1px solid #e5e7eb; }
@media (max-width: 600px) {
    .rec-detail-grid { grid-template-columns: 1fr; gap: 2px 0; }
    .rec-detail-grid > div { flex-direction: column; align-items: flex-start; gap: 0; }
    .rec-lbl { min-width: 0; }
    .rec-detail-table th { width: 42%; min-width: 0; padding: 8px 10px; font-size: 0.72rem; }
    .rec-detail-table td { padding: 8px 10px; }
}
.manual-lookup-form { margin: 0; }
.manual-lookup-row {
    display: flex; gap: 10px; align-items: stretch; margin-top: 6px;
}
.manual-lookup-row input {
    flex: 1 1 auto; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px;
    font-family: inherit; font-size: 0.95rem;
}
.manual-lookup-row input:focus { outline: none; border-color: #0b2545; box-shadow: 0 0 0 3px rgba(11,37,69,.08); }
.manual-lookup-row .btn-primary { padding: 10px 18px; }
.manual-slide-panel { margin-top: 22px; padding-top: 20px; border-top: 1px dashed #e5e7eb; }
.manual-detail-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin-bottom: 18px;
}
.manual-detail-grid > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.manual-lbl { color: #6b7280; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .3px; min-width: 110px; }
.manual-val { color: #0b2545; font-weight: 600; font-size: 0.95rem; word-break: break-word; }
.manual-target-row { margin: 6px 0 14px; }
.manual-target-row select {
    display: block; margin-top: 6px; width: 100%; padding: 10px 12px;
    border: 1px solid #d1d5db; border-radius: 8px; font-family: inherit; font-size: 0.95rem;
    background: #fff;
}
.manual-target-row select:focus { outline: none; border-color: #0b2545; box-shadow: 0 0 0 3px rgba(11,37,69,.08); }
.manual-notify-row { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: #374151; cursor: pointer; }
.manual-notify-row input { margin: 0; }
.manual-preview-line {
    margin-top: 14px; padding: 12px 14px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 0.95rem; color: #1f2937;
}
.manual-preview-line:empty { display: none; }
.manual-badge {
    display: inline-block; padding: 1px 7px; background: #ede9fe; color: #5b21b6;
    border: 1px solid #ddd6fe; border-radius: 4px; font-size: 0.72rem; font-weight: 800;
    letter-spacing: .3px; vertical-align: middle;
}
.manual-badge-plus {
    background: #fef3c7; color: #92400e; border-color: #fde68a;
}

/* Community Breakdown — separate stats-only modal launched from the Final
   List "view students" header. It sits on top of the paid-students modal. */
#communityBreakdownModal { z-index: 1100; }
.modal.community-breakdown-modal { max-width: 720px; width: 95vw; }
.paid-comm-empty {
    padding: 36px 16px; text-align: center; color: #6b7280; font-size: 0.95rem;
}
.paid-comm-head {
    font-size: 0.9rem; color: #6b7280; margin: 4px 0 18px;
    text-align: center;
}
.paid-comm-head strong { color: #0b2545; }
.paid-comm-cards {
    /* All 5 community cards stay on one row — they shrink together rather than
       wrap (min-width:0 on the card) so ST never drops to a second line. */
    display: flex; gap: 12px; flex-wrap: nowrap; justify-content: center;
    margin-bottom: 20px;
}
.paid-comm-card {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 14px 10px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
}
.paid-comm-card-k {
    font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em;
}
.paid-comm-card-n {
    font-size: 1.5rem; font-weight: 800; color: #0b2545;
    font-variant-numeric: tabular-nums; line-height: 1.1;
}
.paid-comm-card-pct {
    font-size: 0.8rem; font-weight: 600; color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.audit-filters {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 18px;
}
.audit-filters input[type="text"] { flex: 1 1 280px; min-width: 220px; }
.audit-filters input,
.audit-filters select {
    padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px;
    font-family: inherit; font-size: 0.9rem; background: #fff; color: #1f2937;
}
.audit-filters input:focus,
.audit-filters select:focus {
    outline: none; border-color: #0b2545; box-shadow: 0 0 0 3px rgba(11, 37, 69, .08);
}
.audit-filters button { padding: 8px 18px; }
.modal.programs-upload-modal {
    width: min(880px, 95vw);
    max-width: min(880px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal.programs-upload-modal .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
#programsUploadPreview details {
    margin: 8px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    background: #f9fafb;
}
#programsUploadPreview details summary {
    cursor: pointer;
    font-weight: 700;
    color: #0b2545;
    padding: 4px 0;
}
#programsUploadPreview details[open] summary {
    margin-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
}
#programsUploadPreview table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.85rem;
}
#programsUploadPreview thead {
    background: #f3f4f6;
}
#programsUploadPreview th,
#programsUploadPreview td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    word-break: break-word;
    vertical-align: top;
}
#programsUploadPreview tbody tr:last-child td { border-bottom: 0; }
#programsUploadPreview th:first-child,
#programsUploadPreview td:first-child { width: 72px; }
#programsUploadPreview th:nth-child(3),
#programsUploadPreview td:nth-child(3) { width: 130px; }
#programsUploadPreview th:nth-child(4),
#programsUploadPreview td:nth-child(4),
#programsUploadPreview th:nth-child(5),
#programsUploadPreview td:nth-child(5) { width: 70px; text-align: right; }
.btn-outline-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: #fff; color: #0b2545;
    border: 1px solid #cbd5e1; border-radius: 8px;
    font-family: inherit; font-size: 0.92rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn-outline-action:hover {
    background: #f1f5f9; border-color: #0b2545;
}
.btn-outline-action:focus-visible {
    outline: 2px solid #3b82f6; outline-offset: 1px;
}
.btn-outline-action svg { flex-shrink: 0; }
.app-pref-hint {
    margin-top: 6px;
    font-size: 0.74rem;
    line-height: 1.45;
    color: #94a3b8;
    font-weight: 400;
}
.slide-opt-edit-btn {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: 6px; padding: 3px; width: 22px; height: 22px;
    background: transparent; border: 1px solid #e5e7eb; border-radius: 4px;
    color: #6b7280; cursor: pointer; vertical-align: middle;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.slide-opt-edit-btn:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.slide-opt-edit-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 1px; }
/* Make the SVG inside transparent to clicks so e.target is always the button. */
.slide-opt-edit-btn svg,
.slide-opt-edit-btn svg * { pointer-events: none; }
.audit-action-tag {
    display: inline-block; padding: 2px 8px; background: #eef2ff; color: #3730a3;
    border: 1px solid #c7d2fe; border-radius: 4px; font-size: 0.78rem; font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, monospace; letter-spacing: .2px;
}
.audit-table th, .audit-table td { vertical-align: top; }
.audit-table tbody tr:hover { background: #f9fafb; }
@media (max-width: 600px) {
    .manual-slide-card { padding: 16px; }
    .manual-detail-grid { grid-template-columns: 1fr; gap: 4px 0; }
    .manual-detail-grid > div { flex-direction: column; align-items: flex-start; gap: 0; padding: 4px 0; }
    .manual-lbl { min-width: 0; }
    .manual-lookup-row { flex-direction: column; }
    .manual-lookup-row .btn-primary { width: 100%; }
}
.slide-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 26px 0 10px;
}
.slide-section-head .slide-section-h { margin: 0; }
.slide-vac-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.slide-vac-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 12px 14px;
}
.slide-vac-ungrouped { background: #fffbeb; border-color: #fde68a; }
.slide-vac-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.slide-vac-code {
    background: #0b2545; color: #fff; padding: 2px 8px;
    border-radius: 6px; font-size: 0.74rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.slide-vac-tag {
    font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px;
    letter-spacing: 0.04em; text-transform: uppercase;
}
.slide-vac-tag-warn { background: #fef3c7; color: #92400e; }
.slide-vac-name {
    font-size: 0.85rem; font-weight: 600; color: #0b2545;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slide-vac-numbers {
    margin-top: 8px; display: flex; align-items: baseline; gap: 4px;
    font-variant-numeric: tabular-nums;
}
.slide-vac-vac { font-size: 1.4rem; font-weight: 700; color: #0891b2; line-height: 1.1; }
.slide-vac-of  { font-size: 1rem; color: #9ca3af; }
.slide-vac-tot { font-size: 0.95rem; font-weight: 600; color: #6b7280; }
.slide-vac-label { font-size: 0.7rem; color: #9ca3af; margin-left: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.slide-vac-sim {
    margin-top: 6px; font-size: 0.78rem; color: #1e40af; font-weight: 600;
}
/* Status pills on slide tables. */
.slide-status-pill {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 0.74rem; font-weight: 700; text-transform: capitalize;
}
.slide-status-pending       { background: #fef3c7; color: #92400e; }
.slide-status-accepted      { background: #d1fae5; color: #065f46; }
.slide-status-rejected      { background: #fee2e2; color: #991b1b; }
.slide-status-auto_declined { background: #fee2e2; color: #b91c1c; }
.slide-status-cancelled     { background: #e5e7eb; color: #4b5563; }
.slide-status-waited        { background: #cffafe; color: #155e75; }
/* Page-level tabs on the Sliding admin page (Vacancies vs Round & History). */
.slide-page-tabs { margin: 4px 0 16px; }
.slide-tab-pane[hidden] { display: none; }
/* Clickable "pending in / pending out" pills on each program card. */
.slide-pending-tag {
    border: none;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    transition: filter 0.12s ease, box-shadow 0.12s ease;
}
.slide-pending-tag:hover { filter: brightness(0.95); box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.slide-pending-in  { background: #fef3c7; color: #92400e; }
.slide-pending-out { background: #fee2e2; color: #991b1b; }
/* "Send email again" button inside the Pending Out modal. */
.btn-slide-resend {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0b2545;
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-slide-resend:hover { background: #eff6ff; border-color: #1e3a8a; color: #1e3a8a; }
.slide-table .actions-cell, .slide-history-table .actions-cell { white-space: nowrap; }
.slide-action-accept { background: #10b981 !important; color: #fff !important; }
.slide-action-accept:hover { background: #059669 !important; }
.slide-action-wait   { background: #0891b2 !important; color: #fff !important; }
.slide-action-wait:hover   { background: #0e7490 !important; }
.slide-action-reject { background: #ef4444 !important; color: #fff !important; }
.slide-action-reject:hover { background: #dc2626 !important; }

/* Preview Offers button — cyan outlined, eye icon + count badge.
   Distinct from the navy "Open Round" primary CTA so admins read it as
   "inspect, no side-effect" before committing. */
.btn-slide-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px 9px 14px;
    border: 1.5px solid #0891b2;
    border-radius: 8px;
    background: #ffffff;
    color: #0891b2;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-slide-preview:hover {
    background: #0891b2;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(8, 145, 178, 0.18);
}
.btn-slide-preview svg {
    width: 16px;
    height: 16px;
    display: block;
    flex: 0 0 16px;
}
.btn-slide-preview-count {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    background: #cffafe;
    color: #0e7490;
    font-size: 0.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
}
.btn-slide-preview:hover .btn-slide-preview-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}
/* Per-row "View email" link inside the slide preview list. */
.btn-slide-row-email {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0b2545;
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.btn-slide-row-email:hover { background: #eff6ff; border-color: #1e3a8a; color: #1e3a8a; }
/* Iframe variant of the email preview — strip inner padding so the email's
   own layout (which already has its own outer margin) doesn't double up. */
iframe.email-preview-frame { padding: 0; }

/* Upload Paid List — preview step before confirm. */
.upload-paid-modal { width: min(820px, 95vw); max-width: min(820px, 95vw); }
.upload-paid-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 6px 0 12px;
}
.ups-card {
    flex: 1 1 160px;
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    background: #ffffff;
}
.ups-card.good     { border-color: #a7f3d0; background: #ecfdf5; }
.ups-card.neutral  { background: #f9fafb; }
.ups-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ups-card.good .ups-label { color: #047857; }
.ups-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-top: 2px;
}
.ups-card.good .ups-value { color: #065f46; }
.upload-paid-tablewrap {
    max-height: 340px;
    overflow-y: auto;
    margin-bottom: 12px;
}
.ups-pct {
    color: #6b7280;
    font-size: 0.78em;
    font-weight: 500;
    margin-left: 2px;
}
/* Status pills inherit existing .alloc-status-* — fall through to the
   existing rules at line 2078+. */
.paid-action-cell { text-align: center; white-space: nowrap; }
.paid-dropout-btn, .paid-restore-btn {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
}
.paid-dropout-btn { background: #fff; color: #b91c1c; border-color: #fecaca; }
.paid-dropout-btn:hover { background: #fee2e2; }
.paid-restore-btn { background: #fff; color: #047857; border-color: #bbf7d0; }
.paid-restore-btn:hover { background: #dcfce7; }
.alloc-detail-table tr.paid-row-dropout td { text-decoration: line-through; text-decoration-color: #6b7280; color: #6b7280; font-style: italic; }
.alloc-detail-table tr.paid-row-dropout td.paid-action-cell { text-decoration: none; font-style: normal; }
#paidStudentsModal .modal.alloc-modal { width: calc(95vw - 100px); }
/* Keep the modal height constant across Active/Dropout tabs — the table area
   stays tall enough to fit a full 10-row page, even when the tab has 0–1 rows. */
#paidStudentsModal .alloc-detail-tablewrap { min-height: 440px; }
/* Dropout confirmation sits on top of the paid-students modal (base z-index 1000). */
#dropoutConfirmModal { z-index: 1100; }
/* Recommendation form opens on top of the Final list modal. */
#recFormModal { z-index: 1100; }
#recDeleteConfirmModal { z-index: 1100; }
/* Slide opt-in toggle is also launched from inside the paid-students modal. */
#slideOptModal { z-index: 1100; }
.paid-rec-delete-btn {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    background: #fee2e2;
    color: #991b1b;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
}
.paid-rec-delete-btn:hover { background: #fecaca; }
.paid-rec-btn { margin-left: auto; font-size: 0.78rem; padding: 6px 14px; }
.rec-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.alloc-detail-table tr.paid-row-rec td { background: #fffbeb; }
.alloc-detail-table td.dash-cell { text-align: center; }
/* Recommendations tab: every row has — in these columns, so centre the headers too
   (Rank=1, App No=2, Over all=6, Round=7, Wave=8). */
.alloc-detail-tablewrap.view-recommendation .alloc-detail-table thead th:nth-child(1),
.alloc-detail-tablewrap.view-recommendation .alloc-detail-table thead th:nth-child(2),
.alloc-detail-tablewrap.view-recommendation .alloc-detail-table thead th:nth-child(6),
.alloc-detail-tablewrap.view-recommendation .alloc-detail-table thead th:nth-child(7),
.alloc-detail-tablewrap.view-recommendation .alloc-detail-table thead th:nth-child(8) {
    text-align: center;
}
.offer-rec-tag {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.7rem;
    font-weight: 700;
}
.offer-rec-tag[hidden] { display: none; }
.dropout-line { padding: 4px 0; font-size: 0.92rem; color: #374151; }
.dropout-line .dropout-label { color: #6b7280; font-weight: 700; display: inline-block; min-width: 90px; }
.alloc-detail-info {
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 300;
    white-space: nowrap;
}
.alloc-detail-tablewrap {
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 12px;
}
/* Pref cells can get wide with full program names — let them stay on one line so the
   horizontal scroll handles overflow cleanly instead of wrapping into tall rows. */
.alloc-detail-table td { white-space: nowrap; }
.alloc-detail-pag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 10px;
}
.alloc-detail-pag a,
.alloc-detail-pag span {
    min-width: 32px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #0b2545;
    text-align: center;
    line-height: 1;
    transition: background .12s, color .12s, border-color .12s;
    font-variant-numeric: tabular-nums;
}
.alloc-detail-pag a { background: #fff; border: 1px solid #e5e7eb; }
.alloc-detail-pag a:hover { background: #0891b2; color: #fff; border-color: #0891b2; }
.alloc-detail-pag a.nav { padding: 6px 12px; font-weight: 900; }
.alloc-detail-pag span.current {
    background: #0b2545; color: #fff; border: 1px solid #0b2545;
}
.alloc-detail-pag span.disabled {
    color: #d1d5db; background: transparent; border: 1px solid transparent;
    cursor: not-allowed;
}
.alloc-detail-pag span.ellipsis {
    color: #9ca3af; border: none; min-width: auto; padding: 6px 4px;
}

.alloc-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.alloc-status-pending  { background: #fef3c7; color: #92400e; }
.alloc-status-paid     { background: #d1fae5; color: #065f46; }
.alloc-status-declined { background: #fee2e2; color: #991b1b; }

.alloc-action-cell { white-space: nowrap; }
.mark-btn {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    color: #0b2545;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    cursor: pointer;
    margin-right: 4px;
    transition: background .15s, border-color .15s;
}
.mark-btn:hover { background: #f3f4f6; }
.mark-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mark-paid     { color: #065f46; border-color: #a7f3d0; }
.mark-paid:hover     { background: #ecfdf5; }
.mark-declined { color: #991b1b; border-color: #fecaca; }
.mark-declined:hover { background: #fef2f2; }

.mark-icon {
    border-color: #d1d5db;
    color: #6b7280;
}
.mark-icon svg { width: 16px; height: 16px; }
.mark-icon-paid { color: #9ca3af; }
.mark-icon-paid:hover { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.mark-icon-paid.active { background: #10b981; color: #fff; border-color: #059669; }
.mark-icon-paid.active:hover { background: #059669; }

.mark-icon-declined { color: #9ca3af; }
.mark-icon-declined:hover { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.mark-icon-declined.active { background: #ef4444; color: #fff; border-color: #dc2626; }
.mark-icon-declined.active:hover { background: #dc2626; }

.paid-template-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 14px;
}

.menu-sub-action-wave[data-disabled-reason] {
    opacity: 0.45;
    cursor: pointer;
}
.menu-sub-action-wave[data-disabled-reason]:hover {
    opacity: 0.7;
}

#toastRoot {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: 16px 24px 16px 22px;
    border-radius: 10px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.98rem;
    background: #1f2937;
    color: #f9fafb;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    border-left: 6px solid #9ca3af;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity .3s ease, transform .3s ease;
    max-width: 560px;
    min-width: 320px;
    text-align: left;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 12px;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
    flex-shrink: 0;
}
.toast-info    { border-left-color: #38bdf8; }
.toast-info::before    { background: #38bdf8; }
.toast-success { border-left-color: #34d399; }
.toast-success::before { background: #34d399; }
.toast-warning { border-left-color: #fbbf24; }
.toast-warning::before { background: #fbbf24; }
.toast-error   { border-left-color: #f87171; }
.toast-error::before   { background: #f87171; }

.resize-hint {
    margin-top: 12px;
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 300;
    line-height: 1.45;
}

.pref-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid #0891b2;
    border-radius: 8px;
    background: #fff;
    color: #0891b2;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.pref-open-btn:hover { background: #0891b2; color: #fff; }
.pref-open-count {
    display: inline-block;
    min-width: 24px;
    padding: 0 6px;
    background: #0891b2;
    color: #fff;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.pref-open-btn:hover .pref-open-count { background: #fff; color: #0891b2; }

.status-filter {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    margin-left: auto;
}
.status-filter-count {
    font-weight: 400;
    font-size: 0.78rem;
    opacity: 0.75;
    margin-left: 3px;
}
.status-filter-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #4b5563;
    cursor: pointer;
    transition: background .15s, color .15s;
    border-right: 1px solid #e5e7eb;
}
.status-filter-btn:last-child { border-right: none; }
.status-filter-btn:hover { background: #f3f4f6; }
a.status-filter-btn { text-decoration: none; display: inline-block; }
.status-filter-btn.active {
    background: #0891b2;
    color: #fff;
}
.status-filter-btn.active:hover { background: #0e7490; }

.modal.pref-modal {
    max-width: 1200px;
    width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.pref-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}
.pref-modal-header .modal-title { flex: 1; margin: 0; }

/* Scope toggle inside the Preferences modal: Full Wave | Offered */
.pref-scope-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}
.pref-scope-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-family: 'Lato', Arial, sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pref-scope-tab:hover { border-color: #0891b2; color: #0891b2; }
.pref-scope-tab.active { background: #0b2545; border-color: #0b2545; color: #fff; }
.pref-scope-tab.active .pref-scope-count { background: rgba(255,255,255,0.2); color: #fff; }
.pref-scope-count {
    display: inline-block;
    min-width: 22px;
    padding: 2px 8px;
    background: #e5e7eb;
    color: #0b2545;
    border-radius: 999px;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}
.modal.pref-detail-modal {
    max-width: 900px;
    width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.pref-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
}
.pref-close-btn:hover { background: #e5e7eb; color: #0b2545; }

/* Export icon-button in modal headers (Preview Students, Allocation Detail,
   Paid Students). Sits next to the close button. */
.modal-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    margin-left: auto;
    margin-right: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #0b2545;
    font-family: inherit;   /* <button> doesn't inherit font-family — force Lato like the rest of the UI */
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.modal-export-btn:hover { background: #f3f4f6; border-color: #cbd5e1; }
.modal-export-btn svg { width: 14px; height: 14px; display: block; }
/* Sibling close button no longer needs auto-margin — the export btn took it. */
.pref-modal-header .modal-export-btn ~ .pref-close-btn { margin-left: 0; }
#allocDetailModal .pref-modal-header .modal-export-btn { margin-left: auto; }
#allocDetailModal .pref-modal-header .pref-close-btn { margin-left: 0; }

.pref-grid-view {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    overflow-y: auto;
}
@media (max-width: 1100px) { .pref-grid-view { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 780px)  { .pref-grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .pref-grid-view { grid-template-columns: 1fr; } }
.pref-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
    font-family: 'Lato', sans-serif;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pref-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.pref-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.pref-card-code {
    display: inline-block;
    padding: 3px 10px;
    background: #0b2545;
    color: #fff;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.pref-card-total {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}
.pref-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0b2545;
    line-height: 1.3;
}
.pref-card-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 6px;
    margin-top: 2px;
}
.pref-card-slot {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 8px 6px 8px;
    text-align: left;
    min-width: 0;
}
.pref-card-slot-label {
    font-size: 0.65rem;
    color: #9ca3af;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
}
.pref-card-slot-value {
    margin-top: 4px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.pref1-code {
    font-weight: 700;
    color: #0b2545;
    font-size: 0.82rem;
}
.pref1-name {
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pref1-count {
    font-weight: 700;
    color: #0891b2;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---------- Round tabs ---------- */
.round-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e5e7eb;
}
.round-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-weight: 700;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .12s, border-color .12s;
    font-size: 0.95rem;
    cursor: pointer;
}
.round-tab:hover { color: #0b2545; }
.round-tab.active {
    color: #0b2545;
    border-bottom-color: #f59e0b;
}
.round-count {
    background: #e5e7eb;
    color: #4b5563;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}
.round-tab.active .round-count {
    background: #0b2545;
    color: #fff;
}

/* ---------- Search bar ---------- */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
    flex-wrap: wrap;
}
.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 280px;
}
.search-bar input[type=text] {
    width: 100%;
    padding: 10px 38px 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 0.92rem;
    background: #fff;
    transition: border-color .15s;
}
.search-bar input[type=text]:focus {
    outline: none;
    border-color: #0b2545;
}
.search-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .12s, color .12s;
}
.search-clear:hover { background: #0b2545; color: #fff; }
.search-clear[hidden] { display: none; }

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    color: #374151;
    background: #e5e7eb;
    border-radius: 8px;
    transition: background .12s, color .12s;
}
.export-btn:hover { background: #0b2545; color: #fff; }
.export-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.export-caret { font-size: 10px; line-height: 1; margin-left: 2px; }
.export-wrap { position: relative; }
.export-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 6px;
    z-index: 100;
}
.export-menu[hidden] { display: none; }
.export-menu a {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: #0b2545;
    border-radius: 6px;
    transition: background .12s;
}
.export-menu a:hover { background: #f3f4f6; }
.export-menu a strong { display: block; font-weight: 700; font-size: 0.88rem; }
.export-menu a .help-sub { font-size: 0.78rem; color: #6b7280; font-weight: 300; }

/* ---------- Seat allocation page ---------- */
.allocation-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.alloc-table td, .alloc-table th { white-space: nowrap; }
.alloc-table input.alloc-seats,
.alloc-table input.alloc-pct {
    width: 90px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
    text-align: right;
}
.alloc-table input.alloc-seats:focus,
.alloc-table input.alloc-pct:focus { outline: none; border-color: #0b2545; }
.alloc-pct-cell {
    font-weight: 700;
    color: #6b7280;
    text-align: right;
}

/* Success badge shown inside a modal */
.success-badge {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.alloc-actions { margin-top: 18px; text-align: right; }
.bulk-apply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.bulk-apply-bar button {
    padding: 8px 16px;
    border-radius: 7px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
    background: #fff;
    color: #0b2545;
    border: 1px solid #d1d5db;
}
.bulk-apply-bar button:hover:not(:disabled) {
    background: #0b2545;
    color: #fff;
    border-color: #0b2545;
}
.bulk-apply-bar #clearAllBtn { color: #dc2626; }
.bulk-apply-bar #clearAllBtn:hover:not(:disabled) {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.bulk-apply-bar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
}

.search-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #0b2545;
    border-radius: 50%;
    display: none;
}
.slide-loading-modal { text-align: center; padding: 32px 28px; max-width: 420px; }
.slide-loading-spinner {
    width: 48px; height: 48px;
    margin: 0 auto 16px;
    border: 4px solid #e5e7eb;
    border-top-color: #0b2545;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.slide-loading-title { font-weight: 800; color: #0b2545; font-size: 1.05rem; margin-bottom: 6px; }
.slide-loading-sub { color: #6b7280; font-size: 0.9rem; line-height: 1.5; }
.search-spinner.active {
    display: inline-block;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#resultsContainer {
    transition: opacity .15s ease;
}
#resultsContainer.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

/* ---------- Data table ---------- */
.table-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}
.table-scroll {
    overflow-x: auto;
    /* always show scrollbar track so horizontal scroll is discoverable */
    scrollbar-color: #9ca3af #e5e7eb;
}
.table-scroll::-webkit-scrollbar { height: 12px; }
.table-scroll::-webkit-scrollbar-track { background: #e5e7eb; border-radius: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: #9ca3af; border-radius: 6px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #6b7280; }

table.data {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    table-layout: auto;
}
table.data thead th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 700;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
table.data tbody td {
    padding: 22px 20px;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 400;
    color: #374151;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.4;
}
table.data tbody tr:hover { background: #fafbfc; }
table.data .rank {
    font-weight: 900;
    color: #0b2545;
    width: 60px;
}
table.data .overall {
    font-weight: 700;
    color: #0b2545;
}
table.data .calc {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.82rem;
    margin-left: 4px;
}
table.data .actions-cell {
    white-space: nowrap;
}
.action-btns {
    display: inline-flex;
    gap: 6px;
    white-space: nowrap;
}
table.data .actions-cell .icon-btn {
    width: 32px;
    height: 32px;
}
.icon-btn svg {
    width: 15px;
    height: 15px;
    display: block;
    flex-shrink: 0;
}
.prefs-more {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
}
.prefs-popover {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 50;
    font-size: 0.82rem;
    min-width: 360px;
}
.prefs-popover.show { display: block; }
.prefs-popover ol { margin-left: 18px; }
.prefs-popover li { padding: 2px 0; }

.pagination {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fafbfc;
    border-top: 1px solid #f3f4f6;
    font-size: 0.85rem;
    color: #6b7280;
    flex-wrap: wrap;
}
.pagination .pages {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pagination .pages a,
.pagination .pages span {
    display: inline-block;
    min-width: 32px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    color: #0b2545;
    font-weight: 700;
    line-height: 1.2;
}
.pagination .pages a {
    border-color: #e5e7eb;
    background: #fff;
    transition: background .12s, border-color .12s, color .12s;
}
.pagination .pages a:hover {
    background: #0b2545;
    border-color: #0b2545;
    color: #fff;
}
.pagination .pages .current {
    background: #0b2545;
    color: #fff;
    border-color: #0b2545;
}
.pagination .pages .disabled {
    color: #d1d5db;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: not-allowed;
}
.pagination .pages .ellipsis {
    color: #9ca3af;
    font-weight: 400;
    padding: 6px 4px;
    min-width: 0;
}
.pagination .pages .nav { font-size: 1.05rem; }

/* ---------- Dashboard (apps listing) ---------- */
.dashboard-sub { color: #6b7280; font-weight: 300; margin-bottom: 22px; font-size: 0.92rem; }
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.app-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform .12s, box-shadow .12s;
    position: relative;
}
.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.app-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    padding-right: 80px;
}
.app-stream-badge,
.app-year-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.stream-engineering { background: #dbeafe; color: #1e40af; }
.stream-commerce    { background: #d1fae5; color: #065f46; }
.stream-law         { background: #fef3c7; color: #92400e; }
.app-year-badge { background: #0b2545; color: #fff; }
.app-card-title { font-weight: 900; font-size: 1.1rem; color: #0b2545; margin-bottom: 6px; }
.app-card-desc { font-weight: 300; font-size: 0.88rem; color: #6b7280; margin-bottom: 14px; line-height: 1.4; }
.app-card-stats {
    display: flex; gap: 14px;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
    font-size: 0.82rem;
    color: #6b7280;
    flex-wrap: wrap;
}
.app-card-stats strong { color: #0b2545; font-weight: 900; }
.app-card-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 4px;
}
.app-card-actions .icon-btn { width: 28px; height: 28px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.app-card-actions .icon-btn svg { width: 13px; height: 13px; }

/* "← All Apps" link — prominent, full-width separator above the app panel */
.sidebar-all-apps {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background .12s, color .12s;
}
.sidebar-all-apps svg { width: 14px; height: 14px; }
.sidebar-all-apps:hover { color: #fff; background: rgba(255,255,255,0.05); }

/* Current-app widget in sidebar — now just the app name/meta */
.sidebar-app-context {
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}
.sidebar-app-name { font-weight: 900; color: #fff; font-size: 0.95rem; margin-bottom: 2px; }
.sidebar-app-meta {
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex; gap: 8px; flex-wrap: wrap;
}

/* ---------- Page actions ---------- */
.page-actions {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------- Programs (accordion) ---------- */
.programs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.program-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}
.program-header-row {
    display: flex;
    align-items: stretch;
    border-left: 3px solid transparent;
    transition: border-color .12s, background .12s;
}
.program-card:has(.program-header[aria-expanded="true"]) .program-header-row {
    border-left-color: #f59e0b;
    background: #fafbfc;
}
.program-header {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: transparent;
    border: none;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}
.program-header:hover { background: #f9fafb; }
.program-code-badge {
    display: inline-block;
    background: #0b2545;
    color: #fff;
    font-weight: 900;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.badge-warn {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}
.program-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 14px;
}
.icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    border-radius: 7px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s, border-color .12s;
    padding: 0;
}
.icon-btn:hover {
    background: #0b2545;
    color: #fff;
    border-color: #0b2545;
}
.icon-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}
.btn-danger {
    padding: 9px 20px;
    border: none;
    border-radius: 7px;
    background: #dc2626;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }

.modal-form { max-width: 460px; }
.modal.rec-form-modal { max-width: 640px; width: 95vw; max-height: 92vh; overflow-y: auto; }
.modal-form.modal-wide {
    max-width: 820px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-form .field { margin-bottom: 14px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    margin-bottom: 8px;
}
.prefs-heading {
    font-weight: 700;
    color: #0b2545;
    margin: 16px 0 8px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}
.prefs-hint {
    display: block;
    font-weight: 300;
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}
.pref-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}
.pref-row select {
    flex: 1;
    min-width: 0;
}
.pref-clear {
    flex-shrink: 0;
    width: 36px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #6b7280;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.pref-clear:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.prefs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 14px;
    margin-bottom: 10px;
}
.modal-form .modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-form .btn-muted {
    padding: 9px 20px;
    background: #e5e7eb;
    color: #374151;
    border: none;
    border-radius: 7px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}
.modal-form .btn-muted:hover { background: #d1d5db; }
.modal .flash {
    margin-bottom: 14px;
    padding: 10px 14px;
    font-size: 0.85rem;
}

/* ---------- App create progress ---------- */
.app-create-progress[hidden] { display: none !important; }
.app-create-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 40px 20px 28px;
    text-align: center;
}
.app-create-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #0b2545;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
.app-create-progress.done .app-create-spinner {
    border-top-color: #10b981;
    animation: none;
    border: 4px solid #10b981;
    background: #10b981;
    position: relative;
}
.app-create-progress.done .app-create-spinner::after {
    content: '\2713';
    color: #fff;
    font-size: 26px;
    font-weight: 900;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.app-create-status {
    color: #0b2545;
    font-weight: 700;
    font-size: 0.95rem;
    min-height: 1.2em;
    transition: opacity .2s;
}
.app-create-progress.done .app-create-status { color: #065f46; }
.cw-preview {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 7px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-size: 0.88rem;
    line-height: 1.4;
}
.cw-preview.warn {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

/* ---------- Streams page ---------- */
.stream-manage-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    max-width: 720px;
}
.stream-manage-card form { margin-bottom: 18px; }
.stream-in-use {
    background: #e0e7ff;
    color: #3730a3;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 8px;
}

/* shared by streams page + any leftover modal list */
.stream-list {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
}
.stream-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}
.stream-row:last-child { border-bottom: none; }
.stream-row-name { flex: 1; color: #0b2545; font-weight: 400; }
.stream-row-name strong { color: #0b2545; font-weight: 900; }
.stream-row.confirming { background: #fef2f2; }
.stream-row .icon-btn { width: 28px; height: 28px; }
.stream-row .icon-btn svg { width: 13px; height: 13px; }
.stream-row .icon-btn.danger:disabled {
    background: #fca5a5;
    color: #fff;
    opacity: 0.55;
    cursor: not-allowed;
    border-color: #fca5a5;
}
.stream-row .btn-danger,
.stream-row .btn-muted {
    padding: 5px 12px;
    font-size: 0.78rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
}
.stream-row .btn-muted { background: #e5e7eb; color: #374151; }
.stream-row .btn-danger { background: #dc2626; color: #fff; }
.stream-empty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.88rem;
    font-weight: 300;
}
.stream-add-row {
    display: flex;
    gap: 8px;
}
.stream-add-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-family: 'Lato', sans-serif;
    font-size: 0.92rem;
}
.stream-add-row .btn-primary {
    padding: 10px 18px;
    font-size: 0.88rem;
}
.program-name {
    flex: 1;
    font-weight: 700;
    color: #0b2545;
    font-size: 0.98rem;
}
.program-total {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.85rem;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 999px;
}
.program-seats {
    font-weight: 700;
    color: #065f46;
    font-size: 0.85rem;
    padding: 4px 10px;
    background: #d1fae5;
    border-radius: 999px;
}
.program-caret {
    color: #9ca3af;
    font-size: 0.9rem;
    transition: transform .15s;
}
.program-header[aria-expanded="true"] .program-caret {
    transform: rotate(180deg);
    color: #0b2545;
}
.program-body {
    padding: 12px 20px 20px;
    border-top: 1px solid #f3f4f6;
    overflow-x: auto;
}
.rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.rank-table thead th {
    padding: 6px 4px 10px;
    color: #6b7280;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.rank-table tbody td {
    padding: 10px 4px 6px;
    text-align: center;
    vertical-align: top;
    min-width: 56px;
}
.rank-bar-wrap {
    width: 100%;
    height: 64px;
    background: #f3f4f6;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 6px;
}
.rank-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #13315c, #0b2545);
    border-radius: 0 0 4px 4px;
    transition: height .25s ease;
    min-height: 2px;
}
.rank-count {
    font-weight: 700;
    color: #0b2545;
    font-size: 0.9rem;
}

/* ---------- Empty state ---------- */
.empty {
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
}
.empty h3 { font-weight: 700; color: #374151; margin-bottom: 6px; }
.empty p { font-weight: 300; }

/* ---------- Upload form ---------- */
.upload-card { max-width: 640px; }
.upload-card .help {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 300;
    margin-top: 4px;
}
.upload-card .btn-primary { margin-top: 8px; }

.template-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 18px;
}
.template-block strong {
    color: #0b2545;
    font-weight: 700;
    font-size: 0.95rem;
}
.template-block .help-sub {
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 300;
    margin-top: 3px;
}
.template-block .btn-muted {
    padding: 10px 18px;
    background: #0b2545;
    color: #fff;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.template-block .btn-muted:hover { background: #13315c; }

/* ---------- Upload preview ---------- */
.preview-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.pill-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 400;
}
.pill strong { font-weight: 900; }
.pill.neutral { background: #e5e7eb; color: #374151; }
.pill.good    { background: #d1fae5; color: #065f46; }
.pill.bad     { background: #fee2e2; color: #991b1b; }
.pill.warn    { background: #fef3c7; color: #92400e; }
.preview-filename {
    font-size: 0.82rem;
    color: #6b7280;
    margin-left: 6px;
}
.preview-actions { display: flex; gap: 10px; }
.preview-actions .btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}
.preview-actions .btn-muted {
    padding: 10px 20px;
    background: #e5e7eb;
    color: #374151;
    border: none;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.preview-actions .btn-muted:hover { background: #d1d5db; }

.filter-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-size: 0.9rem;
}
.filter-bar label { cursor: pointer; color: #374151; font-weight: 700; }
.filter-bar input[type=radio] { margin-right: 6px; }
.filter-bar .pagination-info {
    margin-left: auto;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 400;
}

.tag-good, .tag-bad {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}
.tag-good { background: #d1fae5; color: #065f46; }
.tag-bad  { background: #fee2e2; color: #991b1b; }
.err-reasons {
    font-size: 0.72rem;
    font-weight: 400;
    color: #991b1b;
    margin-top: 4px;
    max-width: 300px;
    white-space: normal;
}
.row-invalid { background: #fef2f2; }
.row-invalid:hover { background: #fee2e2 !important; }
.pref-blank { color: #9ca3af; }
.pref-unmapped { color: #991b1b; }
.pref-unmapped .tag-bad { margin-right: 4px; }

.flash {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-weight: 400;
    font-size: 0.92rem;
}
.flash.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
    background: #fff;
    width: 100%; max-width: 400px;
    border-radius: 12px;
    padding: 28px 28px 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; color: #0b2545; }
.modal-body { font-weight: 300; color: #4b5563; margin-bottom: 20px; line-height: 1.5; }
.modal-actions { text-align: right; }
.modal-actions button {
    padding: 9px 20px;
    border: none; border-radius: 7px;
    background: #0b2545; color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700; font-size: 0.85rem;
    cursor: pointer;
    margin-left: 8px;
}
.modal-actions .btn-primary { background: #0b2545; color: #fff; }
.modal-actions .btn-primary:hover { background: #13315c; }
.modal-actions .btn-danger  { background: #dc2626; color: #fff; }
.modal-actions .btn-danger:hover  { background: #b91c1c; }
.modal-actions .btn-muted   { background: #e5e7eb; color: #374151; }
.modal-actions .btn-muted:hover   { background: #d1d5db; color: #0b2545; }
.modal-actions .btn-send-again { background: #10b981; color: #fff; }
.modal-actions .btn-send-again:hover { background: #059669; }
.modal-actions .btn-preview { background: #0891b2; color: #fff; }
.modal-actions .btn-preview:hover { background: #0e7490; }

/* Upload progress modal (shown while POSTing the xlsx to /upload.php) */
.modal.upload-progress-modal { width: min(460px, 95vw); max-width: min(460px, 95vw); }
.upload-progress-bar-outer {
    width: 100%;
    height: 14px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 14px 0 10px;
}
.upload-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0891b2, #0b2545);
    transition: width 0.2s ease-out;
    border-radius: 999px;
}
/* Indeterminate animation while server parses the file (percentage is unknowable). */
.upload-progress-bar-fill.upload-progress-indeterminate {
    width: 100% !important;
    background: linear-gradient(90deg,
        #e5e7eb 0%, #e5e7eb 30%,
        #0891b2 50%,
        #e5e7eb 70%, #e5e7eb 100%);
    background-size: 300% 100%;
    animation: upload-progress-sweep 1.2s linear infinite;
}
@keyframes upload-progress-sweep {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.upload-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #374151;
    gap: 12px;
}
.upload-progress-meta > #uploadProgressPct {
    font-weight: 700;
    color: #0b2545;
    font-variant-numeric: tabular-nums;
}
.paid-template-row .btn-preview {
    background: #0891b2; color: #fff;
    padding: 7px 14px; font-size: 0.78rem; font-weight: 700;
    border: none; border-radius: 6px; cursor: pointer;
    font-family: 'Lato', sans-serif;
}
.paid-template-row .btn-preview:hover { background: #0e7490; }

/* Generate-dummy-paid modal */
.modal.dummy-paid-modal { width: min(620px, 95vw); max-width: min(620px, 95vw); max-height: 85vh; display: flex; flex-direction: column; }
.dummy-paid-rows {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 55vh; overflow: auto;
    border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 10px 12px; margin-bottom: 14px;
    background: #f9fafb;
}
.dummy-paid-loading { color: #6b7280; font-size: 0.88rem; padding: 8px 4px; }
.dummy-paid-row {
    display: grid;
    grid-template-columns: 70px 1fr auto 80px auto;
    gap: 10px;
    align-items: center;
    padding: 6px 4px;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 0.88rem;
}
.dummy-paid-row:last-child { border-bottom: 0; }
.dummy-paid-code { font-family: 'Lato', sans-serif; font-weight: 700; color: #0b2545; }
.dummy-paid-name { color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dummy-paid-count { color: #6b7280; font-size: 0.78rem; font-weight: 600; }
.dummy-paid-pct {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
    text-align: right;
}
.dummy-paid-unit { color: #6b7280; font-weight: 600; }

/* Send-email confirmation modal has 3 actions (Cancel + Show Preview + Send) —
   give it enough width so they stay on a single line, and switch to flex so they
   align cleanly without wrapping inside the row. */
#sendEmailModal .modal { width: min(560px, 95vw); }
#sendEmailModal .modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
#sendEmailModal .modal-actions button { margin-left: 0; }

/* Per-row "Preview Email" button inside Preview Students (live wave only) */
.ps-email-preview-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #0b2545;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Lato', Arial, sans-serif;
    white-space: nowrap;
}
.ps-email-preview-btn:hover { background: #e2e8f0; border-color: #94a3b8; }

/* Single-candidate email preview modal */
.modal.email-preview-modal { width: min(1000px, 95vw); max-width: min(1000px, 95vw); max-height: 90vh; display: flex; flex-direction: column; }
.email-preview-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.email-preview-body .modal-actions { flex-shrink: 0; }
.email-preview-meta {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #1f2937;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.email-preview-meta .ep-label { color: #6b7280; font-weight: 600; margin-right: 6px; }
.email-preview-frame {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 65vh;
    height: 420px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 20px;
    box-sizing: border-box;
}
/* The email template centers its 620px container with margin:auto — in the preview
   we want it pinned to the left so it doesn't float in a wide modal. */
.email-preview-frame > div { margin: 0 !important; }
