/* Premium SaaS redesign layer. Loaded last to normalize legacy and page-specific styles. */
/* The Inter @font-face import lives in backend/includes/header.php — an @import here is only
   discovered after this 155KB sheet has parsed, which pushed first paint back by ~500ms. */
:root {
    --saas-bg: #f6f8fb;
    --saas-surface: #ffffff;
    --saas-surface-raised: #ffffff;
    --saas-surface-muted: #f9fbfd;
    --saas-ink: #102033;
    --saas-heading: #0b2545;
    --saas-muted: #65758b;
    --saas-subtle: #8a99aa;
    --saas-line: #dfe7f0;
    --saas-line-soft: #eef3f8;
    --saas-primary: #0f4b92;
    --saas-primary-strong: #0a3670;
    --saas-primary-soft: #eaf3ff;
    --saas-green: #0f766e;
    --saas-green-soft: #ecfdf5;
    --saas-amber: #b45309;
    --saas-amber-soft: #fff7ed;
    --saas-red: #b42318;
    --saas-red-soft: #fff1f0;
    --saas-violet: #0f4b92;
    --saas-violet-soft: #eaf3ff;
    --saas-radius: 8px;
    --saas-radius-sm: 6px;
    --saas-shadow: 0 1px 2px rgba(16, 32, 51, 0.05), 0 12px 30px rgba(16, 32, 51, 0.06);
    --saas-shadow-lg: 0 18px 45px rgba(16, 32, 51, 0.12);
    --saas-focus: 0 0 0 3px rgba(15, 75, 146, 0.16);
    --saas-sidebar: #10294b;
    --saas-sidebar-2: #0d3a6d;
}

html {
    min-height: 100%;
    background: var(--saas-bg);
}

body {
    min-height: 100%;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 248, 251, 0) 280px),
        var(--saas-bg) !important;
    color: var(--saas-ink) !important;
    font-feature-settings: "cv02", "cv03", "cv04";
    letter-spacing: 0;
}

body:has(.app-layout) .site-footer {
    display: none;
}

::selection {
    background: rgba(15, 75, 146, 0.18);
    color: var(--saas-heading);
}

:focus-visible {
    outline: none !important;
    box-shadow: var(--saas-focus) !important;
}

.app-layout {
    grid-template-columns: 248px minmax(0, 1fr) !important;
    min-height: 100vh;
    background: var(--saas-bg) !important;
}

.app-main {
    min-width: 0;
    background: var(--saas-bg);
}

.app-main .container,
body:not(:has(.app-layout)) .container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 1rem 1.15rem 1.35rem !important;
    gap: 0.9rem !important;
}

.app-layout .app-main .container {
    max-width: none;
}

.sidebar {
    background: linear-gradient(180deg, var(--saas-sidebar) 0%, var(--saas-sidebar-2) 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    min-height: 66px;
    padding: 0.85rem 0.85rem !important;
    background: rgba(4, 16, 33, 0.18) !important;
    border-bottom: 1px solid rgba(217, 230, 248, 0.16) !important;
}

.sidebar-brand-logo-wrap,
.sidebar-brand .brand-logo {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    border-radius: 10px !important;
}

.sidebar-brand .brand-logo {
    padding: 3px !important;
    background: #fff;
    border: 1px solid rgba(232, 241, 255, 0.82) !important;
}

.sidebar-brand .brand-title {
    color: #ffffff !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
}

.sidebar-brand .brand-role {
    color: #a9c2e6 !important;
    font-size: 0.68rem !important;
    font-weight: 750 !important;
}

.sidebar-brand-open-icon,
.sidebar-brand-close-icon,
.sidebar-toggle svg,
.topbar-notif-btn svg,
.profile-toggle-chevron,
.profile-dropdown-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.sidebar-brand-close-icon {
    color: #dbeafe;
    margin-left: auto;
    padding: 6px;
    width: 32px;
    height: 32px;
    border-radius: var(--saas-radius-sm);
    background: rgba(255, 255, 255, 0.09);
}

.sidebar-brand-toggle:hover .sidebar-brand-close-icon,
.sidebar-brand-toggle:focus-visible .sidebar-brand-close-icon {
    background: rgba(255, 255, 255, 0.16);
}

.sidebar-nav-wrap {
    padding: 0.72rem 0.65rem !important;
}

.sidebar-nav,
.sidebar-nav-group {
    gap: 0.32rem !important;
}

.sidebar-nav a,
.sidebar-nav .nav-link,
.sidebar-nav .sidebar-link {
    min-height: 40px;
    width: 100%;
    border-radius: var(--saas-radius) !important;
    padding: 0.57rem 0.62rem !important;
    border: 1px solid transparent !important;
    color: #dbe7f8 !important;
    background: transparent !important;
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    line-height: 1.2;
    gap: 0.62rem !important;
    letter-spacing: 0;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.sidebar-nav a svg,
.sidebar-nav .nav-link svg,
.sidebar-nav .sidebar-link svg,
.sidebar-nav a i,
.sidebar-nav .nav-link i,
.sidebar-nav .sidebar-link i {
    width: 21px !important;
    height: 21px !important;
    min-width: 21px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    stroke-width: 2.15;
}

.sidebar-nav a:hover,
.sidebar-nav .nav-link:hover,
.sidebar-nav .sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.13) !important;
    color: #ffffff !important;
    transform: none !important;
}

.sidebar-nav a.active,
.sidebar-nav a.is-active,
.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link.is-active,
.sidebar-nav .sidebar-link.active,
.sidebar-nav .sidebar-link.is-active {
    background: #ffffff !important;
    border-color: #ffffff !important;
    color: #0d315d !important;
    box-shadow: 0 10px 24px rgba(4, 16, 33, 0.26) !important;
}

.content-topbar {
    min-height: 58px !important;
    padding: 0 1.05rem !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid var(--saas-line) !important;
    box-shadow: 0 1px 12px rgba(16, 32, 51, 0.06) !important;
    backdrop-filter: blur(14px);
}

.topbar-title {
    color: var(--saas-heading) !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

.sidebar-toggle,
.topbar-notif-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    border-radius: var(--saas-radius) !important;
    border: 1px solid var(--saas-line) !important;
    background: #fff !important;
    color: #43546a !important;
    box-shadow: none !important;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.sidebar-toggle:hover,
.topbar-notif-btn:hover {
    background: var(--saas-primary-soft) !important;
    border-color: #bfd5ef !important;
    color: var(--saas-primary) !important;
    transform: none !important;
}

.topbar-notif-badge {
    top: -3px !important;
    right: -3px !important;
    min-width: 18px !important;
    height: 18px !important;
    line-height: 16px !important;
    background: var(--saas-red) !important;
    border: 2px solid #fff !important;
    box-shadow: 0 5px 12px rgba(180, 35, 24, 0.28) !important;
}

.profile-dropdown-toggle {
    min-height: 40px !important;
    border: 1px solid transparent !important;
    border-radius: var(--saas-radius) !important;
    padding: 0.25rem 0.42rem !important;
    background: transparent !important;
    color: var(--saas-heading) !important;
}

.profile-dropdown-toggle:hover,
.profile-dropdown-toggle.open {
    background: #f2f6fb !important;
    border-color: var(--saas-line) !important;
}

.profile-avatar,
.profile-dropdown-avatar {
    background: linear-gradient(135deg, var(--saas-primary), var(--saas-green)) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.profile-toggle-name {
    max-width: 180px !important;
    color: var(--saas-heading) !important;
    font-weight: 750 !important;
    text-decoration: none !important;
}

.profile-dropdown {
    border: 1px solid var(--saas-line) !important;
    border-radius: 10px !important;
    box-shadow: var(--saas-shadow-lg) !important;
    padding: 0.35rem !important;
}

.profile-dropdown-header {
    border-bottom: 1px solid var(--saas-line-soft) !important;
    padding: 0.75rem !important;
}

.profile-dropdown-item {
    min-height: 38px;
    border-radius: var(--saas-radius-sm);
    padding: 0.52rem 0.65rem !important;
    color: #36465a !important;
    font-weight: 650;
}

.profile-dropdown-item:hover {
    background: #f5f8fc !important;
    color: var(--saas-heading) !important;
}

.dashboard-shell,
.admin-shell {
    gap: 0.9rem !important;
    width: 100%;
    min-width: 0;
}

.card,
.content-section,
.admin-shell section,
.admin-shell .admin-card,
.history-semester-block,
.history-toolbar,
.stu-id-card,
.stu-status-card,
.stu-form-section,
.login-shell {
    border: 1px solid var(--saas-line) !important;
    border-radius: var(--saas-radius) !important;
    background: var(--saas-surface-raised) !important;
    box-shadow: var(--saas-shadow) !important;
    transform: none !important;
}

.card:hover,
.content-section:hover,
.admin-shell section:hover,
.admin-shell .admin-card:hover,
.history-semester-block:hover {
    box-shadow: var(--saas-shadow) !important;
    transform: none !important;
}

.content-section,
.admin-shell section,
.admin-shell .admin-card,
.dashboard-shell .card {
    padding: 1rem !important;
}

.content-head,
.admin-shell .content-head,
.admin-shell .admin-card-head,
.card-head {
    margin-bottom: 0.82rem !important;
    padding-bottom: 0.65rem !important;
    border-bottom: 1px solid var(--saas-line-soft) !important;
    gap: 0.6rem !important;
}

.content-head h2,
.admin-shell .content-head h2,
.admin-shell .admin-card-head h2,
.card-head h2,
.dashboard-shell .card h2 {
    color: var(--saas-heading) !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

.content-head h2 i,
.admin-shell .content-head h2 i,
.admin-shell .admin-card-head h2 i,
.card-head h2 i {
    color: var(--saas-primary);
}

.content-head p,
.admin-shell .content-head p,
.admin-shell .admin-card-head p,
.text-muted,
small {
    color: var(--saas-muted) !important;
}

.hero-card,
.admin-shell .hero-card,
.dashboard-hero {
    border: 0 !important;
    border-radius: var(--saas-radius) !important;
    padding: 1.05rem 1.15rem !important;
    background: linear-gradient(135deg, #0b2545 0%, var(--saas-primary) 58%, var(--saas-green) 100%) !important;
    color: #fff !important;
    box-shadow: 0 14px 32px rgba(11, 37, 69, 0.18) !important;
}

.hero-card h2,
.admin-shell .hero-card h2,
.dashboard-hero h2 {
    color: #fff !important;
    font-size: 1.38rem !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
}

.eyebrow {
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 0.72rem !important;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.78) !important;
    line-height: 1.45;
}

.hero-pulse,
.login-brand-panel::before,
.login-brand-panel::after,
.login-brand-decor,
.login-brand-accent {
    display: none !important;
}

.admin-metrics,
.metric-grid,
.dashboard-shell .metric-grid.metric-grid-four {
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)) !important;
    gap: 0.75rem !important;
}

.admin-metric,
.metric-card {
    min-height: 76px !important;
    gap: 0.72rem !important;
    padding: 0.78rem !important;
    border: 1px solid var(--saas-line) !important;
    border-radius: var(--saas-radius) !important;
    background: #fff !important;
    box-shadow: var(--saas-shadow) !important;
    transform: none !important;
}

.admin-metric::before,
.metric-card::before {
    display: none !important;
}

.admin-metric:hover,
.metric-card:hover {
    box-shadow: var(--saas-shadow) !important;
    transform: none !important;
}

.admin-metric-icon,
.metric-icon {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    border-radius: var(--saas-radius) !important;
    background: var(--saas-primary-soft) !important;
    color: var(--saas-primary) !important;
    box-shadow: none !important;
    font-size: 1rem !important;
}

.admin-metric.is-green .admin-metric-icon { background: var(--saas-green-soft) !important; color: var(--saas-green) !important; }
.admin-metric.is-amber .admin-metric-icon { background: var(--saas-amber-soft) !important; color: var(--saas-amber) !important; }
.admin-metric.is-red .admin-metric-icon { background: var(--saas-red-soft) !important; color: var(--saas-red) !important; }
.admin-metric.is-purple .admin-metric-icon { background: var(--saas-violet-soft) !important; color: var(--saas-violet) !important; }
.admin-metric.is-cyan .admin-metric-icon { background: #ecfeff !important; color: #0e7490 !important; }

.admin-metric-body h3,
.metric-content h3,
.metric-card h3 {
    color: var(--saas-muted) !important;
    font-size: 0.7rem !important;
    font-weight: 850 !important;
    letter-spacing: 0.045em !important;
}

.admin-metric-body p,
.metric-value,
.metric-card p {
    margin: 0.1rem 0 0 !important;
    color: var(--saas-heading) !important;
    font-size: 1.38rem !important;
    line-height: 1.08 !important;
    font-weight: 850 !important;
}

.btn,
.admin-shell .btn,
.dashboard-shell .btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    min-height: 36px;
    border-radius: var(--saas-radius) !important;
    padding: 0.48rem 0.78rem !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    white-space: nowrap;
    box-shadow: none !important;
    transform: none !important;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.btn svg,
.btn i {
    width: 16px;
    height: 16px;
}

.btn-primary,
.admin-shell .btn-primary,
.dashboard-shell .btn-primary {
    background: var(--saas-primary) !important;
    border-color: var(--saas-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.admin-shell .btn-primary:hover,
.dashboard-shell .btn-primary:hover {
    background: var(--saas-primary-strong) !important;
    border-color: var(--saas-primary-strong) !important;
}

.btn-light,
.btn-outline-primary,
.btn-outline-secondary,
.admin-shell .btn-light,
.admin-shell .btn-outline-primary,
.dashboard-shell .btn-outline-primary {
    background: #fff !important;
    border: 1px solid var(--saas-line) !important;
    color: var(--saas-heading) !important;
}

.btn-light:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.admin-shell .btn-light:hover,
.admin-shell .btn-outline-primary:hover,
.dashboard-shell .btn-outline-primary:hover {
    background: var(--saas-primary-soft) !important;
    border-color: #bad2ee !important;
    color: var(--saas-primary) !important;
}

.btn-danger,
.admin-shell .btn-danger {
    background: var(--saas-red) !important;
    border-color: var(--saas-red) !important;
    color: #fff !important;
}

.btn-success,
.admin-shell .btn-success {
    background: var(--saas-green) !important;
    border-color: var(--saas-green) !important;
    color: #fff !important;
}

input,
select,
textarea,
.form-control,
.form-select,
.admin-form input,
.admin-form select,
.admin-form textarea,
.admin-shell input,
.admin-shell select,
.admin-shell textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--saas-line) !important;
    border-radius: var(--saas-radius) !important;
    background: #fff !important;
    color: var(--saas-ink) !important;
    padding: 0.5rem 0.62rem !important;
    font-size: 0.88rem !important;
    box-shadow: none !important;
}

textarea {
    min-height: 92px;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    border-color: #8cb6df !important;
    box-shadow: var(--saas-focus) !important;
    outline: none !important;
}

label,
.admin-form label,
.admin-shell label,
.form-label {
    gap: 0.3rem !important;
    color: var(--saas-heading) !important;
    font-size: 0.82rem !important;
    font-weight: 750 !important;
}

.checkbox-row,
.admin-shell .checkbox-row,
.admin-form .checkbox-row {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 0.45rem !important;
}

input[type="checkbox"],
input[type="radio"] {
    width: 16px !important;
    min-width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    padding: 0 !important;
    accent-color: var(--saas-primary);
}

.table-wrap,
.admin-shell .table-wrap {
    overflow: auto !important;
    border: 1px solid var(--saas-line) !important;
    border-radius: var(--saas-radius) !important;
    background: #fff;
    box-shadow: none !important;
}

table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

th,
td,
.admin-shell table thead th,
.admin-shell table tbody td {
    padding: 0.62rem 0.68rem !important;
    border-bottom: 1px solid var(--saas-line-soft) !important;
    line-height: 1.35 !important;
}

th,
.admin-shell table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc !important;
    color: #4b5f76 !important;
    font-size: 0.72rem !important;
    font-weight: 850 !important;
    text-transform: uppercase;
    letter-spacing: 0.035em !important;
}

td,
.admin-shell table tbody td {
    color: #273f5c !important;
    font-size: 0.84rem !important;
    vertical-align: middle !important;
}

tbody tr:nth-child(even),
.admin-shell table tbody tr:nth-child(even) {
    background: #fbfdff !important;
}

tbody tr:hover,
.admin-shell table tbody tr:hover {
    background: #f4f8fd !important;
}

.badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    min-height: 24px;
    border-radius: 999px !important;
    padding: 0.24rem 0.52rem !important;
    font-size: 0.72rem !important;
    font-weight: 850 !important;
    letter-spacing: 0.01em !important;
    line-height: 1 !important;
    border: 1px solid transparent;
}

.badge-pending,
.badge-submitted,
.badge-draft,
.badge-in_progress,
.badge-in_review {
    background: var(--saas-primary-soft) !important;
    border-color: #c9dff5 !important;
    color: var(--saas-primary-strong) !important;
}

.badge-approved,
.badge-cleared,
.badge-completed,
.badge-waived,
.badge-active {
    background: var(--saas-green-soft) !important;
    border-color: #bfe7d3 !important;
    color: #066252 !important;
}

.badge-unsubmitted,
.badge-warning {
    background: var(--saas-amber-soft) !important;
    border-color: #fed7aa !important;
    color: var(--saas-amber) !important;
}

.badge-rejected,
.badge-cancelled,
.badge-inactive {
    background: var(--saas-red-soft) !important;
    border-color: #ffc9c4 !important;
    color: var(--saas-red) !important;
}

.alert,
.bottom-toast,
.admin-callout,
.admin-assignment-callout,
.empty-note,
.admin-empty,
.form-feedback {
    border-radius: var(--saas-radius) !important;
    border-width: 1px !important;
    box-shadow: none !important;
}

.admin-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 0.75rem !important;
}

.admin-action-tile {
    min-height: 78px;
    border: 1px solid var(--saas-line) !important;
    border-radius: var(--saas-radius) !important;
    background: #fff !important;
    padding: 0.8rem !important;
    box-shadow: none !important;
    transform: none !important;
}

.admin-action-tile:hover {
    background: #f8fbff !important;
    border-color: #bad2ee !important;
    box-shadow: var(--saas-shadow) !important;
}

.admin-action-tile i {
    width: 36px;
    height: 36px;
    min-width: 36px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--saas-radius);
    background: var(--saas-primary-soft);
    color: var(--saas-primary) !important;
    font-size: 1.05rem !important;
}

.admin-action-tile strong {
    color: var(--saas-heading) !important;
    font-size: 0.9rem !important;
}

.admin-action-tile small {
    color: var(--saas-muted) !important;
}

.nav-tabs {
    gap: 0.35rem;
    border-bottom: 1px solid var(--saas-line) !important;
}

.nav-tabs .nav-link {
    border: 1px solid transparent !important;
    border-radius: var(--saas-radius) var(--saas-radius) 0 0 !important;
    background: transparent !important;
    color: var(--saas-muted) !important;
    font-weight: 800 !important;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link.is-active {
    background: #fff !important;
    border-color: var(--saas-line) var(--saas-line) #fff !important;
    color: var(--saas-heading) !important;
}

.progress-wrap {
    height: 10px !important;
    border-radius: 999px !important;
    background: #e9eef5 !important;
}

.progress-bar {
    background: linear-gradient(90deg, var(--saas-primary), var(--saas-green)) !important;
}

.modal-backdrop.show {
    opacity: 0.36 !important;
}

.modal-dialog {
    --bs-modal-margin: 1rem;
}

.modal-content,
.admin-shell .modal-content {
    overflow: hidden;
    border: 1px solid var(--saas-line) !important;
    border-radius: 10px !important;
    box-shadow: var(--saas-shadow-lg) !important;
}

.modal-header,
.admin-shell .modal-header {
    min-height: 54px;
    padding: 0.85rem 1rem !important;
    background: #fff !important;
    color: var(--saas-heading) !important;
    border-bottom: 1px solid var(--saas-line-soft) !important;
}

.modal-title,
.admin-shell .modal-header .modal-title {
    color: var(--saas-heading) !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 850 !important;
    letter-spacing: 0 !important;
}

.modal-header .btn-close,
.admin-shell .modal-header .btn-close {
    filter: none !important;
    opacity: 0.7;
}

.modal-body,
.admin-shell .modal-body {
    padding: 1rem !important;
    background: var(--saas-surface-muted) !important;
}

.modal-footer,
.admin-shell .modal-footer {
    gap: 0.5rem !important;
    padding: 0.75rem 1rem !important;
    background: #fff !important;
    border-top: 1px solid var(--saas-line-soft) !important;
}

.modal-field-grid,
.admin-shell .modal-body .modal-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem !important;
}

.list-group-item {
    background: transparent !important;
    border-color: var(--saas-line-soft) !important;
}

.profile-bar {
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid var(--saas-line) !important;
}

.profile-bar-name {
    color: var(--saas-heading) !important;
    font-size: 1.05rem !important;
    font-weight: 850 !important;
}

.profile-bar-detail {
    color: var(--saas-muted) !important;
}

.student-step-chain {
    gap: 0.6rem !important;
}

.student-step-chip,
.history-req-card,
.stu-timeline-card,
.stu-status-info-item,
.stu-form-section,
.stu-org-card,
.student-notification-item,
.student-clearance-row,
.notifications-highlight-item,
.my-clearances-insight-item {
    border: 1px solid var(--saas-line) !important;
    border-radius: var(--saas-radius) !important;
    background: #fff !important;
    box-shadow: none !important;
}

.student-step-chip.is-current {
    background: #f3f8ff !important;
    border-color: #bad2ee !important;
}

.student-step-chip.is-done {
    background: var(--saas-green-soft) !important;
    border-color: #bfe7d3 !important;
}

.student-step-number,
.stu-timeline-dot {
    background: #eef3f8 !important;
    color: #52657c !important;
}

.student-step-chip.is-current .student-step-number,
.stu-timeline-step[data-step-status="in_review"] .stu-timeline-dot {
    background: var(--saas-primary) !important;
    color: #fff !important;
}

.student-step-chip.is-done .student-step-number,
.stu-timeline-step[data-step-status="cleared"] .stu-timeline-dot,
.stu-timeline-step[data-step-status="waived"] .stu-timeline-dot {
    background: var(--saas-green) !important;
    color: #fff !important;
}

.login-shell {
    overflow: hidden;
    width: min(960px, 94%) !important;
    margin: clamp(1rem, 3vh, 2rem) auto !important;
}

.login-brand-panel {
    background: linear-gradient(135deg, #0b2545 0%, var(--saas-primary) 62%, var(--saas-green) 100%) !important;
}

.login-form-panel {
    background: #fff !important;
}

.login-brand-logo {
    box-shadow: none !important;
}

.login-point-item {
    border-radius: var(--saas-radius) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    transform: none !important;
}

.login-point-item:hover {
    transform: none !important;
}

.login-form-panel .input-icon-wrap input,
.login-form-panel .input-icon-wrap select {
    min-height: 50px !important;
    padding-left: 2.85rem !important;
}

.login-form-panel .pw-toggle {
    min-height: 36px !important;
    width: 36px !important;
    height: 36px !important;
}

.site-footer {
    margin: 0 !important;
    padding: 0.85rem 1.1rem !important;
    background: #fff !important;
    border-top: 1px solid var(--saas-line) !important;
}

.site-footer p {
    color: var(--saas-muted) !important;
}

@media (min-width: 901px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }

    .app-layout.is-sidebar-collapsed {
        grid-template-columns: 76px minmax(0, 1fr) !important;
    }

    .app-layout.is-sidebar-collapsed .sidebar {
        width: 76px;
    }

    .app-layout.is-sidebar-collapsed .sidebar-nav a,
    .app-layout.is-sidebar-collapsed .sidebar-nav .nav-link {
        justify-content: center !important;
        min-height: 44px;
        padding: 0.55rem !important;
        gap: 0 !important;
        font-size: 0 !important;
    }

    .app-layout.is-sidebar-collapsed .sidebar-nav a svg,
    .app-layout.is-sidebar-collapsed .sidebar-nav .nav-link svg,
    .app-layout.is-sidebar-collapsed .sidebar-nav a i,
    .app-layout.is-sidebar-collapsed .sidebar-nav .nav-link i {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
    }
}

@media (max-width: 1100px) {
    .app-main .container,
    body:not(:has(.app-layout)) .container {
        padding: 0.9rem !important;
    }
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        width: 292px !important;
        max-width: 88vw !important;
    }

    .content-topbar {
        min-height: 54px !important;
    }

    .admin-metrics,
    .metric-grid,
    .dashboard-shell .metric-grid.metric-grid-four {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .app-main .container,
    body:not(:has(.app-layout)) .container {
        padding: 0.75rem !important;
        gap: 0.75rem !important;
    }

    .topbar-title {
        font-size: 0.92rem !important;
    }

    .profile-toggle-name,
    .profile-toggle-chevron {
        display: none !important;
    }

    .content-section,
    .admin-shell section,
    .admin-shell .admin-card,
    .card {
        padding: 0.82rem !important;
    }

    .admin-metrics,
    .metric-grid,
    .dashboard-shell .metric-grid.metric-grid-four {
        grid-template-columns: 1fr !important;
    }

    .admin-toolbar,
    .form-actions,
    .admin-shell .form-actions,
    .quick-actions,
    .student-info-actions,
    .history-req-actions,
    .stu-status-actions {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .btn,
    .admin-shell .btn,
    .dashboard-shell .btn,
    .admin-toolbar .btn,
    .form-actions .btn {
        width: 100%;
        white-space: normal;
    }

    .modal-field-grid,
    .admin-shell .modal-body .modal-field-grid {
        grid-template-columns: 1fr;
    }

    .modal-dialog {
        --bs-modal-margin: 0.5rem;
    }

    th,
    td,
    .admin-shell table thead th,
    .admin-shell table tbody td {
        padding: 0.52rem !important;
        font-size: 0.8rem !important;
    }
}
/* Settings and account security pages */
.settings-shell {
    gap: 1rem !important;
}

.settings-shell .profile-shell,
.settings-shell .profile-shell-staff {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) !important;
    gap: 1rem !important;
    align-items: start;
}

.settings-identity-card,
.settings-main-card {
    border-radius: 10px !important;
    padding: 1rem !important;
}

.settings-identity-card > div:first-child {
    width: 76px !important;
    height: 76px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, var(--saas-primary), var(--saas-green)) !important;
    box-shadow: 0 12px 26px rgba(15, 75, 146, 0.18) !important;
    font-size: 1.45rem !important;
    margin: 0 !important;
}

.settings-identity-card > h2 {
    text-align: left !important;
    margin: 0.85rem 0 0 !important;
    color: var(--saas-heading) !important;
    font-size: 1.15rem !important;
    font-weight: 850 !important;
    line-height: 1.2 !important;
}

.settings-identity-card .profile-role {
    text-align: left !important;
    color: var(--saas-muted) !important;
    font-size: 0.82rem !important;
    margin: 0.2rem 0 0.7rem !important;
}

.settings-identity-card > div[style*="text-align:center"] {
    text-align: left !important;
}

.settings-meta-list {
    margin-top: 1rem !important;
    gap: 0 !important;
    border: 1px solid var(--saas-line) !important;
    border-radius: var(--saas-radius) !important;
    overflow: hidden;
    background: #fff;
}

.settings-meta-list > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.72rem 0.78rem !important;
    border-bottom: 1px solid var(--saas-line-soft) !important;
    color: var(--saas-muted) !important;
    font-size: 0.82rem !important;
}

.settings-meta-list > div:last-child {
    border-bottom: 0 !important;
}

.settings-meta-list span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--saas-muted) !important;
}

.settings-meta-list strong {
    color: var(--saas-heading) !important;
    font-size: 0.82rem !important;
    text-align: right;
    overflow-wrap: anywhere;
}

.settings-tabs {
    display: flex !important;
    gap: 0.4rem !important;
    margin-bottom: 1rem !important;
    padding: 0.25rem !important;
    border: 1px solid var(--saas-line) !important;
    border-radius: 10px !important;
    background: var(--saas-surface-muted) !important;
}

.settings-tabs .stu-profile-tab {
    flex: 0 0 auto;
    border-radius: var(--saas-radius) !important;
}

.settings-main-card h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.8rem !important;
    padding: 0 0 0.55rem !important;
    border-bottom: 1px solid var(--saas-line-soft) !important;
    color: var(--saas-heading) !important;
    font-size: 0.98rem !important;
    font-weight: 850 !important;
}

.settings-main-card form > div[style*="margin-bottom:1.5rem"] {
    margin-bottom: 1rem !important;
}

.settings-main-card input[readonly] {
    background: #f8fafc !important;
    color: #52657c !important;
    cursor: not-allowed !important;
}

.settings-main-card .profile-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem !important;
}

.settings-main-card img[alt="Signature"] {
    padding: 0.6rem;
    border: 1px dashed var(--saas-line) !important;
    border-radius: var(--saas-radius) !important;
    background: #fff;
}

.security-shell {
    max-width: 1180px;
    margin: 0 auto;
}

.security-panel {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
    gap: 1rem;
    align-items: stretch;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.security-copy-card,
.security-form-card {
    border: 1px solid var(--saas-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--saas-shadow);
}

.security-copy-card {
    padding: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #0b2545 0%, var(--saas-primary) 58%, var(--saas-green) 100%);
    overflow: hidden;
}

.security-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.security-copy-card h2 {
    margin: 0;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 850;
    line-height: 1.15;
}

.security-copy-card p {
    margin: 0.65rem 0 0;
    max-width: 48ch;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.5;
}

.security-alert {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin-top: 1rem;
    padding: 0.72rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--saas-radius);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
}

.security-guidance-grid {
    display: grid;
    gap: 0.6rem;
    margin-top: 1rem;
}

.security-guidance-grid > div {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.1rem 0.65rem;
    align-items: center;
    padding: 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--saas-radius);
    background: rgba(255, 255, 255, 0.1);
}

.security-guidance-grid i {
    grid-row: span 2;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--saas-radius);
    background: rgba(255, 255, 255, 0.14);
}

.security-guidance-grid strong {
    color: #fff;
    font-size: 0.9rem;
}

.security-guidance-grid span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.security-form-card {
    padding: 1.1rem;
}

.security-form-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--saas-line-soft);
}

.security-form-head h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: var(--saas-heading);
    font-size: 1.05rem;
    font-weight: 850;
}

.security-form-head p {
    margin: 0.2rem 0 0;
    color: var(--saas-muted);
    font-size: 0.85rem;
}

.security-form {
    display: grid;
    gap: 0.85rem;
}

.security-field {
    display: grid;
    gap: 0.36rem !important;
}

.security-field > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3rem !important;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    width: 34px;
    height: 34px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: var(--saas-radius-sm);
    background: transparent;
    color: var(--saas-muted);
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: var(--saas-primary-soft);
    color: var(--saas-primary);
}

.security-requirements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.7rem;
    border: 1px solid var(--saas-line);
    border-radius: var(--saas-radius);
    background: var(--saas-surface-muted);
}

.security-requirements > div {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--saas-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.security-requirements .req-icon {
    color: #9aabba;
}

.security-requirements > div.is-valid {
    color: var(--saas-green);
}

.security-requirements > div.is-valid .req-icon {
    color: var(--saas-green);
}

.security-feedback {
    display: none;
    color: var(--saas-red) !important;
    font-weight: 700;
}

.security-feedback.is-visible {
    display: block;
}

.security-submit {
    width: 100%;
    margin-top: 0.1rem;
}

@media (max-width: 980px) {
    .settings-shell .profile-shell,
    .settings-shell .profile-shell-staff,
    .security-panel {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .settings-main-card .profile-two-col,
    .security-requirements {
        grid-template-columns: 1fr !important;
    }

    .settings-tabs {
        flex-direction: column;
    }

    .settings-tabs .stu-profile-tab {
        width: 100%;
    }

    .settings-meta-list > div {
        grid-template-columns: 1fr !important;
    }

    .settings-meta-list strong {
        text-align: left;
    }
}
/* Final BISU SaaS interface pass */
:root {
    --saas-bg: #f5f7fb;
    --saas-surface: #ffffff;
    --saas-surface-raised: #ffffff;
    --saas-surface-muted: #f8fafc;
    --saas-ink: #182334;
    --saas-heading: #08264a;
    --saas-muted: #62748a;
    --saas-subtle: #8a98aa;
    --saas-line: #dce5ef;
    --saas-line-soft: #edf2f7;
    --saas-primary: #0f4b92;
    --saas-primary-strong: #09386f;
    --saas-primary-soft: #eaf3ff;
    --saas-gold: #f6c343;
    --saas-gold-soft: #fff8df;
    --saas-green: #0a7a4b;
    --saas-green-soft: #eefcf5;
    --saas-amber: #b95c00;
    --saas-amber-soft: #fff5e8;
    --saas-red: #b42318;
    --saas-red-soft: #fff1f0;
    --saas-cyan: #0e7490;
    --saas-cyan-soft: #ecfeff;
    --saas-radius: 8px;
    --saas-radius-sm: 6px;
    --saas-shadow: 0 1px 2px rgba(15, 35, 58, 0.05), 0 10px 26px rgba(15, 35, 58, 0.055);
    --saas-shadow-lg: 0 20px 56px rgba(15, 35, 58, 0.16);
    --saas-focus: 0 0 0 3px rgba(15, 75, 146, 0.18);
    --saas-sidebar: #09284d;
    --saas-sidebar-2: #0f4b92;
}

html,
body {
    font-family: 'Inter', 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: var(--saas-bg) !important;
    color: var(--saas-ink) !important;
}

body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0, rgba(245, 247, 251, 0) 260px),
        var(--saas-bg) !important;
}

body,
button,
input,
select,
textarea {
    letter-spacing: 0 !important;
}

.app-layout {
    grid-template-columns: 260px minmax(0, 1fr) !important;
    background: var(--saas-bg) !important;
}

.app-main {
    min-width: 0;
    background: transparent !important;
}

.app-main .container,
body:not(:has(.app-layout)) .container {
    max-width: 1360px;
    padding: 1.15rem 1.25rem 1.5rem !important;
    gap: 1rem !important;
}

.app-layout .app-main .container {
    max-width: none;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, var(--saas-sidebar) 0%, #0c3566 46%, var(--saas-sidebar-2) 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06), 10px 0 30px rgba(8, 38, 74, 0.08) !important;
}

.sidebar-brand {
    min-height: 72px !important;
    padding: 0.95rem 0.9rem !important;
    background: rgba(3, 18, 36, 0.22) !important;
    border-bottom: 1px solid rgba(222, 234, 249, 0.16) !important;
}

.sidebar-brand-logo-wrap,
.sidebar-brand .brand-logo {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 8px !important;
}

.sidebar-brand .brand-title {
    font-size: 0.98rem !important;
    font-weight: 850 !important;
}

.sidebar-brand .brand-role {
    color: rgba(255, 255, 255, 0.66) !important;
    font-size: 0.7rem !important;
}

.sidebar-nav-wrap {
    padding: 0.9rem 0.72rem !important;
}

.sidebar-nav,
.sidebar-nav-group {
    gap: 0.38rem !important;
}

.sidebar-nav a,
.sidebar-nav .nav-link,
.sidebar-nav .sidebar-link {
    min-height: 42px !important;
    border-radius: 8px !important;
    padding: 0.62rem 0.68rem !important;
    color: rgba(238, 246, 255, 0.86) !important;
    font-size: 0.88rem !important;
    font-weight: 720 !important;
}

.sidebar-nav a svg,
.sidebar-nav .nav-link svg,
.sidebar-nav .sidebar-link svg,
.sidebar-nav a i,
.sidebar-nav .nav-link i,
.sidebar-nav .sidebar-link i {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
}

.sidebar-nav a:hover,
.sidebar-nav .nav-link:hover,
.sidebar-nav .sidebar-link:hover {
    background: rgba(255, 255, 255, 0.11) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #fff !important;
}

.sidebar-nav a.active,
.sidebar-nav a.is-active,
.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link.is-active,
.sidebar-nav .sidebar-link.active,
.sidebar-nav .sidebar-link.is-active {
    position: relative;
    background: #ffffff !important;
    color: var(--saas-heading) !important;
    border-color: #ffffff !important;
    box-shadow: 0 12px 24px rgba(2, 18, 38, 0.24) !important;
}

.sidebar-nav a.active::before,
.sidebar-nav a.is-active::before,
.sidebar-nav .nav-link.active::before,
.sidebar-nav .nav-link.is-active::before,
.sidebar-nav .sidebar-link.active::before,
.sidebar-nav .sidebar-link.is-active::before {
    content: '';
    position: absolute;
    left: -0.72rem;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 999px;
    background: var(--saas-gold);
}

.content-topbar {
    position: sticky !important;
    top: 0;
    z-index: 100;
    min-height: 66px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem !important;
    padding: 0 1.15rem !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid var(--saas-line) !important;
    box-shadow: 0 1px 14px rgba(15, 35, 58, 0.07) !important;
    backdrop-filter: blur(16px);
}

.topbar-title-group {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
}

.topbar-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    margin: 0;
    color: var(--saas-muted) !important;
    font-size: 0.72rem;
    font-weight: 760;
    line-height: 1.1;
    text-transform: uppercase;
}

.topbar-breadcrumb svg {
    width: 13px;
    height: 13px;
    color: #9aabc0;
}

.topbar-title {
    margin: 0 !important;
    color: var(--saas-heading) !important;
    font-size: 1.08rem !important;
    font-weight: 860 !important;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.sidebar-toggle,
.topbar-notif-btn,
.profile-dropdown-toggle {
    border-radius: 8px !important;
}

.topbar-notif-btn,
.sidebar-toggle {
    width: 40px !important;
    height: 40px !important;
    border-color: var(--saas-line) !important;
}

.profile-dropdown-toggle {
    min-height: 42px !important;
    padding: 0.28rem 0.45rem !important;
}

.profile-avatar,
.profile-dropdown-avatar {
    background: var(--saas-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.profile-dropdown {
    border-radius: 8px !important;
    border: 1px solid var(--saas-line) !important;
    box-shadow: var(--saas-shadow-lg) !important;
}

.card,
.content-section,
.admin-shell section,
.admin-shell .admin-card,
.dashboard-shell .card,
.history-semester-block,
.history-toolbar,
.stu-id-card,
.stu-status-card,
.stu-form-section,
.login-shell {
    border: 1px solid var(--saas-line) !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: var(--saas-shadow) !important;
}

.content-section,
.admin-shell section,
.admin-shell .admin-card,
.dashboard-shell .card {
    padding: 1.05rem !important;
}

.content-head,
.admin-shell .content-head,
.admin-shell .admin-card-head,
.card-head {
    align-items: center;
    margin-bottom: 0.9rem !important;
    padding-bottom: 0.72rem !important;
    border-bottom: 1px solid var(--saas-line-soft) !important;
}

.content-head h2,
.admin-shell .content-head h2,
.admin-shell .admin-card-head h2,
.card-head h2,
.dashboard-shell .card h2 {
    color: var(--saas-heading) !important;
    font-size: 1.02rem !important;
    font-weight: 860 !important;
}

.hero-card,
.admin-shell .hero-card,
.dashboard-hero {
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    background: linear-gradient(135deg, #08264a 0%, var(--saas-primary) 76%, #0b6f58 100%) !important;
    box-shadow: 0 16px 38px rgba(8, 38, 74, 0.18) !important;
}

.eyebrow,
.student-kicker,
.security-kicker {
    color: var(--saas-gold) !important;
    letter-spacing: 0.08em !important;
}

.admin-metrics,
.metric-grid,
.dashboard-shell .metric-grid.metric-grid-four {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    gap: 0.85rem !important;
}

.admin-metric,
.metric-card {
    min-height: 86px !important;
    padding: 0.92rem !important;
    border-radius: 8px !important;
    border-color: var(--saas-line) !important;
    background: #fff !important;
    box-shadow: var(--saas-shadow) !important;
}

.admin-metric:hover,
.metric-card:hover,
.admin-action-tile:hover,
.student-clearance-row:hover,
.notifications-highlight-item:hover {
    border-color: #b9d2ee !important;
    box-shadow: 0 12px 28px rgba(15, 75, 146, 0.09) !important;
}

.admin-metric-icon,
.metric-icon,
.admin-action-tile i {
    border-radius: 8px !important;
    background: var(--saas-primary-soft) !important;
    color: var(--saas-primary) !important;
}

.admin-metric.is-amber .admin-metric-icon,
.metric-card.is-amber .metric-icon {
    background: var(--saas-gold-soft) !important;
    color: #8a5a00 !important;
}

.admin-metric-body h3,
.metric-content h3,
.metric-card h3 {
    color: var(--saas-muted) !important;
    font-size: 0.72rem !important;
    font-weight: 830 !important;
}

.admin-metric-body p,
.metric-value,
.metric-card p {
    color: var(--saas-heading) !important;
    font-size: 1.46rem !important;
    font-weight: 880 !important;
}

.btn,
.admin-shell .btn,
.dashboard-shell .btn,
button.btn {
    min-height: 38px;
    border-radius: 8px !important;
    padding: 0.52rem 0.82rem !important;
    font-size: 0.86rem !important;
    font-weight: 780 !important;
}

.btn-primary,
.admin-shell .btn-primary,
.dashboard-shell .btn-primary {
    background: var(--saas-primary) !important;
    border-color: var(--saas-primary) !important;
}

.btn-primary:hover,
.admin-shell .btn-primary:hover,
.dashboard-shell .btn-primary:hover {
    background: var(--saas-primary-strong) !important;
    border-color: var(--saas-primary-strong) !important;
}

.btn-warning {
    background: var(--saas-gold) !important;
    border-color: var(--saas-gold) !important;
    color: #332200 !important;
}

.form-grid,
.admin-form,
.security-form,
.request-form-compact {
    gap: 0.9rem !important;
}

input,
select,
textarea,
.form-control,
.form-select,
.admin-form input,
.admin-form select,
.admin-form textarea,
.admin-shell input,
.admin-shell select,
.admin-shell textarea {
    min-height: 42px;
    border-radius: 8px !important;
    border: 1px solid var(--saas-line) !important;
    background: #fff !important;
    color: var(--saas-ink) !important;
    font-size: 0.9rem !important;
}

input::placeholder,
textarea::placeholder {
    color: #9aa8ba !important;
}

label,
.admin-form label,
.admin-shell label,
.form-label,
.auth-field-label {
    color: var(--saas-heading) !important;
    font-size: 0.84rem !important;
    font-weight: 760 !important;
}

.admin-search-bar,
form[method="get"].admin-form,
.registrar-filter-form {
    padding: 0.8rem !important;
    border: 1px solid var(--saas-line) !important;
    border-radius: 8px !important;
    background: var(--saas-surface-muted) !important;
}

.table-wrap,
.admin-shell .table-wrap {
    border-radius: 8px !important;
    border: 1px solid var(--saas-line) !important;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

table {
    min-width: 720px;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

th,
.admin-shell table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc !important;
    color: #52657c !important;
    font-size: 0.72rem !important;
    font-weight: 860 !important;
    text-transform: uppercase;
}

td,
.admin-shell table tbody td {
    color: #273f5c !important;
    font-size: 0.86rem !important;
}

tbody tr:hover,
.admin-shell table tbody tr:hover {
    background: #f3f8ff !important;
}

.badge {
    min-height: 24px;
    border-radius: 999px !important;
    border: 1px solid transparent !important;
    font-weight: 820 !important;
}

.bottom-toast {
    position: fixed;
    right: 1rem !important;
    bottom: 1rem !important;
    z-index: 1300 !important;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: min(420px, calc(100vw - 2rem)) !important;
    min-height: 48px;
    padding: 0.85rem 1rem;
    border-radius: 8px !important;
    border: 1px solid var(--saas-line) !important;
    background: #fff !important;
    color: var(--saas-heading) !important;
    box-shadow: var(--saas-shadow-lg) !important;
    font-weight: 720;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.bottom-toast::before {
    content: '';
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 999px;
    background: var(--saas-primary);
}

.bottom-toast-success::before { background: var(--saas-green); }
.bottom-toast-error::before { background: var(--saas-red); }
.bottom-toast-warning::before { background: var(--saas-amber); }
.bottom-toast-info::before { background: var(--saas-primary); }

.bottom-toast.is-hiding {
    opacity: 0;
    transform: translateY(8px);
}

/* Auth-page toast placement now lives in assets/css/auth.css, which owns the
   whole login/recovery surface. The rule that used to sit here pinned
   `bottom` with !important and stretched the banner to full viewport height. */

.alert {
    border-radius: 8px !important;
    border-width: 1px !important;
    box-shadow: none !important;
}

.alert-success,
.form-feedback.is-success {
    background: var(--saas-green-soft) !important;
    border-color: #bfe7d3 !important;
    color: #066252 !important;
}

.alert-error,
.alert-danger,
.form-feedback.is-error {
    background: var(--saas-red-soft) !important;
    border-color: #ffc9c4 !important;
    color: var(--saas-red) !important;
}

.alert-warning,
.form-feedback.is-warning {
    background: var(--saas-amber-soft) !important;
    border-color: #fed7aa !important;
    color: var(--saas-amber) !important;
}

.alert-info,
.form-feedback.is-info {
    background: var(--saas-primary-soft) !important;
    border-color: #c9dff5 !important;
    color: var(--saas-primary-strong) !important;
}

.admin-empty,
.empty-note,
.text-center.py-4,
.admin-callout {
    border: 1px dashed #cbd8e6 !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    color: var(--saas-muted) !important;
}

.admin-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 0.85rem !important;
}

.admin-action-tile {
    min-height: 88px;
    display: flex !important;
    align-items: center;
    gap: 0.8rem;
    border-radius: 8px !important;
}

.profile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0 !important;
    border-bottom: 1px solid var(--saas-line) !important;
}

.profile-bar-name {
    color: var(--saas-heading) !important;
    font-size: 1.12rem !important;
    font-weight: 850 !important;
}

.profile-bar-detail {
    color: var(--saas-muted) !important;
}

.student-step-chain {
    gap: 0.65rem !important;
}

.student-step-chip,
.history-req-card,
.stu-timeline-card,
.stu-status-info-item,
.stu-form-section,
.stu-org-card,
.student-notification-item,
.student-clearance-row,
.notifications-highlight-item,
.my-clearances-insight-item {
    border-radius: 8px !important;
    border: 1px solid var(--saas-line) !important;
    background: #fff !important;
}

.student-step-chip.is-current,
.stu-org-card.is-checked,
.stu-request-type-card.is-selected {
    background: var(--saas-primary-soft) !important;
    border-color: #bad2ee !important;
}

.student-step-chip.is-done {
    background: var(--saas-green-soft) !important;
    border-color: #bfe7d3 !important;
}

.request-page-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--saas-line);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.request-page-intro h2 {
    margin: 0.12rem 0 0.3rem;
    color: var(--saas-heading);
    font-size: 1.24rem;
    font-weight: 860;
}

.request-page-intro p {
    margin: 0;
    color: var(--saas-muted);
    line-height: 1.55;
}

.request-workflow {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.request-workflow li {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 0.1rem 0.65rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid var(--saas-line);
    border-radius: 8px;
    background: #fff;
}

.request-workflow span {
    grid-row: span 2;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--saas-primary-soft);
    color: var(--saas-primary);
    font-weight: 850;
}

.request-workflow strong {
    color: var(--saas-heading);
    font-size: 0.86rem;
}

.request-workflow small {
    color: var(--saas-muted) !important;
}

.stu-status-info,
.request-help-grid,
.stu-request-type-cards,
.stu-org-grid {
    gap: 0.75rem !important;
}

.stu-org-card {
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.info-strip,
.status-note {
    border: 1px solid var(--saas-line) !important;
    border-radius: 8px !important;
    background: var(--saas-surface-muted) !important;
    color: #314963 !important;
}

.form-feedback {
    display: none;
    margin-top: 0.85rem;
    padding: 0.72rem 0.8rem;
    border: 1px solid var(--saas-line);
    border-radius: 8px;
    font-weight: 720;
}

.form-feedback.is-info,
.form-feedback.is-success,
.form-feedback.is-error,
.form-feedback.is-warning {
    display: block;
}

.login-shell {
    border-radius: 8px !important;
    box-shadow: 0 28px 70px rgba(8, 38, 74, 0.16) !important;
}

.login-brand-panel {
    background: linear-gradient(135deg, #08264a 0%, var(--saas-primary) 74%, #0b6f58 100%) !important;
}

.login-brand-panel h2,
.security-copy-card h2 {
    font-family: 'Inter', system-ui, sans-serif !important;
    letter-spacing: 0 !important;
}

.login-point-item,
.login-point-icon {
    border-radius: 8px !important;
}

.login-form-panel .input-icon-wrap input,
.login-form-panel .input-icon-wrap select {
    min-height: 52px !important;
}

.cal-toolbar,
.cal-grid,
.cal-week-grid,
.cal-legend {
    border-color: var(--saas-line) !important;
}

.cal-toolbar {
    padding: 0 0 0.9rem !important;
}

.cal-toolbar-title {
    color: var(--saas-heading) !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-weight: 850 !important;
}

.cal-view-toggle,
.cal-toolbar-nav button,
.cal-cell,
.cal-week-cell,
.cal-modal {
    border-color: var(--saas-line) !important;
    border-radius: 8px !important;
}

.cal-view-toggle button.is-active {
    background: var(--saas-primary) !important;
}

.cal-cell.is-today,
.cal-week-cell.is-today {
    background: var(--saas-primary-soft) !important;
}

.cal-cell.is-today .cal-cell-date {
    background: var(--saas-primary) !important;
}

.page-transition-overlay {
    background: rgba(245, 247, 251, 0.74) !important;
    backdrop-filter: blur(6px);
}

.page-transition-spinner {
    border-color: #d9e6f6 !important;
    border-top-color: var(--saas-primary) !important;
}

@media (min-width: 901px) {
    .app-layout.is-sidebar-collapsed {
        grid-template-columns: 78px minmax(0, 1fr) !important;
    }

    .app-layout.is-sidebar-collapsed .sidebar {
        width: 78px !important;
    }
}

@media (max-width: 1100px) {
    .request-page-intro,
    .settings-shell .profile-shell,
    .settings-shell .profile-shell-staff,
    .security-panel {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        z-index: 1050;
    }

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

    .sidebar-backdrop.is-visible {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .content-topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .topbar-breadcrumb {
        display: none;
    }
}

@media (max-width: 640px) {
    .app-main .container,
    body:not(:has(.app-layout)) .container {
        padding: 0.82rem !important;
    }

    .content-topbar {
        min-height: 58px !important;
        padding: 0 0.78rem !important;
    }

    .topbar-title {
        font-size: 0.98rem !important;
    }

    .admin-metrics,
    .metric-grid,
    .dashboard-shell .metric-grid.metric-grid-four,
    .admin-actions-grid {
        grid-template-columns: 1fr !important;
    }

    .request-page-intro,
    .content-section,
    .admin-shell section,
    .admin-shell .admin-card,
    .dashboard-shell .card {
        padding: 0.88rem !important;
    }

    table {
        min-width: 680px;
    }

    .bottom-toast {
        right: 0.75rem !important;
        bottom: 0.75rem !important;
        max-width: calc(100vw - 1.5rem) !important;
    }
}
/* Admin workspace redesign pass - stronger visual system */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

.app-layout {
    width: 100%;
    max-width: 100vw;
    grid-template-columns: 276px minmax(0, 1fr) !important;
    overflow-x: hidden;
}

.app-main,
.admin-shell,
.dashboard-shell {
    min-width: 0 !important;
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar {
    width: 276px !important;
    min-width: 276px !important;
    overflow-x: hidden;
}

.sidebar-brand {
    padding-left: 1rem !important;
    padding-right: 0.85rem !important;
}

.sidebar-nav-wrap {
    padding: 1rem 0.85rem !important;
}

.sidebar-nav a,
.sidebar-nav .nav-link,
.sidebar-nav .sidebar-link {
    overflow: hidden;
    padding-left: 0.92rem !important;
    padding-right: 0.82rem !important;
    text-overflow: ellipsis;
}

.sidebar-nav a.active::before,
.sidebar-nav a.is-active::before,
.sidebar-nav .nav-link.active::before,
.sidebar-nav .nav-link.is-active::before,
.sidebar-nav .sidebar-link.active::before,
.sidebar-nav .sidebar-link.is-active::before {
    left: 0.35rem !important;
    top: 11px !important;
    bottom: 11px !important;
    width: 3px !important;
}

.sidebar-nav a.active,
.sidebar-nav a.is-active,
.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link.is-active,
.sidebar-nav .sidebar-link.active,
.sidebar-nav .sidebar-link.is-active {
    padding-left: 1.05rem !important;
}

.content-topbar {
    min-height: 72px !important;
    padding-inline: 1.35rem !important;
}

.app-main .container {
    padding: 1.35rem 1.45rem 1.75rem !important;
}

.admin-shell {
    gap: 1.05rem !important;
}

.admin-shell > section,
.admin-shell > .admin-card {
    max-width: 100%;
    overflow: hidden;
}

.admin-page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 154px;
    padding: 1.4rem 1.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 14px !important;
    background:
        linear-gradient(135deg, rgba(8, 38, 74, 0.98) 0%, rgba(15, 75, 146, 0.96) 64%, rgba(16, 111, 88, 0.94) 100%) !important;
    box-shadow: 0 22px 44px rgba(8, 38, 74, 0.18) !important;
    color: #fff;
}

.admin-page-hero h1 {
    margin: 0.15rem 0 0.45rem;
    color: #fff;
    font-size: clamp(1.65rem, 2vw, 2.35rem);
    line-height: 1.05;
    font-weight: 900;
}

.admin-page-hero p {
    max-width: 68ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.55;
}

.admin-page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 !important;
    color: var(--saas-gold) !important;
    font-size: 0.72rem;
    font-weight: 880;
    letter-spacing: 0.08em !important;
    text-transform: uppercase;
}

.admin-page-primary-action {
    min-height: 46px !important;
    padding-inline: 1.05rem !important;
    background: #fff !important;
    border-color: #fff !important;
    color: var(--saas-primary-strong) !important;
    box-shadow: 0 14px 28px rgba(5, 24, 52, 0.18) !important;
}

.admin-page-primary-action:hover {
    background: var(--saas-gold-soft) !important;
    border-color: var(--saas-gold-soft) !important;
    color: #6a4700 !important;
}

.admin-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.admin-kpi-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 0.8rem;
    min-height: 92px;
    padding: 1rem;
    border: 1px solid var(--saas-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--saas-shadow);
}

.admin-kpi-card > span {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--saas-primary-soft);
    color: var(--saas-primary);
    font-size: 1.05rem;
}

.admin-kpi-card strong {
    display: block;
    color: var(--saas-heading);
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 900;
}

.admin-kpi-card small {
    display: block;
    margin-top: 0.25rem;
    color: var(--saas-muted) !important;
    font-size: 0.78rem;
    font-weight: 760;
}

.admin-kpi-card.is-success > span { background: var(--saas-green-soft); color: var(--saas-green); }
.admin-kpi-card.is-warning > span { background: var(--saas-gold-soft); color: #8a5a00; }
.admin-kpi-card.is-info > span { background: var(--saas-cyan-soft); color: var(--saas-cyan); }

.admin-students-shell > section:not(.admin-page-hero):not(.admin-kpi-strip) {
    border: 1px solid var(--saas-line) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: var(--saas-shadow) !important;
    padding: 1.15rem !important;
}

.admin-students-shell .content-head {
    margin-bottom: 1rem !important;
    padding-bottom: 0.8rem !important;
}

.admin-students-shell .content-head h2 {
    font-size: 1.08rem !important;
}

.admin-students-shell .content-head h2 i {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--saas-primary-soft);
    color: var(--saas-primary);
}

.admin-students-shell .content-head p {
    margin: 0;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--saas-line);
    border-radius: 999px;
    background: var(--saas-surface-muted);
    color: var(--saas-muted) !important;
    font-weight: 760;
}

.admin-students-shell .admin-search-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem !important;
    padding: 0.85rem !important;
    border: 1px solid #cfdcec !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%) !important;
}

.admin-students-shell .admin-search-bar label {
    margin: 0;
}

.admin-students-shell .admin-search-bar input {
    min-height: 48px !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
}

.admin-students-shell .admin-search-bar .btn {
    min-width: 124px;
    min-height: 48px !important;
    border-radius: 10px !important;
}

.admin-students-shell .table-wrap {
    max-width: 100%;
    overflow-x: auto !important;
    border-radius: 12px !important;
    border: 1px solid #d9e4f1 !important;
    background: #fff;
}

.admin-students-shell table {
    min-width: 1360px;
}

.admin-students-shell th {
    height: 46px;
    background: #f8fafc !important;
    border-bottom: 1px solid #dbe5f0 !important;
    color: #4b6078 !important;
    font-size: 0.72rem !important;
}

.admin-students-shell td {
    padding-block: 0.72rem !important;
    background-clip: padding-box;
}

.admin-students-shell tbody tr {
    background: #fff;
}

.admin-students-shell tbody tr:nth-child(even) {
    background: #f8fbff !important;
}

.admin-students-shell tbody tr:hover {
    background: #eef6ff !important;
}

.admin-students-shell td:first-child,
.admin-students-shell th:first-child {
    padding-left: 0.95rem !important;
}

.admin-students-shell table input[type="text"],
.admin-students-shell table select {
    min-width: 128px;
    min-height: 40px !important;
    border-radius: 9px !important;
    background: #fff !important;
}

.admin-students-shell table .btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0 !important;
    border-radius: 10px !important;
}

.admin-students-shell .checkbox-row {
    min-height: 36px;
    padding: 0.25rem 0.3rem;
    border-radius: 8px;
    color: var(--saas-heading) !important;
    white-space: nowrap;
}

.modal-content {
    border-radius: 14px !important;
}

.modal-field-grid {
    gap: 0.9rem !important;
}

@media (min-width: 901px) {
    .app-layout.is-sidebar-collapsed {
        grid-template-columns: 82px minmax(0, 1fr) !important;
    }

    .app-layout.is-sidebar-collapsed .sidebar {
        width: 82px !important;
        min-width: 82px !important;
    }
}

@media (max-width: 1180px) {
    .admin-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        width: 292px !important;
        min-width: 292px !important;
        max-width: 88vw !important;
    }

    .admin-page-hero {
        grid-template-columns: 1fr;
    }

    .admin-page-primary-action {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .app-main .container {
        padding: 0.85rem !important;
    }

    .admin-page-hero {
        min-height: auto;
        padding: 1.1rem !important;
    }

    .admin-kpi-strip,
    .admin-students-shell .admin-search-bar {
        grid-template-columns: 1fr !important;
    }

    .admin-students-shell .admin-search-bar .btn {
        width: 100%;
    }
}
/* Stationary sidebar final override */
@media (min-width: 901px) {
    body:has(.app-layout) .app-layout {
        --fixed-sidebar-width: 230px;
        --fixed-sidebar-collapsed-width: 76px;
        display: block !important;
        min-height: 100vh;
        background: #f4f7fb;
    }

    body.student-portal-body .app-layout {
        --fixed-sidebar-width: 252px;
    }

    body:has(.app-layout) .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: var(--fixed-sidebar-width) !important;
        height: 100vh !important;
        max-height: 100vh !important;
        z-index: 100;
        overflow: hidden !important;
        transform: none !important;
    }

    body:has(.app-layout) .sidebar-nav-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scrollbar-width: thin;
    }

    body:has(.app-layout) .app-main {
        min-width: 0;
        min-height: 100vh;
        margin-left: var(--fixed-sidebar-width) !important;
        transition: margin-left 0.22s ease;
    }

    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar {
        width: var(--fixed-sidebar-collapsed-width) !important;
    }

    body:has(.app-layout) .app-layout.is-sidebar-collapsed .app-main {
        margin-left: var(--fixed-sidebar-collapsed-width) !important;
    }

    body:has(.app-layout) .content-topbar {
        position: sticky !important;
        top: 0;
        z-index: 80;
    }
}

@media (max-width: 900px) {
    body:has(.app-layout) .app-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    body:has(.app-layout) .app-main {
        margin-left: 0 !important;
    }
}
/* Admin fixed sidebar alignment v4 */
@media (min-width: 901px) {
    body.admin-portal-body .app-layout {
        --admin-sidebar-width: 276px;
        --admin-sidebar-collapsed-width: 82px;
        display: block !important;
        min-height: 100vh !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    body.admin-portal-body .sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: var(--admin-sidebar-width) !important;
        min-width: var(--admin-sidebar-width) !important;
        max-width: var(--admin-sidebar-width) !important;
        height: 100vh !important;
        z-index: 120 !important;
        transform: none !important;
    }

    body.admin-portal-body .app-main {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 100vh !important;
        margin-left: var(--admin-sidebar-width) !important;
        overflow-x: hidden !important;
        transition: margin-left 0.22s ease !important;
    }

    body.admin-portal-body .content-topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 90 !important;
        width: 100% !important;
    }

    body.admin-portal-body .app-main .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding-left: 1.35rem !important;
        padding-right: 1.35rem !important;
    }

    body.admin-portal-body .app-layout.is-sidebar-collapsed .sidebar {
        width: var(--admin-sidebar-collapsed-width) !important;
        min-width: var(--admin-sidebar-collapsed-width) !important;
        max-width: var(--admin-sidebar-collapsed-width) !important;
    }

    body.admin-portal-body .app-layout.is-sidebar-collapsed .app-main {
        margin-left: var(--admin-sidebar-collapsed-width) !important;
    }
}

@media (max-width: 900px) {
    body.admin-portal-body .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body.admin-portal-body .app-main .container {
        max-width: none !important;
        margin: 0 !important;
    }
}
/* Admin student-style visual parity v5 */
body.admin-portal-body {
    --bisu-navy: #082f63;
    --bisu-blue: #0f4b92;
    --bisu-blue-2: #155eac;
    --bisu-gold: #f2b84b;
    --bisu-gold-2: #d69b18;
    --admin-bg: #eef4fa;
    --admin-surface: #ffffff;
    --admin-line: #cfddec;
    --admin-line-soft: #e6eef7;
    --admin-muted: #66758b;
    --admin-text: #10233d;
    background: var(--admin-bg) !important;
}

body.admin-portal-body .app-layout {
    background: var(--admin-bg) !important;
}

body.admin-portal-body .app-main {
    background:
        linear-gradient(180deg, rgba(232, 240, 249, 0.9) 0, rgba(238, 244, 250, 0) 230px),
        var(--admin-bg) !important;
}

body.admin-portal-body .sidebar {
    background: linear-gradient(180deg, var(--bisu-navy) 0%, var(--bisu-blue) 58%, #1260b7 100%) !important;
    color: #eef6ff !important;
    border-right: 0 !important;
    box-shadow: 4px 0 22px rgba(8, 47, 99, 0.24) !important;
}

body.admin-portal-body .sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--sidebar-saas-accent), rgba(242, 199, 71, 0.18));
    pointer-events: none;
}

body.admin-portal-body .sidebar-brand {
    min-height: 72px !important;
    background: rgba(4, 30, 68, 0.28) !important;
    border-bottom: 1px solid rgba(226, 238, 255, 0.18) !important;
}

body.admin-portal-body .sidebar-brand .brand-logo {
    background: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.75) !important;
    box-shadow: 0 0 0 2px rgba(242, 184, 75, 0.22) !important;
}

body.admin-portal-body .brand-title,
body.admin-portal-body .sidebar-brand .brand-text h1 {
    color: #ffffff !important;
}

body.admin-portal-body .brand-role,
body.admin-portal-body .sidebar-brand .brand-text p {
    color: #ffd978 !important;
}

body.admin-portal-body .sidebar-brand-close-icon,
body.admin-portal-body .sidebar-brand-open-icon {
    color: rgba(255, 255, 255, 0.78) !important;
}

body.admin-portal-body .sidebar-nav .nav-link,
body.admin-portal-body .sidebar-nav a,
body.admin-portal-body .sidebar-nav .sidebar-link {
    min-height: 40px !important;
    border-radius: 8px !important;
    color: #eaf2ff !important;
    background: transparent !important;
    border-color: transparent !important;
    opacity: 1 !important;
    font-weight: 760 !important;
}

body.admin-portal-body .sidebar-nav .nav-link svg,
body.admin-portal-body .sidebar-nav a svg,
body.admin-portal-body .sidebar-nav .sidebar-link svg,
body.admin-portal-body .sidebar-nav .nav-link i,
body.admin-portal-body .sidebar-nav a i,
body.admin-portal-body .sidebar-nav .sidebar-link i {
    color: #c9dcf7 !important;
    opacity: 1 !important;
}

body.admin-portal-body .sidebar-nav .nav-link:hover,
body.admin-portal-body .sidebar-nav a:hover,
body.admin-portal-body .sidebar-nav .sidebar-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

body.admin-portal-body .sidebar-nav .nav-link.active,
body.admin-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav a.active,
body.admin-portal-body .sidebar-nav a.is-active,
body.admin-portal-body .sidebar-nav .sidebar-link.active,
body.admin-portal-body .sidebar-nav .sidebar-link.is-active {
    color: var(--bisu-navy) !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(4, 30, 68, 0.28) !important;
}

body.admin-portal-body .sidebar-nav .nav-link.active::before,
body.admin-portal-body .sidebar-nav .nav-link.is-active::before,
body.admin-portal-body .sidebar-nav a.active::before,
body.admin-portal-body .sidebar-nav a.is-active::before,
body.admin-portal-body .sidebar-nav .sidebar-link.active::before,
body.admin-portal-body .sidebar-nav .sidebar-link.is-active::before {
    background: var(--bisu-gold) !important;
    opacity: 1 !important;
}

body.admin-portal-body .sidebar-nav .nav-link.active svg,
body.admin-portal-body .sidebar-nav .nav-link.is-active svg,
body.admin-portal-body .sidebar-nav a.active svg,
body.admin-portal-body .sidebar-nav a.is-active svg,
body.admin-portal-body .sidebar-nav .sidebar-link.active svg,
body.admin-portal-body .sidebar-nav .sidebar-link.is-active svg,
body.admin-portal-body .sidebar-nav .nav-link.active i,
body.admin-portal-body .sidebar-nav .nav-link.is-active i,
body.admin-portal-body .sidebar-nav a.active i,
body.admin-portal-body .sidebar-nav a.is-active i,
body.admin-portal-body .sidebar-nav .sidebar-link.active i,
body.admin-portal-body .sidebar-nav .sidebar-link.is-active i {
    color: var(--bisu-blue) !important;
}

body.admin-portal-body .content-topbar {
    min-height: 72px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid #cbd9ea !important;
    box-shadow: 0 1px 12px rgba(16, 32, 51, 0.055) !important;
    backdrop-filter: blur(14px);
}

body.admin-portal-body .topbar-title {
    color: var(--bisu-navy) !important;
    font-size: 1rem !important;
    font-weight: 850 !important;
}

body.admin-portal-body .topbar-breadcrumb span:first-child {
    color: var(--bisu-blue) !important;
}

body.admin-portal-body .profile-avatar,
body.admin-portal-body .profile-dropdown-avatar {
    background: var(--bisu-blue) !important;
    box-shadow: none !important;
}

body.admin-portal-body .app-main .container {
    padding-top: 0.95rem !important;
    padding-bottom: 1.25rem !important;
}

body.admin-portal-body .admin-shell {
    gap: 0.85rem !important;
}

body.admin-portal-body .admin-shell section,
body.admin-portal-body .admin-shell .admin-card,
body.admin-portal-body .dashboard-shell .content-section {
    background: var(--admin-surface) !important;
    border: 1px solid var(--admin-line) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 20px rgba(15, 58, 115, 0.055) !important;
    padding: 0.9rem 1rem !important;
}

body.admin-portal-body .admin-shell section:hover,
body.admin-portal-body .admin-shell .admin-card:hover {
    transform: none !important;
    box-shadow: 0 10px 22px rgba(15, 58, 115, 0.075) !important;
}

body.admin-portal-body .admin-card-head,
body.admin-portal-body .content-head {
    align-items: flex-start !important;
    gap: 0.55rem !important;
    margin-bottom: 0.7rem !important;
    padding-bottom: 0.55rem !important;
    border-bottom: 1px solid var(--admin-line-soft) !important;
}

body.admin-portal-body .admin-card-head h2,
body.admin-portal-body .content-head h2 {
    color: var(--bisu-navy) !important;
    font-size: 1rem !important;
    font-weight: 850 !important;
    letter-spacing: 0 !important;
}

body.admin-portal-body .admin-card-head h2 i,
body.admin-portal-body .content-head h2 i {
    color: var(--bisu-blue) !important;
}

body.admin-portal-body .admin-card-head p,
body.admin-portal-body .content-head p {
    color: var(--admin-muted) !important;
    font-size: 0.8rem !important;
}

body.admin-portal-body .admin-metrics {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 0.75rem !important;
}

body.admin-portal-body .admin-metric {
    min-height: 78px !important;
    padding: 0.8rem 0.95rem !important;
    background: #ffffff !important;
    border: 1px solid #d8e4f3 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 18px rgba(15, 58, 115, 0.055) !important;
    gap: 0.7rem !important;
}

body.admin-portal-body .admin-metric::before {
    background: linear-gradient(90deg, var(--bisu-blue), var(--bisu-gold)) !important;
}

body.admin-portal-body .admin-metric:hover {
    transform: none !important;
    box-shadow: 0 10px 22px rgba(15, 58, 115, 0.075) !important;
}

body.admin-portal-body .admin-metric-icon,
body.admin-portal-body .admin-action-tile i {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 9px !important;
    color: var(--bisu-blue) !important;
    background: #eaf2ff !important;
    border: 1px solid #d7e7fb !important;
    box-shadow: none !important;
}

body.admin-portal-body .admin-metric-body h3 {
    color: #607087 !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
}

body.admin-portal-body .admin-metric-body p {
    color: var(--bisu-navy) !important;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
}

body.admin-portal-body .admin-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
    gap: 0.75rem !important;
}

body.admin-portal-body .admin-action-tile {
    min-height: 72px !important;
    padding: 0.75rem 0.85rem !important;
    border: 1px solid #d8e4f3 !important;
    border-radius: 9px !important;
    background: #fbfdff !important;
    box-shadow: none !important;
    color: var(--admin-text) !important;
}

body.admin-portal-body .admin-action-tile:hover {
    transform: none !important;
    background: #f5f9ff !important;
    border-color: #bfd5ef !important;
}

body.admin-portal-body .admin-action-tile strong {
    color: var(--bisu-navy) !important;
    font-size: 0.9rem !important;
    font-weight: 850 !important;
}

body.admin-portal-body .admin-action-tile small {
    color: var(--admin-muted) !important;
    font-size: 0.78rem !important;
}

body.admin-portal-body .admin-shell .table-wrap {
    border: 1px solid #d8e4f3 !important;
    border-radius: 9px !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

body.admin-portal-body .admin-shell table {
    background: #ffffff !important;
}

body.admin-portal-body .admin-shell table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f7fc !important;
    color: #465a75 !important;
    border-bottom: 1px solid #d8e4f3 !important;
    padding: 0.56rem 0.65rem !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.04em !important;
}

body.admin-portal-body .admin-shell table tbody td {
    color: var(--admin-text) !important;
    border-bottom: 1px solid #edf3f9 !important;
    padding: 0.56rem 0.65rem !important;
    font-size: 0.82rem !important;
    vertical-align: middle !important;
}

body.admin-portal-body .admin-shell table tbody tr:nth-child(even) {
    background: #fbfdff !important;
}

body.admin-portal-body .admin-shell table tbody tr:hover {
    background: #f4f8ff !important;
}

body.admin-portal-body .admin-shell .btn,
body.admin-portal-body .btn {
    min-height: 34px !important;
    border-radius: 8px !important;
    padding: 0.42rem 0.7rem !important;
    font-size: 0.82rem !important;
    font-weight: 760 !important;
}

body.admin-portal-body .btn-primary,
body.admin-portal-body .admin-shell .btn-primary {
    background: var(--bisu-blue) !important;
    border-color: var(--bisu-blue) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

body.admin-portal-body .btn-primary:hover,
body.admin-portal-body .admin-shell .btn-primary:hover {
    background: var(--bisu-navy) !important;
    border-color: var(--bisu-navy) !important;
}

body.admin-portal-body .btn-light,
body.admin-portal-body .btn-outline-primary,
body.admin-portal-body .admin-shell .btn-light,
body.admin-portal-body .admin-shell .btn-outline-primary {
    background: #ffffff !important;
    border-color: #cbd9ea !important;
    color: var(--bisu-blue) !important;
}

body.admin-portal-body .btn-light:hover,
body.admin-portal-body .btn-outline-primary:hover,
body.admin-portal-body .admin-shell .btn-light:hover,
body.admin-portal-body .admin-shell .btn-outline-primary:hover {
    background: #eef6ff !important;
    border-color: #b7cce4 !important;
}

body.admin-portal-body .admin-shell input,
body.admin-portal-body .admin-shell select,
body.admin-portal-body .admin-shell textarea,
body.admin-portal-body .form-control,
body.admin-portal-body .form-select {
    min-height: 36px !important;
    border: 1px solid #cbd9ea !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: var(--admin-text) !important;
    padding: 0.42rem 0.6rem !important;
    font-size: 0.84rem !important;
    box-shadow: none !important;
}

body.admin-portal-body .admin-shell input:focus,
body.admin-portal-body .admin-shell select:focus,
body.admin-portal-body .admin-shell textarea:focus,
body.admin-portal-body .form-control:focus,
body.admin-portal-body .form-select:focus {
    border-color: var(--bisu-blue) !important;
    box-shadow: 0 0 0 3px rgba(15, 75, 146, 0.14) !important;
}

body.admin-portal-body .badge-active,
body.admin-portal-body .badge-cleared,
body.admin-portal-body .badge-success {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}

body.admin-portal-body .badge-inactive,
body.admin-portal-body .badge-pending,
body.admin-portal-body .badge-warning {
    background: #fff7ed !important;
    color: #b45309 !important;
    border: 1px solid #fed7aa !important;
}

body.admin-portal-body .badge,
body.admin-portal-body .admin-shell .badge {
    min-height: 22px;
    padding: 0.18rem 0.5rem !important;
    border-radius: 999px !important;
    font-size: 0.66rem !important;
    font-weight: 850 !important;
}

body.admin-portal-body .modal-content {
    border: 1px solid #d8e4f3 !important;
    border-radius: 10px !important;
    box-shadow: 0 18px 48px rgba(12, 31, 56, 0.22) !important;
}

body.admin-portal-body .modal-header,
body.admin-portal-body .modal-footer {
    background: #ffffff !important;
    border-color: #e6eef7 !important;
}

body.admin-portal-body .modal-body {
    background: #fbfdff !important;
}

@media (max-width: 900px) {
    body.admin-portal-body .admin-metrics,
    body.admin-portal-body .admin-actions-grid {
        grid-template-columns: 1fr !important;
    }
}
/* Admin slimmer sidebar v6 */
@media (min-width: 901px) {
    body.admin-portal-body .app-layout {
        --admin-sidebar-width: 236px;
        --admin-sidebar-collapsed-width: 76px;
    }

    body.admin-portal-body .sidebar {
        width: var(--admin-sidebar-width) !important;
        min-width: var(--admin-sidebar-width) !important;
        max-width: var(--admin-sidebar-width) !important;
    }

    body.admin-portal-body .app-main {
        margin-left: var(--admin-sidebar-width) !important;
    }

    body.admin-portal-body .app-layout.is-sidebar-collapsed .sidebar {
        width: var(--admin-sidebar-collapsed-width) !important;
        min-width: var(--admin-sidebar-collapsed-width) !important;
        max-width: var(--admin-sidebar-collapsed-width) !important;
    }

    body.admin-portal-body .app-layout.is-sidebar-collapsed .app-main {
        margin-left: var(--admin-sidebar-collapsed-width) !important;
    }
}

body.admin-portal-body .sidebar-brand {
    padding-left: 0.75rem !important;
    padding-right: 0.65rem !important;
    gap: 0.65rem !important;
}

body.admin-portal-body .sidebar-brand-logo-wrap,
body.admin-portal-body .sidebar-brand .brand-logo {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
}

body.admin-portal-body .brand-title {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.admin-portal-body .sidebar-nav-wrap {
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
}

body.admin-portal-body .sidebar-nav .nav-link,
body.admin-portal-body .sidebar-nav a,
body.admin-portal-body .sidebar-nav .sidebar-link {
    padding-left: 0.72rem !important;
    padding-right: 0.62rem !important;
    gap: 0.58rem !important;
    font-size: 0.84rem !important;
}

body.admin-portal-body .sidebar-nav .nav-link svg,
body.admin-portal-body .sidebar-nav a svg,
body.admin-portal-body .sidebar-nav .sidebar-link svg,
body.admin-portal-body .sidebar-nav .nav-link i,
body.admin-portal-body .sidebar-nav a i,
body.admin-portal-body .sidebar-nav .sidebar-link i {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
}
/* Sidebar brand logo clean v16 */
body:has(.app-layout) .sidebar-brand-toggle {
    position: relative !important;
    cursor: pointer !important;
    text-align: left !important;
    width: 100% !important;
    border: 0 !important;
}

body:has(.app-layout) .sidebar-brand-logo-wrap {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 50% !important;
    overflow: visible !important;
}

body:has(.app-layout) .sidebar-brand .brand-logo,
body:has(.app-layout) .sidebar-brand-logo {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    opacity: 1 !important;
    transform: none !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 50% !important;
    object-fit: contain !important;
}

body:has(.app-layout) .sidebar-brand-open-icon,
body:has(.app-layout) .sidebar-brand-close-icon {
    display: none !important;
}

@media (min-width: 901px) {
    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-toggle {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        gap: 0 !important;
    }

    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-toggle .brand-text {
        display: none !important;
    }
}
/* Sidebar collapsed logo visible v17 */
@media (min-width: 901px) {
    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand,
    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-toggle {
        width: 100% !important;
        min-height: 72px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        overflow: visible !important;
    }

    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-logo-wrap {
        display: flex !important;
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        opacity: 1 !important;
        visibility: visible !important;
        overflow: visible !important;
        margin: 0 !important;
    }

    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-logo {
        display: block !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-toggle .brand-text {
        display: none !important;
    }
}
/* Officer and organization portals use the same branded role treatment as admin/student. */
body.officer-portal-body .brand-role,
body.organization-portal-body .brand-role,
body.officer-portal-body .sidebar-brand .brand-text p,
body.organization-portal-body .sidebar-brand .brand-text p {
    color: #ffd978 !important;
}
/* Officer/organization fixed-sidebar alignment parity with admin. */
@media (min-width: 901px) {
    body.officer-portal-body .app-layout,
    body.organization-portal-body .app-layout {
        --staff-sidebar-width: 236px;
        --staff-sidebar-collapsed-width: 76px;
        display: block !important;
        width: 100% !important;
        max-width: 100vw !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.officer-portal-body .sidebar,
    body.organization-portal-body .sidebar {
        width: var(--staff-sidebar-width) !important;
        min-width: var(--staff-sidebar-width) !important;
        max-width: var(--staff-sidebar-width) !important;
    }

    body.officer-portal-body .app-main,
    body.organization-portal-body .app-main {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin-left: var(--staff-sidebar-width) !important;
        overflow-x: hidden !important;
    }

    body.officer-portal-body .content-topbar,
    body.organization-portal-body .content-topbar {
        width: 100% !important;
    }

    body.officer-portal-body .app-main .container,
    body.organization-portal-body .app-main .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding-left: 1.35rem !important;
        padding-right: 1.35rem !important;
    }

    body.officer-portal-body .app-layout.is-sidebar-collapsed .sidebar,
    body.organization-portal-body .app-layout.is-sidebar-collapsed .sidebar {
        width: var(--staff-sidebar-collapsed-width) !important;
        min-width: var(--staff-sidebar-collapsed-width) !important;
        max-width: var(--staff-sidebar-collapsed-width) !important;
    }

    body.officer-portal-body .app-layout.is-sidebar-collapsed .app-main,
    body.organization-portal-body .app-layout.is-sidebar-collapsed .app-main {
        margin-left: var(--staff-sidebar-collapsed-width) !important;
    }
}

@media (max-width: 900px) {
    body.officer-portal-body .app-main,
    body.organization-portal-body .app-main {
        width: 100% !important;
        margin-left: 0 !important;
        overflow-x: hidden !important;
    }

    body.officer-portal-body .app-main .container,
    body.organization-portal-body .app-main .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }
}
body.officer-portal-body .admin-shell,
body.organization-portal-body .admin-shell {
    align-content: start !important;
    grid-auto-rows: max-content;
}

body.officer-portal-body .admin-shell > section,
body.officer-portal-body .admin-shell > .admin-card,
body.organization-portal-body .admin-shell > section,
body.organization-portal-body .admin-shell > .admin-card {
    align-self: start;
    min-height: 0 !important;
}
/* Manage Students compact spacing v22 */
body.admin-portal-body .admin-students-shell {
    gap: 0.48rem !important;
    align-content: start !important;
    grid-auto-rows: max-content !important;
}

body.admin-portal-body .admin-students-shell > .admin-students-toolbar,
body.admin-portal-body .admin-students-shell > .student-filter-bar,
body.admin-portal-body .admin-students-shell > .admin-student-records {
    border-radius: 9px !important;
    box-shadow: 0 5px 14px rgba(15, 58, 115, 0.05) !important;
}

body.admin-portal-body .admin-students-shell > .admin-students-toolbar {
    min-height: auto !important;
    padding: 0.58rem 0.72rem !important;
}

body.admin-portal-body .admin-students-shell .admin-student-search {
    gap: 0.42rem !important;
}

body.admin-portal-body .admin-students-shell .admin-student-search input,
body.admin-portal-body .admin-students-shell .admin-student-search .btn,
body.admin-portal-body .admin-students-shell .admin-add-student-btn {
    min-height: 36px !important;
    height: 36px !important;
    border-radius: 7px !important;
}

body.admin-portal-body .admin-students-shell > .student-filter-bar {
    gap: 0.5rem !important;
    margin-bottom: 0 !important;
    padding: 0.62rem 0.72rem !important;
}

body.admin-portal-body .admin-students-shell > .student-filter-bar label {
    gap: 0.22rem !important;
}

body.admin-portal-body .admin-students-shell > .student-filter-bar select {
    min-height: 36px !important;
    height: 36px !important;
    border-radius: 7px !important;
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
}

body.admin-portal-body .admin-students-shell > .admin-kpi-strip {
    gap: 0.48rem !important;
    margin: 0 !important;
}

body.admin-portal-body .admin-students-shell .admin-kpi-card {
    min-height: 52px !important;
    padding: 0.48rem 0.6rem !important;
    border-radius: 8px !important;
    gap: 0.48rem !important;
}

body.admin-portal-body .admin-students-shell .admin-kpi-card > span {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 7px !important;
}

body.admin-portal-body .admin-students-shell .admin-kpi-card strong {
    font-size: 1.05rem !important;
    line-height: 1 !important;
}

body.admin-portal-body .admin-students-shell .admin-kpi-card small {
    margin-top: 0.05rem !important;
    line-height: 1.1 !important;
}

body.admin-portal-body .admin-students-shell > .admin-student-records {
    padding: 0.62rem 0.72rem !important;
}

body.admin-portal-body .admin-students-shell .admin-student-records .content-head {
    min-height: 32px !important;
    margin-bottom: 0.42rem !important;
    padding-bottom: 0.38rem !important;
}

body.admin-portal-body .admin-students-shell .admin-student-records .content-head h2 i {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
}

body.admin-portal-body .admin-students-shell .admin-student-records .table-wrap {
    border-radius: 8px !important;
}

body.admin-portal-body .admin-students-shell .admin-student-records th {
    height: 36px !important;
    padding-top: 0.42rem !important;
    padding-bottom: 0.42rem !important;
}

body.admin-portal-body .admin-students-shell .admin-student-records td {
    padding-top: 0.42rem !important;
    padding-bottom: 0.42rem !important;
}

@media (max-width: 980px) {
    body.admin-portal-body .admin-students-shell {
        gap: 0.55rem !important;
    }

    body.admin-portal-body .admin-students-shell > .student-filter-bar {
        grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    body.admin-portal-body .admin-students-shell > .student-filter-bar {
        grid-template-columns: 1fr !important;
    }
}
/* System compact spacing v23 */
body:has(.app-layout) .app-main .container {
    padding-top: 0.78rem !important;
    padding-bottom: 1.1rem !important;
}

body:has(.app-layout) .dashboard-shell,
body:has(.app-layout) .admin-shell:not(.admin-students-shell),
body:has(.app-layout) .student-grid-main,
body:has(.app-layout) .student-grid-two,
body:has(.app-layout) .student-grid-three,
body:has(.app-layout) .profile-shell,
body:has(.app-layout) .profile-shell-staff,
body:has(.app-layout) .settings-shell {
    gap: 0.65rem !important;
}

body:has(.app-layout) .metric-grid,
body:has(.app-layout) .admin-metrics,
body:has(.app-layout) .admin-actions-grid,
body:has(.app-layout) .admin-info-grid,
body:has(.app-layout) .dashboard-content-grid,
body:has(.app-layout) .dashboard-info-grid,
body:has(.app-layout) .quick-actions,
body:has(.app-layout) .student-action-grid,
body:has(.app-layout) .student-kpis {
    gap: 0.58rem !important;
}

body:has(.app-layout) .content-section,
body:has(.app-layout) .dashboard-shell .card,
body:has(.app-layout) .admin-shell:not(.admin-students-shell) > section,
body:has(.app-layout) .admin-shell:not(.admin-students-shell) > .admin-card,
body:has(.app-layout) .student-card,
body:has(.app-layout) .student-kpi-card,
body:has(.app-layout) .admin-metric,
body:has(.app-layout) .metric-card,
body:has(.app-layout) .admin-action-tile,
body:has(.app-layout) .student-action-tile,
body:has(.app-layout) .dashboard-info-grid > div,
body:has(.app-layout) .profile-grid div {
    padding: 0.75rem 0.85rem !important;
}

body:has(.app-layout) .hero-card,
body:has(.app-layout) .dashboard-hero,
body:has(.app-layout) .admin-page-hero,
body:has(.app-layout) .student-hero {
    padding: 0.9rem 1rem !important;
}

body:has(.app-layout) .content-head,
body:has(.app-layout) .admin-card-head,
body:has(.app-layout) .card-head {
    margin-bottom: 0.55rem !important;
    padding-bottom: 0.48rem !important;
    gap: 0.45rem !important;
}

body:has(.app-layout) .admin-toolbar,
body:has(.app-layout) .admin-search-bar,
body:has(.app-layout) .student-filter-bar,
body:has(.app-layout) .history-toolbar,
body:has(.app-layout) .form-actions,
body:has(.app-layout) .student-semester-info,
body:has(.app-layout) .profile-bar,
body:has(.app-layout) .stu-status-actions {
    gap: 0.48rem !important;
    margin-bottom: 0.55rem !important;
}

body:has(.app-layout) .table-wrap,
body:has(.app-layout) .admin-shell .table-wrap,
body:has(.app-layout) .dashboard-shell .table-wrap {
    margin-top: 0 !important;
}

body:has(.app-layout) table thead th,
body:has(.app-layout) table tbody td {
    padding-top: 0.48rem !important;
    padding-bottom: 0.48rem !important;
}

body:has(.app-layout) .btn {
    min-height: 36px !important;
}

body:has(.app-layout) input,
body:has(.app-layout) select,
body:has(.app-layout) textarea {
    min-height: 36px !important;
}

@media (max-width: 900px) {
    body:has(.app-layout) .app-main .container {
        padding: 0.7rem 0.8rem 1rem !important;
    }

    body:has(.app-layout) .dashboard-shell,
    body:has(.app-layout) .admin-shell,
    body:has(.app-layout) .student-grid-main,
    body:has(.app-layout) .student-grid-two,
    body:has(.app-layout) .student-grid-three {
        gap: 0.6rem !important;
    }

    body:has(.app-layout) .content-section,
    body:has(.app-layout) .dashboard-shell .card,
    body:has(.app-layout) .admin-shell > section,
    body:has(.app-layout) .admin-shell > .admin-card,
    body:has(.app-layout) .student-card,
    body:has(.app-layout) .student-kpi-card,
    body:has(.app-layout) .admin-metric,
    body:has(.app-layout) .metric-card {
        padding: 0.68rem 0.72rem !important;
    }
}
/* Registrar/Dean clearance copies layout v24 */
body:has(.app-layout) .clearance-copies-page,
body:has(.app-layout) .clearance-copies-page .dashboard-stack {
    display: grid !important;
    align-content: start !important;
    grid-auto-rows: max-content !important;
    gap: 0.6rem !important;
    min-height: 0 !important;
}

body:has(.app-layout) .clearance-copies-page .student-filter-bar {
    height: auto !important;
    min-height: 0 !important;
    align-items: end !important;
    gap: 0.5rem !important;
    margin: 0 !important;
    padding: 0.62rem 0.72rem !important;
    border-radius: 9px !important;
    background: #fff !important;
    box-shadow: 0 5px 14px rgba(15, 58, 115, 0.05) !important;
}

body:has(.app-layout) .clearance-copies-page .student-filter-bar label {
    gap: 0.22rem !important;
}

body:has(.app-layout) .clearance-copies-page .student-filter-bar select {
    height: 36px !important;
    min-height: 36px !important;
    padding-top: 0.34rem !important;
    padding-bottom: 0.34rem !important;
    border-radius: 7px !important;
}

body:has(.app-layout) .clearance-copies-page .metric-grid.metric-grid-two {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.6rem !important;
    height: auto !important;
    min-height: 0 !important;
    align-items: stretch !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body:has(.app-layout) .clearance-copies-page .metric-card {
    min-height: 58px !important;
    height: auto !important;
    padding: 0.58rem 0.7rem !important;
    gap: 0.55rem !important;
    border-radius: 8px !important;
}

body:has(.app-layout) .clearance-copies-page .metric-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 7px !important;
}

body:has(.app-layout) .clearance-copies-page .metric-content h3 {
    font-size: 0.72rem !important;
    line-height: 1.1 !important;
}

body:has(.app-layout) .clearance-copies-page .metric-value,
body:has(.app-layout) .clearance-copies-page .metric-card p {
    font-size: 1.08rem !important;
    line-height: 1 !important;
}

body:has(.app-layout) .clearance-copies-page .content-section {
    min-height: 0 !important;
    height: auto !important;
    padding: 0.72rem 0.85rem !important;
    border-radius: 9px !important;
}

body:has(.app-layout) .clearance-copies-page .content-head {
    min-height: 0 !important;
    margin-bottom: 0.45rem !important;
    padding-bottom: 0.42rem !important;
}

body:has(.app-layout) .clearance-copies-page .empty-note {
    margin: 0 !important;
    padding: 0.62rem 0.72rem !important;
    min-height: 0 !important;
    border-radius: 7px !important;
}

body:has(.app-layout) .clearance-copies-page .copies-search-wrap {
    margin-bottom: 0.5rem !important;
}

body:has(.app-layout) .clearance-copies-page .table-wrap {
    margin-top: 0 !important;
    max-height: calc(100vh - 290px);
    overflow: auto !important;
}

@media (max-width: 900px) {
    body:has(.app-layout) .clearance-copies-page .student-filter-bar,
    body:has(.app-layout) .clearance-copies-page .metric-grid.metric-grid-two {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 640px) {
    body:has(.app-layout) .clearance-copies-page .student-filter-bar,
    body:has(.app-layout) .clearance-copies-page .metric-grid.metric-grid-two {
        grid-template-columns: 1fr !important;
    }
}
/* Portal chrome foundation v25 - replaces legacy style.css structural rules */
body.has-sidebar-open {
    overflow: hidden !important;
}

body:has(.app-layout) .app-layout {
    display: grid;
    width: 100%;
    min-height: 100vh;
}

body:has(.app-layout) .sidebar {
    display: flex !important;
    flex-direction: column !important;
}

body:has(.app-layout) .app-main {
    display: grid;
    grid-template-rows: auto 1fr;
}

body:has(.app-layout) .content-topbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

body:has(.app-layout) .topbar-title-group {
    min-width: 0;
}

body:has(.app-layout) .topbar-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.55rem !important;
    min-width: 0;
    flex-shrink: 0;
}

body:has(.app-layout) .topbar-notif-btn,
body:has(.app-layout) .sidebar-toggle {
    position: relative !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    flex: 0 0 auto;
}

body:has(.app-layout) .topbar-notif-btn {
    display: inline-flex !important;
}

body:has(.app-layout) .sidebar-toggle {
    display: none !important;
}

@media (max-width: 900px) {
    body:has(.app-layout) .sidebar-toggle {
        display: inline-flex !important;
    }
}

body:has(.app-layout) .topbar-notif-badge {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    z-index: 2;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 4px !important;
    border-radius: 999px !important;
    color: #fff !important;
    font-size: 0.66rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    letter-spacing: 0 !important;
}

body:has(.app-layout) .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    border: 0;
    padding: 0;
    background: rgba(7, 18, 34, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

body:has(.app-layout) .sidebar-backdrop.is-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

@media (min-width: 901px) {
    body:has(.app-layout) .sidebar-backdrop {
        display: none !important;
    }
}
/* Student profile/settings layout v27 */
body.student-portal-body .student-profile-v2.student-page {
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    overflow: visible !important;
}

body.student-portal-body .student-profile-v2 .student-grid-main {
    display: grid !important;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 0.75rem !important;
    width: 100% !important;
    min-width: 0 !important;
}

body.student-portal-body .student-profile-v2 .student-panel,
body.student-portal-body .student-profile-v2 .student-identity-card,
body.student-portal-body .student-profile-v2 .stu-form-section {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

body.student-portal-body .student-profile-v2 .student-identity-card {
    position: sticky;
    top: 78px;
    align-self: start !important;
}

body.student-portal-body .student-profile-v2 .student-meta-list {
    display: grid !important;
    gap: 0.48rem !important;
}

body.student-portal-body .student-profile-v2 .student-meta-item {
    min-height: 0 !important;
}

body.student-portal-body .student-profile-v2 .student-meta-item strong,
body.student-portal-body .student-profile-v2 .student-identity-head h2,
body.student-portal-body .student-profile-v2 .student-identity-head p {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body.student-portal-body .student-profile-v2 .settings-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.45rem !important;
    margin-bottom: 0.65rem !important;
}

body.student-portal-body .student-profile-v2 .admin-form {
    display: grid !important;
    gap: 0.65rem !important;
    min-width: 0 !important;
}

body.student-portal-body .student-profile-v2 .stu-form-section {
    padding: 0.68rem 0.78rem !important;
    border-radius: 9px !important;
}

body.student-portal-body .student-profile-v2 .stu-form-section-title {
    margin-bottom: 0.55rem !important;
}

body.student-portal-body .student-profile-v2 .profile-two-col,
body.student-portal-body .student-profile-v2 .student-portal-body .profile-two-col {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.62rem !important;
    min-width: 0 !important;
}

body.student-portal-body .student-profile-v2 label,
body.student-portal-body .student-profile-v2 input,
body.student-portal-body .student-profile-v2 select {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.student-portal-body .student-profile-v2 input,
body.student-portal-body .student-profile-v2 select {
    width: 100% !important;
}

body.student-portal-body .student-profile-v2 button[type="submit"] {
    width: 100% !important;
}

@media (max-width: 1180px) {
    body.student-portal-body .student-profile-v2.student-page {
        max-width: none !important;
    }

    body.student-portal-body .student-profile-v2 .student-grid-main {
        grid-template-columns: minmax(220px, 0.42fr) minmax(0, 0.58fr) !important;
    }
}

@media (max-width: 980px) {
    body.student-portal-body .student-profile-v2 .student-grid-main {
        grid-template-columns: 1fr !important;
    }

    body.student-portal-body .student-profile-v2 .student-identity-card {
        position: static !important;
    }
}

@media (max-width: 640px) {
    body.student-portal-body .student-profile-v2 .profile-two-col {
        grid-template-columns: 1fr !important;
    }
}
/* Glassmorphism sidebar v28 */
body:has(.app-layout) {
    --glass-sidebar-bg: linear-gradient(180deg, rgba(7, 34, 73, 0.82) 0%, rgba(13, 73, 137, 0.72) 58%, rgba(16, 91, 169, 0.66) 100%);
    --glass-sidebar-border: rgba(255, 255, 255, 0.24);
    --glass-sidebar-line: rgba(226, 238, 255, 0.18);
    --glass-sidebar-pill: rgba(255, 255, 255, 0.08);
    --glass-sidebar-pill-hover: rgba(255, 255, 255, 0.15);
    --glass-sidebar-pill-active: rgba(255, 255, 255, 0.22);
    --glass-sidebar-text: #f3f8ff;
    --glass-sidebar-muted: #c8dcf7;
    --glass-sidebar-accent: #ffd978;
}

body:has(.app-layout) .sidebar,
body.student-portal-body .sidebar,
body.admin-portal-body .sidebar,
body.officer-portal-body .sidebar,
body.organization-portal-body .sidebar,
body.dean-portal-body .sidebar {
    color: var(--glass-sidebar-text) !important;
    background: var(--glass-sidebar-bg) !important;
    border-right: 1px solid var(--glass-sidebar-border) !important;
    box-shadow:
        inset -1px 0 0 rgba(255, 255, 255, 0.16),
        inset 1px 0 0 rgba(255, 255, 255, 0.08),
        10px 0 30px rgba(8, 39, 82, 0.22) !important;
    backdrop-filter: blur(18px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(145%) !important;
    overflow: hidden !important;
}

body:has(.app-layout) .sidebar::before,
body.student-portal-body .sidebar::before,
body.admin-portal-body .sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02) 36%, transparent 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 34%);
    opacity: 0.9;
    z-index: 0;
}

body:has(.app-layout) .sidebar::after,
body.student-portal-body .sidebar::after,
body.admin-portal-body .sidebar::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 1px !important;
    height: 100% !important;
    background: linear-gradient(180deg, rgba(255, 217, 120, 0.92), rgba(255, 255, 255, 0.16), rgba(255, 217, 120, 0.28)) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

body:has(.app-layout) .sidebar-brand,
body:has(.app-layout) .sidebar-nav-wrap,
body:has(.app-layout) .sidebar-meta {
    position: relative;
    z-index: 2;
}

body:has(.app-layout) .sidebar-brand,
body.student-portal-body .sidebar-brand,
body.admin-portal-body .sidebar-brand {
    background: rgba(255, 255, 255, 0.07) !important;
    border-bottom: 1px solid var(--glass-sidebar-line) !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(10px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(145%) !important;
}

body:has(.app-layout) .brand-title,
body:has(.app-layout) .sidebar-brand .brand-text h1,
body.student-portal-body .brand-title,
body.admin-portal-body .brand-title {
    color: #ffffff !important;
    text-shadow: 0 1px 10px rgba(5, 20, 45, 0.22);
}

body:has(.app-layout) .brand-role,
body:has(.app-layout) .sidebar-brand .brand-text p,
body.student-portal-body .brand-role,
body.admin-portal-body .brand-role,
body.officer-portal-body .brand-role,
body.organization-portal-body .brand-role,
body.dean-portal-body .brand-role {
    color: var(--glass-sidebar-accent) !important;
}

body:has(.app-layout) .sidebar-nav a,
body:has(.app-layout) .sidebar-nav .nav-link,
body:has(.app-layout) .sidebar-nav .sidebar-link,
body.student-portal-body .sidebar-nav a,
body.student-portal-body .sidebar-nav .nav-link,
body.admin-portal-body .sidebar-nav a,
body.admin-portal-body .sidebar-nav .nav-link,
body.admin-portal-body .sidebar-nav .sidebar-link {
    color: var(--glass-sidebar-text) !important;
    background: var(--glass-sidebar-pill) !important;
    border: 1px solid rgba(255, 255, 255, 0.11) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
    backdrop-filter: blur(10px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(135%) !important;
}

body:has(.app-layout) .sidebar-nav a svg,
body:has(.app-layout) .sidebar-nav .nav-link svg,
body:has(.app-layout) .sidebar-nav .sidebar-link svg,
body:has(.app-layout) .sidebar-nav a i,
body:has(.app-layout) .sidebar-nav .nav-link i,
body:has(.app-layout) .sidebar-nav .sidebar-link i,
body.student-portal-body .sidebar-nav a svg,
body.student-portal-body .sidebar-nav .nav-link svg,
body.student-portal-body .sidebar-nav a i,
body.student-portal-body .sidebar-nav .nav-link i {
    color: #dbeaff !important;
}

body:has(.app-layout) .sidebar-nav a:hover,
body:has(.app-layout) .sidebar-nav .nav-link:hover,
body:has(.app-layout) .sidebar-nav .sidebar-link:hover,
body.student-portal-body .sidebar-nav a:hover,
body.student-portal-body .sidebar-nav .nav-link:hover,
body.admin-portal-body .sidebar-nav a:hover,
body.admin-portal-body .sidebar-nav .nav-link:hover,
body.admin-portal-body .sidebar-nav .sidebar-link:hover {
    color: #ffffff !important;
    background: var(--glass-sidebar-pill-hover) !important;
    border-color: rgba(255, 255, 255, 0.24) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 20px rgba(4, 24, 56, 0.14) !important;
}

body:has(.app-layout) .sidebar-nav a.active,
body:has(.app-layout) .sidebar-nav a.is-active,
body:has(.app-layout) .sidebar-nav .nav-link.active,
body:has(.app-layout) .sidebar-nav .nav-link.is-active,
body:has(.app-layout) .sidebar-nav .sidebar-link.active,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active,
body.student-portal-body .sidebar-nav a.active,
body.student-portal-body .sidebar-nav a.is-active,
body.student-portal-body .sidebar-nav .nav-link.active,
body.student-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav a.active,
body.admin-portal-body .sidebar-nav a.is-active,
body.admin-portal-body .sidebar-nav .nav-link.active,
body.admin-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav .sidebar-link.active,
body.admin-portal-body .sidebar-nav .sidebar-link.is-active {
    color: #ffffff !important;
    background: var(--glass-sidebar-pill-active) !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 12px 26px rgba(4, 24, 56, 0.2) !important;
}

body:has(.app-layout) .sidebar-nav a.active svg,
body:has(.app-layout) .sidebar-nav a.is-active svg,
body:has(.app-layout) .sidebar-nav .nav-link.active svg,
body:has(.app-layout) .sidebar-nav .nav-link.is-active svg,
body:has(.app-layout) .sidebar-nav .sidebar-link.active svg,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active svg,
body:has(.app-layout) .sidebar-nav a.active i,
body:has(.app-layout) .sidebar-nav a.is-active i,
body:has(.app-layout) .sidebar-nav .nav-link.active i,
body:has(.app-layout) .sidebar-nav .nav-link.is-active i,
body:has(.app-layout) .sidebar-nav .sidebar-link.active i,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active i,
body.student-portal-body .sidebar-nav a.active svg,
body.student-portal-body .sidebar-nav a.is-active svg,
body.student-portal-body .sidebar-nav .nav-link.active svg,
body.student-portal-body .sidebar-nav .nav-link.is-active svg,
body.student-portal-body .sidebar-nav a.active i,
body.student-portal-body .sidebar-nav a.is-active i,
body.student-portal-body .sidebar-nav .nav-link.active i,
body.student-portal-body .sidebar-nav .nav-link.is-active i {
    color: #ffffff !important;
}

body:has(.app-layout) .sidebar-nav a.active::before,
body:has(.app-layout) .sidebar-nav a.is-active::before,
body:has(.app-layout) .sidebar-nav .nav-link.active::before,
body:has(.app-layout) .sidebar-nav .nav-link.is-active::before,
body:has(.app-layout) .sidebar-nav .sidebar-link.active::before,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active::before,
body.student-portal-body .sidebar-nav a.active::before,
body.student-portal-body .sidebar-nav a.is-active::before,
body.student-portal-body .sidebar-nav .nav-link.active::before,
body.student-portal-body .sidebar-nav .nav-link.is-active::before {
    background: var(--glass-sidebar-accent) !important;
    box-shadow: 0 0 12px rgba(255, 217, 120, 0.55) !important;
}

body:has(.app-layout) .sidebar-brand-logo-wrap,
body:has(.app-layout) .sidebar-brand .brand-logo,
body:has(.app-layout) .sidebar-brand-logo {
    filter: drop-shadow(0 5px 12px rgba(3, 18, 42, 0.22));
}
/* Darker glass sidebar tuning v29 */
body:has(.app-layout) {
    --glass-sidebar-bg: linear-gradient(180deg, rgba(3, 19, 45, 0.94) 0%, rgba(7, 47, 99, 0.9) 52%, rgba(10, 72, 139, 0.84) 100%);
    --glass-sidebar-border: rgba(255, 255, 255, 0.16);
    --glass-sidebar-line: rgba(220, 235, 255, 0.14);
    --glass-sidebar-pill: rgba(255, 255, 255, 0.045);
    --glass-sidebar-pill-hover: rgba(255, 255, 255, 0.11);
    --glass-sidebar-pill-active: rgba(255, 255, 255, 0.18);
    --glass-sidebar-text: #eef6ff;
    --glass-sidebar-muted: #bed5f3;
    --glass-sidebar-accent: #f6c75a;
}

body:has(.app-layout) .sidebar,
body.student-portal-body .sidebar,
body.admin-portal-body .sidebar,
body.officer-portal-body .sidebar,
body.organization-portal-body .sidebar,
body.dean-portal-body .sidebar {
    box-shadow:
        inset -1px 0 0 rgba(255, 255, 255, 0.11),
        inset 1px 0 0 rgba(255, 255, 255, 0.05),
        12px 0 34px rgba(2, 15, 36, 0.34) !important;
    backdrop-filter: blur(16px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(130%) !important;
}

body:has(.app-layout) .sidebar::before,
body.student-portal-body .sidebar::before,
body.admin-portal-body .sidebar::before {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015) 38%, transparent 75%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 32%),
        radial-gradient(circle at 12% 8%, rgba(255, 217, 120, 0.12), transparent 34%) !important;
    opacity: 0.78 !important;
}

body:has(.app-layout) .sidebar-brand,
body.student-portal-body .sidebar-brand,
body.admin-portal-body .sidebar-brand {
    background: rgba(255, 255, 255, 0.045) !important;
}

body:has(.app-layout) .sidebar-nav a,
body:has(.app-layout) .sidebar-nav .nav-link,
body:has(.app-layout) .sidebar-nav .sidebar-link,
body.student-portal-body .sidebar-nav a,
body.student-portal-body .sidebar-nav .nav-link,
body.admin-portal-body .sidebar-nav a,
body.admin-portal-body .sidebar-nav .nav-link,
body.admin-portal-body .sidebar-nav .sidebar-link {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body:has(.app-layout) .sidebar-nav a.active,
body:has(.app-layout) .sidebar-nav a.is-active,
body:has(.app-layout) .sidebar-nav .nav-link.active,
body:has(.app-layout) .sidebar-nav .nav-link.is-active,
body:has(.app-layout) .sidebar-nav .sidebar-link.active,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active,
body.student-portal-body .sidebar-nav a.active,
body.student-portal-body .sidebar-nav a.is-active,
body.student-portal-body .sidebar-nav .nav-link.active,
body.student-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav a.active,
body.admin-portal-body .sidebar-nav a.is-active,
body.admin-portal-body .sidebar-nav .nav-link.active,
body.admin-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav .sidebar-link.active,
body.admin-portal-body .sidebar-nav .sidebar-link.is-active {
    border-color: rgba(246, 199, 90, 0.32) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1)) !important;
}

/* SaaS sidebar refinement v32 */
body:has(.app-layout) {
    --sidebar-saas-bg: linear-gradient(180deg, #081a31 0%, #0b2442 52%, #0e315b 100%);
    --sidebar-saas-surface: rgba(255, 255, 255, 0.035);
    --sidebar-saas-surface-hover: rgba(255, 255, 255, 0.075);
    --sidebar-saas-surface-active: rgba(255, 255, 255, 0.12);
    --sidebar-saas-border: rgba(148, 163, 184, 0.22);
    --sidebar-saas-divider: rgba(148, 163, 184, 0.16);
    --sidebar-saas-text: #e7eef8;
    --sidebar-saas-muted: #aebfd5;
    --sidebar-saas-icon: #b8c9de;
    --sidebar-saas-accent: #5aa2ff;
    --sidebar-saas-accent-strong: #83b9ff;
}

body:has(.app-layout) .sidebar,
body.student-portal-body .sidebar,
body.admin-portal-body .sidebar,
body.officer-portal-body .sidebar,
body.organization-portal-body .sidebar,
body.dean-portal-body .sidebar {
    background: var(--sidebar-saas-bg) !important;
    border-right: 1px solid var(--sidebar-saas-border) !important;
    box-shadow: 10px 0 30px rgba(2, 12, 27, 0.24) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body:has(.app-layout) .sidebar::before,
body:has(.app-layout) .sidebar::after,
body.student-portal-body .sidebar::before,
body.student-portal-body .sidebar::after,
body.admin-portal-body .sidebar::before,
body.admin-portal-body .sidebar::after,
body.officer-portal-body .sidebar::before,
body.officer-portal-body .sidebar::after,
body.organization-portal-body .sidebar::before,
body.organization-portal-body .sidebar::after,
body.dean-portal-body .sidebar::before,
body.dean-portal-body .sidebar::after {
    display: none !important;
    content: none !important;
}

body:has(.app-layout) .sidebar-brand,
body.student-portal-body .sidebar-brand,
body.admin-portal-body .sidebar-brand,
body.officer-portal-body .sidebar-brand,
body.organization-portal-body .sidebar-brand,
body.dean-portal-body .sidebar-brand {
    min-height: 88px !important;
    padding: 20px 22px !important;
    background: rgba(255, 255, 255, 0.025) !important;
    border-bottom: 1px solid var(--sidebar-saas-divider) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body:has(.app-layout) .sidebar-brand-logo-wrap,
body:has(.app-layout) .sidebar-brand .brand-logo,
body:has(.app-layout) .sidebar-brand-logo {
    filter: none !important;
}

body:has(.app-layout) .brand-title,
body:has(.app-layout) .sidebar-brand .brand-text h1,
body.student-portal-body .brand-title,
body.admin-portal-body .brand-title,
body.officer-portal-body .brand-title,
body.organization-portal-body .brand-title,
body.dean-portal-body .brand-title {
    color: #f8fbff !important;
    font-size: 1.03rem !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    line-height: 1.15 !important;
    text-shadow: none !important;
}

body:has(.app-layout) .brand-role,
body:has(.app-layout) .sidebar-brand .brand-text p,
body.student-portal-body .brand-role,
body.admin-portal-body .brand-role,
body.officer-portal-body .brand-role,
body.organization-portal-body .brand-role,
body.dean-portal-body .brand-role {
    color: #f0c35a !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    text-shadow: none !important;
}

body:has(.app-layout) .sidebar-nav-wrap,
body.student-portal-body .sidebar-nav-wrap,
body.admin-portal-body .sidebar-nav-wrap,
body.officer-portal-body .sidebar-nav-wrap,
body.organization-portal-body .sidebar-nav-wrap,
body.dean-portal-body .sidebar-nav-wrap {
    padding: 14px 12px !important;
}

body:has(.app-layout) .sidebar-nav,
body.student-portal-body .sidebar-nav,
body.admin-portal-body .sidebar-nav,
body.officer-portal-body .sidebar-nav,
body.organization-portal-body .sidebar-nav,
body.dean-portal-body .sidebar-nav {
    gap: 4px !important;
}

body:has(.app-layout) .sidebar-nav a,
body:has(.app-layout) .sidebar-nav .nav-link,
body:has(.app-layout) .sidebar-nav .sidebar-link,
body.student-portal-body .sidebar-nav a,
body.student-portal-body .sidebar-nav .nav-link,
body.admin-portal-body .sidebar-nav a,
body.admin-portal-body .sidebar-nav .nav-link,
body.admin-portal-body .sidebar-nav .sidebar-link,
body.officer-portal-body .sidebar-nav a,
body.officer-portal-body .sidebar-nav .nav-link,
body.organization-portal-body .sidebar-nav a,
body.organization-portal-body .sidebar-nav .nav-link,
body.dean-portal-body .sidebar-nav a,
body.dean-portal-body .sidebar-nav .nav-link {
    min-height: 46px !important;
    padding: 11px 14px 11px 16px !important;
    color: var(--sidebar-saas-text) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease !important;
}

body:has(.app-layout) .sidebar-nav a svg,
body:has(.app-layout) .sidebar-nav .nav-link svg,
body:has(.app-layout) .sidebar-nav .sidebar-link svg,
body:has(.app-layout) .sidebar-nav a i,
body:has(.app-layout) .sidebar-nav .nav-link i,
body:has(.app-layout) .sidebar-nav .sidebar-link i,
body.student-portal-body .sidebar-nav a svg,
body.student-portal-body .sidebar-nav .nav-link svg,
body.student-portal-body .sidebar-nav a i,
body.student-portal-body .sidebar-nav .nav-link i,
body.officer-portal-body .sidebar-nav a svg,
body.organization-portal-body .sidebar-nav a svg,
body.dean-portal-body .sidebar-nav a svg {
    color: var(--sidebar-saas-icon) !important;
    opacity: 0.95 !important;
}

body:has(.app-layout) .sidebar-nav a:hover,
body:has(.app-layout) .sidebar-nav .nav-link:hover,
body:has(.app-layout) .sidebar-nav .sidebar-link:hover,
body.student-portal-body .sidebar-nav a:hover,
body.student-portal-body .sidebar-nav .nav-link:hover,
body.admin-portal-body .sidebar-nav a:hover,
body.admin-portal-body .sidebar-nav .nav-link:hover,
body.admin-portal-body .sidebar-nav .sidebar-link:hover,
body.officer-portal-body .sidebar-nav a:hover,
body.officer-portal-body .sidebar-nav .nav-link:hover,
body.organization-portal-body .sidebar-nav a:hover,
body.organization-portal-body .sidebar-nav .nav-link:hover,
body.dean-portal-body .sidebar-nav a:hover,
body.dean-portal-body .sidebar-nav .nav-link:hover {
    color: #ffffff !important;
    background: var(--sidebar-saas-surface-hover) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    box-shadow: none !important;
    transform: translateX(1px) !important;
}

body:has(.app-layout) .sidebar-nav a:hover svg,
body:has(.app-layout) .sidebar-nav .nav-link:hover svg,
body:has(.app-layout) .sidebar-nav .sidebar-link:hover svg,
body:has(.app-layout) .sidebar-nav a:hover i,
body:has(.app-layout) .sidebar-nav .nav-link:hover i,
body:has(.app-layout) .sidebar-nav .sidebar-link:hover i {
    color: #e4f1ff !important;
}

body:has(.app-layout) .sidebar-nav a.active,
body:has(.app-layout) .sidebar-nav a.is-active,
body:has(.app-layout) .sidebar-nav .nav-link.active,
body:has(.app-layout) .sidebar-nav .nav-link.is-active,
body:has(.app-layout) .sidebar-nav .sidebar-link.active,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active,
body.student-portal-body .sidebar-nav a.active,
body.student-portal-body .sidebar-nav a.is-active,
body.student-portal-body .sidebar-nav .nav-link.active,
body.student-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav a.active,
body.admin-portal-body .sidebar-nav a.is-active,
body.admin-portal-body .sidebar-nav .nav-link.active,
body.admin-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav .sidebar-link.active,
body.admin-portal-body .sidebar-nav .sidebar-link.is-active,
body.officer-portal-body .sidebar-nav a.active,
body.officer-portal-body .sidebar-nav .nav-link.active,
body.organization-portal-body .sidebar-nav a.active,
body.organization-portal-body .sidebar-nav .nav-link.active,
body.dean-portal-body .sidebar-nav a.active,
body.dean-portal-body .sidebar-nav .nav-link.active {
    color: #ffffff !important;
    background: var(--sidebar-saas-surface-active) !important;
    border-color: rgba(131, 185, 255, 0.22) !important;
    box-shadow: inset 3px 0 0 var(--sidebar-saas-accent) !important;
}

body:has(.app-layout) .sidebar-nav a.active::before,
body:has(.app-layout) .sidebar-nav a.is-active::before,
body:has(.app-layout) .sidebar-nav .nav-link.active::before,
body:has(.app-layout) .sidebar-nav .nav-link.is-active::before,
body:has(.app-layout) .sidebar-nav .sidebar-link.active::before,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active::before,
body.student-portal-body .sidebar-nav a.active::before,
body.student-portal-body .sidebar-nav a.is-active::before,
body.student-portal-body .sidebar-nav .nav-link.active::before,
body.student-portal-body .sidebar-nav .nav-link.is-active::before {
    display: none !important;
    content: none !important;
}

body:has(.app-layout) .sidebar-nav a.active svg,
body:has(.app-layout) .sidebar-nav a.is-active svg,
body:has(.app-layout) .sidebar-nav .nav-link.active svg,
body:has(.app-layout) .sidebar-nav .nav-link.is-active svg,
body:has(.app-layout) .sidebar-nav .sidebar-link.active svg,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active svg,
body:has(.app-layout) .sidebar-nav a.active i,
body:has(.app-layout) .sidebar-nav a.is-active i,
body:has(.app-layout) .sidebar-nav .nav-link.active i,
body:has(.app-layout) .sidebar-nav .nav-link.is-active i,
body:has(.app-layout) .sidebar-nav .sidebar-link.active i,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active i {
    color: var(--sidebar-saas-accent-strong) !important;
}

@media (min-width: 992px) {
    body.sidebar-collapsed:has(.app-layout) .sidebar-nav a,
    body.sidebar-collapsed:has(.app-layout) .sidebar-nav .nav-link,
    body.sidebar-collapsed:has(.app-layout) .sidebar-nav .sidebar-link {
        justify-content: center !important;
        padding: 11px !important;
        box-shadow: none !important;
    }

    body.sidebar-collapsed:has(.app-layout) .sidebar-nav a.active,
    body.sidebar-collapsed:has(.app-layout) .sidebar-nav .nav-link.active,
    body.sidebar-collapsed:has(.app-layout) .sidebar-nav .sidebar-link.active {
        box-shadow: inset 0 -3px 0 var(--sidebar-saas-accent) !important;
    }
}
/* BISU logo size refinement v33 */
body:has(.app-layout) .sidebar-brand-logo-wrap,
body.student-portal-body .sidebar-brand-logo-wrap,
body.admin-portal-body .sidebar-brand-logo-wrap,
body.officer-portal-body .sidebar-brand-logo-wrap,
body.organization-portal-body .sidebar-brand-logo-wrap,
body.dean-portal-body .sidebar-brand-logo-wrap {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    flex: 0 0 58px !important;
}

body:has(.app-layout) .sidebar-brand .brand-logo,
body:has(.app-layout) .sidebar-brand-logo,
body.student-portal-body .sidebar-brand .brand-logo,
body.student-portal-body .sidebar-brand-logo,
body.admin-portal-body .sidebar-brand .brand-logo,
body.admin-portal-body .sidebar-brand-logo,
body.officer-portal-body .sidebar-brand .brand-logo,
body.officer-portal-body .sidebar-brand-logo,
body.organization-portal-body .sidebar-brand .brand-logo,
body.organization-portal-body .sidebar-brand-logo,
body.dean-portal-body .sidebar-brand .brand-logo,
body.dean-portal-body .sidebar-brand-logo {
    width: 58px !important;
    height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    object-fit: contain !important;
}

@media (min-width: 992px) {
    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-logo-wrap,
    body.sidebar-collapsed:has(.app-layout) .sidebar-brand-logo-wrap {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        flex-basis: 46px !important;
    }

    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-logo,
    body.sidebar-collapsed:has(.app-layout) .sidebar-brand-logo {
        width: 46px !important;
        height: 46px !important;
        max-width: 46px !important;
        max-height: 46px !important;
    }
}
/* Sidebar topbar alignment v34 */
body:has(.app-layout) {
    --portal-chrome-height: 76px;
}

body:has(.app-layout) .content-topbar,
body.student-portal-body .content-topbar,
body.admin-portal-body .content-topbar,
body.officer-portal-body .content-topbar,
body.organization-portal-body .content-topbar,
body.dean-portal-body .content-topbar {
    min-height: var(--portal-chrome-height) !important;
    height: var(--portal-chrome-height) !important;
    max-height: var(--portal-chrome-height) !important;
    box-sizing: border-box !important;
}

body:has(.app-layout) .sidebar-brand,
body:has(.app-layout) .sidebar-brand-toggle,
body.student-portal-body .sidebar-brand,
body.student-portal-body .sidebar-brand-toggle,
body.admin-portal-body .sidebar-brand,
body.admin-portal-body .sidebar-brand-toggle,
body.officer-portal-body .sidebar-brand,
body.officer-portal-body .sidebar-brand-toggle,
body.organization-portal-body .sidebar-brand,
body.organization-portal-body .sidebar-brand-toggle,
body.dean-portal-body .sidebar-brand,
body.dean-portal-body .sidebar-brand-toggle {
    min-height: var(--portal-chrome-height) !important;
    height: var(--portal-chrome-height) !important;
    max-height: var(--portal-chrome-height) !important;
    padding: 10px 18px !important;
    align-items: center !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

body:has(.app-layout) .sidebar-brand-logo-wrap,
body.student-portal-body .sidebar-brand-logo-wrap,
body.admin-portal-body .sidebar-brand-logo-wrap,
body.officer-portal-body .sidebar-brand-logo-wrap,
body.organization-portal-body .sidebar-brand-logo-wrap,
body.dean-portal-body .sidebar-brand-logo-wrap {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    flex: 0 0 54px !important;
}

body:has(.app-layout) .sidebar-brand .brand-logo,
body:has(.app-layout) .sidebar-brand-logo,
body.student-portal-body .sidebar-brand .brand-logo,
body.student-portal-body .sidebar-brand-logo,
body.admin-portal-body .sidebar-brand .brand-logo,
body.admin-portal-body .sidebar-brand-logo,
body.officer-portal-body .sidebar-brand .brand-logo,
body.officer-portal-body .sidebar-brand-logo,
body.organization-portal-body .sidebar-brand .brand-logo,
body.organization-portal-body .sidebar-brand-logo,
body.dean-portal-body .sidebar-brand .brand-logo,
body.dean-portal-body .sidebar-brand-logo {
    width: 54px !important;
    height: 54px !important;
    max-width: 54px !important;
    max-height: 54px !important;
}

@media (min-width: 992px) {
    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand,
    body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-toggle,
    body.sidebar-collapsed:has(.app-layout) .sidebar-brand,
    body.sidebar-collapsed:has(.app-layout) .sidebar-brand-toggle {
        min-height: var(--portal-chrome-height) !important;
        height: var(--portal-chrome-height) !important;
        max-height: var(--portal-chrome-height) !important;
        padding: 10px !important;
        justify-content: center !important;
    }
}
/* BISU seal sidebar palette v35 */
body:has(.app-layout) {
    --sidebar-saas-bg: linear-gradient(165deg, #11164f 0%, #2b2368 54%, #3b1f6b 100%);
    --sidebar-saas-surface: rgba(255, 255, 255, 0.045);
    --sidebar-saas-surface-hover: rgba(255, 255, 255, 0.12);
    --sidebar-saas-surface-active: rgba(255, 255, 255, 0.16);
    --sidebar-saas-border: rgba(242, 199, 71, 0.34);
    --sidebar-saas-divider: rgba(242, 199, 71, 0.24);
    --sidebar-saas-text: #f5f9ff;
    --sidebar-saas-muted: #d5e4f7;
    --sidebar-saas-icon: #d9e8fb;
    --sidebar-saas-accent: #f2c747;
    --sidebar-saas-accent-strong: #ffd66b;
    --sidebar-saas-green: #2f9d4b;
}

body:has(.app-layout) .sidebar,
body.student-portal-body .sidebar,
body.admin-portal-body .sidebar,
body.officer-portal-body .sidebar,
body.organization-portal-body .sidebar,
body.dean-portal-body .sidebar {
    background: var(--sidebar-saas-bg) !important;
    border-right: 1px solid var(--sidebar-saas-border) !important;
    box-shadow:
        inset -1px 0 0 rgba(255, 214, 107, 0.16),
        10px 0 30px rgba(19, 15, 57, 0.24) !important;
}

body:has(.app-layout) .sidebar-brand,
body:has(.app-layout) .sidebar-brand-toggle,
body.student-portal-body .sidebar-brand,
body.student-portal-body .sidebar-brand-toggle,
body.admin-portal-body .sidebar-brand,
body.admin-portal-body .sidebar-brand-toggle,
body.officer-portal-body .sidebar-brand,
body.officer-portal-body .sidebar-brand-toggle,
body.organization-portal-body .sidebar-brand,
body.organization-portal-body .sidebar-brand-toggle,
body.dean-portal-body .sidebar-brand,
body.dean-portal-body .sidebar-brand-toggle {
    background: rgba(10, 9, 48, 0.28) !important;
    border-bottom: 1px solid var(--sidebar-saas-divider) !important;
}

body:has(.app-layout) .sidebar-brand::after,
body.student-portal-body .sidebar-brand::after,
body.admin-portal-body .sidebar-brand::after,
body.officer-portal-body .sidebar-brand::after,
body.organization-portal-body .sidebar-brand::after,
body.dean-portal-body .sidebar-brand::after {
    display: block !important;
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    /* Must land on the same pixel row, at the same weight, as the topbar's
       divider — the two sit side by side at the top of every portal and read as
       one horizontal line broken by the sidebar edge when they disagree.
       `.content-topbar` is 76px tall and closes with a 1px `border-bottom`,
       which paints INSIDE its box on the last row. `.sidebar-brand` is also
       76px, so `bottom: 0` + `height: 1px` puts this rail on exactly that row.
       It used to be 2px at `bottom: -1px`, i.e. one pixel lower and twice as
       thick, which is the visible step between the two lines. */
    bottom: 0 !important;
    height: 1px !important;
    background: linear-gradient(90deg, var(--sidebar-saas-accent), rgba(255, 214, 107, 0.18), var(--sidebar-saas-green)) !important;
}

body:has(.app-layout) .brand-role,
body:has(.app-layout) .sidebar-brand .brand-text p,
body.student-portal-body .brand-role,
body.admin-portal-body .brand-role,
body.officer-portal-body .brand-role,
body.organization-portal-body .brand-role,
body.dean-portal-body .brand-role {
    color: var(--sidebar-saas-accent-strong) !important;
}

body:has(.app-layout) .sidebar-nav a.active,
body:has(.app-layout) .sidebar-nav a.is-active,
body:has(.app-layout) .sidebar-nav .nav-link.active,
body:has(.app-layout) .sidebar-nav .nav-link.is-active,
body:has(.app-layout) .sidebar-nav .sidebar-link.active,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active,
body.student-portal-body .sidebar-nav a.active,
body.student-portal-body .sidebar-nav a.is-active,
body.student-portal-body .sidebar-nav .nav-link.active,
body.student-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav a.active,
body.admin-portal-body .sidebar-nav a.is-active,
body.admin-portal-body .sidebar-nav .nav-link.active,
body.admin-portal-body .sidebar-nav .nav-link.is-active,
body.admin-portal-body .sidebar-nav .sidebar-link.active,
body.admin-portal-body .sidebar-nav .sidebar-link.is-active,
body.officer-portal-body .sidebar-nav a.active,
body.officer-portal-body .sidebar-nav .nav-link.active,
body.organization-portal-body .sidebar-nav a.active,
body.organization-portal-body .sidebar-nav .nav-link.active,
body.dean-portal-body .sidebar-nav a.active,
body.dean-portal-body .sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 214, 107, 0.32) !important;
    box-shadow: inset 3px 0 0 var(--sidebar-saas-accent) !important;
}

body:has(.app-layout) .sidebar-nav a.active svg,
body:has(.app-layout) .sidebar-nav a.is-active svg,
body:has(.app-layout) .sidebar-nav .nav-link.active svg,
body:has(.app-layout) .sidebar-nav .nav-link.is-active svg,
body:has(.app-layout) .sidebar-nav .sidebar-link.active svg,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active svg,
body:has(.app-layout) .sidebar-nav a.active i,
body:has(.app-layout) .sidebar-nav a.is-active i,
body:has(.app-layout) .sidebar-nav .nav-link.active i,
body:has(.app-layout) .sidebar-nav .nav-link.is-active i,
body:has(.app-layout) .sidebar-nav .sidebar-link.active i,
body:has(.app-layout) .sidebar-nav .sidebar-link.is-active i {
    color: var(--sidebar-saas-accent-strong) !important;
}
/* Center signature previews v36 */
body:has(.app-layout) .student-meta-item:has(img[alt="Signature"]),
body:has(.app-layout) .stu-form-section:has(img[alt="Signature"]),
body:has(.app-layout) .stu-form-section:has(img[alt="Your signature"]),
body:has(.app-layout) section:has(> h4 img[alt="Signature"]),
body:has(.app-layout) section:has(img[alt="Your signature"]) {
    text-align: center !important;
}

body:has(.app-layout) img[alt="Signature"],
body:has(.app-layout) img[alt="Your signature"] {
    margin-left: auto !important;
    margin-right: auto !important;
}

body:has(.app-layout) .student-meta-item:has(img[alt="Signature"]) form {
    display: flex !important;
    justify-content: center !important;
}
/* Global table density v38 */
body:has(.app-layout) table th,
body:has(.app-layout) table td,
body.student-portal-body table th,
body.student-portal-body table td,
body.admin-portal-body table th,
body.admin-portal-body table td,
body.officer-portal-body table th,
body.officer-portal-body table td,
body.organization-portal-body table th,
body.organization-portal-body table td,
body.dean-portal-body table th,
body.dean-portal-body table td {
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
    line-height: 1.18 !important;
    vertical-align: middle !important;
}

body:has(.app-layout) table thead th,
body.student-portal-body table thead th,
body.admin-portal-body table thead th,
body.officer-portal-body table thead th,
body.organization-portal-body table thead th,
body.dean-portal-body table thead th {
    padding-top: 0.34rem !important;
    padding-bottom: 0.34rem !important;
}

body:has(.app-layout) table td .btn,
body:has(.app-layout) table td button,
body:has(.app-layout) table td input,
body:has(.app-layout) table td select,
body:has(.app-layout) table td .form-control,
body:has(.app-layout) table td .form-select,
body.student-portal-body table td .btn,
body.student-portal-body table td button,
body.student-portal-body table td input,
body.student-portal-body table td select,
body.admin-portal-body table td .btn,
body.admin-portal-body table td button,
body.admin-portal-body table td input,
body.admin-portal-body table td select {
    min-height: 30px !important;
    height: 30px !important;
    padding-top: 0.22rem !important;
    padding-bottom: 0.22rem !important;
    line-height: 1.15 !important;
}

body:has(.app-layout) table td .badge,
body.student-portal-body table td .badge,
body.admin-portal-body table td .badge,
body.officer-portal-body table td .badge,
body.organization-portal-body table td .badge,
body.dean-portal-body table td .badge {
    min-height: 20px !important;
    padding-top: 0.16rem !important;
    padding-bottom: 0.16rem !important;
    line-height: 1.1 !important;
}

body.student-portal-body .student-mayor-v2 table th,
body.student-portal-body .student-mayor-v2 table td,
body.admin-portal-body .admin-students-shell table th,
body.admin-portal-body .admin-students-shell table td {
    padding-top: 0.28rem !important;
    padding-bottom: 0.28rem !important;
}
/* Global table body density v39 */
body:has(.app-layout) table tbody tr,
body.student-portal-body table tbody tr,
body.admin-portal-body table tbody tr,
body.officer-portal-body table tbody tr,
body.organization-portal-body table tbody tr,
body.dean-portal-body table tbody tr {
    min-height: 0 !important;
}

body:has(.app-layout) table tbody td,
body.student-portal-body table tbody td,
body.admin-portal-body table tbody td,
body.officer-portal-body table tbody td,
body.organization-portal-body table tbody td,
body.dean-portal-body table tbody td {
    padding-top: 0.22rem !important;
    padding-bottom: 0.22rem !important;
    line-height: 1.12 !important;
    vertical-align: middle !important;
}

body:has(.app-layout) table tbody td strong,
body:has(.app-layout) table tbody td small,
body:has(.app-layout) table tbody td span,
body:has(.app-layout) table tbody td a,
body.student-portal-body table tbody td strong,
body.student-portal-body table tbody td small,
body.student-portal-body table tbody td span,
body.student-portal-body table tbody td a,
body.admin-portal-body table tbody td strong,
body.admin-portal-body table tbody td small,
body.admin-portal-body table tbody td span,
body.admin-portal-body table tbody td a {
    line-height: 1.12 !important;
}

body:has(.app-layout) table tbody td small,
body.student-portal-body table tbody td small,
body.admin-portal-body table tbody td small,
body.officer-portal-body table tbody td small,
body.organization-portal-body table tbody td small,
body.dean-portal-body table tbody td small {
    font-size: 0.72rem !important;
}

body:has(.app-layout) table tbody td .btn,
body:has(.app-layout) table tbody td button,
body.student-portal-body table tbody td .btn,
body.student-portal-body table tbody td button,
body.admin-portal-body table tbody td .btn,
body.admin-portal-body table tbody td button,
body.officer-portal-body table tbody td .btn,
body.officer-portal-body table tbody td button,
body.organization-portal-body table tbody td .btn,
body.organization-portal-body table tbody td button,
body.dean-portal-body table tbody td .btn,
body.dean-portal-body table tbody td button {
    min-height: 28px !important;
    height: 28px !important;
    padding-top: 0.16rem !important;
    padding-bottom: 0.16rem !important;
}

body:has(.app-layout) table tbody td input,
body:has(.app-layout) table tbody td select,
body:has(.app-layout) table tbody td textarea,
body:has(.app-layout) table tbody td .form-control,
body:has(.app-layout) table tbody td .form-select,
body.student-portal-body table tbody td input,
body.student-portal-body table tbody td select,
body.student-portal-body table tbody td textarea,
body.admin-portal-body table tbody td input,
body.admin-portal-body table tbody td select,
body.admin-portal-body table tbody td textarea {
    min-height: 28px !important;
    height: 28px !important;
    padding-top: 0.16rem !important;
    padding-bottom: 0.16rem !important;
    font-size: 0.78rem !important;
}

body.student-portal-body .student-mayor-v2 table tbody td,
body.admin-portal-body .admin-students-shell table tbody td {
    padding-top: 0.18rem !important;
    padding-bottom: 0.18rem !important;
}
/* Global table body compact content v40 */
body:has(.app-layout) table tbody td,
body.student-portal-body table tbody td,
body.admin-portal-body table tbody td,
body.officer-portal-body table tbody td,
body.organization-portal-body table tbody td,
body.dean-portal-body table tbody td {
    height: 34px !important;
    min-height: 34px !important;
    padding-top: 0.12rem !important;
    padding-bottom: 0.12rem !important;
    line-height: 1.05 !important;
}

body:has(.app-layout) table tbody td br,
body.student-portal-body table tbody td br,
body.admin-portal-body table tbody td br,
body.officer-portal-body table tbody td br,
body.organization-portal-body table tbody td br,
body.dean-portal-body table tbody td br {
    display: none !important;
}

body:has(.app-layout) table tbody td strong,
body:has(.app-layout) table tbody td small,
body:has(.app-layout) table tbody td span:not(.spinner-border),
body.student-portal-body table tbody td strong,
body.student-portal-body table tbody td small,
body.student-portal-body table tbody td span:not(.spinner-border),
body.admin-portal-body table tbody td strong,
body.admin-portal-body table tbody td small,
body.admin-portal-body table tbody td span:not(.spinner-border) {
    display: inline !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.05 !important;
}

body:has(.app-layout) table tbody td small::before,
body.student-portal-body table tbody td small::before,
body.admin-portal-body table tbody td small::before,
body.officer-portal-body table tbody td small::before,
body.organization-portal-body table tbody td small::before,
body.dean-portal-body table tbody td small::before {
    content: ' ';
}

body:has(.app-layout) table tbody td .btn,
body:has(.app-layout) table tbody td button,
body:has(.app-layout) table tbody td input,
body:has(.app-layout) table tbody td select,
body:has(.app-layout) table tbody td .form-control,
body:has(.app-layout) table tbody td .form-select,
body.student-portal-body table tbody td .btn,
body.student-portal-body table tbody td button,
body.student-portal-body table tbody td input,
body.student-portal-body table tbody td select,
body.student-portal-body table tbody td .form-control,
body.student-portal-body table tbody td .form-select,
body.admin-portal-body table tbody td .btn,
body.admin-portal-body table tbody td button,
body.admin-portal-body table tbody td input,
body.admin-portal-body table tbody td select,
body.admin-portal-body table tbody td .form-control,
body.admin-portal-body table tbody td .form-select {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding-top: 0.08rem !important;
    padding-bottom: 0.08rem !important;
    line-height: 1 !important;
    font-size: 0.76rem !important;
}

body:has(.app-layout) table tbody td .badge,
body.student-portal-body table tbody td .badge,
body.admin-portal-body table tbody td .badge,
body.officer-portal-body table tbody td .badge,
body.organization-portal-body table tbody td .badge,
body.dean-portal-body table tbody td .badge {
    min-height: 18px !important;
    padding: 0.1rem 0.42rem !important;
    font-size: 0.68rem !important;
}

body.student-portal-body .student-mayor-v2 table tbody td {
    height: 32px !important;
    min-height: 32px !important;
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
}

body.student-portal-body .student-mayor-v2 table tbody td:first-child {
    white-space: nowrap !important;
}

body.student-portal-body .student-mayor-v2 table tbody td:first-child .btn {
    margin-top: 0 !important;
    margin-left: 0.35rem !important;
}

body.student-portal-body .student-mayor-v2 .stu-mayor-action-form {
    grid-template-columns: minmax(128px, 0.52fr) minmax(176px, 1fr) 78px !important;
    gap: 0.35rem !important;
}

body.student-portal-body .student-mayor-v2 .stu-mayor-action-form .btn {
    width: 78px !important;
}
/* Keep table ID numbers under names v41 */
body:has(.app-layout) table tbody td strong + br,
body.student-portal-body table tbody td strong + br,
body.admin-portal-body table tbody td strong + br,
body.officer-portal-body table tbody td strong + br,
body.organization-portal-body table tbody td strong + br,
body.dean-portal-body table tbody td strong + br {
    display: initial !important;
}

body:has(.app-layout) table tbody td strong + br + small,
body.student-portal-body table tbody td strong + br + small,
body.admin-portal-body table tbody td strong + br + small,
body.officer-portal-body table tbody td strong + br + small,
body.organization-portal-body table tbody td strong + br + small,
body.dean-portal-body table tbody td strong + br + small {
    display: block !important;
    margin-top: 0.08rem !important;
    line-height: 1.05 !important;
}
/* Compact first-column row actions v42 */
body.student-portal-body .student-mayor-v2 table tbody td:first-child,
body:has(.app-layout) table tbody td:first-child:has(> a.btn) {
    white-space: nowrap !important;
}

body.student-portal-body .student-mayor-v2 table tbody td:first-child > strong + br,
body:has(.app-layout) table tbody td:first-child:has(> a.btn) > strong + br {
    display: none !important;
}

body.student-portal-body .student-mayor-v2 table tbody td:first-child > a.btn,
body:has(.app-layout) table tbody td:first-child:has(> a.btn) > a.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    height: 26px !important;
    min-height: 26px !important;
    margin-top: 0 !important;
    margin-left: 0.45rem !important;
    padding: 0.12rem 0.48rem !important;
    border-radius: 7px !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

body.student-portal-body .student-mayor-v2 table tbody td:first-child > a.btn i,
body:has(.app-layout) table tbody td:first-child:has(> a.btn) > a.btn i {
    font-size: 0.72rem !important;
    line-height: 1 !important;
}
/* Shared table pagination v43 */
body:has(.app-layout) .table-pagination,
body.student-portal-body .table-pagination,
body.admin-portal-body .table-pagination,
body.officer-portal-body .table-pagination,
body.organization-portal-body .table-pagination,
body.dean-portal-body .table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin: 0.45rem 0 0.85rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #dce6f1;
    border-radius: 8px;
    background: #f8fbff;
    color: #4f6882;
    font-size: 0.76rem;
}

.table-pagination-summary {
    font-weight: 700;
}

.table-pagination-actions,
.table-page-size {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.table-page-size {
    color: #5c738b;
    font-weight: 800;
}

.table-page-size select {
    width: 68px;
    min-height: 28px;
    height: 28px;
    padding: 0.12rem 1.45rem 0.12rem 0.4rem;
    border: 1px solid #cbd9e8;
    border-radius: 7px;
    background-color: #fff;
    color: #23435f;
    font-size: 0.74rem;
    font-weight: 800;
}

.table-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 28px;
    padding: 0.16rem 0.48rem;
    border: 1px solid #cbd9e8;
    border-radius: 7px;
    background: #fff;
    color: #244b72;
    font-size: 0.74rem;
    font-weight: 800;
}

.table-page-btn:not(:disabled):hover {
    border-color: #9ab4d0;
    background: #eef5fc;
}

.table-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.table-pagination-page {
    min-width: 78px;
    text-align: center;
    color: #63788f;
    font-weight: 800;
}

@media (max-width: 640px) {
    .table-pagination,
    .table-pagination-actions {
        align-items: stretch;
        width: 100%;
    }

    .table-pagination-actions {
        justify-content: space-between;
    }
}
/* Student sidebar brand full-title fix */
body.student-portal-body .sidebar-brand,
body.student-portal-body .sidebar-brand-toggle {
    height: auto !important;
    min-height: 92px !important;
    max-height: none !important;
    padding: 12px 18px !important;
    overflow: visible !important;
}

body.student-portal-body .sidebar-brand .brand-text {
    display: grid !important;
    gap: 0.16rem !important;
    min-width: 0 !important;
    max-width: 150px !important;
    white-space: normal !important;
}

body.student-portal-body .sidebar-brand .brand-title {
    display: block !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    font-size: 0.98rem !important;
    line-height: 1.12 !important;
}

body.student-portal-body .sidebar-brand .brand-role {
    display: block !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.05 !important;
}

@media (min-width: 992px) {
    body.student-portal-body .app-layout.is-sidebar-collapsed .sidebar-brand,
    body.student-portal-body .app-layout.is-sidebar-collapsed .sidebar-brand-toggle,
    body.sidebar-collapsed.student-portal-body .sidebar-brand,
    body.sidebar-collapsed.student-portal-body .sidebar-brand-toggle {
        min-height: var(--portal-chrome-height) !important;
        height: var(--portal-chrome-height) !important;
        max-height: var(--portal-chrome-height) !important;
        padding: 10px 0 !important;
        overflow: hidden !important;
    }
}

/* ===== Adaptive sidebar toggle v47 =========================================
   Desktop: the BISU brand is the collapse control and the hamburger is gone.
   Tablet/mobile: the brand is inert branding and the hamburger drives the
   off-canvas drawer. Kept last so it outranks the earlier shell passes. */

/* --- Desktop: brand acts as the collapse control -------------------------- */
@media (min-width: 901px) {
    html body:has(.app-layout) .sidebar-toggle {
        display: none !important;
    }

    html body:has(.app-layout) .sidebar-brand-toggle {
        cursor: pointer !important;
        transition: background 0.2s ease, padding 0.2s ease !important;
    }

    html body:has(.app-layout) .sidebar-brand-toggle:hover,
    html body:has(.app-layout) .sidebar-brand-toggle:focus-visible {
        background: rgba(255, 255, 255, 0.12) !important;
    }

    html body:has(.app-layout) .sidebar-brand-toggle:focus-visible {
        outline: 2px solid rgba(255, 217, 120, 0.85) !important;
        outline-offset: -2px !important;
    }

    /* The logo is the affordance, so it gets the press feedback. */
    html body:has(.app-layout) .sidebar-brand-logo-wrap {
        transition: transform 0.22s ease, box-shadow 0.22s ease !important;
    }

    html body:has(.app-layout) .sidebar-brand-toggle:hover .sidebar-brand-logo-wrap {
        transform: scale(1.06) !important;
    }

    html body:has(.app-layout) .sidebar-brand-toggle:active .sidebar-brand-logo-wrap {
        transform: scale(0.94) !important;
    }

    /* Width/margin animate together so the rail slides rather than snaps. */
    html body:has(.app-layout) .sidebar {
        transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1),
            min-width 0.24s cubic-bezier(0.4, 0, 0.2, 1),
            max-width 0.24s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    html body:has(.app-layout) .app-main {
        transition: margin-left 0.24s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* Icon-only rail: labels are gone, so the native title tooltip carries them. */
    html body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-nav a,
    html body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-nav .nav-link,
    html body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-nav .sidebar-link {
        justify-content: center !important;
        gap: 0 !important;
        font-size: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }
}

/* --- Tablet & mobile: hamburger drawer ------------------------------------ */
@media (max-width: 900px) {
    html body:has(.app-layout) .sidebar-toggle {
        display: inline-flex !important;
    }

    /* Branding only down here — no collapse behaviour to advertise. */
    html body:has(.app-layout) .sidebar-brand-toggle {
        cursor: default !important;
        pointer-events: none !important;
        background: transparent !important;
    }

    html body:has(.app-layout) .sidebar-brand-toggle:hover,
    html body:has(.app-layout) .sidebar-brand-toggle:focus-visible {
        background: transparent !important;
        outline: none !important;
    }

    html body:has(.app-layout) .sidebar-brand-toggle:hover .sidebar-brand-logo-wrap,
    html body:has(.app-layout) .sidebar-brand-toggle:active .sidebar-brand-logo-wrap {
        transform: none !important;
    }

    /* Off-canvas drawer. translate3d keeps the slide on the compositor. */
    html body:has(.app-layout) .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        z-index: 1050 !important;
        overflow: hidden !important;
        transform: translate3d(-105%, 0, 0) !important;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
            box-shadow 0.28s ease !important;
        will-change: transform;
    }

    html body:has(.app-layout) .sidebar.is-open {
        transform: translate3d(0, 0, 0) !important;
        box-shadow: 0 22px 60px rgba(8, 39, 82, 0.32) !important;
    }

    /* The shared shell only scrolls the nav on desktop; a tall role menu on a
       short phone would otherwise be clipped with no way to reach the bottom. */
    html body:has(.app-layout) .sidebar-nav-wrap {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    html body:has(.app-layout) .sidebar-backdrop {
        display: block !important;
        transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* Never leave a collapsed rail behind when crossing the breakpoint. */
    html body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar {
        width: 292px !important;
        min-width: 292px !important;
        max-width: 88vw !important;
    }

    html body:has(.app-layout) .app-layout.is-sidebar-collapsed .app-main {
        margin-left: 0 !important;
    }

    html body:has(.app-layout) .sidebar-toggle:focus-visible {
        outline: 2px solid rgba(15, 75, 146, 0.45) !important;
        outline-offset: 2px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body:has(.app-layout) .sidebar,
    html body:has(.app-layout) .app-main,
    html body:has(.app-layout) .sidebar-backdrop,
    html body:has(.app-layout) .sidebar-brand-logo-wrap {
        transition: none !important;
    }
}

/* --- Logo <-> panel icon swap (desktop only) ------------------------------ */
html body:has(.app-layout) .sidebar-brand-logo-wrap {
    position: relative !important;
}

/* stroke is set alongside color because the student layer restyles sidebar
   icons and lucide paints from currentColor. */
html body:has(.app-layout) .sidebar-brand .sidebar-brand-logo-wrap .sidebar-brand-swap-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    display: none;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    color: #ffd978 !important;
    stroke: #ffd978 !important;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

@media (min-width: 901px) {
    /* Expanded shows "close the panel"; the rail shows "open the panel". */
    html body:has(.app-layout) .sidebar-brand-swap-close,
    html body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-swap-open {
        display: block !important;
    }

    html body:has(.app-layout) .app-layout.is-sidebar-collapsed .sidebar-brand-swap-close,
    html body:has(.app-layout) .sidebar-brand-swap-open {
        display: none !important;
    }

    html body:has(.app-layout) .sidebar-brand .sidebar-brand-logo-wrap .sidebar-brand-logo {
        transition: opacity 0.18s ease, transform 0.18s ease !important;
    }

    /* The long selector is deliberate: the shell pins the logo to opacity:1
       !important at (0,3,1), so hiding it needs to outrank that.
       :active keeps the swap working on touch screens, where :hover never
       fires on a tap. */
    html body:has(.app-layout) .sidebar-brand-toggle:hover .sidebar-brand-logo-wrap .sidebar-brand-logo,
    html body:has(.app-layout) .sidebar-brand-toggle:focus-visible .sidebar-brand-logo-wrap .sidebar-brand-logo,
    html body:has(.app-layout) .sidebar-brand-toggle:active .sidebar-brand-logo-wrap .sidebar-brand-logo {
        opacity: 0 !important;
        transform: scale(0.82) !important;
    }

    html body:has(.app-layout) .sidebar-brand-toggle:hover .sidebar-brand-logo-wrap .sidebar-brand-swap-icon,
    html body:has(.app-layout) .sidebar-brand-toggle:focus-visible .sidebar-brand-logo-wrap .sidebar-brand-swap-icon,
    html body:has(.app-layout) .sidebar-brand-toggle:active .sidebar-brand-logo-wrap .sidebar-brand-swap-icon {
        opacity: 1 !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    /* The logo itself is the control, so it keeps its own press feedback. */
    html body:has(.app-layout) .sidebar-brand-toggle:active .sidebar-brand-logo-wrap .sidebar-brand-swap-icon {
        transform: translate(-50%, -50%) scale(0.9) !important;
    }
}

@media (max-width: 900px) {
    html body:has(.app-layout) .sidebar-brand-swap-icon {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body:has(.app-layout) .sidebar-brand-swap-icon,
    html body:has(.app-layout) .sidebar-brand-logo {
        transition: none !important;
    }
}
