/* =================================================================
   PRATHAM 2.0 — TTMS theme
   Palette pulled from the user's screenshots:
     - Navy primary:        #1c3d6f
     - Navy deep header:    #122a52
     - Gradient (cards/btn): #f5872a (orange)  ->  #5a3e9c (purple)
     - Gold/metallic title: #d6a647
     - Accents:             #28a745 (edit-green), #dc3545 (delete-red),
                             #ffc107 (yellow pill), #6f42c1 (purple pill),
                             #17a2b8 (info-blue pill)
   ================================================================= */

* { box-sizing: border-box; }

:root {
    --navy:        #1c3d6f;
    --navy-deep:   #122a52;
    --navy-darker: #0d1f3d;
    --orange:      #f5872a;
    --orange-soft: #f8a85b;
    --purple:      #5a3e9c;
    --purple-deep: #3e2872;
    --gold:        #d6a647;
    --gold-bright: #f3c969;

    --grad-or-pu:  linear-gradient(135deg, #f5872a 0%, #c95fa0 50%, #5a3e9c 100%);
    --grad-or-pu-btn: linear-gradient(90deg, #f59042 0%, #c95fa0 60%, #4a3a92 100%);
    --grad-dark:   linear-gradient(135deg, #1a1a1a 0%, #2a1f3d 100%);

    --bg:          #eef2f8;
    --card:        #ffffff;
    --border:      #d9def0;
    --text:        #1a2540;
    --muted:       #6b7593;

    --pill-blue-bg: #e0ecff;
    --pill-blue-fg: #1d5fb4;
    --pill-purple-bg: #ece4ff;
    --pill-purple-fg: #5a3e9c;
    --pill-green-bg: #dcf5e3;
    --pill-green-fg: #1f7a3a;
    --pill-yellow-bg: #fff4d1;
    --pill-yellow-fg: #8a6500;
    --pill-red-bg: #ffdcdc;
    --pill-red-fg: #b51d1d;

    --shadow-md: 0 8px 24px rgba(20, 30, 60, 0.10);
    --shadow-lg: 0 14px 40px rgba(15, 20, 50, 0.18);

    --radius: 10px;
    --radius-lg: 14px;
}

html, body { margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif; color: var(--text); }
body { background: var(--bg); min-height: 100vh; font-size: 14px; }
a { color: var(--navy); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ====================== TOASTS ====================== */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: 8px; box-shadow: var(--shadow-md); color: #fff; font-weight: 500; min-width: 280px; }
.toast-success { background: #1f7a3a; }
.toast-error   { background: #b51d1d; }
.toast-info    { background: var(--navy); }
.toast-warning { background: #8a6500; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body { background: #0a0e1f; }

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(120deg, rgba(20,30,60,0.55) 0%, rgba(90,62,156,0.45) 50%, rgba(34,139,80,0.55) 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23202830'/><stop offset='1' stop-color='%23414b5a'/></linearGradient></defs><rect width='1200' height='800' fill='url(%23g)'/><g opacity='0.18' fill='%23ffffff'><circle cx='180' cy='200' r='90'/><circle cx='980' cy='160' r='60'/><circle cx='1080' cy='600' r='110'/><circle cx='320' cy='620' r='70'/></g></svg>");
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 16px;
    position: relative;
}

.login-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(120deg, rgba(0,0,0,0.45), rgba(0,0,0,0.15) 50%, rgba(20,80,40,0.35) 100%);
    pointer-events: none;
}

.brand-banner {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 22px;
    background: var(--grad-dark);
    padding: 18px 42px;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    max-width: 920px;
    width: 100%;
    border: 1px solid rgba(214, 166, 71, 0.25);
}
.brand-logo {
    width: 78px; height: 78px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f3c969 0%, #a87f25 70%);
    display: flex; align-items: center; justify-content: center;
    color: #1a1a1a; font-weight: 800; font-size: 18px;
    box-shadow: 0 0 0 4px rgba(214, 166, 71, 0.25), 0 4px 14px rgba(0,0,0,0.5);
}
.brand-emblem { font-family: 'Cinzel', serif; }
.brand-emblem-sm { font-family: 'Cinzel', serif; font-weight: 800; color: var(--gold-bright); margin-right: 6px; }
.brand-text { color: #fff; }
.brand-title {
    margin: 0; font-family: 'Cinzel', serif; font-weight: 800;
    font-size: 38px; letter-spacing: 2px;
    background: linear-gradient(180deg, #ffe9a8 0%, #c69733 60%, #d6a647 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.brand-title span { color: #f3c969; -webkit-text-fill-color: initial; }
.brand-subtitle { margin: 4px 0 0; font-size: 13px; color: #e8e8e8; opacity: 0.9; }

.login-card {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: 1fr 1.1fr;
    width: 100%; max-width: 920px;
    margin-top: 28px;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.role-panel {
    background: var(--grad-or-pu);
    color: #fff;
    padding: 42px 30px;
    display: flex; flex-direction: column;
}
.role-title {
    margin: 0 0 30px; text-align: center;
    font-size: 22px; font-weight: 700; letter-spacing: 0.5px;
}
.role-buttons { display: flex; flex-direction: column; gap: 14px; flex: 1; justify-content: center; }
.role-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 28px;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}
.role-btn:hover { background: rgba(255,255,255,0.18); }
.role-btn.active { background: rgba(255,255,255,0.95); color: var(--purple); border-color: #fff; }

.login-form-panel { padding: 38px 36px; }
.form-title {
    margin: 0 0 22px; color: var(--navy);
    font-size: 22px; font-weight: 700; text-align: center;
}

.login-form .field { margin-bottom: 16px; }
.login-form label { display: block; font-weight: 600; margin-bottom: 6px; color: #2a3556; }
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%; padding: 11px 14px;
    border: 1px solid #d2d8ec; border-radius: 8px;
    background: #f7f9ff; font-size: 14px;
}
.login-form input:focus { outline: none; border-color: var(--orange); background: #fff; box-shadow: 0 0 0 3px rgba(245,135,42,0.15); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 42px; }
.eye-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; font-size: 16px; color: var(--navy);
}

.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-display {
    flex: 1; background: #f7f9ff;
    border: 1px solid #d2d8ec; border-radius: 8px;
    padding: 10px;
    font-family: 'Cinzel', serif; font-weight: 800; letter-spacing: 8px;
    font-size: 22px; color: var(--navy);
    text-align: center;
    background-image:
        repeating-linear-gradient(45deg, transparent 0 6px, rgba(245,135,42,0.12) 6px 7px),
        repeating-linear-gradient(-45deg, transparent 0 6px, rgba(90,62,156,0.10) 6px 7px);
    text-decoration: line-through;
    text-decoration-color: rgba(220,53,69,0.55);
    user-select: none;
}
.captcha-refresh {
    background: var(--navy); color: #fff; border: none;
    border-radius: 8px; padding: 0 14px; font-size: 18px;
}
.captcha-refresh:hover { background: var(--navy-deep); }

.form-error {
    background: #fff0f0; border: 1px solid #f1c0c0;
    color: #8a1f1f; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px;
}

.btn-primary {
    width: 100%;
    background: var(--grad-or-pu-btn);
    color: #fff; border: none;
    padding: 13px 18px; font-weight: 700; font-size: 15px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(245,135,42,0.25);
    transition: transform 0.05s ease, box-shadow 0.2s ease;
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(90,62,156,0.32); }
.btn-primary:active { transform: translateY(1px); }

.form-foot { margin-top: 16px; display: flex; justify-content: space-between; gap: 10px; }
.btn-outline {
    background: #fff; color: var(--navy);
    border: 1.5px solid var(--navy);
    padding: 9px 14px; font-weight: 600; border-radius: 8px; font-size: 13px;
}
.btn-outline:hover { background: var(--navy); color: #fff; }

.login-footer { position: relative; z-index: 1; color: #e8e8e8; margin-top: 32px; font-size: 12px; letter-spacing: 0.5px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-body { background: var(--bg); }

.topbar {
    background: var(--navy-deep);
    color: #fff;
    padding: 12px 22px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky; top: 0; z-index: 500;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.hamburger { background: transparent; border: none; color: #fff; font-size: 22px; cursor: pointer; transition: opacity 0.15s; }
.hamburger:hover { opacity: .7; }
.topbar-title { font-weight: 700; letter-spacing: 0.4px; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-role-pill {
    background: var(--grad-or-pu-btn);
    color: #fff;
    padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.logout-link {
    color: #fff; background: rgba(255,255,255,0.08);
    padding: 6px 14px; border-radius: 16px; font-weight: 600;
}
.logout-link:hover { background: rgba(255,255,255,0.18); }

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); transition: grid-template-columns 0.28s cubic-bezier(0.4,0,0.2,1); }

.sidebar {
    background: var(--navy);
    border-right: 1px solid var(--navy-deep);
    padding: 18px 12px;
    position: sticky; top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    transition: opacity 0.2s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px 14px; font-weight: 800; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 10px;
}
.side-nav { display: flex; flex-direction: column; }

.main-content { padding: 22px 28px 80px; overflow-x: hidden; overflow-y: auto; height: calc(100vh - 56px); box-sizing: border-box; }

/* ===== Card ===== */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.card-header {
    background: var(--navy);
    color: #fff;
    padding: 12px 18px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
}
.card-title { font-weight: 700; letter-spacing: 0.3px; font-size: 14.5px; }
.card-note { font-size: 12px; color: var(--gold-bright); }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 22px; }
.card-body.no-pad { padding: 0; }
.count-badge {
    background: rgba(255,255,255,0.18);
    padding: 2px 10px; border-radius: 12px; font-size: 12px; margin-left: 8px;
}

/* ===== Form grid ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; }
.field.full, .actions.full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; }
.field label { font-weight: 600; color: var(--navy); margin-bottom: 6px; font-size: 12px; letter-spacing: 0.5px; }
.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field input[type="time"],
.field input[type="password"],
.field input[type="email"],
.field select,
.field textarea {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
}
.field select[multiple] { min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(245,135,42,0.15);
}
.field.check label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 13px; }
.field.check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--purple); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 10px; }

.search-box {
    padding: 7px 12px; border-radius: 16px; border: 1px solid var(--border);
    background: #fff; font-size: 13px; min-width: 200px;
}
.btn-dark {
    background: var(--navy-deep); color: #fff; border: none;
    padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 13px;
}

/* ===== Table ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
    background: var(--navy);
    color: #fff;
    text-align: left;
    padding: 12px 14px;
    font-weight: 700; font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.data-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #eef1f8;
    vertical-align: middle;
}
.data-table tbody tr:nth-child(even) { background: #f9fbff; }
.data-table tbody tr:hover { background: #fff7ed; }
.data-table tbody tr.row-active { background: linear-gradient(90deg, #fff4e3 0%, #f5ebff 100%); }
.empty { text-align: center; padding: 28px !important; color: var(--muted); font-style: italic; }
.course-name { font-weight: 600; color: var(--navy); }

.row-actions { display: flex; gap: 6px; align-items: center; }
.btn-mini {
    padding: 5px 11px; border-radius: 6px; border: none;
    font-size: 12px; font-weight: 700; cursor: pointer;
    text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.btn-edit   { background: #ddf2e2; color: #1f7a3a; border: 1px solid #b4dec0; }
.btn-edit:hover { background: #1f7a3a; color: #fff; }
.btn-delete { background: #fcdada; color: #b51d1d; border: 1px solid #f0b6b6; }
.btn-delete:hover { background: #b51d1d; color: #fff; }
form.inline { display: inline; }

/* ===== Pills ===== */
.pill {
    display: inline-flex; align-items: center;
    padding: 4px 11px; border-radius: 14px;
    font-size: 11.5px; font-weight: 700;
    letter-spacing: 0.4px; white-space: nowrap;
    text-transform: uppercase;
}
.pill-blue   { background: var(--pill-blue-bg);   color: var(--pill-blue-fg); }
.pill-purple { background: var(--pill-purple-bg); color: var(--pill-purple-fg); }
.pill-green  { background: var(--pill-green-bg);  color: var(--pill-green-fg); }
.pill-yellow { background: var(--pill-yellow-bg); color: var(--pill-yellow-fg); }
.pill-red    { background: var(--pill-red-bg);    color: var(--pill-red-fg); }

/* ===== Tabs ===== */
.tab-bar {
    display: flex; gap: 4px; flex-wrap: wrap;
    background: #f1f4fb;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 22px;
}
.tab-btn {
    flex: 1; min-width: 130px;
    background: transparent; border: none;
    padding: 9px 12px; border-radius: 8px;
    font-weight: 600; font-size: 13px;
    color: var(--navy);
    transition: all 0.2s;
}
.tab-btn:hover { background: #e2e8f5; }
.tab-btn.active {
    background: var(--grad-or-pu-btn);
    color: #fff;
    box-shadow: 0 4px 12px rgba(90,62,156,0.25);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.filter-h { margin: 0 0 14px; color: var(--navy); font-size: 15px; font-weight: 700; }
.sub-h { margin: 18px 0 8px; color: var(--navy); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.hint { color: var(--muted); font-size: 12.5px; font-style: italic; margin: 6px 0; }
.muted { color: var(--muted); font-size: 12.5px; }

/* ===== Lists ===== */
.calendar-list, .resource-list { list-style: none; padding: 0; margin: 0; }
.calendar-list li, .resource-list li {
    padding: 8px 0; border-bottom: 1px dashed #e5e9f5;
    display: flex; gap: 10px; align-items: center;
}
.calendar-list li:last-child, .resource-list li:last-child { border-bottom: none; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h3 { color: var(--navy); margin: 0 0 8px; }

/* ===== Responsive ===== */

/* Desktop: hamburger collapses sidebar with animation */
@media (min-width: 901px) {
    body.sidebar-hidden .layout { grid-template-columns: 0px 1fr; }
    body.sidebar-hidden .sidebar { opacity: 0; pointer-events: none; }
}

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -260px; top: 56px; width: 240px; height: calc(100vh - 56px); transition: left 0.28s cubic-bezier(0.4,0,0.2,1); z-index: 40; opacity: 1; pointer-events: auto; }
    .sidebar.open { left: 0; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 39; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
    .sidebar-backdrop.visible { opacity: 1; pointer-events: auto; }
    .login-card { grid-template-columns: 1fr; }
    .role-panel { padding: 28px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
    .brand-banner { flex-direction: column; text-align: center; padding: 18px; }
    .brand-title { font-size: 28px; }
}
@media (max-width: 560px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .topbar-right .user-chip { display: none; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 6px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   OVERVIEW / DASHBOARD ADDITIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Overview stat cards ── */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
.stat-card {
    border-radius: 12px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.stat-card.stat-blue   { background: linear-gradient(135deg, #1c3d6f, #2d6ab4); }
.stat-card.stat-green  { background: linear-gradient(135deg, #1a6b3c, #2ea861); }
.stat-card.stat-orange { background: linear-gradient(135deg, #b85a00, #f5872a); }
.stat-card.stat-purple { background: linear-gradient(135deg, #4a2a80, #8a5cd8); }
.stat-icon  { font-size: 1.75rem; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .78rem; opacity: .85; text-align: center; }

/* ── Sidebar active course ── */
.sidebar-active-course {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-label      { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; }
.sidebar-course-name{ font-weight: 700; font-size: .9rem; color: var(--orange); }
.sidebar-course-sub { font-size: .72rem; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Section layout helpers ── */
.section-divider { border: none; border-top: 1px solid #e2e8f0; margin: 1.5rem 0; }
.subsection-title { font-size: .9rem; font-weight: 600; color: var(--navy); margin: 0 0 .6rem; }
.context-label { font-size: .85rem; color: #555; }
.text-warning { color: #b45309; }
.text-muted   { color: #888; }
.block { display: block; }

/* ── Resources grid ── */
.resources-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.resource-col-full { grid-column: 1 / -1; }

/* ── Resource entry with inline edit ── */
.resource-list  { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.resource-entry { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.resource-row   { display: flex; justify-content: space-between; align-items: flex-start; padding: .65rem .75rem; }
.resource-info  { display: flex; flex-direction: column; gap: .2rem; }
.resource-meta  { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin-top: .2rem; }
.resource-actions { display: flex; gap: .35rem; flex-shrink: 0; }

/* ── Inline edit panel ── */
.edit-panel {
    border-top: 2px solid var(--orange);
    background: #fff;
    padding: .75rem;
    transition: all .2s ease;
}
.edit-panel.hidden { display: none; }
.inline-form.compact .form-group { margin-bottom: .5rem; }

/* ── Add form as <details> ── */
.add-form-details { margin-bottom: 1rem; border: 1px dashed #cbd5e1; border-radius: 8px; }
.add-form-summary {
    padding: .65rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: .85rem;
    color: var(--navy);
    list-style: none;
}
.add-form-summary:hover { background: #f1f5f9; }
.add-form-details[open] .add-form-summary { border-bottom: 1px dashed #cbd5e1; }
.add-form-details .inline-form { padding: .75rem 1rem; }

/* ── Form grid helpers ── */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }
.form-actions { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.help-text    { font-size: .75rem; color: #64748b; display: block; margin-top: .2rem; }

/* ── Toggle group (checkbox + label inline) ── */
.toggle-group { display: flex; align-items: center; gap: .4rem; margin: .5rem 0; }
.toggle-row   { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .5rem; }

/* ── Checkbox list (multi-select via checkboxes) ── */
.checkbox-list {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: .5rem .6rem;
    max-height: 160px;
    overflow-y: auto;
    background: #fff;
}
.checkbox-list ul { list-style: none; margin: 0; padding: 0; }
.checkbox-list li { padding: .2rem 0; font-size: .83rem; }
.checkbox-list label { display: flex; align-items: center; gap: .35rem; cursor: pointer; }
.checkbox-list.compact { max-height: 120px; }
.checkbox-item { display: flex; align-items: center; gap: .35rem; font-size: .82rem; padding: .18rem 0; cursor: pointer; }

/* ── Subject area chips with delete ── */
.subject-area-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill-delete-btn {
    background: none; border: none; cursor: pointer;
    font-size: .8rem; line-height: 1; padding: 0 0 0 .3rem;
    color: inherit; opacity: .7;
}
.pill-delete-btn:hover { opacity: 1; }
.pill-xs { font-size: .68rem !important; padding: 2px 7px !important; }

/* ── Inline row form (subject area add) ── */
.inline-row { display: flex; gap: .5rem; align-items: center; }
.inline-row .form-control { flex: 1; }

/* ── Filter info box ── */
.filter-info-box {
    background: #eff6ff;
    border-left: 3px solid var(--navy);
    padding: .6rem .9rem;
    border-radius: 0 6px 6px 0;
    font-size: .8rem;
    color: #334155;
    margin-top: .75rem;
}

/* ── Generate bar ── */
.generate-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .75rem 0;
}

/* ── Timetable ── */
.tt-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: #f1f5f9;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}
.tt-meta-item { display: flex; flex-direction: column; gap: .1rem; }
.tt-label     { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.tt-table-wrapper { overflow-x: auto; }
.tt-table  { min-width: 900px; }
.tt-time   { white-space: nowrap; font-size: .82rem; }
.tt-date-row td {
    background: linear-gradient(90deg, #1c3d6f 0%, #2d5a9e 100%);
    color: #fff !important;
    font-weight: 600;
    font-size: .82rem;
    padding: .45rem .75rem !important;
}
.row-conducted    { background: #f0fdf4; }
.row-not-conducted{ background: #fff5f5; }
.row-double       { background: #fffbeb; }

/* ── Status select in timetable ── */
.status-select {
    font-size: .75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 4px;
    background: #fff;
    cursor: pointer;
}

/* ── Empty state box ── */
.empty-state-box {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #64748b;
}
.empty-state {
    text-align: center;
    padding: 1.25rem;
    color: #94a3b8;
    font-style: italic;
}

/* ── Button helpers ── */
.btn-sm   { padding: 5px 12px !important; font-size: .78rem !important; }
.btn-dark { background: var(--navy); color: #fff; border: none; }
.btn-dark:hover { background: var(--navy-deep); }
.btn-danger { background: #ef4444 !important; border-color: #ef4444 !important; color: #fff !important; }
.btn-link { background: none; border: none; color: var(--orange); cursor: pointer; font-size: .85rem; padding: 0; text-decoration: underline; }

/* ── Pill additions ── */
.pill-grey   { background: #94a3b8; color: #fff; }
.pill-orange { background: var(--orange); color: #fff; }

/* ── Search bar ── */
.search-bar { margin-bottom: .75rem; }

/* ── Count badge ── */
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: var(--orange);
    color: #fff;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    padding: 0 6px;
    margin-left: .35rem;
    vertical-align: middle;
}

/* ── Block chips with delete button ── */
.block-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.block-chip  { display: flex; align-items: center; gap: .3rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .overview-cards { grid-template-columns: 1fr 1fr; }
    .resources-grid { grid-template-columns: 1fr; }
    .resource-col-full { grid-column: auto; }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .overview-cards { grid-template-columns: 1fr 1fr; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .generate-bar { flex-direction: column; align-items: flex-start; }
}

/* ── Faculty/Trainee sidebar course nav ── */
.side-nav-course {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 2px;
    cursor: pointer;
    color: var(--text);
    font-size: .78rem;
    text-decoration: none;
    transition: background .15s;
}
.side-nav-course:hover { background: #f1f4fb; }
.side-nav-course-active { background: var(--grad-or-pu-btn) !important; color: #fff !important; }

/* ── fc-input: standalone inputs inside inline edit panels ── */
.fc-input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
    width: 100%;
}
.fc-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(245,135,42,0.15);
}

/* ── Standalone text inputs in flex rows (e.g. subject area add) ── */
.inline-add-input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text);
    flex: 1;
}
.inline-add-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(245,135,42,0.15);
}

/* ──────────────────────────────────────────────────────────────────
   Admin Sidebar v2 — section headers, step numbers, active card
   ────────────────────────────────────────────────────────────────── */

.topbar-course {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    color: #fff;
    padding: 0 1rem;
    min-width: 0;
}
.topbar-course-label {
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .55;
}
.topbar-course-name {
    font-size: .82rem;
    font-weight: 700;
    color: var(--gold-bright, #fbbf24);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-name { color: #fff; font-size: 13px; }

.sidebar-active-card {
    margin: 0 4px 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1c3d6f, #2d6ab4);
    color: #fff;
    box-shadow: 0 2px 8px rgba(28,61,111,.18);
}
.sidebar-active-card.sidebar-no-course {
    background: linear-gradient(135deg, #64748b, #94a3b8);
}
.sidebar-active-label {
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    opacity: .7;
    margin-bottom: .15rem;
}
.sidebar-active-name {
    font-weight: 700;
    font-size: .88rem;
    line-height: 1.2;
}
.sidebar-active-code {
    font-size: .7rem;
    opacity: .85;
    margin-top: .15rem;
    letter-spacing: .04em;
}

.side-nav-section {
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.45);
    padding: 14px 12px 6px;
    font-weight: 700;
}

.side-nav a {
    position: relative;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-radius: 8px;
    color: rgba(255,255,255,.88);
    font-weight: 600;
    font-size: .82rem;
    margin-bottom: 2px;
    text-decoration: none;
    transition: background .15s, transform .12s;
}
.side-nav a:hover { background: rgba(255,255,255,.1); transform: translateX(2px); }
.side-nav a.active {
    background: rgba(255,255,255,.15);
    color: #fff;
    border-left: 3px solid var(--orange);
}
.side-nav a.active .nav-step,
.side-nav a.active .nav-icon {
    background: rgba(255,255,255,.22);
    color: #fff;
}
.side-nav a.active .nav-sub { color: rgba(255,255,255,.85); }
.side-nav a.nav-disabled {
    opacity: .45;
    pointer-events: none;
    cursor: not-allowed;
}

.nav-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #e2e8f0;
    color: var(--navy);
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 800;
    flex-shrink: 0;
}
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #e2e8f0;
    color: var(--navy);
    border-radius: 6px;
    font-size: .8rem;
    flex-shrink: 0;
}
.nav-sub {
    width: 100%;
    padding-left: 0;
    font-size: .65rem;
    color: rgba(255,255,255,.5);
    font-weight: 500;
    letter-spacing: .02em;
    margin-top: 1px;
}
/* indent sub-label only when a step badge is present in the same link */
.side-nav a:has(.nav-step) .nav-sub,
.side-nav a:has(.nav-icon) .nav-sub {
    padding-left: 32px;
}
.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

.sidebar-switcher {
    margin-top: 1.25rem;
    padding: 12px 6px 6px;
    border-top: 1px solid var(--border);
}
.sidebar-switcher-label {
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #94a3b8;
    padding: 0 8px;
    margin-bottom: .4rem;
    font-weight: 700;
}
.sidebar-course-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: .75rem;
    color: rgba(255,255,255,.8);
    text-decoration: none;
    margin-bottom: 2px;
    transition: background .15s, color .15s;
}
.sidebar-course-link:hover { background: #f1f4fb; color: var(--navy); }
.sidebar-course-link.active {
    background: rgba(245,135,42,.22);
    color: #fff;
    font-weight: 700;
}
.sidebar-course-link.active .sidebar-course-code { background: var(--orange); color: #fff; }
.sidebar-course-code {
    display: inline-block;
    background: #e2e8f0;
    color: var(--navy);
    font-size: .6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: .04em;
    flex-shrink: 0;
}
.sidebar-course-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────────────
   Workflow stepper (Overview page)
   ────────────────────────────────────────────────────────────────── */

.workflow-stepper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    position: relative;
}
.workflow-step {
    text-align: center;
    padding: .5rem .25rem;
    position: relative;
}
.workflow-step + .workflow-step::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 28px;
    width: 16px;
    height: 2px;
    background: #cbd5e1;
}
.workflow-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #cbd5e1;
    color: #94a3b8;
    font-weight: 800;
    font-size: .9rem;
    margin-bottom: .4rem;
    transition: all .2s;
}
.workflow-step.done .workflow-step-num {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}
.workflow-step.current .workflow-step-num {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(245,135,42,.18);
}
.workflow-step-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.2;
}
.workflow-step-sub {
    font-size: .62rem;
    color: #64748b;
    margin-top: .15rem;
}
@media (max-width: 900px) {
    .workflow-stepper { grid-template-columns: repeat(3, 1fr); gap: 1rem 0; }
    .workflow-step + .workflow-step::before { display: none; }
}

/* ──────────────────────────────────────────────────────────────────
   Next step hint bar (bottom of each page)
   ────────────────────────────────────────────────────────────────── */

.next-step-bar {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff, #ede9fe);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: .9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.next-step-bar-text strong {
    color: var(--navy);
    font-size: .9rem;
}
.next-step-bar-text p {
    margin: .15rem 0 0;
    font-size: .78rem;
    color: #475569;
}
.next-step-bar a.btn-next {
    background: var(--navy);
    color: #fff;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: .82rem;
    white-space: nowrap;
    transition: background .15s, transform .12s;
}
.next-step-bar a.btn-next:hover {
    background: var(--navy-deep);
    transform: translateX(2px);
}

/* Legend dots for workflow stepper */
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 2px;
    vertical-align: middle;
}
.legend-done    { background: #10b981; }
.legend-current { background: var(--orange); }
.legend-pending { background: #94a3b8; }

/* ── Print helpers ── */
@media print {
    .no-print { display: none !important; }
}

