/* ═══════════════════════════════════════════════════════════
   Vitus HMS — Global Styles (Redesigned)
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Layout */
    --sidebar-width: 200px;
    --sidebar-collapsed: 0px;
    --topbar-height: 60px;

    /* Sidebar colours */
    --sidebar-bg: #2D2D4D;
    --sidebar-hover: rgba(255,255,255,.08);
    --sidebar-active-bg: rgba(255,255,255,.12);
    --sidebar-active-text: #fbbf24;
    --sidebar-border: rgba(255,255,255,.08);

    /* Brand colours */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;

    /* Surface */
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --card-radius: 3px;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    font-size: .875rem;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ═══════ SIDEBAR ═══════ */
#sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

/* Brand */
.sidebar-brand {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand-name {
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
}

.brand-sub {
    color: var(--text-muted);
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

/* Nav Container */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .5rem 0;
    scrollbar-width: none;
    scrollbar-color: rgba(255,255,255,.1) transparent;
    overflow-anchor: none;
}

.sidebar-nav:hover {
    scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }

/* Nav Items */
.nav-item {
    display: flex;
    align-items: center;
    padding: .55rem 1rem;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-size: .8rem;
    transition: all .15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    white-space: nowrap;
    position: relative;
}

.nav-item > i:first-child {
    width: 22px;
    font-size: .95rem;
    text-align: center;
    margin-right: .75rem;
    flex-shrink: 0;
}

.nav-item > span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    color: rgba(255,255,255,.9);
    background: var(--sidebar-hover);
}

.nav-item.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
}

/* Dropdown Arrow */
.nav-arrow {
    font-size: .6rem;
    margin-left: auto;
    transition: transform .25s ease, opacity .15s ease;
    opacity: 0;
}

.nav-item.has-sub:hover .nav-arrow,
.nav-item.has-sub[aria-expanded="true"] .nav-arrow {
    opacity: 1;
}

.nav-item.has-sub[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
}

/* Sub-nav */
.nav-sub {
    background: rgba(0,0,0,.15);
}

.nav-sub .nav-item {
    padding-left: 2.75rem;
    font-size: .78rem;
}

.nav-sub .nav-item > i:first-child {
    font-size: .4rem;
    width: 18px;
}

.sidebar-nav > * + .nav-group,
.sidebar-nav > * + .nav-item { margin-top: 2px; border-top: 1px solid rgba(255,255,255,.12); }

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

.sidebar-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-avatar-initials {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: .75rem;
    flex-shrink: 0;
}

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

/* ═══════ MAIN CONTENT ═══════ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s cubic-bezier(.4,0,.2,1);
}

.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* ═══════ TOPBAR ═══════ */
.topbar {
    height: var(--topbar-height);
    background: var(--sidebar-bg);
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    color: #fff;
}

.topbar-btn {
    width: 38px; height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.15);
    background: transparent;
    color: rgba(255,255,255,.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all .15s;
}

.topbar-btn:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

/* Hamburger — plain dashes, no box */
.hamburger-btn {
    width: 32px;
    height: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all .2s;
}

.topbar-btn.dropdown-toggle::after { display: none; }

.topbar-tenant {
    color: rgba(255,255,255,.9);
    font-size: .85rem;
    align-items: center;
}

/* Global Search */
.topbar-search { width: 100%; max-width: 320px; }

.topbar-search .form-control {
    padding: .35rem 2rem .35rem 2rem;
    border-radius: 3px;
    border: 1px solid var(--card-border);
    background: var(--body-bg);
    font-size: .75rem;
    height: 32px;
    transition: all .2s;
}

.topbar-search .form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.topbar-search .search-icon {
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .75rem;
}

.topbar-search .search-kbd {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: .1rem .4rem;
    font-size: .65rem;
    color: var(--text-muted);
    font-family: inherit;
}

/* Global search dropdown */
.global-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 9999;
    max-height: 380px;
    overflow-y: auto;
}
.global-search-dropdown.show { display: block; }
.global-search-dropdown .search-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: .8rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}
.global-search-dropdown .search-item:hover,
.global-search-dropdown .search-item.active {
    background: var(--primary-light);
}
.global-search-dropdown .search-item i {
    font-size: 1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.global-search-dropdown .search-item-label { font-weight: 500; }
.global-search-dropdown .search-item-sub {
    font-size: .7rem;
    color: var(--text-secondary);
}
.global-search-dropdown .search-item-type {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    background: var(--body-bg);
    padding: .1rem .4rem;
    border-radius: 3px;
    margin-left: auto;
    flex-shrink: 0;
}
.global-search-dropdown .search-hint {
    padding: .6rem .75rem;
    font-size: .75rem;
    color: var(--text-muted);
    text-align: center;
}

/* User button */
.topbar-user-btn {
    display: inline-flex;
    align-items: center;
    padding: .3rem .5rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.15);
    background: transparent;
    font-size: .82rem;
    color: rgba(255,255,255,.9);
    cursor: pointer;
    transition: all .15s;
}

.topbar-user-btn:hover { background: rgba(255,255,255,.08); }
.topbar-user-btn.dropdown-toggle::after { display: none; }

.topbar-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.topbar-avatar-initials {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: .7rem;
}

/* ═══════ DROPDOWN MENUS ═══════ */
.dropdown-menu {
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,.12);
    padding: .35rem;
    font-size: .82rem;
}

/* Prevent table-responsive from clipping action dropdowns */
.table-responsive {
    overflow: visible !important;
}
.table-responsive .dropdown-menu {
    position: absolute;
    z-index: 1050;
}

.dropdown-item {
    border-radius: var(--card-radius);
    padding: .45rem .75rem;
    transition: background .1s;
}

.dropdown-item:active { background: var(--primary-light); }

.dropdown-header {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    font-weight: 600;
}

/* ═══════ PAGE CONTENT ═══════ */
.messages-container {
    margin-bottom: 1rem;
}

/* ═══════ CARDS (3px radius everywhere) ═══════ */
.card,
.stat-card,
.table-card,
.form-card,
.info-card,
.chart-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
}

.card { border-radius: var(--card-radius); }

.stat-card {
    padding: 1rem;
    transition: box-shadow .2s, transform .2s;
    position: relative;
    overflow: hidden;
    background: var(--sidebar-bg);
    border-color: transparent;
    color: #fff;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: none !important;
    color: rgba(255,255,255,.7);
}

.stat-card .stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .78rem;
    color: rgba(255,255,255,.7);
    margin-top: .25rem;
}

.stat-card .stat-trend {
    font-size: .72rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .15rem .4rem;
    border-radius: 99px;
}

.stat-card .text-success { color: #6ee7b7 !important; }
.stat-card .text-danger  { color: #fca5a5 !important; }
.stat-card .text-warning { color: #fde68a !important; }
.stat-card .text-primary { color: #93c5fd !important; }
.stat-card .text-info    { color: #67e8f9 !important; }
.stat-card .text-muted   { color: rgba(255,255,255,.55) !important; }

.stat-trend.up   { color: #059669; background: var(--success-light); }
.stat-trend.down { color: #dc2626; background: var(--danger-light); }

/* ═══════ TABLE CARD ═══════ */
.table-card {
    overflow: visible;
}

.table-card .card-header,
.card .card-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    padding: .85rem 1.25rem;
    font-weight: 600;
    font-size: .85rem;
}

.table {
    margin: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--card-border);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    font-weight: 600;
    padding: .7rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: .65rem 1rem;
    vertical-align: middle;
    font-size: .82rem;
    border-color: #f1f5f9;
}

.table tbody tr:hover {
    background: rgba(59,130,246,.02);
}

/* ═══════ FORM CARD ═══════ */
.form-card {
    padding: 1.5rem;
}

/* ═══════ REPORT CARDS ═══════ */
.report-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}
.report-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.report-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}
.report-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: .75rem;
}

/* ═══════ BADGES ═══════ */
.badge {
    border-radius: var(--card-radius);
    font-weight: 500;
    font-size: .72rem;
    padding: .3em .6em;
}

.badge-status { font-weight: 500; }

/* ═══════ BUTTONS ═══════ */
.btn {
    border-radius: var(--card-radius);
    font-size: .82rem;
    font-weight: 500;
    padding: .45rem 1rem;
    transition: all .15s;
}

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

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

/* ═══════ ALERTS ═══════ */
.alert {
    border-radius: var(--card-radius);
    font-size: .82rem;
    border: none;
    padding: .75rem 1rem;
}

/* ═══════ FORM CONTROLS ═══════ */
.form-control, .form-select {
    border-radius: var(--card-radius);
    font-size: .82rem;
    border-color: var(--card-border);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ═══════ QUEUE ITEMS ═══════ */
.queue-item {
    padding: .75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background .15s;
}

.queue-item:hover { background: #f8fafc; }
.queue-item:last-child { border-bottom: none; }

/* ═══════ AUTH WRAPPER (login page) ═══════ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    padding: 0;
}

.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left image panel */
.login-image-panel {
    flex: 0 0 45%;
    position: relative;
    overflow: hidden;
}

.login-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(28,7,3,.6) 0%, transparent 50%);
    pointer-events: none;
}

.login-brand-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255,255,255,.5);
    font-size: .75rem;
    z-index: 1;
}

/* Logo above welcome text */
.login-form-logo {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    object-fit: contain;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    border: 2px solid #f0f0f0;
}

.login-form-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1C0703, #5a1510);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    color: #fff;
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: #fff;
}

.login-form-content {
    width: 100%;
    max-width: 400px;
}

.login-form-content .input-group-text {
    background: #f8f9fa;
    border-right: 0;
    color: #6c757d;
}

.login-form-content .input-group .form-control {
    border-left: 0;
}

.login-form-content .input-group .btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
}

/* Tablet & Mobile: full-screen image background with form overlay */
@media (max-width: 991px) {
    .login-container {
        position: relative;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .login-image-panel {
        position: absolute;
        inset: 0;
        z-index: 0;
        height: auto;
    }
    .login-image-overlay {
        background: rgba(28,7,3,.55);
    }
    .login-brand-footer {
        display: block;
        bottom: 1rem;
        font-size: .65rem;
        color: rgba(255,255,255,.6);
        z-index: 2;
    }
    .login-form-panel {
        position: relative;
        z-index: 1;
        background: rgba(255,255,255,.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-radius: 16px;
        padding: 2rem 2rem;
        margin: 1.5rem;
        max-width: 420px;
        width: calc(100% - 3rem);
        box-shadow: 0 12px 40px rgba(0,0,0,.25);
    }
    .login-form-content {
        max-width: 100%;
        margin: 0 auto;
    }
    .login-form-logo { width: 70px; height: 70px; margin-bottom: .75rem; }
    .login-form-icon { width: 56px; height: 56px; font-size: 1.75rem; margin-bottom: .75rem; }
}

/* Mobile fine-tuning */
@media (max-width: 575px) {
    .login-form-panel {
        padding: 1.5rem 1.25rem;
        margin: 1rem;
        width: calc(100% - 2rem);
        border-radius: 14px;
    }
    .login-form-logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: .5rem; }
    .login-form-icon { width: 48px; height: 48px; font-size: 1.4rem; border-radius: 12px; margin-bottom: .5rem; }
    .login-form-content h3 { font-size: 1.2rem; }
    .login-form-content .form-label { font-size: .85rem; }
    .login-form-content .input-group-text { padding: .4rem .65rem; }
    .login-form-content .btn { font-size: .9rem; padding: .5rem; }
    .login-form-content .mb-3 { margin-bottom: .75rem !important; }
    .login-form-content .mb-4 { margin-bottom: 1rem !important; }
    .login-brand-footer { display: none; }
}

.auth-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    max-width: 420px;
    width: 100%;
    padding: 2.5rem;
}

/* ═══════ SIDEBAR COLLAPSED STATE ═══════ */
body.sidebar-collapsed #sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 991px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 1rem;
    }

    .topbar {
        padding: 0 .75rem;
    }
}

@media (max-width: 575px) {
    .page-content {
        padding: .75rem;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }
}

/* ═══════ TOGGLE SWITCH (FIDES STYLE) ═══════ */
.toggle-switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: .2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ═══════ CHART CARD ═══════ */
.chart-card {
    padding: 1.25rem;
}

.chart-card .chart-title {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* ═══════ PAGE HEADER ═══════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.page-header h1,
.page-header .page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-header .page-subtitle {
    font-size: .82rem;
    color: var(--text-secondary);
    margin-top: .15rem;
}

/* ═══════ EMPTY STATE ═══════ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: .5;
}

/* ═══════ LOADING SPINNER ═══════ */
.spin { display: inline-block; animation: vitus-spin .7s linear infinite; }
@keyframes vitus-spin { to { transform: rotate(360deg); } }
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════ TOM SELECT OVERRIDES ═══════ */
.ts-wrapper .ts-control {
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    font-size: .8rem;
    min-height: 34px;
    padding: .3rem .5rem;
}
.ts-wrapper .ts-control input { font-size: .8rem; }
.ts-wrapper.focus .ts-control { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.ts-dropdown { border-radius: var(--card-radius); font-size: .8rem; border-color: var(--card-border); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.ts-dropdown .active { background: var(--primary-light); color: var(--text-primary); }
.ts-dropdown .option { padding: .35rem .6rem; }

/* ═══════ LIST CONTROLS ═══════ */
.list-controls .form-select-sm {
    min-width: 60px;
}

.list-pagination .page-link {
    font-size: .78rem;
    padding: .3rem .6rem;
    border-radius: var(--card-radius);
    margin: 0 1px;
}

.list-pagination .page-item.active .page-link {
    background: #1C0703;
    border-color: #1C0703;
}

/* ═══════ WELCOME BANNER ═══════ */
.welcome-banner {
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    border-radius: var(--card-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.welcome-banner .welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: .25rem;
}

.welcome-banner .welcome-subtitle {
    font-size: .85rem;
    color: rgba(255,255,255,.75);
    margin-bottom: 0;
}

.welcome-banner .welcome-datetime {
    font-size: .8rem;
    color: rgba(255,255,255,.65);
    margin-top: .5rem;
}

.welcome-banner .welcome-datetime i {
    margin-right: .35rem;
}

/* ═══════ SITE FOOTER ═══════ */
.site-footer {
    text-align: center;
    padding: 1.25rem 1.5rem;
    font-size: .78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.site-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* ═══════ BRANCH SELECTOR ═══════ */
.branch-selector-btn {
    display: inline-flex;
    align-items: center;
    padding: .4rem .75rem;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.9);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.branch-selector-btn:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.branch-selector-btn::after { display: none; }

.branch-dropdown {
    min-width: 220px;
    padding: .5rem;
}

.branch-dropdown .dropdown-item {
    border-radius: 3px;
    padding: .5rem .75rem;
    font-size: .82rem;
}

.branch-dropdown .dropdown-item.active {
    background: var(--primary);
    color: #fff;
}

.branch-dropdown .dropdown-item:not(.active):hover {
    background: var(--body-bg);
}

/* ═══════ FORM SECTIONS ═══════ */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: .82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.form-section-title i {
    margin-right: .4rem;
    color: var(--primary);
}

/* ═══════ PASSWORD TOGGLE ═══════ */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: .65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    z-index: 3;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* ═══════ PRINT ═══════ */
@media print {
    #sidebar,
    .topbar,
    #sidebarOverlay,
    .site-footer,
    .breadcrumb,
    .no-print,
    .btn:not(.no-hide-print),
    .list-controls {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .page-content {
        padding: 0 !important;
    }
    .card, .stat-card, .table-card, .form-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
