/* ══════════════════════════════════════════════
   CollegeERP Web — Design System
   Theme: Deep Indigo / Violet
══════════════════════════════════════════════ */

:root {
    --sidebar-width:    268px;
    --sidebar-bg:       #1a1040;
    --sidebar-border:   rgba(255,255,255,0.07);
    --accent:           #7c3aed;
    --accent-hover:     #6d28d9;
    --accent-light:     #ede9fe;
    --surface:          #ffffff;
    --surface-2:        #f9fafb;
    --border:           #e5e7eb;
    --text-primary:     #111827;
    --text-secondary:   #6b7280;
    --text-muted:       #9ca3af;
    --success:          #10b981;
    --warning:          #f59e0b;
    --danger:           #ef4444;
    --info:             #3b82f6;
    --radius:           14px;
    --radius-sm:        8px;
    --radius-xs:        6px;
    --shadow-sm:        0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:           0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-md:        0 10px 25px -5px rgba(0,0,0,0.10), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-lg:        0 20px 40px -10px rgba(0,0,0,0.14);
    --transition:       0.2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f3f4f6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    box-shadow: 4px 0 30px rgba(0,0,0,0.25);
    overflow: hidden;
}

/* Brand */
.sidebar-brand {
    padding: 1.375rem 1.375rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.825rem;
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #fff; flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(124,58,237,0.45);
}

.sidebar-brand-text { line-height: 1.25; }
.sidebar-brand-name { font-size: 0.95rem; font-weight: 800; color: #f9fafb; letter-spacing: -0.2px; }
.sidebar-brand-sub  { font-size: 0.62rem; color: #6b7280; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 500; }

/* College pill */
.sidebar-college-pill {
    margin: 0.875rem 1.125rem;
    padding: 0.6rem 0.875rem;
    background: rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.sidebar-college-pill i { color: #a78bfa; font-size: 0.95rem; }
.sidebar-college-name { font-size: 0.775rem; font-weight: 600; color: #c4b5fd; line-height: 1.3; }
.sidebar-college-code { font-size: 0.62rem; color: #6b7280; font-weight: 500; margin-top: 0.05rem; }

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Smooth momentum scrolling on iOS */
    -webkit-overflow-scrolling: touch;
    /* Reserve scrollbar space so layout doesn't shift */
    scrollbar-gutter: stable;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

.sidebar-section {
    padding: 1rem 1.375rem 0.3rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #4b5563;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.575rem 1rem;
    margin: 1px 0.75rem;
    color: #9ca3af;
    text-decoration: none;
    border-radius: var(--radius-sm);
    gap: 0.7rem;
    font-size: 0.855rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.sidebar-link i { font-size: 1rem; width: 1.15rem; text-align: center; flex-shrink: 0; }

.sidebar-link:hover { color: #e5e7eb; background: rgba(255,255,255,0.05); }

.sidebar-link.active {
    color: #fff;
    background: rgba(124,58,237,0.18);
    box-shadow: inset 3px 0 0 #7c3aed;
    margin-left: 0.5rem;
    padding-left: 0.875rem;
}

.sidebar-link.active i { color: #a78bfa; }

.sidebar-link-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 50px;
    line-height: 1.4;
}

/* ── Sidebar menu search ─────────────────────────────────────────── */
.sidebar-search {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--sidebar-bg);
    padding: 0.15rem 0.625rem 0.5rem;
}
.sidebar-search-box {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sidebar-search-box:focus-within {
    background: rgba(255,255,255,0.15);
    border-color: rgba(167,139,250,0.6);
}
.sidebar-search-box > i {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.sidebar-search-box input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 0.83rem;
}
.sidebar-search-box input::placeholder { color: rgba(255,255,255,0.55); }
.sidebar-search-clear {
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
    flex-shrink: 0;
}
.sidebar-search-clear:hover { color: #fff; }
.sidebar-noresults {
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    padding: 0.5rem 0.9rem;
}
/* Hidden by the menu search (kept separate from accordion open/close) */
.nav-hidden { display: none !important; }

/* ── Collapsible multi-level menu groups (accordion) ─────────────── */

/* Each module group is a rounded block */
.nav-group {
    margin: 2px 0.625rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

/* Open state: subtle purple tint + border */
.nav-group.open {
    border-color: rgba(124,58,237,0.22);
    background: rgba(124,58,237,0.07);
}

/* Slightly more space between consecutive groups */
.nav-group + .nav-group { margin-top: 3px; }

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin: 0;
    padding: 0.6rem 0.875rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: #9ca3af;
    font-size: 0.845rem;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
    letter-spacing: 0.01em;
}
.nav-group-header:hover { color: #e5e7eb; background: rgba(255,255,255,0.06); }

/* Open header: accent color, square bottom corners so body connects flush */
.nav-group.open > .nav-group-header {
    color: #c4b5fd;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Module icon: dim when closed, lit when open */
.nav-group-icon {
    font-size: 0.95rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
    color: #6d5aab;
    transition: color var(--transition);
}
.nav-group.open > .nav-group-header .nav-group-icon { color: #a78bfa; }

.nav-group-label { flex: 1; text-align: left; }

.nav-group-chevron {
    font-size: 0.65rem;
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-group.open > .nav-group-header .nav-group-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Body: CSS grid animation (0fr → 1fr) */
.nav-group-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-group.open > .nav-group-body { grid-template-rows: 1fr; }

/* Single inner wrapper — required for the grid-row collapse trick */
.nav-group-inner {
    overflow: hidden;
    min-height: 0;
    padding-bottom: 0;
    transition: padding-bottom 0.28s ease;
}
.nav-group.open > .nav-group-body > .nav-group-inner {
    padding-bottom: 0.35rem;
}

/* Nested links: indented, slightly smaller */
.nav-group-body .sidebar-link {
    padding-left: 2.5rem;
    font-size: 0.835rem;
    font-weight: 500;
    margin: 1px 0.25rem;
    border-radius: var(--radius-sm);
}
.nav-group-body .sidebar-link.active {
    padding-left: 2.375rem;
    box-shadow: inset 3px 0 0 #7c3aed;
    background: rgba(124,58,237,0.18);
    color: #fff;
    margin-left: 0.1rem;
}
.nav-group-body .sidebar-link.active i { color: #a78bfa; }

/* ── Nested (3rd-level) nav-groups ──────────────────────────────────── */
/* Sub-group header: indented to align with sibling links */
.nav-group-body .nav-group {
    margin: 1px 0.25rem;
}
.nav-group-body .nav-group .nav-group-header {
    padding-left: 2.25rem;
    font-size: 0.815rem;
    font-weight: 500;
    color: #9ca3af;
}
.nav-group-body .nav-group.open > .nav-group-header { color: #c4b5fd; }

/* 3rd-level links: deeper indent */
.nav-group-body .nav-group-body .sidebar-link {
    padding-left: 3.25rem;
    font-size: 0.815rem;
}

/* Disabled / "coming soon" placeholder */
.sidebar-link-disabled { cursor: default; opacity: 0.45; pointer-events: none; }
.sidebar-link-disabled:hover { background: transparent; color: #9ca3af; }

/* Footer */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

/* User strip in sidebar footer */
.sidebar-user-strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
}

.sidebar-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: #fff; font-weight: 700; flex-shrink: 0;
}

.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    border-radius: var(--radius-sm);
    padding: 0.15rem;
    margin: -0.15rem;
    transition: background 0.15s;
}
.sidebar-user-link:hover { background: rgba(255,255,255,0.06); }

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.78rem; font-weight: 600; color: #e5e7eb; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.65rem; color: #6b7280; }

.sidebar-logout-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xs);
    color: #6b7280;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #fca5a5;
}

/* ══════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Header ── */
.top-header {
    background: var(--surface);
    padding: 0 1.5rem;
    height: 62px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1020;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; cursor: pointer;
    transition: background var(--transition);
    font-size: 1.2rem;
}

.sidebar-toggle:hover { background: var(--surface-2); color: var(--text-primary); }

.header-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.header-breadcrumb .crumb-active { color: var(--text-primary); font-weight: 600; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.header-icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }

.header-notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 7px; height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid var(--surface);
}

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.75rem 0.3rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
    font-family: inherit;
}

.header-user-btn:hover { background: var(--surface-2); border-color: #a78bfa; }

.header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.header-user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
}

.header-user-role {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.header-user-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform var(--transition);
    margin-left: 0.1rem;
}

.header-user-chevron.open { transform: rotate(180deg); }

/* ══════════════════════════════════════════════
   CUSTOM USER DROPDOWN
══════════════════════════════════════════════ */
.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 2000;
    overflow: hidden;
    animation: dropdownFadeIn 0.15s ease;
}

.user-dropdown-menu.open { display: block; }

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border-bottom: 1px solid var(--border);
}

.user-dropdown-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
}

.user-dropdown-name  { font-size: 0.855rem; font-weight: 700; color: var(--text-primary); }
.user-dropdown-email { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

.user-dropdown-divider { height: 1px; background: var(--border); }

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.845rem;
    font-family: inherit;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.user-dropdown-item:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.user-dropdown-item i { font-size: 0.95rem; width: 1rem; text-align: center; }

.user-dropdown-item-danger { color: #dc2626; }
.user-dropdown-item-danger:hover { background: #fef2f2; color: #991b1b; }

.header-user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; color: #fff; font-weight: 700; flex-shrink: 0;
}

/* ── Page Content ── */
.page-content {
    flex: 1;
    padding: 1.75rem 1.75rem;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-left { flex: 1; min-width: 0; }

.page-header-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.page-header-sub {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ══════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════ */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.375rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card-violet::before  { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.stat-card-emerald::before { background: linear-gradient(90deg, #059669, #10b981); }
.stat-card-amber::before   { background: linear-gradient(90deg, #d97706, #f59e0b); }
.stat-card-rose::before    { background: linear-gradient(90deg, #dc2626, #ef4444); }
.stat-card-sky::before     { background: linear-gradient(90deg, #0284c7, #38bdf8); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon-violet  { background: #ede9fe; color: #7c3aed; }
.stat-icon-emerald { background: #d1fae5; color: #059669; }
.stat-icon-amber   { background: #fef3c7; color: #d97706; }
.stat-icon-rose    { background: #fee2e2; color: #dc2626; }
.stat-icon-sky     { background: #e0f2fe; color: #0284c7; }

.stat-body { flex: 1; min-width: 0; }

.stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

.stat-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
}

.stat-trend-up   { color: #059669; }
.stat-trend-down { color: #dc2626; }

/* ══════════════════════════════════════════════
   CONTENT CARDS
══════════════════════════════════════════════ */
.content-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.375rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
}

.content-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card-title i { color: var(--accent); }

.content-card-body { padding: 1.375rem; }

/* ══════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════ */
.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.375rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.table-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-title i { color: var(--accent); }

.table-search {
    position: relative;
    max-width: 260px;
    width: 100%;
}

.table-search-input {
    width: 100%;
    padding: 0.45rem 1rem 0.45rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.825rem;
    background: var(--surface-2);
    transition: all var(--transition);
    font-family: inherit;
    color: var(--text-primary);
}

.table-search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.table-search-icon {
    position: absolute;
    left: 0.75rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.data-table thead th {
    padding: 0.75rem 1.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background var(--transition);
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #faf5ff; }

.data-table tbody td {
    padding: 0.875rem 1.25rem;
    font-size: 0.855rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.375rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   BADGES & CHIPS
══════════════════════════════════════════════ */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-active    { background: #d1fae5; color: #065f46; }
.badge-inactive  { background: #fee2e2; color: #991b1b; }
.badge-primary   { background: #ede9fe; color: #5b21b6; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-neutral   { background: #f3f4f6; color: #374151; }

.code-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: 'Courier New', monospace;
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

/* ── Avatar / Initials ── */
.avatar-initials {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--accent-light);
    color: var(--accent);
}

/* ══════════════════════════════════════════════
   ACTION BUTTONS
══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.855rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 1.5px solid transparent;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(124,58,237,0.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline-primary:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline-secondary:hover {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: #fca5a5;
}

.btn-outline-danger:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: var(--danger);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); }

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    border-radius: var(--radius-xs);
}

.btn-icon {
    width: 32px; height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
}

/* ══════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.alert-success {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.btn-close, .alert-close-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 1.1rem;
    padding: 0 0.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.btn-close:hover, .alert-close-btn:hover { opacity: 1; }

/* ══════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════ */
.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.form-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.form-card-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.form-card-sub   { font-size: 0.8rem; color: var(--text-secondary); margin: 0.15rem 0 0; }

.form-card-body   { padding: 1.5rem; }
.form-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: block;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 90px; }

.is-invalid { border-color: var(--danger) !important; }
.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important; }
.field-error { display: block; font-size: 0.775rem; color: var(--danger); margin-top: 0.3rem; }

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ══════════════════════════════════════════════
   QUICK ACTION ITEMS
══════════════════════════════════════════════ */
.quick-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition);
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.quick-action-item:last-child { border-bottom: none; }
.quick-action-item:hover { background: var(--surface-2); color: var(--text-primary); }

.quick-action-left { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; font-weight: 500; }

.quick-action-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   ACTIVITY FEED
══════════════════════════════════════════════ */
.activity-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.3rem;
}

.activity-text { font-size: 0.835rem; color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ══════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--surface);
}

/* Left panel */
.login-left {
    width: 45%;
    background: linear-gradient(145deg, #1a1040 0%, #2d1b69 45%, #4c1d95 80%, #5b21b6 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

/* Decorative blobs */
.login-left::before {
    content: '';
    position: absolute;
    top: -80px; left: -80px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(167,139,250,0.12);
    pointer-events: none;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -60px; right: -60px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: rgba(124,58,237,0.18);
    pointer-events: none;
}

.login-blob {
    position: absolute;
    border-radius: 50%;
    background: rgba(196,181,253,0.07);
    pointer-events: none;
}

.login-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 380px;
}

.login-logo-circle {
    width: 80px; height: 80px;
    border-radius: 22px;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.login-left-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 0.875rem;
    letter-spacing: -0.3px;
}

.login-left-sub {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.65;
    margin-bottom: 2.5rem;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    width: 100%;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(8px);
    transition: background var(--transition);
}

.login-feature:hover { background: rgba(255,255,255,0.1); }

.login-feature-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(167,139,250,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #c4b5fd; flex-shrink: 0;
}

.login-feature-title { font-size: 0.825rem; font-weight: 600; color: #e9d5ff; }
.login-feature-sub   { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 0.1rem; }

/* Right panel */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: var(--surface);
}

.login-box {
    width: 100%;
    max-width: 440px;
}

.login-header { margin-bottom: 2rem; }

.login-welcome {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.3px;
}

.login-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* College code highlight field */
.login-college-field {
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border: 2px solid #ddd6fe;
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.login-college-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.login-college-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-xs);
    background: var(--accent-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: var(--accent); flex-shrink: 0;
}

.login-college-field-inner { flex: 1; }
.login-college-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent); margin-bottom: 0.2rem; }

.login-college-input {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    outline: none;
}

.login-college-input::placeholder { color: var(--text-muted); font-weight: 400; letter-spacing: 0; text-transform: none; font-family: inherit; font-size: 0.875rem; }

/* Auto-detected college badge (replaces the code input when URL matches) */
.login-college-badge {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: linear-gradient(135deg, rgba(139,92,246,0.12) 0%, rgba(99,102,241,0.08) 100%);
    border: 1.5px solid rgba(139,92,246,0.35);
    border-radius: 14px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
}
.login-college-badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.login-college-badge-info { flex: 1; min-width: 0; }
.login-college-badge-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.login-college-badge-code {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    letter-spacing: 0.3px;
}
.login-college-badge-check {
    color: #7c3aed;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Credential fields */
.login-field { margin-bottom: 1.125rem; }

.login-field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: block;
}

.login-field-wrap { position: relative; }

.login-field-icon {
    position: absolute;
    left: 0.875rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.9rem; pointer-events: none;
}

.login-field-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.login-field-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.login-field-input.is-invalid { border-color: var(--danger); }
.login-field-input::placeholder { color: var(--text-muted); }

.login-pw-toggle {
    position: absolute;
    right: 0.875rem; top: 50%;
    transform: translateY(-50%);
    border: none; background: transparent;
    color: var(--text-muted); cursor: pointer;
    padding: 0; font-size: 1rem;
    transition: color var(--transition);
}

.login-pw-toggle:hover { color: var(--text-secondary); }

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.login-check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.login-forgot {
    font-size: 0.825rem;
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.login-forgot:hover { color: var(--accent-hover); text-decoration: underline; }

.login-btn {
    width: 100%;
    padding: 0.825rem;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition);
    letter-spacing: 0.2px;
    box-shadow: 0 4px 14px rgba(124,58,237,0.3);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124,58,237,0.45);
}

.login-btn:active { transform: translateY(0); }

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    font-size: 0.775rem;
    color: var(--text-muted);
    font-weight: 500;
}

.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.875rem;
    font-size: 0.825rem;
    color: #991b1b;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.875rem;
    font-size: 0.825rem;
    color: #166534;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Forgot-password / reset screens reuse the login shell */
.login-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 1.25rem;
}

.login-back:hover { color: var(--accent); }

.login-otp-input {
    font-size: 1.6rem;
    letter-spacing: 0.6rem;
    text-align: center;
    font-family: monospace;
    font-weight: 700;
}

/* ══════════════════════════════════════════════
   SIDEBAR OVERLAY
══════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show { display: block; }

/* ══════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════ */
.fw-semibold { font-weight: 600; }
.fw-bold     { font-weight: 700; }
.text-muted  { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.ms-auto { margin-left: auto; }
.w-100 { width: 100%; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.row { display: flex; flex-wrap: wrap; margin: 0 -0.75rem; }
.g-3 > * { padding: 0.75rem; }
.col-lg-3 { flex: 0 0 25%; max-width: 25%; }
.col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-lg-5 { flex: 0 0 41.667%; max-width: 41.667%; }
.col-lg-6 { flex: 0 0 50%; max-width: 50%; }
.col-lg-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-lg-8 { flex: 0 0 66.667%; max-width: 66.667%; }
.col-12   { flex: 0 0 100%; max-width: 100%; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8 { flex: 0 0 50%; max-width: 50%; }
}

@media (max-width: 767.98px) {
    .login-left { display: none; }
    .login-right { padding: 1.5rem; }
    .page-content { padding: 1rem; }
    .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 575.98px) {
    .header-breadcrumb { display: none; }
    .stat-value { font-size: 1.5rem; }
}

/* ══════════════════════════════════════════════
   UNIT SWITCHER
══════════════════════════════════════════════ */

/* Header unit badge */
.header-unit-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.25);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #7c3aed;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-unit-badge i { font-size: 0.7rem; flex-shrink: 0; }

/* Sidebar unit switcher */
.sidebar-unit-switcher { padding: 0 0.75rem 0.25rem; }

/* Compact unit selector embedded in the college pill */
.sidebar-college-unit-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    background: transparent;
    border: none;
    padding: 2px 0;
    margin: 0;
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: color 0.12s;
}
.sidebar-college-unit-btn:hover { color: #bfdbfe; }
.sidebar-college-unit-btn .sidebar-unit-btn-text { flex: 1; min-width: 0; }

.sidebar-unit-btn {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.4rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}
.sidebar-unit-btn:hover { background: rgba(255,255,255,0.12); }
.sidebar-unit-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-unit-list {
    display: none;
    flex-direction: column;
    margin-top: 0.3rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
}
.sidebar-unit-list.open { display: flex; }

.sidebar-unit-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.7rem;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}
.sidebar-unit-option:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-unit-option-active { color: #93c5fd; font-weight: 600; }

/* ── App dialogs (replaces the browser's alert/confirm) ───────────────────── */
.app-dialog-overlay {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(15, 23, 42, .45);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: ad-fade .12s ease;
}
.app-dialog-open { overflow: hidden; }
.app-dialog {
    background: var(--surface); color: var(--text-primary);
    border: 1.5px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
    width: 100%; max-width: 420px;
    animation: ad-pop .14s ease;
}
.app-dialog-body { display: flex; gap: .9rem; padding: 1.4rem 1.4rem 1rem; }
.app-dialog-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.app-dialog-title { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.app-dialog-message { font-size: .9rem; color: var(--text-secondary); white-space: pre-line; word-break: break-word; }
.app-dialog-actions {
    display: flex; justify-content: flex-end; gap: .5rem;
    padding: .85rem 1.4rem 1.15rem;
}
.app-dialog-actions .btn { min-width: 84px; justify-content: center; }

.ad--info .app-dialog-icon     { color: var(--accent, #7c3aed); }
.ad--success .app-dialog-icon  { color: #16a34a; }
.ad--warning .app-dialog-icon  { color: #b45309; }
.ad--question .app-dialog-icon { color: var(--accent, #7c3aed); }
.ad--danger .app-dialog-icon   { color: #dc2626; }
/* A destructive confirmation gets a red primary button so OK never looks routine. */
.ad--danger .app-dialog-actions .btn-primary { background: #dc2626; border-color: #dc2626; }

@keyframes ad-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ad-pop  { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
