/* PG Management — premium admin UI */
:root {
    --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --font-display: "Plus Jakarta Sans", system-ui, sans-serif;

    --sidebar-w: 278px;
    --sidebar-bg: #0b0d12;
    --sidebar-surface: rgba(255, 255, 255, 0.03);
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --sidebar-muted: #8b929e;
    --sidebar-text: #e8eaed;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-muted: rgba(99, 102, 241, 0.14);
    --accent-glow: rgba(99, 102, 241, 0.45);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #f43f5e;

    --bg-app: #eeeff3;
    --bg-elevated: #ffffff;
    --text: #0f1419;
    --text-secondary: #5c6570;
    --text-tertiary: #8b949e;

    --border: rgba(15, 20, 25, 0.08);
    --border-strong: rgba(15, 20, 25, 0.12);

    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 20, 25, 0.06), 0 1px 3px rgba(15, 20, 25, 0.04);
    --shadow-lg: 0 12px 40px rgba(15, 20, 25, 0.08), 0 4px 12px rgba(15, 20, 25, 0.04);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.85);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

.admin-body {
    font-family: var(--font);
    font-feature-settings: "kern" 1, "liga" 1;
    background-color: var(--bg-app);
    background-image:
        radial-gradient(ellipse 120% 80% at 100% -20%, rgba(99, 102, 241, 0.07), transparent 50%),
        radial-gradient(ellipse 80% 50% at 0% 100%, rgba(16, 185, 129, 0.05), transparent 45%);
    min-height: 100vh;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    min-height: 100vh;
    align-items: stretch;
}

/* ——— Sidebar ——— */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    background:
        linear-gradient(165deg, rgba(99, 102, 241, 0.09) 0%, transparent 42%),
        linear-gradient(180deg, #12151c 0%, #0b0d12 100%);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.25);
}

.sidebar-brand {
    padding: 1.75rem 1.35rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex-shrink: 0;
    background: linear-gradient(145deg, #818cf8 0%, #6366f1 45%, #4f46e5 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 8px 24px rgba(99, 102, 241, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.35);
}

.sidebar-brand-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.03em;
    color: #fafafa;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    margin-top: 0.2rem;
}

.sidebar-nav-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.85rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    padding: 0.5rem 0.75rem 0.65rem;
    opacity: 0.85;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 3px;
    border-radius: 11px;
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
    position: relative;
}

.sidebar-link:hover {
    background: var(--sidebar-surface);
    color: var(--sidebar-text);
}

.sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0.12) 100%);
    box-shadow:
        0 0 0 1px rgba(129, 140, 248, 0.35) inset,
        0 4px 20px rgba(99, 102, 241, 0.15);
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #a5b4fc, #6366f1);
    box-shadow: 0 0 12px var(--accent-glow);
}

.sidebar-icon {
    font-size: 1.125rem;
    opacity: 0.88;
    width: 1.35rem;
    text-align: center;
}

.sidebar-link.active .sidebar-icon {
    opacity: 1;
    color: #c7d2fe;
}

.sidebar-footer {
    padding: 1rem 0.85rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius);
    background: var(--sidebar-surface);
    border: 1px solid var(--sidebar-border);
    margin-bottom: 0.65rem;
}

a.sidebar-user:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.07);
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(145deg, #4b5563, #374151);
    color: #f3f4f6;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.sidebar-user-meta {
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    color: var(--sidebar-muted);
}

.sidebar-link.logout-link {
    color: #f87171;
    opacity: 0.9;
}

.sidebar-link.logout-link:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
}

/* ——— Main ——— */
.main-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    padding: 1.25rem 2.25rem 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(238, 239, 243, 0.72);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

.topbar-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.35rem;
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--text);
    line-height: 1.2;
}

.topbar-sub {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-weight: 450;
    max-width: 42rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.topbar-badge i {
    color: var(--accent);
    font-size: 0.875rem;
}

.main-content {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    padding-left: 2.25rem !important;
    padding-right: 2.25rem !important;
}

/* ——— Cards ——— */
.card-soft {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.card-soft:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.card-soft .card-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 249, 251, 0.98));
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.02em;
    padding: 1rem 1.35rem;
    color: var(--text);
}

.card-soft .card-body {
    padding: 1.35rem;
}

/* ——— Stat cards ——— */
.stat-grid .stat-card {
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.4rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.stat-grid .stat-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(30%, -35%);
    pointer-events: none;
}

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

.stat-card .label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.stat-card .value {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-top: 0.35rem;
    color: var(--text);
    line-height: 1.1;
}

.stat-card .hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 500;
}

.stat-accent-teal::after {
    background: var(--success);
}

.stat-accent-teal {
    border-left: 3px solid var(--success);
}

.stat-accent-amber::after {
    background: var(--warning);
}

.stat-accent-amber {
    border-left: 3px solid var(--warning);
}

.stat-accent-violet::after {
    background: var(--accent);
}

.stat-accent-violet {
    border-left: 3px solid var(--accent);
}

.stat-accent-rose::after {
    background: var(--danger);
}

.stat-accent-rose {
    border-left: 3px solid var(--danger);
}

/* ——— Buttons ——— */
.btn-accent {
    background: linear-gradient(180deg, #818cf8 0%, #6366f1 100%);
    border: none;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.55rem 1.2rem;
    border-radius: 10px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 4px 14px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}

.btn-accent:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 8px 22px rgba(99, 102, 241, 0.4);
}

.btn-accent:active {
    transform: translateY(0);
}

.admin-body .btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 10px;
}

.admin-body .btn-outline-secondary:hover {
    background: var(--bg-app);
    border-color: var(--text-tertiary);
    color: var(--text);
}

.admin-body .btn-outline-primary {
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.8125rem;
}

.admin-body .btn-sm {
    border-radius: 8px;
    font-weight: 600;
}

/* ——— Tables ——— */
.table-responsive {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.admin-body .table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
}

.admin-body .table thead th {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.25rem;
    background: rgba(248, 249, 251, 0.95);
}

.admin-body .table tbody td {
    padding: 0.9rem 1.25rem;
    vertical-align: middle;
    border-bottom-color: var(--border);
    font-size: 0.875rem;
}

.admin-body .table tbody tr:last-child td {
    border-bottom: none;
}

.admin-body .table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.03);
}

.badge-status {
    font-weight: 600;
    padding: 0.35em 0.7em;
    border-radius: 8px;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
}

.admin-body .badge.bg-secondary {
    background: #f1f3f5 !important;
    color: var(--text-secondary) !important;
    font-weight: 600;
}

.admin-body .badge.bg-success {
    font-weight: 600;
}

.admin-body .badge.bg-warning {
    font-weight: 600;
}

/* ——— Forms ——— */
.admin-body .form-control,
.admin-body .form-select {
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.admin-body .form-control:focus,
.admin-body .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-muted);
}

.admin-body .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 1.5rem 0 0.85rem;
}

.admin-body .alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.admin-body .alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #047857;
}

.admin-body .alert-danger {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.18);
    color: #be123c;
}

/* ——— Lists & empty ——— */
.admin-body .list-group-item {
    border-color: var(--border);
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ——— Login (premium split) ——— */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    padding: 0;
    background: var(--sidebar-bg);
}

.login-split-brand {
    flex: 1;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.5rem;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(99, 102, 241, 0.35), transparent 55%),
        radial-gradient(ellipse 60% 50% at 90% 80%, rgba(16, 185, 129, 0.12), transparent 50%),
        linear-gradient(160deg, #151923 0%, #0b0d12 100%);
    border-right: 1px solid var(--sidebar-border);
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .login-split-brand {
        display: flex;
    }
}

.login-split-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.9;
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
}

.login-brand-mark-lg {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(145deg, #818cf8 0%, #6366f1 50%, #4f46e5 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 12px 40px rgba(99, 102, 241, 0.5);
    margin-bottom: 2rem;
}

.login-brand-headline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: #fafafa;
    max-width: 16ch;
}

.login-brand-copy {
    margin-top: 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--sidebar-muted);
    max-width: 36ch;
}

.login-brand-footer {
    position: relative;
    z-index: 1;
    font-size: 0.8125rem;
    color: var(--sidebar-muted);
}

.login-split-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--bg-app);
    background-image:
        radial-gradient(ellipse 100% 80% at 50% -30%, rgba(99, 102, 241, 0.08), transparent 55%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    padding: 2.25rem 2rem !important;
}

.login-card .login-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--text);
}

.login-card .login-card-sub {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.login-card .form-control {
    background: #fafbfc;
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: 11px;
    padding: 0.75rem 1rem;
}

.login-card .form-control:focus {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-muted);
    color: var(--text);
}

.login-card .form-control-lg {
    min-height: calc(1.5em + 1.1rem + 2px);
}

.login-card label {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
}

.login-card .btn-accent {
    padding: 0.75rem 1.25rem;
    border-radius: 11px;
    font-size: 0.9375rem;
}

.login-card .alert-danger {
    border-radius: 10px;
}

.login-hint {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 1.5rem;
}

.login-hint code {
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

/* Mobile login header when split hidden */
.login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .login-mobile-brand {
        display: none;
    }
}

/* Modal polish inside admin — must sit above mobile drawer (z-index 1050) */
.modal {
    z-index: 1065;
}

.modal-backdrop {
    z-index: 1060;
}

.modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom-color: var(--border);
}

.modal-footer {
    border-top-color: var(--border);
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 991.98px) {
    .modal {
        padding-left: env(safe-area-inset-left, 0);
        padding-right: env(safe-area-inset-right, 0);
    }

    .modal-dialog {
        margin: 0.75rem auto;
        max-width: calc(100% - 1.5rem);
    }

    .modal-dialog.modal-fullscreen-sm-down {
        margin: 0;
        max-width: 100%;
        min-height: 100%;
        height: 100%;
    }

    .modal-fullscreen-sm-down .modal-content {
        min-height: 100%;
        border-radius: 0;
        border: none;
    }

    .modal-fullscreen-sm-down .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-fullscreen-sm-down .modal-footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0));
    }

    body.modal-open .sidebar-backdrop.is-visible {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* Pagination / filters row */
.filter-pills .btn {
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.4rem 1rem;
}

.filter-pills .btn-dark {
    background: linear-gradient(180deg, #818cf8 0%, #6366f1 100%);
    border: none;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.filter-pills .btn-dark:hover {
    filter: brightness(1.05);
    color: #fff !important;
}

.filter-pills .btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.filter-pills .btn-outline-secondary:hover {
    background: var(--bg-app);
    border-color: var(--text-tertiary);
    color: var(--text);
}

.filter-pills-sm .btn {
    padding: 0.22rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.35;
}

/* Dashboard extras */
.dash-occupancy-bar {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 0.5rem;
}

.dash-occupancy-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #34d399);
    transition: width 0.4s var(--ease);
}

.dash-link-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.875rem;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.dash-link-tile:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
    color: var(--text);
}

.dash-link-tile i {
    font-size: 1.25rem;
    color: var(--accent);
}

/* ——— Mobile layout (drawer nav, touch, safe areas) ——— */
.sidebar-backdrop {
    display: none;
}

.dash-table-touch {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(15, 20, 25, 0.48);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.26s var(--ease), visibility 0.26s;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        pointer-events: none;
    }

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

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(var(--sidebar-w), min(88vw, 320px));
        max-width: 100%;
        z-index: 1050;
        height: 100vh;
        height: 100dvh;
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
        transform: translate3d(-105%, 0, 0);
        transition: transform 0.3s var(--ease);
        box-shadow: none;
    }

    .sidebar.sidebar-open {
        transform: translate3d(0, 0, 0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.45);
    }

    .topbar {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0));
        padding-top: max(0.65rem, env(safe-area-inset-top, 0));
    }

    .topbar-menu-btn {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        color: var(--text);
        box-shadow: var(--shadow-sm);
    }

    .topbar-menu-btn:hover {
        background: var(--bg-app);
        border-color: var(--border-strong);
    }

    .topbar-title {
        font-size: 1.35rem;
    }

    .topbar-sub {
        font-size: 0.875rem;
    }

    .topbar-badge {
        display: none;
    }

    .main-content {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0)) !important;
        padding-right: max(0.75rem, env(safe-area-inset-right, 0)) !important;
        padding-top: 0.5rem !important;
        padding-bottom: max(2.5rem, env(safe-area-inset-bottom, 0)) !important;
    }

    .stat-grid .stat-card {
        padding: 1.1rem 1.15rem;
    }

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

    .stat-grid .stat-card .hint {
        font-size: 0.78rem;
        line-height: 1.4;
    }

    .card-soft .card-header {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }

    .card-soft .card-body {
        padding: 1rem;
    }
}

@media (max-width: 991.98px) {
    body.admin-sidebar-open {
        overflow: hidden;
        overscroll-behavior: none;
    }
}

@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none !important;
    }
}
