:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --primary: #1e3a8a;
    --primary-700: #1e40af;
    --accent: #f59e0b;
    --bg: #f7f8fb;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --sidebar: #0b1f4a;
    --sidebar-accent: #142a66;
    --sidebar-text: #e2e8f0;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 4px 12px rgba(15, 23, 42, 0.06);
    --radius: 14px;
}

[data-bs-theme="dark"] {
    --primary: #3b82f6;
    --primary-700: #60a5fa;
    --accent: #fbbf24;
    --bg: #090d16;
    --surface: #111827;
    --ink: #f8fafc;
    --muted: #94a3b8;
    --border: #1e293b;
    --sidebar: #060b16;
    --sidebar-accent: #0c1427;
    --sidebar-text: #e2e8f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.45);
}

body {
    background: var(--bg);
    font-family: var(--font-sans);
    color: var(--ink);
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand {
    font-family: var(--font-display);
    letter-spacing: 0.2px;
}

.app {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-accent) 100%);
    color: var(--sidebar-text);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    z-index: 1045;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Desktop Collapsed Mode: Mini-Sidebar (Icon Only) */
@media (min-width: 992px) {
    .app.sidebar-collapsed .sidebar,
    html.sidebar-collapsed-preload .app .sidebar {
        width: 72px;
        min-width: 72px;
        padding: 1.25rem 0.5rem;
        margin-left: 0;
        pointer-events: auto;
    }

    .app.sidebar-collapsed .sidebar .sidebar-header,
    html.sidebar-collapsed-preload .app .sidebar .sidebar-header {
        justify-content: center !important;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .app.sidebar-collapsed .sidebar .sidebar-header > div,
    html.sidebar-collapsed-preload .app .sidebar .sidebar-header > div {
        justify-content: center !important;
        gap: 0 !important;
        width: 100%;
    }

    .app.sidebar-collapsed .sidebar .sidebar-header .brand,
    .app.sidebar-collapsed .sidebar .sidebar-header .role-badge,
    html.sidebar-collapsed-preload .app .sidebar .sidebar-header .brand,
    html.sidebar-collapsed-preload .app .sidebar .sidebar-header .role-badge {
        display: none !important;
    }

    .app.sidebar-collapsed .sidebar .sidebar-logos,
    html.sidebar-collapsed-preload .app .sidebar .sidebar-logos {
        margin-bottom: 0;
        justify-content: center;
        width: 100%;
    }

    .app.sidebar-collapsed .sidebar .sidebar-logo:nth-child(2),
    html.sidebar-collapsed-preload .app .sidebar .sidebar-logo:nth-child(2) {
        display: none !important;
    }

    .app.sidebar-collapsed .sidebar .sidebar-logo:first-child,
    html.sidebar-collapsed-preload .app .sidebar .sidebar-logo:first-child {
        width: 36px;
        height: 36px;
        margin: 0 auto;
    }

    .app.sidebar-collapsed .sidebar .nav-link,
    html.sidebar-collapsed-preload .app .sidebar .nav-link {
        justify-content: center !important;
        padding: 0.65rem 0;
        margin: 0.25rem 0;
        text-align: center;
        border-radius: 10px;
    }

    .app.sidebar-collapsed .sidebar .nav-link i,
    html.sidebar-collapsed-preload .app .sidebar .nav-link i {
        font-size: 1.25rem;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .app.sidebar-collapsed .sidebar .nav-link span,
    html.sidebar-collapsed-preload .app .sidebar .nav-link span {
        display: none !important;
    }

    .app.sidebar-collapsed .sidebar .nav-link:hover,
    html.sidebar-collapsed-preload .app .sidebar .nav-link:hover {
        transform: scale(1.08);
        background: rgba(255, 255, 255, 0.18);
    }

    .app.sidebar-collapsed .sidebar hr,
    html.sidebar-collapsed-preload .app .sidebar hr {
        margin: 0.75rem 0.25rem;
    }
}

/* Mobile & Tablet Drawer Mode (< 992px) */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        max-height: 100vh;
        transform: translateX(-100%);
        margin-left: 0 !important;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
    }

    .app.sidebar-open .sidebar {
        transform: translateX(0);
    }
}

/* Sidebar Backdrop for Mobile/Drawer */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.app.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Hamburger Sidebar Toggle Button */
.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    border-radius: 9px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn i {
    font-size: 1.35rem;
    line-height: 1;
}

.sidebar-toggle-btn:hover {
    background: rgba(30, 58, 138, 0.1);
    color: var(--primary-700);
    border-color: var(--border);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.sidebar-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar .brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
}

.role-badge {
    font-size: 0.72rem;
    margin-top: 0.2rem;
    color: #ffd867;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar a {
    text-decoration: none !important;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    margin: 0.15rem 0;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-weight: 500;
    font-size: 0.92rem;
    opacity: 0.88;
    display: flex;
    align-items: center;
    transition: all 0.18s ease;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-link i {
    font-size: 1.15rem;
    opacity: 0.9;
    transition: transform 0.18s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.14);
    opacity: 1;
    color: #ffffff;
    transform: translateX(3px);
    text-decoration: none !important;
}

.sidebar .nav-link:hover i {
    transform: scale(1.1);
}

.sidebar .nav-link:focus,
.sidebar .nav-link:active,
.sidebar .nav-link:visited {
    color: #ffffff;
    text-decoration: none !important;
    outline: none;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff !important;
    font-weight: 600;
    opacity: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    text-decoration: none !important;
}

/* Custom Tooltip Styling for Collapsed Sidebar */
.tooltip {
    pointer-events: none;
    z-index: 1070;
}

.tooltip-inner {
    background-color: #0b1f4a;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #0b1f4a;
}

.main-content {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.container-fluid {
    max-width: 1220px;
    padding: 24px;
}

.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.card.p-3,
.card.p-4 {
    padding: 1.25rem !important;
}

.table thead {
    background: #f1f5f9;
}

.table {
    border-color: var(--border);
    font-size: 0.92rem;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: #f8fafc;
}

.table th {
    font-weight: 700;
    color: #334155;
}

.table td {
    vertical-align: middle;
}

.table-hover>tbody>tr:hover>* {
    background-color: #eef2ff;
}

.alert {
    border-radius: 12px;
    border-color: var(--border);
}

.sidebar hr {
    border-color: rgba(255, 255, 255, 0.15);
}

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

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-700);
    border-color: var(--primary-700);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-outline-primary {
    border-color: #cbd5f5;
    color: var(--primary);
}

.btn-outline-primary:hover {
    border-color: var(--primary-700);
    background: rgba(30, 64, 175, 0.08);
    color: var(--primary-700);
}

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

.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--border);
    box-shadow: none;
}

.form-label {
    font-weight: 600;
    color: #475569;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-700);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.badge-status {
    font-size: 0.75rem;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%), url('../img/login_bg.jpg') no-repeat center center / cover;
    padding: 20px;
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: loginFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes loginFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logos {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.login-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.sidebar-logos {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 50%;
    padding: 4px;
}

.app-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 1.25rem;
}

.profile-avatar--large {
    width: 96px;
    height: 96px;
}

.profile-avatar--large img {
    max-width: 100%;
    max-height: 100%;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 50;
}

.header-avatar-link {
    display: inline-flex;
    border-radius: 50%;
    text-decoration: none;
}

.header-avatar-link:focus-visible {
    outline: 2px solid var(--primary-700);
    outline-offset: 2px;
}

.header-avatar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    position: relative;
    z-index: 51;
    cursor: pointer;
}

.header-avatar-button:focus-visible {
    outline: 2px solid var(--primary-700);
    outline-offset: 2px;
}

.header-user .dropdown-toggle::after {
    display: none;
}

.header-user .dropdown-menu {
    z-index: 2000;
}

.header-profile {
    position: relative;
}

.header-profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 160px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    padding: 6px;
    display: none;
    z-index: 3000;
}

.header-profile-menu.is-open {
    display: block;
}

.header-profile-item {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.header-profile-item:hover {
    background: #f1f5f9;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-avatar-placeholder {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 0.85rem;
}

.college-logo-preview {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #ffffff;
}

.college-logo-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #ffffff;
}

.program-image-preview {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
}

.program-image-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #ffffff;
}

.accreditor-hero {
    background: var(--surface);
    border-top: 3px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
    padding: 24px 16px 18px;
    margin-bottom: 28px;
}

.accreditor-hero__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.accreditor-hero__title {
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: 800;
    margin: 10px 0 12px;
    color: var(--ink);
}

.accreditor-hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
    font-size: 0.9rem;
    color: var(--muted);
}

.accreditor-area-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 24px;
    padding: 0 6px 24px;
}

.accreditor-area-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 18px 16px 20px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.accreditor-area-link {
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.accreditor-area-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.accreditor-hero--compact {
    margin-bottom: 20px;
}

.area-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: radial-gradient(circle at top, #f9d76c 0%, #f2b01e 70%);
    color: #1f2a6b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.area-code {
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--ink);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.area-name {
    color: var(--muted);
    font-size: 0.95rem;
    min-height: 42px;
}

.area-program {
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.program-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.program-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.program-avatar-placeholder {
    font-weight: 800;
    color: #1e3a8a;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.evidence-area-header {
    background: var(--surface);
    padding: 16px 18px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.evidence-area-title {
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--ink);
}

.evidence-area-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.evidence-area-table {
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
}

.evidence-area-table thead th {
    background: #f1f5f9;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.6px;
}

.evidence-category-row td {
    background: #fef3c7;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.evidence-parameter-row td {
    background: #f8fafc;
    font-weight: 700;
}

.evidence-param-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e0e7ff;
    color: var(--primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.evidence-empty-row td {
    color: var(--muted);
    font-style: italic;
}

.evidence-item-title {
    font-weight: 600;
}

.evidence-item-desc {
    color: var(--muted);
    font-size: 0.85rem;
}

.evidence-col-code {
    width: 150px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.param-branch-symbol {
    display: inline-block;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.95em;
    margin-right: 4px;
}

/* Parameter hierarchy indentation for Code and Statement columns */
.param-row-depth-1 .evidence-col-code,
.evidence-col-code.param-depth-1 {
    padding-left: 1.5rem !important;
}

.param-row-depth-1 .evidence-col-statement,
.evidence-col-statement.param-depth-1 {
    padding-left: 1.25rem !important;
}

.param-row-depth-2 .evidence-col-code,
.evidence-col-code.param-depth-2 {
    padding-left: 2.5rem !important;
}

.param-row-depth-2 .evidence-col-statement,
.evidence-col-statement.param-depth-2 {
    padding-left: 2.25rem !important;
}

.param-row-depth-3 .evidence-col-code,
.evidence-col-code.param-depth-3 {
    padding-left: 3.5rem !important;
}

.param-row-depth-3 .evidence-col-statement,
.evidence-col-statement.param-depth-3 {
    padding-left: 3.25rem !important;
}

.evidence-col-link {
    width: 120px;
    text-align: center;
}

.evidence-link {
    color: var(--primary-700);
    font-weight: 600;
    text-decoration: underline;
}

.evidence-missing {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.area-taskforce {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0;
}

.area-taskforce-member {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    text-decoration: none;
    color: inherit;
}

.area-taskforce-member:hover {
    background: #eef2ff;
}

.area-taskforce-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
}

.area-taskforce-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.area-taskforce-name {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.9rem;
}

.key-officials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.key-official-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    text-align: center;
}

.key-official-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto 12px;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
    color: var(--primary);
}

.key-official-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.key-official-name {
    font-weight: 700;
    color: var(--ink);
}

.key-official-role {
    font-size: 0.9rem;
    color: var(--muted);
}

.key-official-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.key-official-preview {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    background: #e2e8f0;
}

/* ─────────────────────────────────────────────────────────────────────────
   Floating Dark Mode Toggle Button (Lower-Right)
   ───────────────────────────────────────────────────────────────────────── */
.theme-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    z-index: 1060;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle-btn:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22), 0 3px 8px rgba(15, 23, 42, 0.12);
}

.theme-toggle-btn:active {
    transform: translateY(0) scale(0.94);
}

.theme-toggle-btn .theme-icon-dark,
.theme-toggle-btn .theme-icon-light {
    font-size: 1.3rem;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, color 0.25s ease;
    position: absolute;
}

/* Light mode state: show moon, hide sun */
html[data-bs-theme="light"] .theme-toggle-btn .theme-icon-dark,
:root:not([data-bs-theme="dark"]) .theme-toggle-btn .theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #1e3a8a;
}

html[data-bs-theme="light"] .theme-toggle-btn .theme-icon-light,
:root:not([data-bs-theme="dark"]) .theme-toggle-btn .theme-icon-light {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
    pointer-events: none;
}

/* Dark mode state: show sun, hide moon */
[data-bs-theme="dark"] .theme-toggle-btn {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 16px rgba(251, 191, 36, 0.25);
}

[data-bs-theme="dark"] .theme-toggle-btn:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7), 0 0 22px rgba(251, 191, 36, 0.45);
}

[data-bs-theme="dark"] .theme-toggle-btn .theme-icon-dark {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
    pointer-events: none;
}

[data-bs-theme="dark"] .theme-toggle-btn .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #fbbf24;
}

@media (max-width: 575.98px) {
    .theme-toggle-btn {
        bottom: 18px;
        right: 18px;
        width: 44px;
        height: 44px;
    }
    .theme-toggle-btn .theme-icon-dark,
    .theme-toggle-btn .theme-icon-light {
        font-size: 1.15rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   Comprehensive Dark Mode Overrides
   ───────────────────────────────────────────────────────────────────────── */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .main-content {
    background-color: var(--bg);
    color: var(--ink);
}

/* Fix text-dark and dark headings/labels across all pages */
[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-black,
[data-bs-theme="dark"] .text-body,
[data-bs-theme="dark"] h1.text-dark,
[data-bs-theme="dark"] h2.text-dark,
[data-bs-theme="dark"] h3.text-dark,
[data-bs-theme="dark"] h4.text-dark,
[data-bs-theme="dark"] h5.text-dark,
[data-bs-theme="dark"] h6.text-dark,
[data-bs-theme="dark"] div.text-dark,
[data-bs-theme="dark"] span.text-dark,
[data-bs-theme="dark"] p.text-dark,
[data-bs-theme="dark"] td.text-dark,
[data-bs-theme="dark"] a.text-dark {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .text-primary {
    color: #60a5fa !important;
}

/* Cards & Containers */
[data-bs-theme="dark"] .card {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--ink);
}

/* Background utility overrides */
[data-bs-theme="dark"] .bg-white {
    background-color: var(--surface) !important;
    color: var(--ink) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #151f35 !important;
    color: var(--ink) !important;
}

/* Tables & Sortable Headers */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--border);
    color: #f8fafc !important;
    border-color: var(--border) !important;
}

[data-bs-theme="dark"] .table thead,
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table th {
    background-color: #151f35 !important;
    color: #f8fafc !important;
    border-color: var(--border) !important;
}

[data-bs-theme="dark"] .table th a,
[data-bs-theme="dark"] .table thead th a {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .table th a:hover,
[data-bs-theme="dark"] .table thead th a:hover {
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .table th i.text-primary,
[data-bs-theme="dark"] .table thead th i.text-primary {
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .table th i.text-muted,
[data-bs-theme="dark"] .table thead th i.text-muted {
    color: #64748b !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: transparent !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(59, 130, 246, 0.16) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table td {
    border-color: var(--border);
    color: #f1f5f9 !important;
}

/* Form Controls & Inputs */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0c1427 !important;
    border-color: #243452 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b !important;
    opacity: 1;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0c1427 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

[data-bs-theme="dark"] .form-label {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .form-text {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .form-check-label {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: #0c1427 !important;
    border-color: #475569 !important;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #151f35 !important;
    border-color: #243452 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .form-control::file-selector-button {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .form-control:hover:not(:disabled):not([readonly])::file-selector-button {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* Parameters Area Checkbox Container */
[data-bs-theme="dark"] #area-checkbox-container {
    background-color: #0c1427 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .area-checkbox-item {
    border-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .area-checkbox-item label,
[data-bs-theme="dark"] .area-checkbox-item strong {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .area-checkbox-item:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

/* Badges */
[data-bs-theme="dark"] .badge.bg-light {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .badge.bg-white {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .badge.bg-info-subtle {
    background-color: rgba(14, 165, 233, 0.25) !important;
    color: #38bdf8 !important;
    border-color: rgba(14, 165, 233, 0.4) !important;
}

[data-bs-theme="dark"] .badge.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

[data-bs-theme="dark"] .badge.bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.25) !important;
    color: #4ade80 !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

[data-bs-theme="dark"] .badge.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.25) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

[data-bs-theme="dark"] .badge.bg-primary-subtle {
    background-color: rgba(59, 130, 246, 0.25) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

[data-bs-theme="dark"] .badge.bg-info {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-warning {
    background-color: #d97706 !important;
    color: #ffffff !important;
}

/* Buttons */
[data-bs-theme="dark"] .btn-outline-dark {
    color: #e2e8f0 !important;
    border-color: #475569 !important;
    background-color: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-dark:hover {
    color: #ffffff !important;
    background-color: #334155 !important;
    border-color: #64748b !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    color: #ffffff !important;
    background-color: #334155 !important;
    border-color: #64748b !important;
}

[data-bs-theme="dark"] .btn-secondary {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .btn-secondary:hover {
    background-color: #475569 !important;
    border-color: #64748b !important;
}

/* Header & Profile */
[data-bs-theme="dark"] .header-profile-menu {
    background: #172033;
    border-color: var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .header-profile-item {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .header-profile-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Login Page */
[data-bs-theme="dark"] .login-wrapper {
    background: linear-gradient(135deg, rgba(6, 11, 22, 0.94) 0%, rgba(2, 6, 23, 0.97) 100%), url('../img/login_bg.jpg') no-repeat center center / cover;
}

[data-bs-theme="dark"] .login-card {
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    color: var(--ink);
}

/* Modals */
[data-bs-theme="dark"] .modal-content {
    background-color: #111827 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .modal-header {
    background-color: #172033 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .modal-footer {
    background-color: #172033 !important;
    border-color: #1e293b !important;
}

[data-bs-theme="dark"] .modal-title,
[data-bs-theme="dark"] .modal-title * {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .modal-body.bg-light {
    background-color: #090d16 !important;
}

/* Progress bar background */
[data-bs-theme="dark"] .progress {
    background-color: #1e293b !important;
}

/* Image previews */
[data-bs-theme="dark"] .college-logo-preview,
[data-bs-theme="dark"] .college-logo-thumb,
[data-bs-theme="dark"] .program-image-preview,
[data-bs-theme="dark"] .program-image-thumb {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Accreditor & Area Cards */
[data-bs-theme="dark"] .accreditor-hero {
    background: var(--surface);
    border-color: var(--border);
}

[data-bs-theme="dark"] .accreditor-area-card {
    background: var(--surface);
    border: 1px solid var(--border);
}

[data-bs-theme="dark"] .area-code {
    color: var(--ink);
}

[data-bs-theme="dark"] .key-official-card {
    background: #131d35;
    border-color: var(--border);
    color: var(--ink);
}

[data-bs-theme="dark"] .area-taskforce-member {
    background: #131d35;
    border-color: var(--border);
    color: var(--ink);
}

[data-bs-theme="dark"] .area-taskforce-member:hover {
    background: #1e293b;
}

[data-bs-theme="dark"] .area-taskforce-avatar,
[data-bs-theme="dark"] .key-official-avatar,
[data-bs-theme="dark"] .profile-avatar,
[data-bs-theme="dark"] .header-avatar {
    background: #1e293b;
}

/* Evidence area table */
[data-bs-theme="dark"] .evidence-area-table {
    background: var(--surface);
}

[data-bs-theme="dark"] .evidence-category-row td {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fcd34d !important;
}

[data-bs-theme="dark"] .evidence-parameter-row td {
    background: #172033 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .evidence-param-tag {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

[data-bs-theme="dark"] .evidence-missing {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Alerts */
[data-bs-theme="dark"] .alert-info {
    background-color: rgba(14, 165, 233, 0.15) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    color: #7dd3fc !important;
}

[data-bs-theme="dark"] .alert-success {
    background-color: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    color: #86efac !important;
}

[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fde047 !important;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .app-footer {
    border-color: var(--border);
    color: var(--muted);
}

/* ==========================================================================
   Expansive Document Viewer Modal (Wide Screen & Edge-to-Edge Canvas)
   ========================================================================== */
.evidence-viewer-modal {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.evidence-viewer-modal .evidence-modal-dialog {
    width: 96vw;
    max-width: 1720px;
    height: 94vh;
    margin: 3vh auto;
    transition: transform 0.2s ease-out, width 0.2s ease-out, height 0.2s ease-out;
}

.evidence-viewer-modal .evidence-modal-content {
    height: 94vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.evidence-viewer-modal .evidence-modal-header {
    height: 52px;
    min-height: 52px;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 0.75rem;
}

.evidence-viewer-modal #evidenceViewerModalLabel {
    color: var(--ink);
    font-size: 0.925rem;
    max-width: 48vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.evidence-viewer-modal #evidenceViewerParamBadge {
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.evidence-viewer-modal #evidenceViewerFileMeta {
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.evidence-viewer-modal .evidence-modal-body {
    flex: 1 1 auto;
    height: calc(100% - 52px);
    padding: 0 !important;
    margin: 0 !important;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}

.evidence-viewer-modal .evidence-modal-body #evidenceViewerLoader {
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.evidence-viewer-modal .evidence-modal-body #evidenceViewerLoader .text-muted {
    color: #94a3b8 !important;
}

.evidence-viewer-modal iframe#evidenceViewerFrame {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    background: #0f172a;
}

/* Fullscreen Mode */
.evidence-viewer-modal.is-fullscreen .evidence-modal-dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    transform: none !important;
}

.evidence-viewer-modal.is-fullscreen .evidence-modal-content {
    height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
}

.evidence-viewer-modal.is-fullscreen .evidence-modal-body {
    height: calc(100vh - 52px) !important;
}

/* Dark Mode Theme */
[data-bs-theme="dark"] .evidence-viewer-modal .evidence-modal-content {
    background: #111827;
    border-color: #374151;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

[data-bs-theme="dark"] .evidence-viewer-modal .evidence-modal-header {
    background: #1f2937;
    border-bottom-color: #374151;
}

[data-bs-theme="dark"] .evidence-viewer-modal #evidenceViewerModalLabel {
    color: #f3f4f6;
}

[data-bs-theme="dark"] .evidence-viewer-modal #evidenceViewerParamBadge {
    background: rgba(59, 130, 246, 0.25) !important;
    color: #93c5fd !important;
}

/* Responsive Viewports */
@media (max-width: 768px) {
    .evidence-viewer-modal .evidence-modal-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
    }

    .evidence-viewer-modal .evidence-modal-content {
        height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
    }

    .evidence-viewer-modal .evidence-modal-body {
        height: calc(100vh - 52px) !important;
    }

    .evidence-viewer-modal #evidenceViewerModalLabel {
        max-width: 32vw;
        font-size: 0.825rem;
    }
}