/* ============================================================
   POLICYBASE RECRUITSAFE — DESIGN SYSTEM
   Specialist Safer Recruitment & Document Verification Service
============================================================ */

:root {
    --pb-navy: #0f2340;
    --pb-navy-mid: #1c3558;
    --pb-navy-light: #2c4974;
    --pb-green: #1a7a45;
    --pb-green-hover: #22a05a;
    --pb-green-pale: #ebf8f1;
    --pb-green-text: #0d542d;
    --pb-amber: #d97706;
    --pb-amber-pale: #fffbeb;
    --pb-amber-text: #92400e;
    --pb-red: #dc2626;
    --pb-red-pale: #fef2f2;
    --pb-red-text: #991b1b;
    --pb-blue: #2563eb;
    --pb-blue-pale: #eff6ff;
    --pb-blue-text: #1e40af;
    --pb-purple: #7c3aed;
    --pb-purple-pale: #f5f3ff;
    --pb-purple-text: #5b21b6;
    --pb-bg: #f8fafc;
    --pb-surface: #ffffff;
    --pb-border: #e2e8f0;
    --pb-border-strong: #cbd5e1;
    --pb-text-main: #0f172a;
    --pb-text-muted: #64748b;
    --pb-text-light: #94a3b8;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 14px rgba(15, 35, 64, 0.07);
    --shadow-lg: 0 10px 30px rgba(15, 35, 64, 0.12);
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    height: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    min-height: 100%;
    font-family: var(--font-body);
    color: var(--pb-text-main);
    background-color: var(--pb-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ── TOP ROLE SELECTOR BAR ── */
.role-bar {
    background: #091628;
    color: #e2e8f0;
    padding: 8px 24px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.role-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.role-bar-left .live-badge {
    background: #10b981;
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.role-bar-left .live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.role-pills {
    display: flex;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    padding: 4px;
    border-radius: var(--radius-full);
}

.role-pill {
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.78rem;
    color: #94a3b8;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.role-pill:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.role-pill.active {
    background: var(--pb-green);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 122, 69, 0.4);
}

/* ── HEADER ── */
.header {
    background: var(--pb-surface);
    border-bottom: 1px solid var(--pb-border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-badge {
    background: linear-gradient(135deg, var(--pb-navy) 0%, var(--pb-navy-mid) 100%);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(15, 35, 64, 0.25);
    border: 2px solid rgba(26, 122, 69, 0.3);
}

.brand-titles h1 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--pb-navy);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-titles .tagline {
    font-size: 0.78rem;
    color: var(--pb-text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--pb-green);
    color: #fff;
}
.btn-primary:hover {
    background: var(--pb-green-hover);
    box-shadow: 0 4px 12px rgba(26, 122, 69, 0.3);
}

.btn-navy {
    background: var(--pb-navy);
    color: #fff;
}
.btn-navy:hover {
    background: var(--pb-navy-mid);
    box-shadow: 0 4px 12px rgba(15, 35, 64, 0.3);
}

.btn-outline {
    background: var(--pb-surface);
    border-color: var(--pb-border-strong);
    color: var(--pb-text-main);
}
.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-danger {
    background: var(--pb-red);
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
}

/* ── LAYOUT ── */
.main-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 24px;
    min-width: 0;
}

/* ── STATS GRID ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--pb-surface);
    border: 1px solid var(--pb-border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

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

.stat-card.stat-shortcut {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.stat-card.stat-shortcut:hover {
    border-color: var(--pb-green);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.stat-card.stat-shortcut:active {
    transform: translateY(-1px);
}

.stat-arrow {
    transition: all 0.2s ease;
    opacity: 0.6;
}

.stat-card.stat-shortcut:hover .stat-arrow {
    color: var(--pb-green) !important;
    opacity: 1;
    transform: translateX(4px);
}

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

.stat-icon.green { background: var(--pb-green-pale); color: var(--pb-green); }
.stat-icon.navy { background: #e0e7ff; color: var(--pb-navy); }
.stat-icon.amber { background: var(--pb-amber-pale); color: var(--pb-amber); }
.stat-icon.blue { background: var(--pb-blue-pale); color: var(--pb-blue); }
.stat-icon.purple { background: var(--pb-purple-pale); color: var(--pb-purple); }
.stat-icon.red { background: var(--pb-red-pale); color: var(--pb-red); }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--pb-navy);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--pb-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ── CARDS & SECTIONS ── */
.card {
    background: var(--pb-surface);
    border: 1px solid var(--pb-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--pb-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.card-header h2, .card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pb-navy);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* ── TABS ── */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--pb-border);
    margin-bottom: 20px;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-track {
    background: transparent;
}

.tabs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.tab-btn {
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--pb-text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--pb-navy);
}

.tab-btn.active {
    color: var(--pb-green);
    border-bottom-color: var(--pb-green);
    font-weight: 700;
}

.tab-content {
    display: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tab-content.active {
    display: block;
}

/* ── TABLES ── */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    box-sizing: border-box;
    margin-bottom: 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.table-responsive::-webkit-scrollbar {
    height: 7px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.table th {
    background: #f8fafc;
    color: var(--pb-text-muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--pb-border);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--pb-border);
    vertical-align: middle;
}

.table tr:hover td {
    background-color: #fbfcfe;
}

/* ── CLICKABLE STAFF ROWS & DIRECT EVIDENCE LINKS ── */
.clickable-staff-row {
    cursor: pointer;
    transition: all 0.18s ease;
}
.clickable-staff-row:hover td {
    background-color: #f0f7ff !important;
}
.staff-name-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: all 0.18s ease;
}
.staff-name-link .staff-name-text {
    color: var(--pb-navy);
    transition: color 0.18s ease;
}
.staff-name-link .staff-open-icon {
    opacity: 0.35;
    transform: translate(-1px, 1px);
    transition: all 0.18s ease;
}
.staff-name-link:hover .staff-name-text,
.clickable-staff-row:hover .staff-name-link .staff-name-text {
    color: var(--pb-blue);
    text-decoration: underline;
}
.staff-name-link:hover .staff-open-icon,
.clickable-staff-row:hover .staff-name-link .staff-open-icon {
    opacity: 1;
    transform: translate(1px, -1px);
}


/* ── STATUS BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-ready { background: var(--pb-green-pale); color: var(--pb-green-text); border: 1px solid #bbf7d0; }
.badge-review { background: var(--pb-blue-pale); color: var(--pb-blue-text); border: 1px solid #bfdbfe; }
.badge-attention { background: var(--pb-red-pale); color: var(--pb-red-text); border: 1px solid #fecaca; }
.badge-pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-handover { background: var(--pb-purple-pale); color: var(--pb-purple-text); border: 1px solid #ddd6fe; }
.badge-progress { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-invited { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.badge-verified { background: #dcfce7; color: #166534; font-weight: 700; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-submitted { background: #e0f2fe; color: #0369a1; }
.badge-requested { background: #f1f5f9; color: #64748b; }

/* ── PROGRESS BAR ── */
.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pb-green) 0%, var(--pb-green-hover) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* ── BRANDSO ONE SPECIAL BANNER ── */
.brandso-sync-banner {
    background: linear-gradient(135deg, #091628 0%, #172554 100%);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    color: #fff;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border: 1px solid rgba(255,255,255,0.12);
}

.brandso-sync-banner h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brandso-sync-banner p {
    font-size: 0.83rem;
    color: #cbd5e1;
    margin-top: 4px;
    max-width: 700px;
}

/* ── MODALS ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--pb-surface);
    border-radius: var(--radius-lg);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--pb-border);
    animation: modalSlide 0.2s ease-out;
}

.modal-card.modal-lg {
    max-width: 860px;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--pb-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--pb-navy);
}

.modal-close {
    font-size: 1.4rem;
    color: var(--pb-text-muted);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--pb-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
}

/* ── FORMS ── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--pb-navy);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--pb-border-strong);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--pb-text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--pb-green);
    box-shadow: 0 0 0 3px rgba(26, 122, 69, 0.15);
}

/* ── TOAST NOTIFICATION ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--pb-navy);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--pb-green);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ── APPLICANT MOBILE SHELL ── */
.mobile-simulator-wrap {
    max-width: 520px;
    margin: 20px auto;
    background: #fff;
    border-radius: 36px;
    box-shadow: 0 20px 50px rgba(15, 35, 64, 0.15);
    border: 8px solid #0f172a;
    overflow: hidden;
}

.mobile-notch {
    height: 24px;
    background: #0f172a;
    width: 140px;
    margin: 0 auto;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.mobile-screen {
    padding: 20px 18px 40px;
    background: #f8fafc;
    min-height: 700px;
}

/* ── APP SHELL & SIDEBAR NAVIGATION (Modern Management Layout) ── */
.app-shell {
    display: block;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    background-color: var(--pb-bg);
}

.app-sidebar {
    width: 260px;
    background: #091628;
    color: #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: transform 0.25s ease, left 0.25s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.sidebar-brand .brand-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--pb-navy) 0%, var(--pb-green) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(26, 122, 69, 0.35);
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.sidebar-brand .brand-info h2 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-brand .brand-info p {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 1px;
}

.sidebar-user {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pb-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-user-details {
    min-width: 0;
    flex: 1;
}

.sidebar-user-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    padding: 12px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: #94a3b8;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.18s ease;
    text-decoration: none;
    margin-bottom: 2px;
}

.nav-link-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nav-link-content i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-link-content span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
    color: #ffffff;
    background: var(--pb-green);
    box-shadow: 0 2px 10px rgba(26, 122, 69, 0.35);
}

.nav-badge {
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-btn.btn-logout:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.4);
}

.app-main {
    margin-left: 260px;
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    box-sizing: border-box;
    transition: margin-left 0.25s ease, width 0.25s ease, max-width 0.25s ease;
}

body.sidebar-collapsed .app-sidebar {
    transform: translateX(-260px);
}
body.sidebar-collapsed .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.app-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--pb-border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 12px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.topbar-page-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--pb-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ── RESPONSIVE & MOBILE BREAKPOINTS ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 998;
}

.sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--pb-border-strong);
    color: var(--pb-navy);
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: #f1f5f9;
}

@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-260px);
        z-index: 1001;
    }

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

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

    .app-main {
        margin-left: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .main-wrapper {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .app-topbar {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .topbar-right {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }

    .role-bar {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}
