/* ==========================================================================
   NEMSU Cantilan Campus — Sports Hub Operation
   Navy Blue Professional Design System
   Harmonized to Official NEMSU Seal (Navy Blue, Laurel Gold, Forest Green)
   ========================================================================== */

:root {
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;

    /* Primary Navy Blue (Executive, Professional Brand Tone) */
    --nemsu-blue: #1d3557;
    --nemsu-blue-dark: #122540;
    --nemsu-blue-light: #eef2f8;
    --nemsu-blue-border: #c7d3e3;

    /* Academic Forest Green (Health & Agriculture Quadrant) */
    --nemsu-green: #0b6b2e;
    --nemsu-green-dark: #074a1f;
    --nemsu-green-light: #ecfdf5;
    --nemsu-green-border: #a7f3d0;
    
    /* Official Laurel & Star Gold */
    --nemsu-gold: #c8901f;
    --nemsu-gold-dark: #92620f;
    --nemsu-gold-light: #fbf4e7;
    --nemsu-gold-border: #e9d3a3;

    /* Torch of Knowledge Flame Red */
    --nemsu-red: #b3413f;
    --nemsu-red-light: #fdf2f2;
    --nemsu-red-border: #eecaca;

    /* Sidebar Navigation (Deep Executive Navy) */
    --sidebar-bg: #0a1728;
    --sidebar-hover: #152a44;
    --sidebar-active-bg: #1d3557;
    --sidebar-border: rgba(255, 255, 255, 0.08);

    --content-bg: #f7f9fb;
    --surface-primary: #ffffff;
    --surface-secondary: #f8fafc;
    --surface-hover: #f1f5f9;
    --control-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-border-subtle: #f1f5f9;
    --surface-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.035);
    --surface-shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.09);
    --focus-ring: 0 0 0 3px rgba(29, 53, 87, 0.16);
    --brand-gradient: linear-gradient(135deg, #1d3557 0%, #284b78 100%);
    --accent-glow: rgba(29, 53, 87, 0.08);
    --radius-card: 14px;
    --radius-control: 9px;
    
    --text-primary: #101828;
    --text-secondary: #475569;
    --text-muted: #64748b;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bs-body-bg: #0f172a;
    --bs-body-color: #e2e8f0;
    --bs-emphasis-color: #f8fafc;
    --bs-secondary-color: #cbd5e1;
    --bs-tertiary-color: #94a3b8;
    --bs-secondary-bg: #1e293b;
    --bs-tertiary-bg: #172235;
    --bs-border-color: #334155;
    --bs-heading-color: #f1f5f9;
    --nemsu-blue: #4d79b5;
    --nemsu-blue-dark: #365f96;
    --nemsu-blue-light: #24364f;
    --nemsu-blue-border: #405774;
    --nemsu-green: #168447;
    --nemsu-green-dark: #116b39;
    --nemsu-green-light: #173b2c;
    --nemsu-green-border: #285a43;
    --nemsu-gold-light: #40351f;
    --nemsu-gold-border: #69552d;
    --nemsu-red-light: #442a2a;
    --nemsu-red-border: #704141;
    --content-bg: #0f172a;
    --surface-primary: #1e293b;
    --surface-secondary: #172235;
    --surface-hover: #29384e;
    --control-bg: #172235;
    --card-border: #334155;
    --card-border-subtle: #263449;
    --surface-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.12);
    --surface-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.24);
    --focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.22);
    --brand-gradient: linear-gradient(135deg, #355b8d 0%, #4d79b5 100%);
    --accent-glow: rgba(96, 165, 250, 0.1);
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
}

html[data-theme="dark"] body {
    --bs-body-bg: var(--content-bg);
    --bs-body-color: var(--text-primary);
    background-color: var(--content-bg);
    color: var(--text-primary);
}

.recruitment-pipeline-lane {
    background-color: var(--surface-secondary);
}

* {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

html, body,
button, .btn,
a, span, p, div,
h1, h2, h3, h4, h5, h6,
label, input, textarea, select,
th, td, li, small, strong, em {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

html[data-theme="dark"] .top-navbar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .list-group-item {
    background-color: #1e293b;
    color: var(--text-primary);
    border-color: var(--card-border);
}

html[data-theme="dark"] .top-navbar h6,
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-black,
html[data-theme="dark"] .text-body {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary {
    color: var(--text-muted) !important;
}

html[data-theme="dark"] .text-body-secondary {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .bg-warning .text-dark,
html[data-theme="dark"] .bg-warning-subtle .text-dark,
html[data-theme="dark"] .bg-warning.text-dark,
html[data-theme="dark"] .bg-warning-subtle.text-dark {
    color: #332500 !important;
}

html[data-theme="dark"] .badge-status-available,
html[data-theme="dark"] .badge-status-confirmed {
    color: #86efac;
    border-color: #285a43;
}

html[data-theme="dark"] .badge-status-checked-out {
    color: #bfdbfe;
    border-color: #405774;
}

html[data-theme="dark"] .badge-status-damaged,
html[data-theme="dark"] .badge-status-rejected {
    color: #fca5a5;
    border-color: #704141;
}

html[data-theme="dark"] .badge-status-under-repair,
html[data-theme="dark"] .badge-status-pending {
    color: #fde68a;
    border-color: #69552d;
}

html[data-theme="dark"] .badge-status-cancelled {
    background-color: #29384e;
    border-color: #40516a;
    color: #cbd5e1;
}

html[data-theme="dark"] .text-nemsu-blue {
    color: #93c5fd !important;
}

html[data-theme="dark"] .text-nemsu-green {
    color: #86efac !important;
}

html[data-theme="dark"] .text-nemsu-gold {
    color: #fde68a !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light {
    background-color: #1e293b !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .btn-light {
    background-color: #26354b;
    border-color: #40516a;
    color: var(--text-primary);
}

html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn-light:focus {
    background-color: #33465f;
    border-color: #526985;
    color: #ffffff;
}

html[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background-color: #334155;
    color: #ffffff;
}

html[data-theme="dark"] .table {
    --bs-table-bg: #1e293b;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--card-border);
    --bs-table-striped-bg: #243247;
    --bs-table-striped-color: var(--text-primary);
    --bs-table-hover-bg: #29384e;
    --bs-table-hover-color: var(--text-primary);
}

html[data-theme="dark"] .table thead th {
    background-color: #253449;
    color: var(--text-muted);
}

html[data-theme="dark"] .table tbody td {
    color: var(--text-primary);
}

html[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: #29384e;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: #172235;
    border-color: #40516a;
    color: var(--text-primary);
}

html[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: #172235;
    color: var(--text-primary);
}

html[data-theme="dark"] .sports-chat-messages,
html[data-theme="dark"] .admin-coach-chat-messages {
    background-color: #111c2e;
}

html[data-theme="dark"] .chat-seen-reader {
    color: var(--text-secondary);
}

html[data-theme="dark"] .chat-typing-dots {
    color: var(--text-muted);
}

html[data-theme="dark"] .swal2-popup.nemsu-swal-popup,
html[data-theme="dark"] .swal2-popup.nemsu-swal-toast {
    background: #1e293b !important;
    border-color: var(--card-border) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .swal2-popup.nemsu-swal-popup .swal2-title,
html[data-theme="dark"] .swal2-popup.nemsu-swal-toast .swal2-title {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .swal2-popup.nemsu-swal-popup .swal2-html-container {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .nemsu-swal-cancel {
    background: #26354b !important;
    border-color: #40516a !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .nemsu-swal-cancel:hover {
    background: #33465f !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-end,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] hr {
    border-color: var(--card-border) !important;
}

html[data-theme="dark"] .pagination {
    --bs-pagination-color: var(--text-secondary);
    --bs-pagination-bg: #1e293b;
    --bs-pagination-border-color: var(--card-border);
    --bs-pagination-hover-bg: #334155;
    --bs-pagination-hover-border-color: #526177;
    --bs-pagination-disabled-bg: #172235;
    --bs-pagination-disabled-border-color: var(--card-border);
}

html[data-theme="dark"] #rowsPerPageSelect,
html[data-theme="dark"] #rowsPerPageSelect:hover,
html[data-theme="dark"] #rowsPerPageSelect:focus {
    background-color: #172235;
    color: var(--text-primary);
}

/* ==========================================================================
   Shared application design polish
   ========================================================================== */
body {
    font-size: 0.9rem;
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.025em;
}

h1, .h1 { font-weight: 750; }
h2, .h2 { font-weight: 700; }
h3, .h3, h4, .h4 { font-weight: 700; }
h5, .h5, h6, .h6 { font-weight: 650; }

a {
    text-underline-offset: 0.16em;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

button, input, select, textarea {
    font: inherit;
}

:focus-visible {
    outline: 3px solid rgba(29, 53, 87, 0.45);
    outline-offset: 2px;
}

html[data-theme="dark"] :focus-visible {
    outline-color: rgba(147, 197, 253, 0.75);
}

.top-navbar {
    padding: 0.8rem clamp(1rem, 2.5vw, 2rem);
    min-height: 72px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.045);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
}

.top-navbar h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.96rem;
    font-weight: 700;
}

.main-body {
    padding: clamp(1rem, 2.6vw, 2rem);
}

.card {
    overflow-wrap: break-word;
    border-color: var(--card-border);
    border-radius: var(--radius-card);
    background-color: var(--surface-primary);
    box-shadow: var(--surface-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.card-header {
    background-color: var(--surface-primary);
    border-color: var(--card-border-subtle);
}

.card-footer {
    background-color: var(--surface-secondary);
    border-color: var(--card-border);
}

.stat-card {
    border-radius: var(--radius-card);
    background-color: var(--surface-primary);
    box-shadow: var(--surface-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--nemsu-blue-border);
    box-shadow: var(--surface-shadow-hover);
}

.btn {
    min-height: 38px;
    border-radius: var(--radius-control);
    font-weight: 600;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn-sm {
    min-height: 32px;
}

.btn:not(:disabled):not(.disabled):hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.form-control,
.form-select,
.input-group-text {
    min-height: 40px;
    border-radius: var(--radius-control);
    background-color: var(--control-bg);
    border-color: var(--card-border);
}

textarea.form-control {
    min-height: unset;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--nemsu-blue);
    box-shadow: var(--focus-ring);
}

.form-label,
label:not(.form-check-label):not(.visually-hidden) {
    color: var(--text-secondary);
    font-weight: 600;
}

.table-responsive {
    border-radius: 10px;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

.table thead th {
    background-color: var(--surface-secondary);
    letter-spacing: 0.065em;
}

.table tbody tr {
    transition: background-color 0.16s ease;
}

.table-hover tbody tr:hover {
    background-color: var(--surface-hover);
}

.dropdown-menu {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background-color: var(--surface-primary);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: 7px;
    padding: 0.5rem 0.7rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.modal-content,
.offcanvas {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    background-color: var(--surface-primary);
    color: var(--text-primary);
    box-shadow: var(--surface-shadow-hover);
}

.alert {
    border-radius: 11px;
}

.badge {
    font-weight: 600;
}

.nav-link-custom {
    min-height: 40px;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.nav-link-custom:hover {
    transform: translateX(2px);
}

.pagination .page-link {
    border-radius: 7px;
}

.sports-chat-messages,
.admin-coach-chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas {
    background-color: var(--surface-primary);
    color: var(--text-primary);
    border-color: var(--card-border);
}

html[data-theme="dark"] .card-footer {
    background-color: var(--surface-secondary);
}

html[data-theme="dark"] .table thead th {
    background-color: var(--surface-secondary);
}

html[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: var(--surface-hover);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: var(--control-bg);
}

html[data-theme="dark"] .dropdown-menu {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

@media (max-width: 575.98px) {
    .top-navbar {
        min-height: 64px;
        gap: 0.5rem;
        padding: 0.65rem 0.85rem;
    }

    .top-navbar > .d-flex {
        gap: 0.6rem !important;
    }

    .main-body {
        padding: 1rem 0.85rem;
    }

    .card {
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-body);
    background-color: var(--content-bg);
    color: var(--text-primary);
    min-height: 100vh;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

.auth-input-has-toggle::-ms-reveal,
.auth-input-has-toggle::-ms-clear,
.password-has-custom-toggle::-ms-reveal,
.password-has-custom-toggle::-ms-clear {
    display: none;
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: flex-start;
}

.app-sidebar {
    width: var(--app-sidebar-width, 285px);
    background-color: var(--sidebar-bg);
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    z-index: 1030;
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-toggle-button {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.sidebar-brand-text h6 {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.02em;
}

.sidebar-brand-text small {
    color: var(--nemsu-gold);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
}

.sidebar-menu {
    padding: 1rem 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.menu-header {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #4b5a7a;
    padding: 0.85rem 0.75rem 0.35rem;
    letter-spacing: 0.08em;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.58rem 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s ease;
    margin-bottom: 3px;
}

.nav-link-custom i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: color 0.15s ease;
}

.nav-link-custom:hover {
    color: #ffffff;
    background-color: var(--sidebar-hover);
}

.nav-link-custom:hover i {
    color: var(--nemsu-gold);
}

.nav-link-custom.active {
    color: #ffffff;
    background-color: var(--sidebar-active-bg);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(29, 53, 87, 0.35);
}

.nav-link-custom.active i {
    color: var(--nemsu-gold);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.25);
    font-size: 0.8rem;
}

.notification-center-menu {
    width: min(390px, calc(100vw - 1rem));
    min-width: min(330px, calc(100vw - 1rem));
    overflow: hidden;
    border: 1px solid var(--card-border) !important;
    border-radius: 10px;
}

.notification-feed-list {
    max-height: min(44vh, 300px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.notification-private-message-list {
    max-height: min(28vh, 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notification-private-message {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--card-border);
    background: var(--surface-primary);
    color: var(--text-primary);
    text-align: left;
}

.notification-private-message:hover,
.notification-private-message:focus-visible {
    background: var(--surface-secondary);
}

.notification-private-message-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.15rem;
}

.notification-private-message-details strong,
.notification-private-message-details > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-private-message-details strong {
    font-size: 0.78rem;
}

.notification-private-message-details > span {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.notification-feed-state {
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

.notification-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--card-border);
    border-left: 3px solid #64748b;
    background: var(--surface-primary);
}

.notification-feed-item.is-unread {
    background: color-mix(in srgb, var(--surface-primary) 88%, var(--nemsu-blue));
}

.notification-feed-item[data-category="facility"] {
    border-left-color: #dc3545;
}

.notification-feed-item[data-category="equipment"] {
    border-left-color: #0d6efd;
}

.notification-feed-item[data-category="people"] {
    border-left-color: #198754;
}

.notification-feed-item[data-category="schedule"] {
    border-left-color: #9b59b6;
}

.notification-feed-main {
    min-width: 0;
    flex: 1 1 auto;
}

.notification-feed-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.notification-feed-title {
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.78rem;
    line-height: 1.3;
}

.notification-feed-item.is-unread .notification-feed-title {
    font-weight: 700;
}

.notification-feed-category {
    flex: 0 0 auto;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    background: var(--surface-secondary);
    color: var(--text-muted);
    font-size: 0.61rem;
    font-weight: 700;
}

.notification-feed-message {
    margin-top: 0.18rem;
    color: var(--text-muted);
    font-size: 0.73rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.notification-feed-time {
    display: block;
    margin-top: 0.22rem;
    color: var(--text-muted);
    font-size: 0.65rem;
}

.notification-feed-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.28rem;
}

.notification-feed-actions .btn {
    padding: 0.14rem 0.38rem;
    font-size: 0.65rem;
    white-space: nowrap;
}

.notification-feed-actions .btn-outline-danger {
    min-width: 1.7rem;
}

.notification-feed-load-more {
    display: block;
    width: calc(100% - 1rem);
    margin: 0.5rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.notification-feed-shortcuts a {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-decoration: none;
}

.notification-feed-shortcuts a:hover {
    color: var(--nemsu-blue);
    text-decoration: underline;
}

/* ==========================================================================
   Content Area & Top Navbar
   ========================================================================== */
.app-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    min-width: 0;
    width: 0;
    margin-left: var(--app-sidebar-width, 285px);
    padding-bottom: 80px;
}

.site-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: var(--app-sidebar-width, 285px);
    z-index: 1020;
    min-height: 69px;
    padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    background-color: var(--surface-primary) !important;
    color: var(--text-muted) !important;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.top-navbar h6 {
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.main-body {
    padding: 2rem;
    flex-grow: 1;
}

/* ==========================================================================
   Cards & Panels
   ========================================================================== */
.card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
    background-color: #ffffff;
    margin-bottom: 1.5rem;
    transition: border-color 0.15s ease;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border-subtle);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.stat-card {
    border-radius: 12px;
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--card-border);
    padding: 0.85rem 1.15rem;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--card-border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ==========================================================================
   Buttons & Controls (Branded with NEMSU Palette)
   ========================================================================== */
.btn {
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
}

/* Primary University Action Button */
.btn-nemsu, .btn-primary {
    background-color: var(--nemsu-blue) !important;
    border-color: var(--nemsu-blue) !important;
    color: #ffffff !important;
}

.btn-nemsu:hover, .btn-nemsu:focus,
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--nemsu-blue-dark) !important;
    border-color: var(--nemsu-blue-dark) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(29, 53, 87, 0.25);
}

.btn-outline-primary {
    color: var(--nemsu-blue) !important;
    border-color: var(--nemsu-blue) !important;
}

.btn-outline-primary:hover {
    background-color: var(--nemsu-blue) !important;
    color: #ffffff !important;
}

/* Secondary Campus Green Button */
.btn-nemsu-green, .btn-success {
    background-color: var(--nemsu-green) !important;
    border-color: var(--nemsu-green) !important;
    color: #ffffff !important;
}

.btn-nemsu-green:hover, .btn-success:hover {
    background-color: var(--nemsu-green-dark) !important;
    border-color: var(--nemsu-green-dark) !important;
    color: #ffffff !important;
}

.form-control, .form-select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem;
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--nemsu-blue);
    box-shadow: 0 0 0 3px rgba(29, 53, 87, 0.14);
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* ==========================================================================
   Modern Minimalist Badges (Matched to Logo Colors)
   ========================================================================== */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    letter-spacing: 0.01em;
}

/* Available / Rostered / Confirmed: Academic Green */
.badge-status-available, .badge-status-confirmed { 
    background-color: var(--nemsu-green-light); 
    color: #065f46; 
    border: 1px solid var(--nemsu-green-border); 
}

/* Checked Out / Shortlisted: Royal University Blue */
.badge-status-checked-out { 
    background-color: var(--nemsu-blue-light); 
    color: #122540; 
    border: 1px solid var(--nemsu-blue-border); 
}

/* Damaged / Rejected: Torch Flame Red */
.badge-status-damaged, .badge-status-rejected { 
    background-color: var(--nemsu-red-light); 
    color: var(--nemsu-red); 
    border: 1px solid var(--nemsu-red-border); 
}

/* Under Repair / Pending: Laurel Gold */
.badge-status-under-repair, .badge-status-pending { 
    background-color: var(--nemsu-gold-light); 
    color: var(--nemsu-gold-dark); 
    border: 1px solid var(--nemsu-gold-border); 
}

.badge-status-cancelled { 
    background-color: #f1f5f9; 
    color: #475569; 
    border: 1px solid #e2e8f0; 
}

/* Text Accent Utilities */
.text-nemsu-blue { color: var(--nemsu-blue) !important; }
.text-nemsu-green { color: var(--nemsu-green) !important; }
.text-nemsu-gold { color: var(--nemsu-gold-dark) !important; }

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 1199.98px) {
    .app-sidebar {
        position: fixed;
        z-index: 1040;
        height: 100vh;
        height: 100dvh;
        left: calc(-1 * var(--app-sidebar-width, 285px));
    }
    .app-content {
        margin-left: 0;
        padding-bottom: 80px;
    }
    .app-sidebar.show {
        transform: translateX(var(--app-sidebar-width, 285px));
    }
    .main-body {
        padding: 1.25rem;
    }
    .top-navbar {
        padding: 0.75rem 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .top-navbar {
        gap: 0.75rem !important;
    }

    .top-navbar > .d-flex:last-child {
        gap: 0.5rem !important;
    }

    .top-navbar > .d-flex:last-child > .text-end {
        display: none !important;
    }

    .theme-toggle {
        width: 38px;
        padding: 3px;
    }

    .theme-toggle-label {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .top-navbar {
        gap: 0.35rem !important;
    }

    .top-navbar > .d-flex:first-child > div:last-child {
        overflow-wrap: normal;
    }

    .top-navbar > .d-flex:first-child small {
        display: none;
    }

    .top-navbar > .d-flex:last-child {
        gap: 0.25rem !important;
    }

    .top-navbar #sidebarToggle {
        width: 40px;
        height: 38px;
        flex: 0 0 40px;
        padding: 0;
    }

    #activeUsersToggle {
        gap: 0.25rem !important;
        padding-right: 0.35rem !important;
        padding-left: 0.35rem !important;
    }
}

/* ==========================================================================
   Custom Professional SweetAlert2 Modal & Notification Theme
   ========================================================================== */
.swal2-container {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(9, 16, 36, 0.5) !important;
}

.swal2-popup.nemsu-swal-popup {
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
    padding: 2rem 1.75rem 1.75rem !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    color: var(--text-primary) !important;
}

.swal2-popup.nemsu-swal-popup .swal2-image {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: min(65vh, 720px);
    object-fit: contain;
}

.swal2-popup.nemsu-swal-popup .swal2-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: 1.28rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em !important;
    padding: 0.5rem 0 0 !important;
    margin-bottom: 0.5rem !important;
}

.swal2-popup.nemsu-swal-popup .swal2-html-container {
    font-size: 0.92rem !important;
    color: #475569 !important;
    line-height: 1.55 !important;
    margin: 0.5rem 0 1.5rem !important;
}

.swal2-popup.nemsu-swal-popup .swal2-actions {
    gap: 0.75rem !important;
    margin-top: 1rem !important;
    width: 100% !important;
    justify-content: center !important;
}

.swal2-popup.nemsu-swal-popup .swal2-styled {
    margin: 0 !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    padding: 0.6rem 1.5rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* SweetAlert Icons refined */
.swal2-popup.nemsu-swal-popup .swal2-icon.swal2-success {
    border-color: #10b981 !important;
    color: #10b981 !important;
}

.swal2-popup.nemsu-swal-popup .swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #10b981 !important;
}

.swal2-popup.nemsu-swal-popup .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.swal2-popup.nemsu-swal-popup .swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

.swal2-popup.nemsu-swal-popup .swal2-icon.swal2-error {
    border-color: var(--nemsu-red) !important;
    color: var(--nemsu-red) !important;
}

/* Custom Action Button Classes */
.nemsu-swal-confirm {
    background: linear-gradient(135deg, var(--nemsu-blue) 0%, var(--nemsu-blue-dark) 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

.nemsu-swal-confirm:hover {
    box-shadow: 0 4px 12px rgba(29, 53, 87, 0.35) !important;
    transform: translateY(-1px) !important;
}

.nemsu-swal-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

.nemsu-swal-danger:hover {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35) !important;
    transform: translateY(-1px) !important;
}

.nemsu-swal-cancel {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

.nemsu-swal-cancel:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* Floating Toast Styling */
.swal2-popup.nemsu-swal-toast {
    border-radius: 12px !important;
    padding: 0.75rem 1.25rem !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0,0,0,0.05) !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

.swal2-popup.nemsu-swal-toast .swal2-title {
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

/* ==========================================================================
   Professional Minimalist Pagination System
   ========================================================================== */
.pagination {
    --bs-pagination-padding-x: 0.65rem;
    --bs-pagination-padding-y: 0.35rem;
    --bs-pagination-font-size: 0.8125rem;
    --bs-pagination-color: #334155;
    --bs-pagination-bg: #ffffff;
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: #e2e8f0;
    --bs-pagination-border-radius: 6px;
    --bs-pagination-hover-color: var(--nemsu-blue);
    --bs-pagination-hover-bg: #f8fafc;
    --bs-pagination-hover-border-color: #cbd5e1;
    --bs-pagination-focus-color: var(--nemsu-blue);
    --bs-pagination-focus-bg: #eff6ff;
    --bs-pagination-focus-box-shadow: none;
    --bs-pagination-active-color: #ffffff;
    --bs-pagination-active-bg: var(--nemsu-blue);
    --bs-pagination-active-border-color: var(--nemsu-blue);
    --bs-pagination-disabled-color: #94a3b8;
    --bs-pagination-disabled-bg: #f8fafc;
    --bs-pagination-disabled-border-color: #f1f5f9;
}

.pagination .page-link {
    transition: all 0.15s ease-in-out;
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background-color: var(--nemsu-blue);
    border-color: var(--nemsu-blue);
    box-shadow: 0 2px 5px rgba(29, 53, 87, 0.25);
}

.pagination .page-link:hover:not(.active) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination .page-item.disabled .page-link {
    cursor: not-allowed;
}

#rowsPerPageSelect {
    cursor: pointer;
    background-color: #f8fafc;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

#rowsPerPageSelect:hover,
#rowsPerPageSelect:focus {
    background-color: #ffffff;
    border-color: var(--nemsu-blue-border);
}

/* ==========================================================================
   Live Search & Auto-Filter Styles
   ========================================================================== */
.live-filtering {
    position: relative;
}

.live-filtering .table-responsive,
.live-filtering tbody,
.live-filtering .row.g-3 {
    opacity: 0.65;
    transition: opacity 0.15s ease-in-out;
}

/* Subtle search input active state */
.search-input-active {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231d3557' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' stroke='%231d3557' stroke-width='2' fill='none' stroke-dasharray='30' stroke-dashoffset='0'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 8 8' to='360 8 8' dur='0.75s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Final shared layer: keeps page-level legacy styles visually consistent. */
body {
    font-size: 0.9rem;
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.top-navbar h6 {
    font-family: var(--font-display);
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.025em;
}

h1, .h1 { font-weight: 750; }
h2, .h2 { font-weight: 700; }
h3, .h3, h4, .h4 { font-weight: 700; }
h5, .h5, h6, .h6 { font-weight: 650; }

.top-navbar {
    min-height: 72px;
    padding: 0.8rem clamp(1rem, 2.5vw, 2rem);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.045);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
}

.main-body {
    padding: clamp(1rem, 2.6vw, 2rem);
}

.card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    background-color: var(--surface-primary);
    box-shadow: var(--surface-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.card-header {
    background-color: var(--surface-primary);
    border-color: var(--card-border-subtle);
}

.card-footer {
    background-color: var(--surface-secondary);
    border-color: var(--card-border);
}

.stat-card {
    border-radius: var(--radius-card);
    background-color: var(--surface-primary);
    box-shadow: var(--surface-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--nemsu-blue-border);
    box-shadow: var(--surface-shadow-hover);
}

.btn:not(.rounded-circle) {
    min-height: 38px;
    border-radius: var(--radius-control);
    font-weight: 600;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn-sm:not(.rounded-circle) {
    min-height: 32px;
}

.btn:not(.rounded-circle):not(:disabled):not(.disabled):hover {
    transform: translateY(-1px);
}

.btn:not(.rounded-circle):active {
    transform: translateY(0);
}

.form-control,
.form-select,
.input-group-text {
    min-height: 40px;
    border-radius: var(--radius-control);
    background-color: var(--control-bg);
    border-color: var(--card-border);
}

textarea.form-control {
    min-height: unset;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--nemsu-blue);
    box-shadow: var(--focus-ring);
}

.table-responsive {
    border-radius: 10px;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

.table thead th {
    background-color: var(--surface-secondary);
    letter-spacing: 0.065em;
}

.table tbody tr {
    transition: background-color 0.16s ease;
}

.table-hover tbody tr:hover {
    background-color: var(--surface-hover);
}

.dropdown-menu {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background-color: var(--surface-primary);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: 7px;
    padding: 0.5rem 0.7rem;
}

.modal-content,
.offcanvas {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    background-color: var(--surface-primary);
    color: var(--text-primary);
    box-shadow: var(--surface-shadow-hover);
}

.alert {
    border-radius: 11px;
}

.badge {
    font-weight: 600;
}

.nav-link-custom {
    min-height: 40px;
}

.pagination .page-link {
    border-radius: 7px;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas {
    background-color: var(--surface-primary);
    color: var(--text-primary);
    border-color: var(--card-border);
}

html[data-theme="dark"] .card-footer {
    background-color: var(--surface-secondary);
}

html[data-theme="dark"] .table thead th {
    background-color: var(--surface-secondary);
}

html[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: var(--surface-hover);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: var(--control-bg);
}

@media (max-width: 575.98px) {
    .top-navbar {
        min-height: 64px;
        gap: 0.5rem;
        padding: 0.65rem 0.85rem;
    }

    .top-navbar > .d-flex {
        gap: 0.6rem !important;
    }

    .main-body {
        padding: 1rem 0.85rem;
    }

    .card {
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Consistent, legible typography across every authenticated page. */
html,
body,
button,
input,
optgroup,
select,
textarea,
.btn,
.form-control,
.form-select,
.input-group-text,
.table,
.dropdown-menu,
.modal,
.offcanvas,
.pagination,
.badge,
.alert,
.nav-link-custom {
    font-family: var(--font-body);
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
}

body {
    font-size: 0.9375rem;
    line-height: 1.6;
    font-weight: 400;
}

h1, .h1 {
    font-size: clamp(1.6rem, 2.2vw, 1.95rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

h2, .h2 {
    font-size: clamp(1.4rem, 1.8vw, 1.65rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

h3, .h3 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.025em;
}

h4, .h4 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

h5, .h5 {
    font-size: 1.025rem;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: -0.015em;
}

h6, .h6 {
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: -0.01em;
}

p,
li,
td,
th,
label,
.form-text,
.dropdown-item,
.card-body,
.alert {
    line-height: 1.55;
}

.small,
small {
    line-height: 1.45;
}

.table {
    font-size: 0.875rem;
}

.table thead th {
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.065em;
}

.form-control,
.form-select,
.btn {
    font-size: 0.875rem;
    font-weight: 500;
}

.btn {
    font-weight: 600;
    letter-spacing: -0.005em;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.005em;
}

.top-navbar h6 {
    font-size: 0.96rem;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    body {
        font-size: 0.9rem;
    }

    h1, .h1 {
        font-size: 1.55rem;
    }

    h2, .h2 {
        font-size: 1.35rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes app-content-enter {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    @keyframes app-menu-enter {
        from {
            opacity: 0;
            transform: translateY(-5px) scale(0.99);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .dropdown-menu.show {
        transform-origin: top right;
        animation: app-menu-enter 160ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
    }
}

html {
    scroll-behavior: smooth;
}

body,
.top-navbar,
.card,
.card-header,
.card-footer,
.dropdown-menu,
.modal-content,
.offcanvas,
.list-group-item,
.table,
.table tbody tr,
.form-control,
.form-select,
.input-group-text,
.btn,
.badge,
.alert,
.nav-link-custom {
    transition-property: color, background-color, border-color, box-shadow, transform, opacity;
    transition-duration: 180ms;
    transition-timing-function: ease;
}

.card,
.stat-card,
.btn,
.nav-link-custom,
.dropdown-item,
.page-link {
    -webkit-tap-highlight-color: transparent;
}

.btn:not(:disabled):not(.disabled):active,
.page-link:active {
    transform: scale(0.98);
}

.form-control,
.form-select,
.input-group-text,
.form-check-input {
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease;
}

.form-check-input:checked {
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dropdown-item,
.nav-link-custom,
.page-link {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.toast.show {
    animation: app-content-enter 220ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .main-body {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes app-message-enter {
        from {
            opacity: 0;
            transform: translateY(5px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes app-notice-enter {
        from {
            opacity: 0;
            transform: translateY(-6px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .admin-coach-chat-messages > article,
    .sports-chat-messages > article {
        animation: app-message-enter 220ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
    }

    .alert {
        animation: app-notice-enter 220ms cubic-bezier(0.2, 0.65, 0.3, 1) both;
    }
}

.card:focus-within,
.stat-card:focus-within {
    border-color: var(--nemsu-blue-border);
    box-shadow: var(--surface-shadow-hover);
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
    transition-duration: 220ms;
}

.accordion-button {
    transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.accordion-collapse {
    transition: height 240ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.live-filtering .table-responsive,
.live-filtering tbody,
.live-filtering .row.g-3 {
    transform: translateY(2px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.live-filtering tbody tr {
    transition: background-color 160ms ease, opacity 180ms ease;
}

.page-link:not(.active):not(.disabled) {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.form-check-input,
.form-switch .form-check-input {
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-position 180ms ease;
}

.notification-center,
#notificationCenterToggle,
#themeToggle,
[data-bs-toggle="dropdown"] {
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

#themeToggle:hover,
#notificationCenterToggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.12);
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    width: 112px;
    height: 38px;
    padding: 4px;
    overflow: hidden;
    border: 1px solid #10243d;
    border-radius: 999px;
    background: linear-gradient(135deg, #10243d 0%, #1d3557 58%, #294c76 100%);
    color: #f8fafc;
    box-shadow: 0 3px 10px rgba(18, 37, 64, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    cursor: pointer;
    isolation: isolate;
    transition: background 260ms ease, border-color 260ms ease, box-shadow 260ms ease, transform 180ms ease;
}

.theme-toggle::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    content: "";
    opacity: 0;
    transition: opacity 260ms ease;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff 0%, #e8eef6 100%);
    color: #183452;
    box-shadow: 0 2px 7px rgba(3, 11, 22, 0.24), inset 0 1px 0 #ffffff;
    font-size: 0.95rem;
    transition: left 280ms cubic-bezier(0.2, 0.8, 0.2, 1), color 220ms ease, background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.theme-toggle-label {
    width: 100%;
    padding-left: 32px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.59rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    transition: padding 280ms cubic-bezier(0.2, 0.8, 0.2, 1), color 220ms ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(18, 37, 64, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.theme-toggle:hover .theme-toggle-thumb {
    transform: scale(1.04);
}

.theme-toggle:active .theme-toggle-thumb {
    transform: scale(0.94);
}

.theme-toggle:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.42);
    outline-offset: 3px;
}

.theme-toggle[aria-pressed="true"] {
    border-color: #475569;
    background: #e8edf4;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1), inset 0 1px 0 #ffffff;
}

.theme-toggle[aria-pressed="true"]::before {
    opacity: 1;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
    left: calc(100% - 33px);
    border-color: #f4ce75;
    background: linear-gradient(145deg, #fff2c5 0%, #f4ce75 100%);
    color: #49370f;
    box-shadow: 0 2px 8px rgba(18, 37, 64, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.theme-toggle[aria-pressed="true"] .theme-toggle-label {
    padding-right: 32px;
    padding-left: 0;
    color: #f8fafc;
}

html[data-theme="dark"] .theme-toggle:not([aria-pressed="true"]) {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
    color: #172235;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 #ffffff;
}

html[data-theme="dark"] .theme-toggle:not([aria-pressed="true"]) .theme-toggle-thumb {
    border-color: #f4ce75;
    background: linear-gradient(145deg, #fff2c5 0%, #f4ce75 100%);
    color: #49370f;
}

html[data-theme="dark"] .theme-toggle:not([aria-pressed="true"]) .theme-toggle-label {
    color: #172235;
}

html[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
    border-color: #10243d;
    background: linear-gradient(135deg, #10243d 0%, #1d3557 58%, #294c76 100%);
}

html[data-theme="dark"] .theme-toggle[aria-pressed="true"]::before {
    opacity: 0;
}

@media (max-width: 575.98px) {
    .theme-toggle {
        width: 108px;
        height: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle,
    .theme-toggle::before,
    .theme-toggle-thumb,
    .theme-toggle-label {
        transition: none !important;
    }

    .theme-toggle:hover,
    .theme-toggle:hover .theme-toggle-thumb,
    .theme-toggle:active .theme-toggle-thumb {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-coach-chat-messages > article,
    .sports-chat-messages > article,
    .alert {
        animation: none !important;
    }

    .live-filtering .table-responsive,
    .live-filtering tbody,
    .live-filtering .row.g-3 {
        transform: none;
    }
}

/* Premium shared visual layer for admin, coach, and athlete workspaces. */
.app-content {
    background:
        radial-gradient(ellipse at 92% 0%, var(--accent-glow), transparent 34rem),
        var(--content-bg);
}

.top-navbar {
    background: color-mix(in srgb, var(--surface-primary) 92%, transparent);
    border-bottom-color: color-mix(in srgb, var(--card-border) 82%, transparent);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.045);
}

.top-navbar::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--nemsu-blue-border), transparent);
    content: "";
    pointer-events: none;
}

.top-navbar {
    isolation: isolate;
}

.top-navbar > * {
    position: relative;
    z-index: 1;
}

.app-sidebar {
    background:
        radial-gradient(ellipse at 0% 0%, rgba(51, 91, 143, 0.22), transparent 28rem),
        linear-gradient(180deg, #0b192c 0%, var(--sidebar-bg) 52%, #081322 100%);
}

.sidebar-brand {
    position: relative;
}

.sidebar-brand::after {
    position: absolute;
    right: 1.25rem;
    bottom: -1px;
    left: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 144, 31, 0.65), transparent);
    content: "";
}

.nav-link-custom.active {
    position: relative;
    overflow: hidden;
    background: linear-gradient(105deg, rgba(45, 79, 124, 0.98), rgba(29, 53, 87, 0.82));
}

.nav-link-custom.active::before {
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 0;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--nemsu-gold);
    content: "";
}

.nav-link-custom:hover {
    background-color: rgba(255, 255, 255, 0.075);
}

.main-body > .card,
.main-body > .row > [class*="col"] > .card,
.main-body > .row > .card {
    border-color: color-mix(in srgb, var(--card-border) 82%, transparent);
}

.card-header {
    position: relative;
}

.card-header:not(:has(> .row)),
.card-header.d-flex,
.card-header[class*="justify-content"] {
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--surface-primary) 94%, var(--nemsu-blue-light)), var(--surface-primary));
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    letter-spacing: -0.02em;
}

.stat-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.stat-card::after {
    position: absolute;
    top: -2.5rem;
    right: -2rem;
    z-index: -1;
    width: 7rem;
    height: 7rem;
    border: 1px solid color-mix(in srgb, var(--nemsu-blue-border) 45%, transparent);
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    content: "";
    pointer-events: none;
}

.stat-icon {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent);
}

.btn-primary,
.btn-nemsu {
    background-image: var(--brand-gradient) !important;
    box-shadow: 0 2px 5px rgba(18, 37, 64, 0.14);
}

.btn-success,
.btn-nemsu-green {
    box-shadow: 0 2px 5px rgba(7, 74, 31, 0.12);
}

.form-control,
.form-select {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
    border-color: var(--nemsu-blue-border);
}

.table-responsive {
    border: 1px solid var(--card-border-subtle);
    background: var(--surface-primary);
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: inset 0 -1px var(--card-border);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.dropdown-menu {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.modal-backdrop.show {
    opacity: 0.55;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.alert {
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.035);
}

::selection {
    color: #ffffff;
    background: var(--nemsu-blue);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: #94a3b8;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
    background-clip: padding-box;
}

html[data-theme="dark"] .top-navbar {
    background: color-mix(in srgb, var(--surface-primary) 94%, transparent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .app-content {
    background:
        radial-gradient(ellipse at 92% 0%, var(--accent-glow), transparent 34rem),
        var(--content-bg);
}

html[data-theme="dark"] .card-header:not(:has(> .row)),
html[data-theme="dark"] .card-header.d-flex,
html[data-theme="dark"] .card-header[class*="justify-content"] {
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--surface-primary) 94%, #355b8d), var(--surface-primary));
}

html[data-theme="dark"] .table-responsive {
    border-color: var(--card-border);
}

html[data-theme="dark"] ::selection {
    color: #0f172a;
    background: #93c5fd;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .card:not(.stat-card):hover {
        border-color: color-mix(in srgb, var(--nemsu-blue-border) 72%, var(--card-border));
        box-shadow: var(--surface-shadow-hover);
    }

    .btn-primary:hover,
    .btn-nemsu:hover {
        box-shadow: 0 7px 18px rgba(18, 37, 64, 0.22);
    }

    .dropdown-item:hover {
        transform: translateX(2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .stat-card:hover,
    .nav-link-custom:hover,
    .dropdown-item:hover,
    .btn:hover {
        transform: none !important;
    }
}

/* Facility booking calendar */
.facility-my-bookings-table {
    width: 100%;
    min-width: 1020px;
    table-layout: fixed;
}

.facility-my-bookings-table th:last-child,
.facility-my-bookings-table td.facility-booking-action {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.facility-my-bookings-table td.facility-booking-action form,
.facility-my-bookings-table td.facility-booking-action .btn {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.facility-calendar-toolbar {
    background: var(--surface-primary);
    border-bottom-color: var(--card-border);
}

.facility-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.facility-calendar-card .card-body {
    overflow-x: hidden;
}

/* Keep the user directory readable on narrow screens; the table scrolls instead of
   breaking long email addresses into one character per line. */
.users-directory-table {
    min-width: 900px;
    table-layout: fixed;
}

.users-directory-table th,
.users-directory-table td {
    overflow-wrap: normal;
}

.users-directory-table .user-email-cell {
    white-space: nowrap;
}

.modal-dialog-scrollable .modal-body {
    min-height: 0;
    max-height: calc(100vh - 180px);
}

.facility-calendar-weekday {
    padding: 0.65rem 0.35rem;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
}

.facility-calendar-month-count {
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--surface-secondary);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.facility-calendar-days {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--card-border);
    border-left: 1px solid var(--card-border);
}

.facility-calendar-day {
    min-height: 112px;
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    background: var(--surface-primary);
}

.facility-calendar-day.is-outside-month {
    background: var(--surface-secondary);
}

.facility-calendar-date {
    width: 100%;
    height: 100%;
    min-height: 112px;
    padding: 0.55rem;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.facility-calendar-date:hover,
.facility-calendar-day.is-selected .facility-calendar-date {
    background: var(--nemsu-blue-light);
}

.facility-calendar-day.is-selected .facility-calendar-date {
    box-shadow: inset 0 0 0 2px var(--nemsu-blue);
}

.facility-calendar-day.is-today .facility-calendar-day-number {
    color: #fff;
    background: var(--nemsu-blue);
}

.facility-calendar-day-number {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 700;
}

.facility-calendar-day-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.4rem;
    margin-top: 0.25rem;
    font-size: 0.62rem;
    font-weight: 700;
}

.facility-calendar-day-counts .is-occupied,
.facility-calendar-legend-dot.is-occupied {
    color: #b42318;
}

.facility-calendar-day-counts .is-available,
.facility-calendar-legend-dot.is-available {
    color: #087443;
}

.facility-calendar-day-counts .is-pending,
.facility-calendar-legend-dot.is-pending {
    color: #9a6700;
}

.facility-calendar-day-counts .is-scheduled,
.facility-calendar-legend-dot.is-scheduled {
    color: #2457a7;
}

.facility-calendar-events {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.35rem;
}

.facility-calendar-event {
    display: block;
    overflow: hidden;
    padding: 0.18rem 0.3rem;
    border-left: 3px solid;
    border-radius: 3px;
    font-size: 0.64rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.facility-calendar-event.is-confirmed,
.facility-calendar-status.is-confirmed {
    color: #075e38;
    background: #e7f7ee;
    border-color: #15945a;
}

.facility-calendar-event.is-pending,
.facility-calendar-status.is-pending {
    color: #7a4f00;
    background: #fff5d8;
    border-color: #d69a13;
}

.facility-calendar-event.is-scheduled,
.facility-calendar-status.is-scheduled {
    color: #174b91;
    background: #eaf2ff;
    border-color: #3979d1;
}

.facility-calendar-more {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.facility-calendar-legend-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
}

.facility-calendar-legend-dot.is-occupied {
    background: #dc3545;
}

.facility-calendar-legend-dot.is-available {
    background: #15945a;
}

.facility-calendar-legend-dot.is-pending {
    background: #d69a13;
}

.facility-calendar-legend-dot.is-scheduled {
    background: #3979d1;
}

.facility-agenda-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--card-border);
    border-left: 4px solid #15945a;
    border-radius: 10px;
    background: var(--surface-primary);
}

.facility-agenda-item + .facility-agenda-item {
    margin-top: 0.75rem;
}

.facility-agenda-item.is-pending {
    border-left-color: #d69a13;
}

.facility-agenda-item.is-scheduled {
    border-left-color: #3979d1;
}

.facility-agenda-time {
    display: flex;
    min-width: 5.25rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.facility-agenda-time span {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
}

.facility-agenda-content {
    min-width: 0;
}

.facility-calendar-status {
    padding: 0.22rem 0.5rem;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

.facility-calendar-empty {
    display: flex;
    min-height: 100px;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: var(--text-muted);
    text-align: center;
}

.facility-calendar-empty i {
    color: var(--nemsu-blue);
    font-size: 1.35rem;
}

html[data-theme="dark"] .facility-calendar-event.is-confirmed,
html[data-theme="dark"] .facility-calendar-status.is-confirmed {
    color: #b7f2d0;
    background: #173b2c;
    border-color: #3ca879;
}

html[data-theme="dark"] .facility-calendar-event.is-pending,
html[data-theme="dark"] .facility-calendar-status.is-pending {
    color: #ffe2a0;
    background: #40351f;
    border-color: #c49638;
}

html[data-theme="dark"] .facility-calendar-event.is-scheduled,
html[data-theme="dark"] .facility-calendar-status.is-scheduled {
    color: #c7ddff;
    background: #1e3556;
    border-color: #5a8dd4;
}

html[data-theme="dark"] .facility-calendar-day-counts .is-occupied,
html[data-theme="dark"] .facility-calendar-legend-dot.is-occupied {
    color: #ff8a8a;
}

html[data-theme="dark"] .facility-calendar-day-counts .is-available,
html[data-theme="dark"] .facility-calendar-legend-dot.is-available {
    color: #8fe0b5;
}

html[data-theme="dark"] .facility-calendar-day-counts .is-pending,
html[data-theme="dark"] .facility-calendar-legend-dot.is-pending {
    color: #f4cb70;
}

html[data-theme="dark"] .facility-calendar-day-counts .is-scheduled,
html[data-theme="dark"] .facility-calendar-legend-dot.is-scheduled {
    color: #9bc1ff;
}

@media (max-width: 575.98px) {
    .facility-calendar-grid,
    .facility-calendar-days {
        width: 100%;
        min-width: 0;
    }

    .facility-calendar-weekday {
        padding: 0.45rem 0.1rem;
        font-size: 0.55rem;
        letter-spacing: 0;
    }

    .facility-calendar-day,
    .facility-calendar-date {
        min-height: 76px;
    }

    .facility-calendar-date {
        padding: 0.25rem;
    }

    .facility-calendar-day-number {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 0.7rem;
    }

    .facility-calendar-day-counts {
        gap: 0.15rem;
        margin-top: 0.15rem;
        font-size: 0;
    }

    .facility-calendar-day-counts span {
        overflow: hidden;
        width: 0.35rem;
        height: 0.35rem;
        border-radius: 50%;
        font-size: 0;
    }

    .facility-calendar-day-counts .is-occupied {
        background: #dc3545;
    }

    .facility-calendar-day-counts .is-available {
        background: #15945a;
    }

    .facility-calendar-day-counts .is-pending {
        background: #d69a13;
    }

    .facility-calendar-day-counts .is-scheduled {
        background: #3979d1;
    }

    .facility-calendar-events {
        gap: 0.1rem;
        margin-top: 0.2rem;
    }

    .facility-calendar-event {
        padding: 0.12rem 0.18rem;
        border-left-width: 2px;
        font-size: 0.52rem;
    }

    .facility-calendar-toolbar {
        padding-right: 0.75rem !important;
        padding-left: 0.75rem !important;
    }

    .facility-calendar-toolbar .facility-calendar-nav,
    .facility-calendar-today {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }

    .facility-calendar-toolbar h5 {
        font-size: 0.95rem;
    }

    .facility-agenda-item {
        gap: 0.65rem;
        padding: 0.75rem;
    }

    .facility-agenda-time {
        min-width: 4.25rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 767.98px) {
    .theme-toggle {
        width: 38px !important;
    }

    .theme-toggle-label {
        display: none !important;
    }
}

/* Shared responsive safeguards for browser zoom and narrow viewports. */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

.app-wrapper,
.app-content,
.top-navbar,
.main-body,
.main-body > *,
.row > *,
.card,
.card-body,
.card-header,
.card-footer {
    min-width: 0;
}

.top-navbar > .d-flex:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.top-navbar > .d-flex:first-child > div:last-child,
.top-navbar h6 {
    min-width: 0;
    overflow-wrap: break-word;
}

.main-body img,
.card img {
    max-width: 100%;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
    width: 100%;
}

.team-card-footer {
    min-width: 0;
}

.team-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.375rem;
    min-width: 0;
}

.form-control,
.form-select,
.input-group,
.input-group > *,
.btn {
    max-width: 100%;
}

.modal-dialog:not(.modal-sm):not(.modal-lg):not(.modal-xl):not(.modal-fullscreen) {
    width: calc(100% - 1rem);
    max-width: 500px;
}

.modal-dialog.modal-xl {
    width: calc(100% - 1rem);
    max-width: min(1140px, calc(100vw - 1rem));
}

.report-export-actions {
    min-width: 0;
    max-width: 100%;
}

html:has(body.modal-open) {
    overflow: hidden;
    overscroll-behavior: none;
}

@media (max-width: 575.98px) {
    .top-navbar {
        align-items: center;
    }

    .top-navbar > .d-flex:first-child h6 {
        font-size: 0.9rem;
        line-height: 1.2;
        overflow-wrap: normal;
    }

    .main-body {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .report-export-actions {
        width: 100%;
    }

    .report-export-actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .app-content {
        padding-bottom: 84px;
    }

    .site-footer {
        left: 0;
        min-height: 0;
        padding: 0.45rem 0.6rem max(0.45rem, env(safe-area-inset-bottom)) !important;
        font-size: 0.68rem;
        line-height: 1.25;
    }
}

body.portal-dashboard,
body.portal-dashboard-user {
    background: #f3f6fb;
    color: #101828;
}

body.portal-dashboard .app-wrapper {
    display: block;
    min-height: auto;
}

body.portal-dashboard .app-sidebar {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
}

body.portal-dashboard .app-content {
    margin-left: 0 !important;
    width: 100% !important;
    background: #f3f6fb;
}

body.portal-dashboard .top-navbar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid #dfe7f0;
    box-shadow: none;
    color: #101828;
    padding: 0.8rem 2rem;
}

body.portal-dashboard .top-navbar h6,
body.portal-dashboard .top-navbar .fw-semibold,
body.portal-dashboard .top-navbar .small,
body.portal-dashboard .top-navbar .text-dark,
body.portal-dashboard .top-navbar .text-muted,
body.portal-dashboard .top-navbar .dropdown-menu .fw-semibold,
body.portal-dashboard .top-navbar .dropdown-menu .small,
body.portal-dashboard .top-navbar .dropdown-item,
body.portal-dashboard .main-body,
body.portal-dashboard .hero-pill,
body.portal-dashboard .hero-title,
body.portal-dashboard .hero-lead,
body.portal-dashboard .section-heading,
body.portal-dashboard .section-subtext,
body.portal-dashboard .stat-label,
body.portal-dashboard .minimal-card-title,
body.portal-dashboard .minimal-card-desc,
body.portal-dashboard .minimal-card-footer,
body.portal-dashboard .footer-heading,
body.portal-dashboard .landing-footer .footer-link,
body.portal-dashboard .landing-footer .footer-bottom {
    color: #101828 !important;
}

body.portal-dashboard .top-navbar .text-muted,
body.portal-dashboard .hero-lead,
body.portal-dashboard .section-subtext,
body.portal-dashboard .minimal-card-desc,
body.portal-dashboard .landing-footer .footer-link,
body.portal-dashboard .landing-footer .footer-bottom {
    color: #475569 !important;
}

body.portal-dashboard .main-body {
    background: #f3f6fb;
    padding-top: 0;
}

body.portal-dashboard .hero-section {
    background: linear-gradient(180deg, #f6f8fb 0%, #edf3f9 100%);
    border: none;
    padding-top: 3.2rem;
    padding-bottom: 2.7rem;
}

body.portal-dashboard .hero-section .container,
body.portal-dashboard .stats-strip .container,
body.portal-dashboard .section-wrap .container,
body.portal-dashboard .landing-footer .container {
    max-width: 1240px;
}

body.portal-dashboard .hero-pill {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #dfe7f0;
    border-radius: 999px;
    color: #475569;
    padding: 0.45rem 0.9rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.portal-dashboard .hero-pill .dot {
    background: #1d3557;
}

body.portal-dashboard .hero-title {
    color: #101828;
    font-size: clamp(2.5rem, 4vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    max-width: 820px;
    margin: 0 auto 1.2rem;
}

body.portal-dashboard .hero-title .text-brand {
    color: #1d3557;
}

body.portal-dashboard .hero-lead {
    color: #475569;
    font-size: 1.08rem;
    max-width: 760px;
    margin: 0 auto 2rem;
}

body.portal-dashboard .btn-landing-primary,
body.portal-dashboard .btn-landing-secondary {
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.7rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

body.portal-dashboard .btn-landing-primary {
    background: #1d3557;
    color: #fff !important;
    border: 1px solid transparent;
    box-shadow: 0 8px 18px rgba(29, 53, 87, 0.12);
}

body.portal-dashboard .btn-landing-primary:hover {
    background: #122845;
}

body.portal-dashboard .btn-landing-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #101828 !important;
    border: 1px solid #dfe7f0;
}

body.portal-dashboard .btn-landing-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body.portal-dashboard .hero-section .row.g-3 > div > div {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #dfe7f0;
    border-radius: 10px;
    color: #101828;
}

body.portal-dashboard .hero-section .row.g-3 .small {
    color: #101828;
}

body.portal-dashboard .hero-section .row.g-3 p.small {
    color: #475569;
}

body.portal-dashboard .stats-strip {
    background: rgba(255, 255, 255, 0.85);
    border-top: 1px solid #dfe7f0;
    border-bottom: 1px solid #dfe7f0;
    padding: 1.1rem 0 1.2rem;
}

body.portal-dashboard .stat-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #dfe7f0;
    border-radius: 12px;
    padding: 1.05rem 0.8rem;
    display: block;
    text-align: center;
}

body.portal-dashboard .stat-number {
    color: #d39b39 !important;
    font-weight: 800;
    font-size: clamp(2rem, 3vw, 3rem);
    text-shadow: none;
}

body.portal-dashboard .stat-label {
    color: #475569;
    font-size: 0.73rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.portal-dashboard .section-wrap {
    background: transparent;
    padding: 4rem 0;
}

body.portal-dashboard .section-wrap-subtle {
    background: transparent;
    border: none;
}

body.portal-dashboard .section-tag {
    background: transparent;
    border: none;
    color: #101828;
    letter-spacing: 0.14em;
}

body.portal-dashboard .section-heading {
    color: #101828;
    font-size: 2.1rem;
    letter-spacing: -0.04em;
    font-weight: 800;
}

body.portal-dashboard .section-subtext {
    color: #475569;
    font-size: 1rem;
    max-width: 760px;
}

body.portal-dashboard .minimal-card {
    background: #fff;
    border: 1px solid #dfe7f0;
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
}

body.portal-dashboard .sport-card-image,
body.portal-dashboard .facility-card-image,
body.portal-dashboard .sports-all-image-strip {
    background: #edf3fa;
    border-bottom: 1px solid #dfe7f0;
    margin: 0;
}

body.portal-dashboard .badge-minimal {
    background: #eef3ff;
    color: #1d3557;
    border: 1px solid #dfe7f0;
}

body.portal-dashboard .badge-minimal-neutral {
    background: #f8fafc;
    color: #475569;
}

body.portal-dashboard .badge-minimal-green {
    background: #ecfdf5;
    color: #166534;
}

body.portal-dashboard .landing-footer {
    background: #f6f8fb;
    border-top: 1px solid #dfe7f0;
}

body.portal-dashboard .landing-footer .footer-heading {
    color: #101828;
    letter-spacing: 0.1em;
}

body.portal-dashboard .landing-footer .footer-link {
    color: #475569;
}

body.portal-dashboard .landing-footer .footer-bottom {
    border-top: 1px solid #dfe7f0;
    color: #475569;
}

body.portal-dashboard .theme-toggle {
    background: #eef2f7;
    border: 1px solid #dfe7f0;

    .card-header,
    .card-body,
    .card-footer {
        padding-right: 0.85rem !important;
        padding-left: 0.85rem !important;
    }

    .modal-dialog {
        width: calc(100% - 0.75rem);
        margin-right: auto;
        margin-left: auto;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
    }

    .modal-dialog-scrollable {
        max-height: calc(100% - 1rem);
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 767.98px) {
    .app-content {
        padding-bottom: 140px;
    }
}

.active-users-dropdown .dropdown-menu.show {
    animation: none;
}

.active-users-role-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.active-users-role-filters-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.active-users-role-filter {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.32rem 0.35rem;
    border: 1px solid var(--card-border);
    border-radius: 0.45rem;
    background: var(--surface-primary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.active-users-role-filter:hover,
.active-users-role-filter.is-active {
    border-color: var(--nemsu-blue);
    background: color-mix(in srgb, var(--surface-primary) 88%, var(--nemsu-blue));
    color: var(--nemsu-blue);
}

.active-users-role-filter .badge {
    background: var(--surface-secondary);
    color: var(--text-muted);
    font-size: 0.6rem;
}

.active-users-role-filter.is-active .badge {
    background: var(--nemsu-blue);
    color: #fff;
}

.active-users-message-button {
    display: inline-flex;
    width: 92px;
    min-width: 92px;
    flex: 0 0 92px;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding-right: 0.35rem;
    padding-left: 0.35rem;
    white-space: nowrap;
}

.dashboard-communication-row .admin-coach-chat-panel {
    width: 100%;
}

.chat-reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-left: 3px solid var(--bs-primary);
    padding: 0.5rem 0.75rem;
    background: var(--bs-tertiary-bg);
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.chat-reply-preview[hidden] {
    display: none;
}

.chat-reply-preview > span,
.chat-message-quote > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-quote {
    margin-bottom: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-left: 2px solid currentColor;
    opacity: 0.8;
    font-size: 0.8rem;
}

@media (min-width: 1200px) {
    body.sidebar-collapsed .app-sidebar {
        display: none;
    }

    body.sidebar-collapsed .app-content {
        width: auto;
        margin-left: 0;
    }

    body.sidebar-collapsed .site-footer {
        left: 0;
    }
}

@media (max-width: 767.98px) {
    .team-card-footer {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0.65rem;
    }

    .team-card-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .team-card-actions > .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        padding-right: 0.4rem;
        padding-left: 0.4rem;
        text-align: center;
        white-space: normal;
    }

    .team-card-actions > .btn:last-child {
        grid-column: 1 / -1;
    }
}

.masts-export-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.masts-settings-logo {
    display: block;
    width: 116px;
    height: 48px;
    object-fit: contain;
    object-position: left center;
}

.masts-export-status {
    flex: 1 1 auto;
    min-width: 0;
}

.masts-export-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.masts-export-actions .btn {
    white-space: nowrap;
}

@media (max-width: 1399.98px) {
    .masts-export-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .masts-export-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .masts-export-actions {
        width: 100%;
    }

    .masts-export-actions .btn {
        flex: 1 1 auto;
    }
}
