::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.18); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(250, 204, 21, 0.9), rgba(14, 116, 144, 0.75)); border-radius: 999px; }

:root {
    --app-font: 'Inter', sans-serif;
    --premium-navy: #081426;
    --premium-slate: #0f172a;
    --premium-gold: #facc15;
    --premium-gold-soft: rgba(250, 204, 21, 0.14);
    --premium-emerald: #10b981;
    --premium-rose: #f43f5e;
    --premium-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
}

/* Final responsive overrides */
@media (max-width: 1023px) {
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    #page-app,
    #page-app.app-shell,
    #page-app .app-shell-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 100dvh;
        overflow: visible !important;
    }

    #page-app .app-topbar {
        position: sticky !important;
        top: 0;
        z-index: 20;
    }

    #page-app .app-topbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        gap: 0.625rem;
        padding: 0.75rem 1rem;
        overflow: visible !important;
    }

    #page-app .app-topbar > div:first-child,
    #page-app .app-topbar > div:last-child {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    #page-app .app-topbar > div:first-child {
        display: flex;
        align-items: center;
        gap: 0.625rem;
    }

    #page-app .app-topbar > div:first-child > div {
        min-width: 0;
        flex: 1 1 auto;
    }

    #page-app .app-topbar #page-title {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    #page-app .app-topbar .topbar-user-profile {
        min-width: 2.5rem;
        flex: 0 0 auto;
        margin-right: auto;
    }

    #page-app .app-topbar > div:last-child > button {
        display: inline-flex !important;
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
        min-height: 2.75rem;
        flex: 0 0 2.75rem !important;
        align-items: center;
        justify-content: center;
        padding: 0;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child > button span {
        display: none;
    }

    #page-app .app-footer {
        position: static !important;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        max-height: none !important;
        min-height: 0 !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    #tab-dashboard table,
    #tab-antrian table {
        width: max-content;
        min-width: 760px;
    }
}

@media (max-width: 639px) {
    #page-app .app-topbar {
        padding: 0.625rem 0.75rem;
    }

    #tab-dashboard,
    #tab-antrian,
    #tab-users,
    #tab-profile {
        padding: 0.75rem;
    }

    #tab-dashboard > .grid:first-child,
    #tab-dashboard > .grid:nth-of-type(2) {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

body:has(#page-app:not(.hidden)) {
    overflow: hidden !important;
}

#page-app:not(.hidden) {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#page-app:not(.hidden) .app-shell-content {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    width: auto !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#page-app:not(.hidden) .app-topbar,
#page-app:not(.hidden) .app-footer {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
}

#page-app:not(.hidden) .app-topbar {
    z-index: 40;
}

#page-app:not(.hidden) .app-footer {
    z-index: 39;
}

#page-app:not(.hidden) > .app-shell-content > .tab-content:not(.hidden) {
    display: block !important;
    flex: 1 1 0% !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    pointer-events: auto !important;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

#page-app:not(.hidden) #tab-kios:not(.hidden) > div {
    min-height: 100% !important;
    overflow: visible !important;
}

body:has(#page-app:not(.hidden)) {
    overflow: hidden;
}

#page-app:not(.hidden) {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden !important;
}

#page-app:not(.hidden) .app-shell-content {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

#page-app:not(.hidden) .app-topbar,
#page-app:not(.hidden) .app-footer {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto;
}

#page-app:not(.hidden) .tab-content {
    flex: 1 1 0%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Refined dashboard hierarchy: utilities remain intact while visual emphasis is softened. */
#page-app {
    color: #334155;
}

#page-app .bg-white {
    border-color: rgba(226, 232, 240, 0.8);
}

#page-app .text-slate-500,
#page-app .text-slate-600,
#page-app .text-slate-700 {
    color: #94a3b8;
}

#page-app h1,
#page-app h2,
#page-app h3 {
    letter-spacing: -0.015em;
}

#tab-dashboard .grid > div[id^="card-loket-"] {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    min-height: 180px;
    border-radius: 0.875rem;
    padding: 1.125rem;
    border-color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

#tab-dashboard .grid > div[id^="card-loket-"] > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

#tab-dashboard .grid > div[id^="card-loket-"] .flex.items-center.justify-between.mb-1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

#tab-dashboard .grid > div[id^="card-loket-"] .text-[10px] {
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
}

#tab-dashboard .grid > div[id^="card-loket-"] h3 {
    line-height: 1.1;
    word-break: break-word;
    overflow-wrap: anywhere;
}

#tab-dashboard .grid > div[id^="card-loket-"]:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

#tab-dashboard div[id^="card-loket-"] p,
#tab-dashboard .dashboard-metric span,
#tab-dashboard table thead,
#tab-antrian table thead {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#tab-dashboard div[id^="card-loket-"] h3 {
    font-weight: 700;
}

#tab-dashboard table tbody tr,
#tab-antrian table tbody tr {
    transition: background-color 160ms ease;
}

#tab-dashboard table tbody tr:nth-child(even),
#tab-antrian table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.62);
}

#tab-dashboard table tbody tr:hover,
#tab-antrian table tbody tr:hover {
    background: rgba(248, 250, 252, 0.8);
}

#tab-dashboard table th,
#tab-dashboard table td,
#tab-antrian table th,
#tab-antrian table td {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.nav-item {
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.nav-item:hover {
    transform: translateX(3px);
}

#page-app.kios-context .app-topbar {
    background: #0f172a;
    border-color: rgba(51, 65, 85, 0.9);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.2);
}

#page-app.kios-context .app-topbar #page-title,
#page-app.kios-context .app-topbar #top-user-name {
    color: #f8fafc;
}

#page-app.kios-context .app-topbar #top-user-role,
#page-app.kios-context .app-topbar .text-slate-600 {
    color: #94a3b8;
}

#page-app.kios-context .app-topbar .lg\:hidden {
    color: #cbd5e1;
}

#page-app.kios-context .app-topbar .topbar-kiosk-link {
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(8, 145, 178, 0.14);
    color: #a5f3fc;
}

#page-app.kios-context .app-topbar .topbar-kiosk-link:hover {
    border-color: rgba(103, 232, 249, 0.65);
    background: rgba(8, 145, 178, 0.28);
    color: #cffafe;
}

html, body {
    width: 100%;
    min-width: 320px;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
}

body {
    font-family: var(--app-font);
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at top left, rgba(250, 204, 21, 0.12), transparent 24%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 24%),
        #f8fafc;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.font-sans,
.font-mono,
button,
input,
select,
textarea {
    font-family: var(--app-font);
}

button,
input,
select,
textarea {
    touch-action: manipulation;
}

img,
svg,
video {
    max-width: 100%;
    display: block;
}

#page-app {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible !important;
}

#page-app.app-shell {
    overflow: visible !important;
    height: auto !important;
}

#page-app .app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
}

#page-app .app-footer {
    position: sticky !important;
    bottom: 0;
    z-index: 19;
}

#page-app {
    backdrop-filter: none;
}

@media (min-width: 1024px) {
    #page-app .app-shell-content {
        padding-top: 4rem;
        padding-bottom: 3.5rem;
    }

    #page-app .app-topbar {
        position: fixed !important;
        top: 0;
        right: 0;
        left: 16rem;
        z-index: 40;
    }

    #page-app .app-footer {
        position: fixed !important;
        right: 0;
        bottom: 0;
        left: 16rem;
        z-index: 39;
    }
}

#page-app .app-shell-content {
    min-height: 100dvh;
    height: auto;
}

#page-app .tab-content {
    min-width: 0;
    overflow: visible;
}

#page-app #tab-kios > div {
    min-height: 100%;
    overflow: visible !important;
}

#page-app * {
    box-sizing: border-box;
}

#page-app .truncate,
#page-app h1,
#page-app h2,
#page-app h3,
#page-app p,
#page-app span,
#page-app td,
#page-app th,
#page-app input,
#page-app button,
#page-app select,
#page-app textarea {
    overflow-wrap: anywhere;
    word-break: break-word;
}

#page-app,
#page-login,
#fullscreen-display {
    backdrop-filter: blur(8px);
}

#login-pass::-ms-reveal,
#login-pass::-ms-clear {
    display: none;
}

#login-pass::-webkit-textfield-decoration-container,
#login-pass::-webkit-credentials-auto-fill-button {
    display: none !important;
    -webkit-appearance: none !important;
}

.password-toggle {
    backdrop-filter: none;
    line-height: 1;
    padding: 0;
    min-width: 1.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
    color: rgba(148, 163, 184, 0.9);
}

.password-toggle i {
    display: inline-block;
    transform: translateY(-0.5px);
}

.password-toggle:hover {
    color: rgba(250, 204, 21, 0.9);
}

.login-screen {
    position: relative;
    z-index: 50;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background:
        radial-gradient(circle at 15% 20%, rgba(250, 204, 21, 0.18), transparent 24%),
        radial-gradient(circle at 85% 80%, rgba(14, 165, 233, 0.2), transparent 28%),
        linear-gradient(135deg, #020617 0%, #0a192f 52%, #082f49 100%);
}

.login-screen::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.login-screen::before,
.login-screen::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(250, 204, 21, 0.14);
    transform: rotate(18deg);
    pointer-events: none;
}

/* Premium judicial portal login */
.login-screen {
    isolation: isolate;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 78% 48%, rgba(30, 64, 175, 0.22), transparent 30%),
        radial-gradient(circle at 18% 80%, rgba(180, 145, 72, 0.1), transparent 25%),
        linear-gradient(125deg, #030712 0%, #0b1220 48%, #101b2e 100%);
}

.login-screen::before,
.login-screen::after {
    z-index: -1;
    border-color: rgba(148, 163, 184, 0.1);
}

.login-architecture,
.login-architecture::before,
.login-architecture::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-architecture {
    z-index: 0;
}

.login-architecture::before {
    content: '';
    background: linear-gradient(115deg, transparent 0 42%, rgba(56, 189, 248, 0.08) 42.1%, transparent 56%);
    opacity: 0.85;
}

.architecture-plane,
.architecture-beam {
    position: absolute;
    display: block;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.09), rgba(30, 41, 59, 0.02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 22px 70px rgba(0, 0, 0, 0.2);
    transform: skewY(-18deg) rotate(-7deg);
    z-index: 0;
}

.architecture-plane-one { width: 44vw; height: 65vh; left: -8vw; top: 15vh; }
.architecture-plane-two { width: 28vw; height: 76vh; left: 28vw; top: -18vh; background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 23, 42, 0.02)); }
.architecture-plane-three { width: 34vw; height: 52vh; right: -5vw; bottom: -8vh; transform: skewY(16deg) rotate(8deg); background: linear-gradient(135deg, rgba(180, 145, 72, 0.1), rgba(15, 23, 42, 0.02)); }
.architecture-beam { height: 1px; width: 68vw; left: -4vw; top: 30vh; border: 0; background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent); transform: rotate(-16deg); box-shadow: 0 0 18px rgba(212, 175, 55, 0.18); }
.architecture-beam-two { top: auto; bottom: 22vh; left: 20vw; transform: rotate(21deg); background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.36), transparent); box-shadow: 0 0 18px rgba(56, 189, 248, 0.14); }

.login-content {
    position: relative;
    z-index: 1;
}

.login-hero,
.login-card,
.login-hero-brand,
.login-hero-copy,
.login-feature-list {
    position: relative;
    z-index: 2;
}

.login-card {
    position: relative;
    overflow: hidden;
    border-color: #334155;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.43));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(125%);
}

.login-card::before { position: absolute; top: 0; left: 12%; right: 12%; height: 1px; content: ''; background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.74), transparent); }
.login-logo-wrap { margin-bottom: 1.35rem; padding: 0; background: transparent; border: 0; box-shadow: none; }
.login-logo { border-radius: 0; filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.38)); }
.login-kicker { margin-top: 0.15rem; color: #d6b866; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; }
.login-brand h2 { margin-top: 0.7rem; letter-spacing: 0.035em; }
.login-brand > p:last-child { margin-top: 0.65rem; }
.login-card label { color: #b6c0d0; letter-spacing: 0.08em; }
.login-input { border: 1px solid rgba(71, 85, 105, 0.7); border-radius: 0.65rem; background: rgba(2, 6, 23, 0.5); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.24), 0 1px 0 rgba(255,255,255,0.025); }
.login-input:focus { border-color: rgba(96, 165, 250, 0.82); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16), inset 0 2px 6px rgba(0, 0, 0, 0.24); outline: none; }
.login-submit { border: 1px solid rgba(96, 165, 250, 0.45); background: #1d4ed8; color: #eff6ff; box-shadow: 0 5px 14px rgba(29, 78, 216, 0.2); }
.login-submit:hover { border-color: rgba(147, 197, 253, 0.68); background: #2563eb; box-shadow: 0 7px 16px rgba(29, 78, 216, 0.28); transform: translateY(-1px); }
.login-card .text-gold-400 { color: #d6b866; }
.login-card .text-gold-400:hover { color: #f1d98e; }
.login-card .password-toggle:hover { color: #bfdbfe; }

/* Split-screen enterprise login */
.login-content { width: 100%; }
.login-hero { position: relative; }
.login-hero-brand { opacity: 0.96; }
.login-hero-logo { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.32)); }
.login-hero-brand-subtitle { display: block; margin-top: 2px; color: #94a3b8; font-size: 0.68rem; letter-spacing: 0.05em; }
.login-hero-copy { margin-top: clamp(5rem, 13vh, 9rem); }
.login-hero-eyebrow { color: #d6b866; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.22em; }
.login-hero-copy h1 { margin-top: 1rem; color: #f8fafc; font-size: clamp(2.1rem, 3.4vw, 4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.08; }
.login-hero-description { max-width: 560px; margin-top: 1.5rem; color: #94a3b8; font-size: 0.95rem; line-height: 1.75; }
.login-feature-list span { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(71, 85, 105, 0.58); border-radius: 9999px; background: rgba(30, 41, 59, 0.58); padding: 8px 12px; color: #cbd5e1; font-size: 0.7rem; backdrop-filter: blur(10px); }
.login-feature-list i { color: #d6b866; font-size: 0.68rem; }
.login-form-heading h2 { color: #f8fafc; letter-spacing: -0.025em; }

@media (min-width: 1024px) {
    .login-hero { min-height: 620px; }
    .login-card { justify-self: end; }
}

.dashboard-scanner-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(8, 145, 178, 0.18), rgba(2, 6, 23, 0.95) 58%);
}

#cam-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 1rem;
    text-align: center;
    z-index: 2;
}

#cam-placeholder > div:first-child {
    position: relative;
    width: 12.5rem;
    height: 12.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.dashboard-scanner-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: auto;
    border: 2px solid rgba(103, 232, 249, 0.7);
    border-radius: 9999px;
    box-shadow: 0 0 0 12px rgba(34, 211, 238, 0.03), 0 0 24px rgba(34, 211, 238, 0.14);
    background: rgba(15, 23, 42, 0.12);
}

.dashboard-scanner-ring::before,
.dashboard-scanner-ring::after {
    content: "";
    position: absolute;
    inset: 16px;
    border: 1px dashed rgba(52, 211, 153, 0.8);
    border-radius: 9999px;
}

.dashboard-scanner-ring::after {
    inset: 34px;
    border-style: solid;
    border-color: rgba(34, 211, 238, 0.38) transparent;
}

.dashboard-scanner-line {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(76%, 220px);
    height: 2px;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.9), transparent);
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.72);
    border-radius: 9999px;
}

#cam-placeholder > div:last-child {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#cam-placeholder p {
    position: relative;
    z-index: 2;
    margin: 0;
    line-height: 1.5;
    max-width: 16rem;
}

@media (max-width: 640px) {
    .login-screen {
        padding: 0.75rem;
        min-height: 100dvh;
    }
    .login-content {
        justify-content: center;
        min-height: calc(100dvh - 1.5rem);
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }
    .login-card { padding: 1.5rem; }
    .login-architecture { opacity: 0.9; }
    .architecture-plane-one { width: 75vw; left: -28vw; }
    .architecture-plane-two { left: 42vw; width: 45vw; }
    .login-hero { min-height: 0; padding: 1rem 0 0; position: relative; z-index: 2; }
    .login-hero-brand { position: relative; z-index: 2; }
    .login-hero-copy { margin-top: 4rem; position: relative; z-index: 2; }
    .login-hero-copy h1 { font-size: 2.2rem; }
    .login-hero-description { font-size: 0.82rem; line-height: 1.6; }
    .login-feature-list { margin-top: 3rem; position: relative; z-index: 2; }
    .login-card { justify-self: stretch; margin-top: 1rem; }

    .app-topbar {
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }

    .app-topbar > div:first-child,
    .app-topbar > div:last-child {
        width: 100%;
        justify-content: space-between;
    }

    .app-topbar > div:last-child > button,
    .app-topbar > div:last-child > div {
        flex: 1 1 auto;
        min-width: 0;
    }

    #tab-dashboard .grid {
        grid-template-columns: 1fr;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] {
        min-height: 170px;
        padding: 1rem;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] h3 {
        font-size: clamp(2rem, 6.5vw, 2.6rem);
    }
}

.login-screen::before {
    width: 42vw;
    height: 42vw;
    left: -18vw;
    top: -16vw;
    border-radius: 38%;
    box-shadow: 0 0 0 28px rgba(250, 204, 21, 0.025), 0 0 0 56px rgba(250, 204, 21, 0.018);
}

.login-screen::after {
    width: 34vw;
    height: 34vw;
    right: -14vw;
    bottom: -14vw;
    border-radius: 44%;
    border-color: rgba(56, 189, 248, 0.14);
    box-shadow: 0 0 0 24px rgba(56, 189, 248, 0.025), 0 0 0 48px rgba(56, 189, 248, 0.018);
}

.login-input {
    background: rgba(2, 6, 23, 0.56);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(2, 6, 23, 0.12);
}

.login-input:focus {
    border-color: rgba(250, 204, 21, 0.72);
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.app-shell {
    min-height: 100dvh;
}

.app-shell-content {
    min-height: 100dvh;
    overflow: visible;
}

@media (max-width: 768px) {
    #page-app,
    .app-shell,
    .app-shell-content {
        overflow: visible !important;
    }

    .app-shell {
        height: auto !important;
        min-height: 100dvh !important;
    }

    .app-shell-content {
        min-height: 100dvh !important;
    }
}

#tab-antrian,
#tab-dashboard,
#tab-kios,
#tab-users,
#tab-profile {
    overflow: visible;
}

.tab-content {
    min-height: 0;
    overflow: visible;
}

.app-topbar,
.app-footer {
    flex-shrink: 0;
    backdrop-filter: blur(16px);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(248,250,252,0.92));
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08), inset 0 -1px 0 rgba(148, 163, 184, 0.18);
}

.app-topbar > div {
    display: flex;
    align-items: center;
    min-width: 0;
}

.app-topbar > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.app-topbar > div:last-child {
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topbar-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex-shrink: 1;
}

.topbar-user-profile > div {
    min-width: 0;
}

@media (max-width: 1024px) {
    .app-shell {
        min-height: 100dvh;
        height: auto;
    }

    .app-shell-content {
        min-height: 100dvh;
    }

    .app-topbar {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .topbar-user-profile .text-left {
        display: none;
    }

    .app-topbar > div:last-child {
        gap: 0.5rem;
    }

    .app-topbar > div:last-child > button:not(.topbar-logout) {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    #sidebar {
        width: min(82vw, 320px);
    }
}

@media (max-width: 768px) {
    #tab-dashboard,
    #tab-antrian,
    #tab-kios,
    #tab-users,
    #tab-profile {
        padding: 0.75rem;
    }

    #tab-dashboard .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #tab-dashboard .grid > div[id^="card-loket-"] {
        padding: 1rem;
    }

    #tab-dashboard .dashboard-metric,
    #tab-antrian .dashboard-table-wrap,
    #tab-dashboard .dashboard-table-wrap {
        min-height: unset;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        max-height: 52vh;
    }

    #tab-dashboard .dashboard-metric {
        padding: 0.9rem 1rem;
    }

    #tab-dashboard .dashboard-metric .text-3xl {
        font-size: clamp(1.45rem, 5vw, 2rem);
    }

    .queue-toolbar {
        padding: 1rem !important;
    }

    .queue-toolbar > div,
    .queue-toolbar > div:last-child,
    .table-search,
    .queue-toolbar > div:last-child > div {
        width: 100%;
    }

    .queue-toolbar > div:last-child {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .queue-toolbar > div:last-child > div {
        flex-wrap: wrap;
    }

    .table-search {
        min-width: 0;
    }

    .app-footer {
        padding: 0.75rem 1rem;
    }

    .app-shell,
    .app-shell-content {
        min-height: 100dvh;
        height: auto;
    }
}

@media (max-width: 560px) {
    #page-app,
    .app-shell,
    .app-shell-content {
        overflow: visible !important;
    }

    .app-topbar {
        min-height: 72px;
        height: auto;
        flex-wrap: wrap;
        row-gap: 0.5rem;
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }

    .app-topbar > div:first-child {
        width: 100%;
    }

    .app-topbar > div:last-child {
        width: 100%;
        justify-content: space-between;
    }

    .app-topbar > div:last-child > button:not(.topbar-logout) {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-logout {
        width: 2.5rem;
        flex-shrink: 0;
    }

    #page-title {
        font-size: 1rem;
    }

    #tab-dashboard,
    #tab-antrian,
    #tab-kios,
    #tab-users,
    #tab-profile {
        padding: 0.625rem;
    }

    #tab-dashboard .grid {
        grid-template-columns: 1fr;
    }

    #tab-dashboard .dashboard-metric {
        min-height: 110px;
    }

    #tab-dashboard .dashboard-metric > div:first-child {
        gap: 0.5rem;
    }

    .queue-toolbar > div:last-child > div {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .queue-toolbar input[type="date"] {
        width: 100%;
    }

    .table-pagination {
        gap: 0.5rem;
        font-size: 0.7rem;
    }

    .table-page-button {
        min-height: 34px;
        min-width: 34px;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] {
        padding: 0.9rem;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        max-height: 46vh;
    }

    .app-shell,
    .app-shell-content {
        height: auto;
        min-height: 100dvh;
    }
}

#page-title {
    position: relative;
    display: inline-block;
    font-family: inherit;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #0f172a;
    text-shadow: none;
    background: none;
    -webkit-text-fill-color: initial;
}

#page-title::after {
    content: none;
}

.app-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}

#tab-antrian .dashboard-table-wrap,
#tab-dashboard .dashboard-table-wrap {
    max-height: 420px;
    min-height: 220px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.7) rgba(241, 245, 249, 0.9);
}

#tab-antrian .dashboard-table-wrap {
    max-height: 62vh;
}

#tab-antrian .dashboard-table-wrap::-webkit-scrollbar,
#tab-dashboard .dashboard-table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#tab-antrian .dashboard-table-wrap::-webkit-scrollbar-track,
#tab-dashboard .dashboard-table-wrap::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.10);
    border-radius: 9999px;
}

#tab-antrian .dashboard-table-wrap::-webkit-scrollbar-thumb,
#tab-dashboard .dashboard-table-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(14, 116, 144, 0.9), rgba(250, 204, 21, 0.85));
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

#tab-antrian .dashboard-table-wrap::-webkit-scrollbar-thumb:hover,
#tab-dashboard .dashboard-table-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(8, 145, 178, 1), rgba(234, 179, 8, 0.95));
}

#tab-antrian table,
#tab-dashboard table {
    min-width: 860px;
}

.table-search:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.table-page-button {
    display: inline-flex;
    min-height: 36px;
    min-width: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #475569;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.table-page-button:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #2563eb;
}

.table-page-button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.table-action-button {
    display: inline-flex;
    min-height: 40px;
    min-width: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    color: #94a3b8;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.table-action-button:hover {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #e11d48;
}

#tab-dashboard .grid > div[id^="card-loket-"] button {
    min-height: 44px;
}

/* User management workspace */
#tab-users .user-management-shell {
    max-width: 1440px;
    margin: 0 auto;
}

#tab-users .user-metric-card {
    position: relative;
    display: flex;
    min-height: 112px;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.96);
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
}

#tab-users .user-metric-card p {
    margin: 0 0 5px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#tab-users .user-metric-card strong {
    color: #0f172a;
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1;
}

#tab-users .user-metric-icon {
    display: inline-flex;
    height: 44px;
    width: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 1rem;
}

#tab-users .user-metric-icon-blue { background: #eff6ff; color: #2563eb; }
#tab-users .user-metric-icon-emerald { background: #ecfdf5; color: #059669; }
#tab-users .user-metric-icon-indigo { background: #eef2ff; color: #4f46e5; }

#tab-users .user-live-label {
    position: absolute;
    top: 18px;
    right: 20px;
    color: #059669;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

#tab-users .user-live-label i,
#tab-users .user-status-active i {
    animation: userStatusPulse 2s ease-in-out infinite;
}

@keyframes userStatusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.42; }
}

#tab-users .user-management-table th,
#tab-users .user-management-table td {
    padding: 16px 20px;
    vertical-align: middle;
}

#tab-users .user-management-table tbody tr {
    background: #ffffff;
    transition: background-color 160ms ease;
}

#tab-users .user-management-table tbody tr:hover { background: #f8fafc; }

#tab-users .user-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

#tab-users .user-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

#tab-users .user-avatar {
    height: 40px;
    width: 40px;
    border-radius: 9999px;
    object-fit: cover;
    box-shadow: 0 0 0 3px #ffffff, 0 2px 8px rgba(15, 23, 42, 0.14);
}

#tab-users .user-online-dot {
    position: absolute;
    right: -1px;
    bottom: 0;
    height: 10px;
    width: 10px;
    border: 2px solid #ffffff;
    border-radius: 9999px;
    background: #10b981;
}

#tab-users .user-online-dot.is-offline { background: #94a3b8; }
#tab-users .user-identity strong { display: block; color: #0f172a; font-size: 0.875rem; font-weight: 700; }
#tab-users .user-identity span { display: block; margin-top: 3px; color: #64748b; font-size: 0.72rem; }
#tab-users .user-nip { display: inline-block; border: 1px solid rgba(226, 232, 240, 0.8); border-radius: 0.375rem; background: #f1f5f9; padding: 5px 10px; color: #334155; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.72rem; }
#tab-users .user-role-badge { display: inline-flex; border-radius: 9999px; padding: 5px 11px; font-size: 0.72rem; font-weight: 700; }
#tab-users .user-role-admin { border: 1px solid rgba(199, 210, 254, 0.6); background: #eef2ff; color: #4338ca; }
#tab-users .user-role-operator { border: 1px solid rgba(186, 230, 253, 0.6); background: #f0f9ff; color: #0369a1; }
#tab-users .user-desk-cell { color: #64748b; font-weight: 600; }
#tab-users .user-status-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 9999px; padding: 5px 10px; font-size: 0.72rem; font-weight: 700; }
#tab-users .user-status-active { border: 1px solid rgba(167, 243, 208, 0.6); background: #ecfdf5; color: #047857; }
#tab-users .user-status-inactive { border: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; }
#tab-users .user-status-badge i { font-size: 0.45rem; }
#tab-users .user-actions { display: flex; align-items: center; justify-content: center; gap: 8px; }
#tab-users .user-edit-button,
#tab-users .user-action-menu summary { display: inline-flex; height: 36px; width: 36px; cursor: pointer; align-items: center; justify-content: center; border: 1px solid #e2e8f0; border-radius: 0.5rem; background: #f1f5f9; color: #475569; transition: background-color 160ms ease, color 160ms ease; }
#tab-users .user-edit-button:hover,
#tab-users .user-action-menu summary:hover { background: #e2e8f0; color: #0f172a; }
#tab-users .user-action-menu { position: relative; }
#tab-users .user-action-menu summary { list-style: none; }
#tab-users .user-action-menu summary::-webkit-details-marker { display: none; }
#tab-users .user-action-popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 170px; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 0.625rem; background: #ffffff; padding: 4px; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14); }
#tab-users .user-action-popover button { display: flex; width: 100%; min-height: 36px; align-items: center; gap: 9px; border: 0; border-radius: 0.375rem; background: transparent; padding: 8px 10px; color: #475569; font-size: 0.75rem; text-align: left; }
#tab-users .user-action-popover button:hover { background: #f1f5f9; color: #0f172a; }
#tab-users .user-action-popover .user-menu-danger:hover { background: #fff1f2; color: #e11d48; }
#tab-users .user-search:focus-within,
#tab-users .user-filter-select:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

@media (max-width: 640px) {
    #tab-users .user-management-table th,
    #tab-users .user-management-table td { padding-left: 14px; padding-right: 14px; }
}

/* Profile settings workspace */
#tab-profile .profile-settings-shell { padding-top: 0.5rem; }
#tab-profile .profile-settings-card { border-color: rgba(226, 232, 240, 0.9); box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.03); }
#tab-profile .profile-settings-card { position: relative; }
#tab-profile .profile-settings-card::before { position: absolute; top: 0; right: 14%; left: 14%; height: 2px; content: ''; border-radius: 9999px; background: linear-gradient(90deg, #2563eb, #6366f1); opacity: 0.9; }
#tab-profile .profile-layout { align-items: start; }
#tab-profile .profile-identity-card { position: relative; }
#tab-profile .profile-identity-card .profile-avatar-wrap { margin-top: 0; }
#tab-profile .profile-settings-card { box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08); }
#tab-profile .profile-cover { position: relative; background-image: linear-gradient(90deg, #0f172a, #1e1b4b, #0f172a); }
#tab-profile .profile-cover::after { position: absolute; inset: 0; content: ''; background: linear-gradient(110deg, rgba(255,255,255,0.12), transparent 48%, rgba(15,23,42,0.12)); }
#tab-profile .profile-identity { position: relative; margin-top: 0; }
#tab-profile .profile-hero-row { position: relative; margin-top: 0; padding-top: 0; }
#tab-profile .profile-avatar-wrap { position: relative; margin-top: 0; }
#tab-profile .profile-hero-row { min-height: 58px; }
#tab-profile .profile-hero-row { background: linear-gradient(180deg, #ffffff, #fbfdff); }
#tab-profile .profile-hero-info { min-width: 0; }
#tab-profile .profile-photo-button { box-shadow: 0 2px 5px rgba(37, 99, 235, 0.08); }
#tab-profile .profile-photo-button:hover { border-color: #93c5fd; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12); }
#tab-profile .profile-avatar-wrap { z-index: 1; filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.12)); }
#tab-profile .profile-hero-info { border-left: 1px solid #eef2f7; padding-left: 12px; }
#tab-profile .profile-camera-button { position: absolute; right: 1px; bottom: 1px; display: inline-flex; height: 23px; width: 23px; cursor: pointer; align-items: center; justify-content: center; border: 2px solid #ffffff; border-radius: 9999px; background: #2563eb; color: #ffffff; font-size: 0.58rem; box-shadow: 0 2px 6px rgba(15,23,42,0.2); }
#tab-profile .profile-camera-button { right: 4px; bottom: 4px; }
#tab-profile .profile-camera-button:hover { background: #1d4ed8; }
#tab-profile .profile-photo-actions { padding-bottom: 1px; }
#tab-profile .profile-status-badge { display: inline-flex; align-items: center; border: 1px solid rgba(199, 210, 254, 0.7); border-radius: 9999px; background: #eef2ff; padding: 3px 7px; color: #4338ca; font-size: 0.6rem; font-weight: 700; }
#tab-profile .profile-meta-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(199, 210, 254, 0.7); border-radius: 9999px; background: #eef2ff; padding: 4px 9px; color: #4338ca; font-size: 0.68rem; font-weight: 700; }
#tab-profile .profile-meta-pill-wide { min-height: 40px; width: 100%; border-radius: 0.625rem; padding: 8px 12px; }
#tab-profile .profile-meta-pill i { color: #6366f1; }
#tab-profile .profile-hero-info > label { padding: 4px 8px; font-size: 0.65rem; }
#tab-profile .profile-hero-info p { letter-spacing: -0.015em; }
#tab-profile .profile-nip-display { display: flex; min-height: 38px; align-items: center; gap: 10px; width: 100%; border: 1px solid #e2e8f0; border-radius: 0.625rem; background: #f1f5f9; padding: 6px 12px; color: #334155; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.75rem; }
#tab-profile .profile-nip-display i { color: #94a3b8; font-family: var(--app-font); }
#tab-profile .profile-section { box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025); }
#tab-profile .profile-section-heading { display: flex; align-items: center; gap: 8px; }
#tab-profile .profile-section-icon { display: inline-flex; height: 24px; width: 24px; align-items: center; justify-content: center; border-radius: 7px; background: #eff6ff; color: #2563eb; font-size: 0.65rem; }
#tab-profile .profile-section-heading h3 { letter-spacing: -0.01em; }
#tab-profile .profile-field > label { display: block; margin-bottom: 7px; color: #334155; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
#tab-profile .profile-input-wrap { position: relative; display: flex; min-height: 34px; align-items: center; border: 1px solid #e2e8f0; border-radius: 0.5rem; background: #ffffff; transition: border-color 160ms ease, box-shadow 160ms ease; }
#tab-profile .profile-input-wrap:focus-within { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
#tab-profile .profile-input-wrap > i { width: 32px; flex-shrink: 0; color: #94a3b8; text-align: center; font-size: 0.72rem; }
#tab-profile .profile-input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; padding: 6px 12px 6px 0; color: #1e293b; font-size: 0.75rem; }
#tab-profile .profile-input-wrap input::placeholder { color: #94a3b8; }
#tab-profile .profile-input-wrap input:read-only { color: #64748b; cursor: default; }
#tab-profile .profile-input-wrap button { display: inline-flex; height: 30px; width: 32px; min-height: 0; align-items: center; justify-content: center; border: 0; background: transparent; color: #94a3b8; }
#tab-profile .profile-input-wrap button:hover { color: #2563eb; }
#tab-profile .profile-role-display { display: flex; min-height: 44px; align-items: center; gap: 10px; border: 1px solid rgba(199, 210, 254, 0.7); border-radius: 0.625rem; background: #eef2ff; padding: 10px 12px; color: #4338ca; font-size: 0.875rem; font-weight: 700; }
#tab-profile .profile-role-display i { color: #6366f1; }
#tab-profile .password-strength { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
#tab-profile .password-strength-track { height: 5px; flex: 1; overflow: hidden; border-radius: 9999px; background: #e2e8f0; }
#tab-profile .password-strength-track span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 180ms ease, background-color 180ms ease; }
#tab-profile #profile-strength-label { min-width: 42px; color: #94a3b8; font-size: 0.68rem; font-weight: 700; text-align: right; }
#tab-profile .profile-form-actions button { min-height: 0 !important; line-height: 1.25; }
#tab-profile .profile-cancel-button,
#tab-profile .profile-save-button { min-height: 0; }
#tab-profile .profile-cancel-button,
#tab-profile .profile-save-button { padding-top: 6px; padding-bottom: 6px; font-size: 0.75rem; }
#tab-profile .profile-cancel-button,
#tab-profile .profile-save-button { min-height: 32px !important; padding: 6px 12px; }
#tab-profile .profile-save-button { background: #2563eb !important; }
#tab-profile .profile-save-button:hover { background: #1d4ed8 !important; }
#tab-profile .profile-cancel-button { background: #f1f5f9 !important; color: #475569 !important; }
#tab-profile .profile-cancel-button:hover { background: #e2e8f0 !important; }
#tab-profile .profile-save-button { letter-spacing: -0.01em; }
#tab-profile .profile-form-actions { background: linear-gradient(180deg, #ffffff, #fbfdff); }

/* Premium dark profile surface */
#tab-profile.profile-dark-shell {
    background:
        radial-gradient(circle at 18% 12%, rgba(180, 145, 72, 0.08), transparent 28%),
        radial-gradient(circle at 88% 82%, rgba(37, 99, 235, 0.1), transparent 34%),
        #090d16;
    color: #cbd5e1;
}

#tab-profile.profile-dark-shell .profile-settings-shell { max-width: 40rem; }
#tab-profile.profile-dark-shell .profile-settings-card {
    overflow: hidden;
    border-color: rgba(71, 85, 105, 0.58);
    background: rgba(15, 23, 42, 0.88);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(18px);
}
#tab-profile.profile-dark-shell .profile-settings-card::before { right: 12%; left: 12%; background: linear-gradient(90deg, transparent, #b8944a, transparent); opacity: 0.72; }
#tab-profile.profile-dark-shell .profile-hero-row { border-color: rgba(71, 85, 105, 0.52); background: rgba(15, 23, 42, 0.62); }
#tab-profile.profile-dark-shell .profile-avatar-wrap { filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45)); }
#tab-profile.profile-dark-shell #profile-preview { border: 1px solid rgba(212, 175, 55, 0.72); box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.07), 0 8px 18px rgba(0, 0, 0, 0.42); }
#tab-profile.profile-dark-shell .profile-camera-button { border-color: #172033; background: #2563eb; box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35), 0 4px 10px rgba(0, 0, 0, 0.38); }
#tab-profile.profile-dark-shell .profile-camera-button:hover { background: #3b82f6; }
#tab-profile.profile-dark-shell .profile-hero-info { border-left-color: rgba(148, 163, 184, 0.16); }
#tab-profile.profile-dark-shell .profile-hero-info h2 { color: #f8fafc; }
#tab-profile.profile-dark-shell .profile-hero-info p { color: #94a3b8; }
#tab-profile.profile-dark-shell .profile-status-badge { border-color: rgba(212, 175, 55, 0.42); background: rgba(180, 145, 72, 0.12); color: #e6c878; }
#tab-profile.profile-dark-shell .profile-photo-button { border-color: rgba(96, 165, 250, 0.42); background: rgba(37, 99, 235, 0.08); color: #93c5fd; box-shadow: none; }
#tab-profile.profile-dark-shell .profile-photo-button:hover { background: rgba(37, 99, 235, 0.18); border-color: rgba(147, 197, 253, 0.7); }
#tab-profile.profile-dark-shell .profile-form-content { background: rgba(9, 13, 22, 0.38); }
#tab-profile.profile-dark-shell .profile-section-heading { border-color: rgba(71, 85, 105, 0.45); }
#tab-profile.profile-dark-shell .profile-section-heading h3 { color: #e2e8f0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.68rem; }
#tab-profile.profile-dark-shell .profile-section-icon { background: rgba(37, 99, 235, 0.14); color: #93c5fd; }
#tab-profile.profile-dark-shell .profile-section { box-shadow: none; }
#tab-profile.profile-dark-shell .profile-field > label { color: #aebaca; font-size: 0.65rem; letter-spacing: 0.12em; }
#tab-profile.profile-dark-shell .profile-input-wrap { border-color: rgba(71, 85, 105, 0.46); background: rgba(30, 41, 59, 0.76); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.24), 0 1px 0 rgba(255, 255, 255, 0.025); }
#tab-profile.profile-dark-shell .profile-input-wrap:focus-within { border-color: rgba(96, 165, 250, 0.78); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14), inset 0 2px 5px rgba(0, 0, 0, 0.24); }
#tab-profile.profile-dark-shell .profile-input-wrap > i,
#tab-profile.profile-dark-shell .profile-input-wrap button { color: #94a3b8; }
#tab-profile.profile-dark-shell .profile-input-wrap input { color: #e2e8f0; }
#tab-profile.profile-dark-shell .profile-input-wrap input::placeholder { color: #64748b; }
#tab-profile.profile-dark-shell .profile-input-wrap button:hover { color: #bfdbfe; }
#tab-profile.profile-dark-shell .profile-section + .profile-section { border-color: rgba(71, 85, 105, 0.48); }
#tab-profile.profile-dark-shell .profile-form-actions { border-color: rgba(71, 85, 105, 0.48); background: rgba(15, 23, 42, 0.68); }
#tab-profile.profile-dark-shell .profile-cancel-button { border: 1px solid rgba(148, 163, 184, 0.24); background: rgba(148, 163, 184, 0.08) !important; color: #cbd5e1 !important; box-shadow: none; }
#tab-profile.profile-dark-shell .profile-cancel-button:hover { background: rgba(148, 163, 184, 0.16) !important; color: #f8fafc !important; }
#tab-profile.profile-dark-shell .profile-save-button { border: 1px solid rgba(96, 165, 250, 0.52); background: rgba(37, 99, 235, 0.82) !important; color: #eff6ff; box-shadow: 0 0 18px rgba(37, 99, 235, 0.18); }
#tab-profile.profile-dark-shell .profile-save-button:hover { background: rgba(59, 130, 246, 0.92) !important; box-shadow: 0 0 24px rgba(59, 130, 246, 0.3); }

/* Shared thermal receipt print layout */
@page { size: 80mm auto; margin: 4mm; }

@media print {
    body * { visibility: hidden !important; }
    #thermal-receipt,
    #thermal-receipt * { visibility: visible !important; }
    #thermal-receipt {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 80mm !important;
        max-width: 80mm !important;
        min-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #111827 !important;
        display: block !important;
        overflow: visible !important;
        font-family: Arial, Helvetica, sans-serif !important;
    }
    #thermal-receipt .receipt-watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0.08; pointer-events: none; z-index: 0; }
    #thermal-receipt .receipt-watermark img { width: 70%; height: auto; }
    #thermal-receipt .receipt-content { position: relative; z-index: 1; padding: 4px 12px; }
    #thermal-receipt .receipt-header { display: flex; align-items: center; gap: 10px; margin-top: 4px; margin-bottom: 8px; }
    #thermal-receipt .receipt-header img { width: 36px; height: 36px; object-fit: contain; border-radius: 50%; border: 1px solid #111827; background: #ffffff; }
    #thermal-receipt .receipt-header h2 { margin: 0; font-size: 14px; line-height: 1.2; font-weight: 800; letter-spacing: 0.8px; color: #111827; }
    #thermal-receipt .receipt-header p { margin: 2px 0 0; font-size: 9px; color: #374151; }
    #thermal-receipt .receipt-rule { border-top: 2px solid #111827; margin: 8px 0 6px; }
    #thermal-receipt .receipt-date { margin: 0; font-size: 12px; color: #111827; text-align: center; font-weight: 700; }
    #thermal-receipt .receipt-number-block { text-align: center; padding-top: 8px; padding-bottom: 10px; }
    #thermal-receipt .receipt-number-block p { margin: 0; font-size: 10px; font-weight: 700; color: #111827; letter-spacing: 0.6px; }
    #thermal-receipt .receipt-number-block h1 { margin: 8px 0; font-size: 34px; line-height: 1; font-weight: 900; color: #111827; letter-spacing: 1px; }
    #thermal-receipt .receipt-number-block #print-loket { font-size: 14px; font-weight: 800; color: #111827; letter-spacing: 1.2px; }
    #thermal-receipt .receipt-details { font-size: 10px; line-height: 1.6; color: #111827; padding-top: 6px; }
    #thermal-receipt .receipt-details p { margin: 3px 0; }
    #thermal-receipt .receipt-footer { margin-top: 12px; text-align: center; font-size: 11px; color: #111827; font-weight: 600; }
    #thermal-receipt .receipt-footer p { margin: 4px 0; }
}

/* Integrated enterprise settings workspace */
#tab-profile.profile-dark-shell .profile-enterprise-shell { max-width: 72rem; }
#tab-profile.profile-dark-shell .profile-enterprise-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
#tab-profile.profile-dark-shell .profile-unified-container { gap: 0; align-items: stretch; overflow: hidden; min-height: 510px; border: 1px solid rgba(71, 85, 105, 0.58); border-radius: 12px; background: rgba(15, 23, 42, 0.72); box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255,255,255,0.035); }
#tab-profile.profile-dark-shell .profile-settings-nav { display: flex; min-height: 460px; flex-direction: column; border: 1px solid rgba(71, 85, 105, 0.5); border-radius: 14px; background: rgba(15, 23, 42, 0.72); padding: 14px; box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,0.035); backdrop-filter: blur(16px); }
#tab-profile.profile-dark-shell .profile-unified-container .profile-settings-nav { min-height: 0; height: 100%; border: 0; border-right: 1px solid #334155; border-radius: 0; background: rgba(15, 23, 42, 0.48); box-shadow: none; padding: 24px; }
#tab-profile.profile-dark-shell .profile-nav-brand { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(71, 85, 105, 0.45); padding: 4px 4px 14px; }
#tab-profile.profile-dark-shell .profile-nav-mark { display: inline-flex; height: 30px; width: 30px; align-items: center; justify-content: center; border: 1px solid rgba(212,175,55,0.35); border-radius: 9px; background: rgba(180,145,72,0.1); color: #d6b866; font-size: 0.72rem; }
#tab-profile.profile-dark-shell .profile-nav-brand p { color: #64748b; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; }
#tab-profile.profile-dark-shell .profile-nav-brand strong { display: block; margin-top: 2px; color: #e2e8f0; font-size: 0.75rem; }
#tab-profile.profile-dark-shell .profile-nav-group { padding-top: 22px; }
#tab-profile.profile-dark-shell .profile-nav-label { display: block; padding: 0 8px 8px; color: #64748b; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
#tab-profile.profile-dark-shell .profile-settings-tab { display: flex; min-height: 38px; width: 100%; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 9px 10px; color: #94a3b8; font-size: 0.72rem; text-align: left; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
#tab-profile.profile-dark-shell .profile-settings-tab:hover { border-color: rgba(71,85,105,0.5); background: rgba(51,65,85,0.28); color: #e2e8f0; }
#tab-profile.profile-dark-shell .profile-settings-tab.is-active { border-color: rgba(59,130,246,0.3); background: linear-gradient(90deg, rgba(37,99,235,0.24), rgba(30,41,59,0.2)); color: #dbeafe; box-shadow: inset 2px 0 0 #3b82f6, 0 6px 14px rgba(37,99,235,0.08); }
#tab-profile.profile-dark-shell .profile-settings-tab.is-active i { color: #60a5fa; }
#tab-profile.profile-dark-shell .profile-settings-tab i { width: 14px; color: #64748b; text-align: center; }
#tab-profile.profile-dark-shell .profile-nav-foot { display: flex; align-items: center; gap: 7px; margin-top: auto; border-top: 1px solid rgba(71,85,105,0.4); padding: 14px 4px 2px; color: #94a3b8; font-size: 0.65rem; }
#tab-profile.profile-dark-shell .profile-nav-foot small { margin-left: auto; color: #475569; font-family: ui-monospace, monospace; }
#tab-profile.profile-dark-shell .profile-live-dot { height: 6px; width: 6px; border-radius: 9999px; background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,0.7); }
#tab-profile.profile-dark-shell .profile-enterprise-card { min-width: 0; }
#tab-profile.profile-dark-shell .profile-unified-container .profile-enterprise-card { height: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#tab-profile.profile-dark-shell .profile-unified-container .profile-enterprise-card { display: flex; flex-direction: column; }
#tab-profile.profile-dark-shell .profile-enterprise-card .profile-hero-row { min-height: 78px; }
#tab-profile.profile-dark-shell .profile-enterprise-body { padding: 22px 24px 4px; }
#tab-profile.profile-dark-shell .profile-unified-container .profile-enterprise-body { flex: 1; }
#tab-profile.profile-dark-shell .profile-settings-panel { display: none; }
#tab-profile.profile-dark-shell .profile-settings-panel.is-visible { display: block; animation: profilePanelIn 180ms ease-out; }
@keyframes profilePanelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
#tab-profile.profile-dark-shell .profile-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; border-bottom: 1px solid rgba(71,85,105,0.45); padding-bottom: 15px; }
#tab-profile.profile-dark-shell .profile-panel-heading h3 { margin-top: 5px; color: #f1f5f9; font-size: 1rem; font-weight: 650; }
#tab-profile.profile-dark-shell .profile-panel-heading p { margin-top: 4px; color: #64748b; font-size: 0.72rem; }
#tab-profile.profile-dark-shell .profile-eyebrow { color: #d6b866; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
#tab-profile.profile-dark-shell .profile-panel-badge { display: inline-flex; flex-shrink: 0; align-items: center; gap: 6px; border: 1px solid rgba(52,211,153,0.24); border-radius: 9999px; background: rgba(16,185,129,0.08); padding: 5px 8px; color: #6ee7b7; font-size: 0.62rem; }
#tab-profile.profile-dark-shell .profile-metadata-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; border-top: 1px solid rgba(71,85,105,0.38); padding-top: 15px; }
#tab-profile.profile-dark-shell .profile-metadata-row div { border: 1px solid rgba(71,85,105,0.4); border-radius: 8px; background: rgba(30,41,59,0.42); padding: 9px 10px; }
#tab-profile.profile-dark-shell .profile-metadata-row span { display: block; color: #64748b; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; }
#tab-profile.profile-dark-shell .profile-metadata-row strong { display: block; margin-top: 4px; color: #cbd5e1; font-family: ui-monospace, monospace; font-size: 0.68rem; font-weight: 500; }
#tab-profile.profile-dark-shell .profile-session-list { display: grid; gap: 10px; }
#tab-profile.profile-dark-shell .profile-session-list > div { display: flex; align-items: center; gap: 11px; border: 1px solid rgba(71,85,105,0.42); border-radius: 9px; background: rgba(30,41,59,0.44); padding: 12px; }
#tab-profile.profile-dark-shell .profile-session-icon { display: inline-flex; height: 30px; width: 30px; align-items: center; justify-content: center; border-radius: 8px; background: rgba(37,99,235,0.12); color: #93c5fd; font-size: 0.7rem; }
#tab-profile.profile-dark-shell .profile-session-list strong { display: block; color: #e2e8f0; font-size: 0.72rem; }
#tab-profile.profile-dark-shell .profile-session-list small { display: block; margin-top: 3px; color: #64748b; font-size: 0.63rem; }
#tab-profile.profile-dark-shell .profile-session-list em { margin-left: auto; color: #6ee7b7; font-size: 0.62rem; font-style: normal; }
#tab-profile.profile-dark-shell .profile-form-actions { margin-top: 16px; }
#tab-profile.profile-dark-shell .profile-unified-container .profile-form-actions { margin-top: 16px; }

#page-app.profile-context { background: #0f172a; }
#page-app.profile-context .app-topbar,
#page-app.profile-context .app-footer { border-color: rgba(71, 85, 105, 0.48); background: #0f172a; color: #94a3b8; box-shadow: none; }
#page-app.profile-context .app-topbar #page-title { color: #f8fafc; }
#page-app.profile-context .app-topbar #top-user-name { color: #e2e8f0; }
#page-app.profile-context .app-topbar #top-user-role { color: #64748b; }
#page-app.profile-context .app-topbar .text-slate-600 { color: #cbd5e1; }
#page-app.profile-context .app-topbar .bg-sky-50 { border-color: rgba(96, 165, 250, 0.32); background: rgba(37, 99, 235, 0.12); color: #93c5fd; }
#page-app.profile-context .app-topbar .bg-sky-50:hover { background: rgba(37, 99, 235, 0.22); }
#page-app.profile-context .app-topbar .topbar-logout { border-color: rgba(251, 113, 133, 0.32); background: rgba(225, 29, 72, 0.1); color: #fda4af; }
#page-app.profile-context .app-topbar .topbar-logout:hover { background: rgba(225, 29, 72, 0.2); }
#page-app.profile-context .profile-breadcrumb { display: inline-flex; align-items: center; gap: 7px; color: #64748b; font-size: 0.68rem; white-space: nowrap; }
#page-app.profile-context .profile-breadcrumb i { color: #475569; font-size: 0.52rem; }
#page-app.profile-context .topbar-user-profile { position: relative; }
#page-app.profile-context .topbar-user-profile::after { position: absolute; top: 0; left: 25px; height: 8px; width: 8px; content: ''; border: 2px solid #0f172a; border-radius: 9999px; background: #34d399; box-shadow: 0 0 7px rgba(52,211,153,0.65); }

/* Unified dark dashboard */
#page-app:has(#tab-dashboard:not(.hidden)) { background: #0f172a; }
#page-app:has(#tab-dashboard:not(.hidden)) .app-shell-content { background: #0f172a; }
#page-app:has(#tab-dashboard:not(.hidden)) .app-topbar { border-color: #1e293b; background: rgba(15, 23, 42, 0.92); box-shadow: 0 1px 0 rgba(148,163,184,0.06); }
#page-app:has(#tab-dashboard:not(.hidden)) .app-topbar #page-title { color: #f8fafc; }
#page-app:has(#tab-dashboard:not(.hidden)) .app-topbar #top-user-name { color: #e2e8f0; }
#page-app:has(#tab-dashboard:not(.hidden)) .app-topbar #top-user-role { color: #64748b; }
#page-app:has(#tab-dashboard:not(.hidden)) .app-topbar .bg-sky-50 { border-color: rgba(96,165,250,0.3); background: rgba(37,99,235,0.1); color: #93c5fd; }
#page-app:has(#tab-dashboard:not(.hidden)) .app-topbar .topbar-logout { border-color: rgba(251,113,133,0.3); background: rgba(225,29,72,0.1); color: #fda4af; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard { background: #0f172a; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard > .grid:first-child > div[id^="card-loket-"] { border: 1px solid #334155; border-top: 2px solid #475569; border-radius: 12px; background: #1e293b; box-shadow: 0 8px 22px rgba(2,6,23,0.2); }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard > .grid:first-child > div[id^="card-loket-"]:hover { border-color: #475569; background: #243247; box-shadow: 0 12px 28px rgba(2,6,23,0.32); transform: translateY(-2px); }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard div[id^="card-loket-"] p { color: #94a3b8; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard div[id^="card-loket-"] h3 { color: #f8fafc; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: 0.02em; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard span[id^="badge-loket-"] { border: 1px solid rgba(245,158,11,0.25); background: rgba(120,53,15,0.24); color: #fbbf24; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard div[id^="card-loket-"] button:first-child { min-height: 38px; border: 1px solid rgba(96,165,250,0.32); border-radius: 8px; background: #2563eb; box-shadow: none; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard div[id^="card-loket-"] button:first-child:hover { background: #1d4ed8; box-shadow: 0 5px 14px rgba(37,99,235,0.24); }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard div[id^="card-loket-"] button:last-child { min-height: 32px; border: 1px solid #334155; border-radius: 8px; background: rgba(15,23,42,0.42); color: #94a3b8; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard div[id^="card-loket-"] button:last-child:hover { background: rgba(16,185,129,0.12); color: #6ee7b7; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .dashboard-metric { border: 1px solid #334155; border-radius: 12px; background: #1e293b; box-shadow: 0 8px 22px rgba(2,6,23,0.18); }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .dashboard-metric span { color: #94a3b8; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .dashboard-metric > div[id] { color: #f8fafc; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .dashboard-metric p { color: #64748b; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .dashboard-metric .bg-emerald-100 { border: 1px solid rgba(52,211,153,0.2); background: rgba(16,185,129,0.1); color: #6ee7b7; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard > div:last-child { border-color: #334155; border-radius: 12px; background: #1e293b; box-shadow: 0 12px 28px rgba(2,6,23,0.22); }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .queue-toolbar { border-color: #334155; background: #1e293b; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .queue-toolbar h2 { color: #f1f5f9; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .queue-toolbar p { color: #64748b; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .table-search { border-color: #334155; background: #0f172a; color: #94a3b8; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .table-search input { color: #e2e8f0; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .table-search input::placeholder { color: #64748b; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .queue-toolbar > div:last-child > div { border-color: #334155; background: #0f172a; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .queue-toolbar input[type="date"] { border-color: #334155; background: #1e293b; color: #cbd5e1; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .queue-toolbar label { color: #94a3b8; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .queue-toolbar button { border: 1px solid rgba(52,211,153,0.3); background: rgba(16,185,129,0.08); color: #6ee7b7; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard table { color: #cbd5e1; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard table thead { border-color: #334155; background: #0f172a; color: #94a3b8; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard table tbody tr { border-color: #334155; background: #1e293b; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard table tbody tr:nth-child(even) { background: #1b2638; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard table tbody tr:hover { background: #26364b; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard table tbody td { color: #cbd5e1; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .table-pagination { border-color: #334155; color: #64748b; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .table-page-button { border-color: #334155; background: #1e293b; color: #94a3b8; }
#page-app:has(#tab-dashboard:not(.hidden)) #tab-dashboard .table-page-button:hover:not(:disabled) { border-color: #60a5fa; background: #243b5a; color: #bfdbfe; }
#page-app:has(#tab-dashboard:not(.hidden)) .app-footer { border-color: #1e293b; background: #0f172a; color: #64748b; box-shadow: none; }
#page-app:has(#tab-dashboard:not(.hidden)) #sidebar { border-color: #1e293b; background: #0b1220; box-shadow: none; }
#page-app:has(#tab-dashboard:not(.hidden))::-webkit-scrollbar-track { background: #0f172a; }
#page-app:has(#tab-dashboard:not(.hidden))::-webkit-scrollbar-thumb { background: #334155; border-radius: 999px; }
#page-app:has(#tab-dashboard:not(.hidden))::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Complete dark queue list context */
#page-app.queue-context { background: #0f172a; }
#page-app.queue-context .app-shell-content { background: #0f172a; }
#page-app.queue-context .app-topbar { border-color: #1e293b; background: rgba(15,23,42,0.94); box-shadow: 0 1px 0 rgba(148,163,184,0.06); }
#page-app.queue-context .app-topbar #page-title { color: #f8fafc; }
#page-app.queue-context .app-topbar #top-user-name { color: #e2e8f0; }
#page-app.queue-context .app-topbar #top-user-role { color: #64748b; }
#page-app.queue-context .app-topbar .bg-sky-50 { border-color: rgba(96,165,250,0.3); background: rgba(37,99,235,0.1); color: #93c5fd; }
#page-app.queue-context .app-topbar .topbar-logout { border-color: rgba(251,113,133,0.3); background: rgba(225,29,72,0.1); color: #fda4af; }
#page-app.queue-context #sidebar { border-color: #1e293b; background: #0b1220; box-shadow: none; }
#page-app.queue-context #tab-antrian { background: #0f172a; }
#page-app.queue-context #tab-antrian > div { border-color: #334155; border-radius: 12px; background: #1e293b; box-shadow: 0 16px 32px rgba(2,6,23,0.24); }
#page-app.queue-context #tab-antrian .queue-toolbar { border-color: #334155; background: #1e293b; }
#page-app.queue-context #tab-antrian .queue-toolbar h2 { display: none; }
#page-app.queue-context #tab-antrian .queue-toolbar .queue-context-label { color: #f1f5f9; font-size: 1rem; font-weight: 700; }
#page-app.queue-context #tab-antrian .queue-toolbar p:not(.queue-context-label) { margin-top: 3px; color: #64748b; }
#page-app.queue-context #tab-antrian .table-search { border-color: #334155; background: #0f172a; color: #94a3b8; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
#page-app.queue-context #tab-antrian .table-search input { color: #e2e8f0; }
#page-app.queue-context #tab-antrian .table-search input::placeholder { color: #64748b; }
#page-app.queue-context #tab-antrian .queue-toolbar > div:last-child > div { border-color: #334155; background: #0f172a; }
#page-app.queue-context #tab-antrian .queue-toolbar input[type="date"] { border-color: #334155; background: #1e293b; color: #cbd5e1; }
#page-app.queue-context #tab-antrian .queue-toolbar label { color: #94a3b8; }
#page-app.queue-context #tab-antrian table { color: #cbd5e1; }
#page-app.queue-context #tab-antrian table thead { border-color: #334155; background: #0f172a; color: #94a3b8; }
#page-app.queue-context #tab-antrian table tbody tr { border-color: #334155; background: #1e293b; }
#page-app.queue-context #tab-antrian table tbody tr:nth-child(even) { background: #1b2638; }
#page-app.queue-context #tab-antrian table tbody tr:hover { background: #26364b; }
#page-app.queue-context #tab-antrian table tbody td { color: #cbd5e1; }
#page-app.queue-context #tab-antrian .table-pagination { border-color: #334155; color: #64748b; }
#page-app.queue-context #tab-antrian .table-page-button { border-color: #334155; background: #1e293b; color: #94a3b8; }
#page-app.queue-context #tab-antrian .table-page-button:hover:not(:disabled) { border-color: #60a5fa; background: #243b5a; color: #bfdbfe; }
#page-app.queue-context #tab-antrian .queue-status-called { border-color: rgba(245,158,11,0.34); background: rgba(120,53,15,0.25); color: #fbbf24; }
#page-app.queue-context #tab-antrian .queue-status-complete { border-color: rgba(52,211,153,0.3); background: rgba(6,78,59,0.38); color: #6ee7b7; }
#page-app.queue-context #tab-antrian span.bg-amber-100 { border: 1px solid rgba(245,158,11,0.34); background: rgba(120,53,15,0.25); color: #fbbf24; }
#page-app.queue-context #tab-antrian span.bg-emerald-100 { border: 1px solid rgba(52,211,153,0.3); background: rgba(6,78,59,0.38); color: #6ee7b7; }
#page-app.queue-context #tab-antrian span.queue-status-waiting { border: 1px solid rgba(148,163,184,0.28); background: rgba(51,65,85,0.32); color: #cbd5e1; }
#page-app.queue-context #tab-antrian .table-action-button { border-color: transparent; background: transparent; color: #fb7185; }
#page-app.queue-context #tab-antrian .table-action-button:hover { border-color: rgba(251,113,133,0.25); background: rgba(225,29,72,0.12); color: #fda4af; }
#page-app.queue-context .app-footer { border-color: #1e293b; background: #0f172a; color: #64748b; box-shadow: none; }

/* Dark user management context */
#page-app.users-context { background: #0f172a; }
#page-app.users-context .app-shell-content { background: #0f172a; }
#page-app.users-context .app-topbar { border-color: #1e293b; background: rgba(15,23,42,0.94); box-shadow: 0 1px 0 rgba(148,163,184,0.06); }
#page-app.users-context .app-topbar #page-title { width: 0; overflow: hidden; opacity: 0; }
#page-app.users-context .app-topbar #top-user-name { color: #e2e8f0; }
#page-app.users-context .app-topbar #top-user-role { color: #64748b; }
#page-app.users-context .app-topbar .bg-sky-50 { border-color: rgba(96,165,250,0.3); background: rgba(37,99,235,0.1); color: #93c5fd; }
#page-app.users-context .app-topbar .topbar-logout { border-color: rgba(251,113,133,0.3); background: rgba(225,29,72,0.1); color: #fda4af; }
#page-app.users-context #sidebar { border-color: #1e293b; background: #0b1220; box-shadow: none; }
#page-app.users-context #tab-users { background: #0f172a; }
#page-app.users-context #tab-users .user-metric-card { border-color: #334155; border-radius: 12px; background: #1e293b; box-shadow: 0 10px 26px rgba(2,6,23,0.2); }
#page-app.users-context #tab-users .user-metric-card p { color: #94a3b8; }
#page-app.users-context #tab-users .user-metric-card strong { color: #f8fafc; }
#page-app.users-context #tab-users .user-metric-icon-blue { background: rgba(37,99,235,0.14); color: #60a5fa; }
#page-app.users-context #tab-users .user-metric-icon-emerald { background: rgba(16,185,129,0.12); color: #34d399; }
#page-app.users-context #tab-users .user-metric-icon-indigo { background: rgba(99,102,241,0.14); color: #a5b4fc; }
#page-app.users-context #tab-users .user-live-label { color: #6ee7b7; }
#page-app.users-context #tab-users .user-live-label i { text-shadow: 0 0 8px rgba(52,211,153,0.75); }
#page-app.users-context #tab-users > .user-management-shell > div:last-child { border-color: #334155; border-radius: 12px; background: #1e293b; box-shadow: 0 16px 34px rgba(2,6,23,0.24); }
#page-app.users-context #tab-users .user-management-header { border-color: #334155; background: #1e293b; }
#page-app.users-context #tab-users .user-management-header h2 { color: #f1f5f9; }
#page-app.users-context #tab-users .user-management-header p { color: #64748b; }
#page-app.users-context #tab-users .user-primary-button { min-height: 38px; border: 1px solid rgba(96,165,250,0.34); border-radius: 9px; background: #2563eb; box-shadow: 0 6px 14px rgba(37,99,235,0.18); }
#page-app.users-context #tab-users .user-primary-button:hover { background: #1d4ed8; box-shadow: 0 8px 18px rgba(37,99,235,0.26); }
#page-app.users-context #tab-users .user-filter-toolbar { border-color: #334155; background: #172235; }
#page-app.users-context #tab-users .user-search { border-color: #334155; background: #0f172a; color: #94a3b8; box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); }
#page-app.users-context #tab-users .user-search input { color: #e2e8f0; }
#page-app.users-context #tab-users .user-search input::placeholder { color: #64748b; }
#page-app.users-context #tab-users .user-filter-select { border-color: #334155; background: #0f172a; color: #cbd5e1; }
#page-app.users-context #tab-users .user-management-table { color: #cbd5e1; }
#page-app.users-context #tab-users .user-management-table thead { border-color: #334155; background: #0f172a; color: #94a3b8; }
#page-app.users-context #tab-users .user-management-table tbody tr { border-color: #334155; background: #1e293b; }
#page-app.users-context #tab-users .user-management-table tbody tr:nth-child(even) { background: #1b2638; }
#page-app.users-context #tab-users .user-management-table tbody tr:hover { background: #26364b; }
#page-app.users-context #tab-users .user-identity strong { color: #f1f5f9; }
#page-app.users-context #tab-users .user-identity span { color: #64748b; }
#page-app.users-context #tab-users .user-nip { border-color: #334155; background: rgba(15,23,42,0.62); color: #cbd5e1; }
#page-app.users-context #tab-users .user-role-admin { border-color: rgba(96,165,250,0.3); background: rgba(30,64,175,0.24); color: #60a5fa; }
#page-app.users-context #tab-users .user-role-operator { border-color: rgba(56,189,248,0.3); background: rgba(7,89,133,0.24); color: #7dd3fc; }
#page-app.users-context #tab-users .user-desk-cell { color: #94a3b8; }
#page-app.users-context #tab-users .user-status-active { border-color: rgba(52,211,153,0.3); background: rgba(6,78,59,0.34); color: #6ee7b7; }
#page-app.users-context #tab-users .user-status-inactive { border-color: #334155; background: rgba(51,65,85,0.32); color: #94a3b8; }
#page-app.users-context #tab-users .user-edit-button,
#page-app.users-context #tab-users .user-action-menu summary { border-color: #334155; background: rgba(51,65,85,0.34); color: #94a3b8; }
#page-app.users-context #tab-users .user-edit-button:hover,
#page-app.users-context #tab-users .user-action-menu summary:hover { border-color: #64748b; background: #334155; color: #e2e8f0; }
#page-app.users-context #tab-users .user-action-popover { border-color: #334155; background: #1e293b; box-shadow: 0 16px 30px rgba(0,0,0,0.35); }
#page-app.users-context #tab-users .user-action-popover button { color: #cbd5e1; }
#page-app.users-context #tab-users .user-action-popover button:hover { background: #334155; color: #f8fafc; }
#page-app.users-context #tab-users .user-action-popover .user-menu-danger:hover { background: rgba(225,29,72,0.14); color: #fda4af; }
#page-app.users-context #tab-users .user-table-empty { color: #64748b; }
#page-app.users-context .app-footer { border-color: #1e293b; background: #0f172a; color: #64748b; box-shadow: none; }

@media (max-width: 760px) {
    #page-app.profile-context .profile-breadcrumb { display: none; }
}

@media (max-width: 800px) {
    #tab-profile.profile-dark-shell .profile-enterprise-layout { grid-template-columns: 1fr; }
    #tab-profile.profile-dark-shell .profile-unified-container { min-height: 0; }
    #tab-profile.profile-dark-shell .profile-settings-nav { min-height: auto; }
    #tab-profile.profile-dark-shell .profile-unified-container .profile-settings-nav { height: auto; border-right: 0; border-bottom: 1px solid #334155; padding: 16px; }
    #tab-profile.profile-dark-shell .profile-unified-container .profile-enterprise-card { height: auto; }
    #tab-profile.profile-dark-shell .profile-nav-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding-top: 14px; }
    #tab-profile.profile-dark-shell .profile-nav-label { grid-column: 1 / -1; }
    #tab-profile.profile-dark-shell .profile-nav-foot { display: none; }
}

@media (max-width: 560px) {
    #tab-profile.profile-dark-shell .profile-enterprise-body { padding: 18px 16px 2px; }
    #tab-profile.profile-dark-shell .profile-hero-info { gap: 7px; }
    #tab-profile.profile-dark-shell .profile-hero-info p { max-width: 155px; }
    #tab-profile.profile-dark-shell .profile-panel-heading { flex-direction: column; }
    #tab-profile.profile-dark-shell .profile-metadata-row { grid-template-columns: 1fr; }
    #tab-profile.profile-dark-shell .profile-settings-tab { justify-content: center; padding: 8px 5px; font-size: 0.62rem; }
    #tab-profile.profile-dark-shell .profile-settings-tab i { display: none; }
}

@media (max-width: 640px) {
    #tab-profile .profile-identity { align-items: flex-start; }
    #tab-profile .profile-avatar-wrap { margin-top: 0; }
    #tab-profile .profile-photo-actions { padding-top: 0.25rem; }
}

#page-app button:not(.password-toggle) {
    min-height: 44px;
}

@media (max-width: 1023px) {
    #sidebar {
        box-shadow: 18px 0 40px rgba(2, 6, 23, 0.3);
    }
}

@media (max-width: 1023px) {
    #page-app .app-topbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.625rem;
        min-height: 0;
        height: auto !important;
        padding: 0.75rem 1rem;
    }

    #page-app .app-topbar > div:first-child,
    #page-app .app-topbar > div:last-child {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    #page-app .app-topbar > div:first-child {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.625rem;
    }

    #page-app .app-topbar > div:first-child > div {
        min-width: 0;
        flex: 1 1 auto;
    }

    #page-app .app-topbar > div:first-child > div h1 {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        overflow: visible !important;
    }

    #page-app .app-topbar .topbar-user-profile {
        min-width: 2.5rem;
        flex: 0 0 auto;
    }

    #page-app .app-topbar > div:last-child > button {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        width: auto;
        min-width: 2.75rem;
        min-height: 2.75rem;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child > .topbar-logout {
        width: 2.75rem;
        min-width: 2.75rem;
    }
}

@media (max-width: 639px) {
    #page-app .app-topbar {
        padding: 0.625rem 0.75rem;
    }

    #page-app .app-topbar > div:last-child {
        justify-content: space-between;
    }

    #page-app .app-topbar > div:last-child > .topbar-user-profile {
        margin-right: auto;
    }

    #page-app .app-topbar > div:last-child > button:not(.topbar-logout) {
        width: 2.75rem;
        padding: 0;
    }

    #page-app .app-topbar > div:last-child > button:not(.topbar-logout) span {
        display: none;
    }

    #tab-dashboard,
    #tab-antrian,
    #tab-users,
    #tab-profile {
        padding: 0.75rem;
    }

    #tab-dashboard > .grid:first-child,
    #tab-dashboard > .grid:nth-of-type(2) {
        gap: 0.75rem;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] {
        border-radius: 1.125rem;
        padding: 1rem;
    }
}

/* Mobile and tablet product layout */
@media (max-width: 1023px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-x: none;
    }

    #page-app,
    #page-app.app-shell,
    #page-app .app-shell-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 100dvh;
        overflow: visible !important;
    }

    #page-app .app-shell-content {
        display: flex !important;
        flex: 1 1 auto;
    }

    #page-app .app-topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0;
        gap: 0.625rem;
        padding: 0.75rem 1rem;
        overflow: visible !important;
    }

    #page-app .app-topbar > div:first-child,
    #page-app .app-topbar > div:last-child {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    #page-app .app-topbar > div:first-child {
        display: flex;
        align-items: center;
        gap: 0.625rem;
    }

    #page-app .app-topbar > div:first-child > button {
        width: 2.75rem;
        height: 2.75rem;
        flex: 0 0 2.75rem;
    }

    #page-app .app-topbar > div:first-child > div {
        min-width: 0;
        flex: 1 1 auto;
    }

    #page-app .app-topbar #page-title {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        overflow: visible !important;
    }

    #page-app .app-topbar .topbar-user-profile {
        min-width: 2.5rem;
        flex: 0 0 auto;
        margin-right: auto;
    }

    #page-app .app-topbar > div:last-child > button {
        display: inline-flex !important;
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
        min-height: 2.75rem;
        flex: 0 0 2.75rem !important;
        align-items: center;
        justify-content: center;
        padding: 0;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child > button span {
        display: none;
    }

    #page-app .app-topbar > div:last-child > .topbar-logout {
        width: 2.75rem;
        min-width: 2.75rem;
    }

    #page-app .tab-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: visible;
    }

    #tab-dashboard,
    #tab-antrian,
    #tab-users,
    #tab-profile {
        padding: 1rem;
    }

    #tab-dashboard > .grid:first-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.875rem;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] {
        min-width: 0;
        min-height: 176px;
        padding: 1rem;
        border-radius: 1rem;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] h3 {
        font-size: clamp(1.65rem, 4vw, 2rem);
    }

    #tab-dashboard > .grid:nth-of-type(2) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.875rem;
    }

    #tab-dashboard .dashboard-metric {
        min-width: 0;
        min-height: 118px;
        padding: 1rem;
        border-radius: 1rem;
    }

    #tab-dashboard .dashboard-metric span,
    #tab-dashboard .dashboard-metric p {
        overflow-wrap: anywhere;
    }

    #tab-dashboard .queue-toolbar,
    #tab-antrian .queue-toolbar {
        align-items: stretch;
        padding: 1rem;
    }

    #tab-dashboard .queue-toolbar > div,
    #tab-antrian .queue-toolbar > div {
        min-width: 0;
        max-width: 100%;
    }

    #tab-dashboard .queue-toolbar > div:last-child,
    #tab-antrian .queue-toolbar > div:last-child {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.625rem;
    }

    #tab-dashboard .queue-toolbar .table-search,
    #tab-antrian .queue-toolbar .table-search {
        width: 100%;
        min-width: 0;
    }

    #tab-dashboard .queue-toolbar > div:last-child > div,
    #tab-antrian .queue-toolbar > div:last-child > div {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem;
    }

    #tab-dashboard .queue-toolbar input[type="date"],
    #tab-antrian .queue-toolbar input[type="date"] {
        flex: 1 1 9rem;
        min-width: 9rem;
        max-width: 100%;
        min-height: 40px;
    }

    #tab-dashboard .queue-toolbar button,
    #tab-antrian .queue-toolbar button {
        min-height: 40px;
        flex: 0 1 auto;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        width: 100%;
        min-width: 0;
        min-height: 0;
        max-height: none !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    #tab-dashboard table,
    #tab-antrian table {
        width: max-content;
        min-width: 760px;
    }

    #tab-users .overflow-x-auto {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #tab-users .user-management-table {
        min-width: 760px;
    }

    #page-app .app-footer {
        position: static !important;
    }
}

@media (max-width: 639px) {
    #page-app .app-topbar {
        padding: 0.625rem 0.75rem;
    }

    #tab-dashboard,
    #tab-antrian,
    #tab-users,
    #tab-profile {
        padding: 0.75rem;
    }

    #tab-dashboard > .grid:first-child,
    #tab-dashboard > .grid:nth-of-type(2) {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] {
        min-height: 164px;
    }

    #tab-dashboard .queue-toolbar,
    #tab-antrian .queue-toolbar {
        padding: 0.875rem;
    }

    #tab-dashboard .queue-toolbar > div:last-child > div,
    #tab-antrian .queue-toolbar > div:last-child > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    #tab-dashboard .queue-toolbar input[type="date"],
    #tab-antrian .queue-toolbar input[type="date"] {
        min-width: 0;
        grid-column: 1;
    }

    #tab-dashboard .queue-toolbar button,
    #tab-antrian .queue-toolbar button {
        grid-column: 2;
    }

    #tab-dashboard .queue-toolbar #reset-antrian-btn {
        grid-column: 1 / -1;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    #tab-dashboard,
    #tab-antrian,
    #tab-users,
    #tab-profile {
        padding: 1rem;
    }

    #tab-dashboard > .grid:first-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.875rem;
    }

    #tab-dashboard .dashboard-metric {
        min-height: 118px;
        padding: 1rem;
    }

    #tab-dashboard .queue-toolbar,
    #tab-antrian .queue-toolbar {
        padding: 1rem 1.125rem;
    }
}

@media (max-width: 639px) {
    #page-app {
        background: #f8fafc;
    }

    #page-app .app-shell-content {
        background: #f8fafc;
    }

    #page-app .app-topbar {
        min-height: 64px;
        padding: 0.625rem 0.75rem;
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    }

    #page-app .app-topbar > div:first-child {
        gap: 0.5rem;
    }

    #page-app .app-topbar > div:first-child > button {
        width: 2.75rem;
        height: 2.75rem;
        flex: 0 0 2.75rem;
    }

    #page-app .app-topbar > div:last-child {
        gap: 0.375rem;
    }

    #page-app .app-topbar > div:last-child > button {
        min-height: 40px;
        padding-left: 0.625rem;
        padding-right: 0.625rem;
    }

    #tab-dashboard,
    #tab-antrian,
    #tab-users,
    #tab-profile {
        padding: 0.75rem;
    }

    #tab-dashboard > .grid:first-child {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] {
        min-height: 172px;
        padding: 1rem;
        border-radius: 1rem;
    }

    #tab-dashboard .grid > div[id^="card-loket-"] h3 {
        font-size: 1.75rem;
    }

    #tab-dashboard > .grid:nth-of-type(2) {
        gap: 0.75rem;
    }

    #tab-dashboard .dashboard-metric {
        min-height: 104px;
        padding: 0.875rem 1rem;
        border-radius: 1rem;
    }

    #tab-dashboard .dashboard-metric > div:last-of-type {
        font-size: 1.75rem;
    }

    #tab-dashboard .queue-toolbar,
    #tab-antrian .queue-toolbar {
        gap: 0.75rem;
        padding: 1rem;
    }

    #tab-dashboard .queue-toolbar h2,
    #tab-antrian .queue-toolbar h2 {
        font-size: 1rem;
        line-height: 1.35;
    }

    #tab-dashboard .queue-toolbar > div:last-child,
    #tab-antrian .queue-toolbar > div:last-child {
        gap: 0.625rem;
    }

    #tab-dashboard .queue-toolbar > div:last-child > div,
    #tab-antrian .queue-toolbar > div:last-child > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem;
    }

    #tab-dashboard .queue-toolbar input[type="date"],
    #tab-antrian .queue-toolbar input[type="date"] {
        width: 100%;
        min-height: 38px;
    }

    #tab-dashboard .queue-toolbar button,
    #tab-antrian .queue-toolbar button {
        min-height: 38px;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        border-top: 1px solid rgba(226, 232, 240, 0.8);
        scrollbar-width: thin;
    }

    #tab-dashboard table,
    #tab-antrian table {
        min-width: 720px;
    }
}

@media (max-width: 1023px) {
    #page-app,
    #page-app.app-shell,
    #page-app .app-shell-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    #page-app .tab-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    #tab-dashboard,
    #tab-antrian {
        overflow: visible;
    }

    #tab-dashboard .queue-toolbar,
    #tab-antrian .queue-toolbar {
        align-items: stretch;
    }

    #tab-dashboard .queue-toolbar > div,
    #tab-antrian .queue-toolbar > div {
        min-width: 0;
        max-width: 100%;
    }

    #tab-dashboard .queue-toolbar > div:last-child,
    #tab-antrian .queue-toolbar > div:last-child {
        width: 100%;
    }

    #tab-dashboard .queue-toolbar > div:last-child > div,
    #tab-antrian .queue-toolbar > div:last-child > div {
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
    }

    #tab-dashboard .queue-toolbar input[type="date"],
    #tab-antrian .queue-toolbar input[type="date"] {
        min-width: 0;
        flex: 1 1 10rem;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        min-height: 0;
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
        overscroll-behavior-x: contain;
        overscroll-behavior-y: auto;
    }

    #tab-dashboard table,
    #tab-antrian table {
        width: max-content;
        min-width: 760px;
    }

    #page-app .app-footer {
        position: static;
    }
}

@media (max-width: 639px) {
    #tab-dashboard,
    #tab-antrian,
    #tab-users,
    #tab-profile {
        padding: 0.75rem;
    }

    #tab-dashboard .queue-toolbar,
    #tab-antrian .queue-toolbar {
        padding: 1rem;
    }

    #tab-dashboard .queue-toolbar > div:last-child > div,
    #tab-antrian .queue-toolbar > div:last-child > div {
        align-items: stretch;
        gap: 0.5rem;
    }

    #tab-dashboard .queue-toolbar > div:last-child > div > *,
    #tab-antrian .queue-toolbar > div:last-child > div > * {
        max-width: 100%;
    }

    #tab-dashboard .queue-toolbar button,
    #tab-antrian .queue-toolbar button {
        flex: 1 1 auto;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 1023px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    #page-app,
    #page-app.app-shell,
    #page-app .app-shell-content {
        display: flex;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: auto !important;
        min-height: 100dvh;
        overflow: visible !important;
    }

    #page-app .app-shell-content {
        flex: 1 1 auto;
    }

    #page-app .app-topbar {
        position: sticky;
        inset-inline: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    #page-app .app-topbar > div:first-child {
        width: auto;
        max-width: 100%;
        flex: 1 1 auto;
        justify-content: flex-start;
        margin: 0;
    }

    #page-app .app-topbar > div:first-child > div {
        min-width: 0;
        max-width: 100%;
    }

    #page-app .app-topbar #page-title {
        max-width: calc(100vw - 5rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child {
        width: auto;
        max-width: 100%;
        flex: 0 1 auto;
        justify-content: flex-end;
        margin-left: auto;
    }

    #page-app #sidebar {
        left: 0;
        right: auto;
        margin: 0;
        transform: translateX(-100%);
    }

    #page-app #sidebar:not(.-translate-x-full) {
        transform: translateX(0);
    }

    #page-app #sidebar-overlay {
        width: 100vw;
        max-width: 100vw;
    }
}

@media (max-width: 960px) {
    #page-app .app-topbar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    #page-app .app-topbar > div {
        min-width: 0;
        max-width: 100%;
    }

    #page-app .app-topbar > div:last-child {
        overflow: hidden;
    }

    .app-topbar {
        gap: 0.75rem;
        height: auto;
        min-height: 72px;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .app-topbar > div:first-child {
        min-width: 0;
        flex: 1 1 auto;
    }

    .topbar-user-profile {
        min-width: 0;
        max-width: 100%;
    }

    #top-user-name {
        max-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #tab-dashboard .grid,
    #tab-antrian .grid,
    #tab-users .user-metric-grid,
    .kiosk-dashboard-purpose-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    body.sidebar-open {
        overflow: hidden;
    }

    #sidebar-overlay {
        cursor: pointer;
    }

    #sidebar {
        max-width: min(86vw, 18rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .app-shell {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .app-topbar {
        flex-wrap: wrap;
    }

    .app-topbar > div:last-child {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #page-title {
        max-width: 180px;
    }

    #tab-dashboard .grid > div[id^="card-loket-"],
    #tab-dashboard .dashboard-metric,
    #tab-users .user-metric-card {
        width: 100%;
    }

    #tab-users .user-management-header {
        align-items: flex-start;
    }

    #tab-users .user-management-header > div:first-child {
        max-width: 100%;
    }

    .kiosk-dashboard-desk-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kiosk-dashboard-purpose-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .tab-content {
        padding: 1rem;
    }

    .app-topbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .app-topbar > div:last-child {
        justify-content: space-between;
    }

    .app-topbar .space-x-4 > * {
        margin-left: 0;
    }

    .table-pagination {
        align-items: stretch;
    }

    #page-title {
        max-width: 150px;
        font-size: 0.95rem;
    }

    .topbar-user-profile {
        flex: 1 1 auto;
        min-width: 0;
    }

    #top-user-name {
        max-width: 100px;
    }

    #top-user-role {
        display: none;
    }

    .kiosk-dashboard-desk-grid,
    #tab-dashboard .grid,
    #tab-users .user-metric-grid,
    #tab-dashboard .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .kiosk-dashboard-header .flex {
        align-items: flex-start;
    }

    .kiosk-dashboard-header .flex > div:first-child {
        width: 100%;
    }

    .kiosk-dashboard-input,
    #tab-kios select.kiosk-hidden-select {
        min-height: 52px;
        font-size: 1rem;
    }

    .kiosk-dashboard-desk,
    .kiosk-dashboard-purpose {
        min-height: 72px;
    }

    .kiosk-dashboard-cta {
        min-height: 56px;
    }

    #tab-users .user-search,
    #tab-users .user-filter-select,
    #tab-users .user-primary-button,
    #tab-dashboard .table-search,
    #tab-dashboard input[type="date"],
    #tab-antrian .table-search,
    #tab-antrian input[type="date"] {
        min-height: 46px;
        font-size: 0.95rem;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        max-height: 58vh;
    }
}

@media (max-width: 480px) {
    .tab-content {
        padding: 0.75rem;
    }

    .app-topbar {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .app-topbar > div:last-child > button,
    .app-topbar > div:last-child > .topbar-user-profile {
        flex: 1 1 auto;
    }

    .app-topbar > div:last-child > button[onclick*="window.open"],
    .app-topbar > div:last-child > button[onclick*="openOperatorHelpModal"] {
        min-width: 0;
        flex: 1 1 42%;
    }

    .app-topbar > div:last-child > .topbar-logout {
        width: 42px;
        min-width: 42px;
        flex: 0 0 auto;
    }

    #page-title {
        max-width: 130px;
    }

    #tab-dashboard .table-search,
    #tab-antrian .table-search {
        width: 100%;
    }

    #tab-dashboard .queue-toolbar > div:last-child,
    #tab-antrian .queue-toolbar > div:last-child {
        width: 100%;
    }

    #tab-dashboard .queue-toolbar > div:last-child > div,
    #tab-antrian .queue-toolbar > div:last-child > div {
        flex-wrap: wrap;
        width: 100%;
    }
}

#tab-kios {
    background: radial-gradient(circle at 15% 10%, rgba(6, 182, 212, 0.08), transparent 30%), #0b1220;
}

.kiosk-dashboard-card {
    background: rgba(15, 23, 42, 0.86);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.3);
}

.kiosk-dashboard-header {
    background: linear-gradient(120deg, #090d16, #0f1b2d 55%, #0b2533);
}

.kiosk-dashboard-input,
#tab-kios select.kiosk-hidden-select {
    min-height: 60px;
    background: #1e293b;
    color: #f8fafc;
}

.kiosk-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.kiosk-dashboard-desk-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.kiosk-dashboard-purpose-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.kiosk-dashboard-desk,
.kiosk-dashboard-purpose {
    display: grid;
    min-height: 82px;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 0.875rem;
    background: rgba(30, 41, 59, 0.68);
    padding: 10px;
    text-align: left;
    color: #cbd5e1;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.kiosk-dashboard-purpose {
    width: 100%;
}

.kiosk-dashboard-desk i,
.kiosk-dashboard-purpose i {
    display: inline-flex;
    height: 34px;
    width: 34px;
    grid-row: span 2;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    background: rgba(6, 182, 212, 0.12);
    color: #67e8f9;
}

.kiosk-dashboard-desk span,
.kiosk-dashboard-purpose span {
    align-self: end;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.kiosk-dashboard-desk small {
    align-self: start;
    color: #94a3b8;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kiosk-dashboard-desk:hover,
.kiosk-dashboard-desk.is-selected,
.kiosk-dashboard-purpose:hover,
.kiosk-dashboard-purpose.is-selected {
    transform: translateY(-2px);
    border-color: #22d3ee;
    background: rgba(8, 145, 178, 0.22);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1), 0 10px 20px rgba(2, 6, 23, 0.22);
}

.dashboard-kiosk-camera {
    background: rgba(9, 13, 22, 0.94);
    align-self: start !important;
    height: 100% !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
}

#dashboard-kiosk-camera > div:last-child {
    margin-top: auto !important;
}

#form-checkin .kiosk-dashboard-cta {
    display: flex !important;
    grid-column: 2;
    justify-self: end;
    width: min(100%, 380px) !important;
    margin-right: 1rem;
}

@media (max-width: 639px) {
    #form-checkin .kiosk-dashboard-cta {
        margin-right: 0;
    }
}

#dashboard-kiosk-camera .dashboard-scanner-frame {
    flex: none !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

#dashboard-kiosk-camera .dashboard-camera-header,
#kiosk-camera-panel > div > div:first-child {
    min-height: 38px;
    align-items: center;
}

#dashboard-kiosk-camera #camera-badge,
#kiosk-camera-panel #camera-badge {
    min-width: 76px;
    min-height: 24px;
    justify-content: center;
    line-height: 1;
    letter-spacing: 0.04em;
    text-align: center;
}

.dashboard-scanner-frame {
    background: radial-gradient(circle at center, rgba(8, 145, 178, 0.12), transparent 54%), #090d16;
}

.dashboard-scanner-frame::before,
.scanner-frame::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(52, 211, 153, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px);
    background-size: 100% 32px, 48px 100%;
    content: '';
    opacity: 0.3;
    pointer-events: none;
}

.dashboard-scanner-frame > #webcam,
.scanner-frame > #webcam {
    position: relative;
    z-index: 2;
}

.dashboard-scanner-frame > #cam-overlay,
.scanner-frame > #cam-overlay {
    z-index: 3;
}

#kiosk-camera-panel #cam-placeholder {
    position: relative;
    z-index: 3;
}

.dashboard-kiosk-camera.scanner-active .dashboard-scanner-frame::before,
.kiosk-camera-panel.scanner-active .scanner-frame::before {
    opacity: 0.08;
}

.dashboard-scanner-ring {
    position: absolute;
    height: 190px;
    width: 190px;
    border: 1px solid rgba(103, 232, 249, 0.65);
    border-radius: 50%;
    box-shadow: 0 0 0 12px rgba(34, 211, 238, 0.04), 0 0 26px rgba(34, 211, 238, 0.22);
    pointer-events: none;
}

.dashboard-scanner-ring::before {
    position: absolute;
    inset: 16px;
    border: 1px dashed rgba(52, 211, 153, 0.75);
    border-radius: 50%;
    content: '';
    animation: dashboardScannerSpin 7s linear infinite;
}

.dashboard-scanner-ring::after {
    position: absolute;
    inset: 38px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 50%;
    content: '';
    animation: dashboardScannerSpin 5s linear infinite reverse;
}

@keyframes dashboardScannerSpin {
    to { transform: rotate(360deg); }
}

.dashboard-scanner-line {
    position: absolute;
    left: 18%;
    right: 18%;
    top: 50%;
    height: 2px;
    width: auto;
    transform: translateY(-70px);
    background: #34d399;
    box-shadow: 0 0 15px #34d399;
    animation: dashboardScannerSweep 2.3s ease-in-out infinite;
}

@keyframes dashboardScannerSweep {
    0%, 100% { transform: translateY(-70px); opacity: 0.2; }
    50% { transform: translateY(70px); opacity: 1; }
}

.dashboard-kiosk-camera.scanner-active .dashboard-scanner-ring,
.dashboard-kiosk-camera.scanner-active .dashboard-scanner-line {
    opacity: 1;
}

.kiosk-dashboard-cta {
    min-height: 64px;
    background: linear-gradient(100deg, #047857, #10b981 52%, #0891b2);
    box-shadow: 0 14px 28px rgba(16, 185, 129, 0.24);
}

.kiosk-dashboard-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(6, 182, 212, 0.3);
}

@media (max-width: 1023px) {
    .kiosk-dashboard-desk-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #tab-kios {
        padding: 1rem;
    }

    #tab-kios .kiosk-dashboard-card {
        border-radius: 1.5rem;
    }

    #tab-kios .kiosk-dashboard-header {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    #tab-kios .kiosk-dashboard-header > .flex {
        flex-direction: column;
        align-items: stretch;
        gap: 0.9rem;
    }

    #tab-kios .dashboard-kiosk-camera {
        padding: 1.25rem;
    }

    #tab-kios .dashboard-scanner-frame {
        height: clamp(220px, 36vw, 320px);
    }
}

@media (max-width: 768px) {
    #tab-kios form {
        padding: 1.1rem;
    }

    #tab-kios .grid {
        gap: 1.25rem;
    }

    #tab-kios .dashboard-kiosk-camera {
        min-height: 0;
    }

    #tab-kios .dashboard-kiosk-camera .flex {
        flex-wrap: wrap;
    }

    #tab-kios .dashboard-kiosk-camera .flex button {
        flex: 1 1 48%;
    }

    #tab-kios .kiosk-dashboard-desk,
    #tab-kios .kiosk-dashboard-purpose {
        min-height: 74px;
    }

    #tab-kios .kiosk-dashboard-header .space-x-4 {
        gap: 0.75rem;
    }

    #tab-kios .kiosk-dashboard-header .p-3 {
        width: 48px;
        height: 48px;
        padding: 0.75rem;
    }
}

@media (min-width: 1280px) {
    .kiosk-dashboard-purpose-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    #tab-kios {
        padding: 0.75rem;
    }

    .kiosk-dashboard-desk-grid {
        grid-template-columns: 1fr;
    }

    .kiosk-dashboard-card {
        border-radius: 1.25rem;
    }

    #tab-kios .kiosk-dashboard-header {
        padding: 1rem;
    }

    #tab-kios .kiosk-dashboard-header .flex {
        gap: 0.75rem;
    }

    #tab-kios .kiosk-dashboard-header .flex > div:first-child {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        width: 100%;
    }

    #tab-kios .kiosk-dashboard-header .p-3 {
        width: 42px;
        height: 42px;
        padding: 0.6rem;
        border-radius: 1rem;
    }

    #tab-kios .kiosk-dashboard-header h2 {
        font-size: 1.1rem;
        line-height: 1.35;
    }

    #tab-kios .kiosk-dashboard-header p {
        font-size: 0.72rem;
        line-height: 1.5;
    }

    #tab-kios .kiosk-dashboard-header .text-\[10px\] {
        letter-spacing: 0.12em;
        white-space: normal;
        text-align: center;
    }

    #tab-kios form {
        padding: 1rem;
    }

    #tab-kios .dashboard-kiosk-camera {
        padding: 1rem;
        border-radius: 1rem;
    }

    #tab-kios .dashboard-scanner-frame {
        height: 210px;
    }

    #tab-kios .dashboard-kiosk-camera .flex {
        flex-direction: column;
    }

    #tab-kios .dashboard-kiosk-camera .flex button {
        width: 100%;
        flex-basis: 100%;
    }

    #tab-kios .kiosk-dashboard-cta {
        min-height: 56px;
        font-size: 0.95rem;
    }

    #tab-kios .kiosk-dashboard-desk,
    #tab-kios .kiosk-dashboard-purpose {
        min-height: 68px;
        padding: 0.65rem;
    }

    #tab-kios .kiosk-dashboard-desk span,
    #tab-kios .kiosk-dashboard-purpose span {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    #tab-kios .kiosk-dashboard-desk small {
        font-size: 0.55rem;
        letter-spacing: 0.04em;
    }

    #tab-kios .kiosk-dashboard-input {
        min-height: 52px;
        font-size: 0.97rem;
    }

    #tab-kios .kiosk-dashboard-input + .absolute i,
    #tab-kios .relative i.absolute {
        top: 50%;
        transform: translateY(-50%);
    }
}

/* Enterprise dashboard visual layer */
#sidebar {
    background: #0f172a;
    border-right: 1px solid #334155;
    box-shadow: 12px 0 28px rgba(15, 23, 42, 0.12);
}

#sidebar .nav-item,
#sidebar > div > nav > button {
    border-left: 4px solid transparent;
    border-radius: 0.625rem;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

#sidebar .nav-item.bg-slate-800\/80 {
    background: #1e293b;
    border-left-color: #3b82f6;
}

#sidebar .nav-item.bg-slate-800\/80 i {
    color: #60a5fa;
}

#tab-dashboard div[id^="card-loket-"] {
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-top: 4px solid #f59e0b;
    border-radius: 0.875rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

#tab-dashboard div[id^="card-loket-"]::before {
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background: #f59e0b;
    content: '';
}

#tab-dashboard div[id^="card-loket-"].desk-is-called {
    border-top-color: #10b981;
}

#tab-dashboard div[id^="card-loket-"].desk-is-called::before {
    background: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
}

#tab-dashboard div[id^="card-loket-"].desk-has-active {
    border: 2px solid #10b981;
    border-top-width: 4px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12);
}

#tab-dashboard div[id^="card-loket-"] > div:last-child {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

#tab-dashboard div[id^="card-loket-"] > div:last-child button {
    min-height: 44px;
    border-radius: 0.625rem;
    font-weight: 600;
    transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease, opacity 200ms ease;
}

#tab-dashboard div[id^="card-loket-"] span[id^="badge-loket-"] {
    background: #fffbeb;
    color: #d97706;
    font-weight: 500;
}

#tab-dashboard div[id^="card-loket-"].desk-is-called span[id^="badge-loket-"] {
    background: #ecfdf5;
    color: #059669;
}

#tab-dashboard div[id^="card-loket-"] h3,
#tab-dashboard div[id^="card-loket-"] h3[id^="dash-"] {
    font-family: 'Courier New', monospace;
    font-weight: 800;
    letter-spacing: -0.03em;
}

#tab-dashboard div[id^="card-loket-"] button:first-child {
    background: #2563eb;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
    font-weight: 600;
    transition: background-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

#tab-dashboard div[id^="card-loket-"] button:first-child:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.28);
    transform: translateY(-1px);
}

#tab-dashboard div[id^="card-loket-"] button:first-child:active:not(:disabled) {
    transform: translateY(0);
}

#tab-dashboard div[id^="card-loket-"] button:first-child:disabled {
    background: #60a5fa;
    color: #ffffff;
    opacity: 0.78 !important;
    box-shadow: none;
}

/* Queue data table polish */
#tab-dashboard .queue-toolbar,
#tab-antrian .queue-toolbar {
    background: rgba(248, 250, 252, 0.8);
}

#tab-dashboard table thead,
#tab-antrian table thead {
    background: rgba(248, 250, 252, 0.8);
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}

#tab-dashboard .queue-purpose-cell,
#tab-dashboard .queue-desk-cell,
#tab-antrian .queue-purpose-cell,
#tab-antrian .queue-desk-cell {
    color: #334155;
}

#tab-dashboard tbody td:first-child strong,
#tab-antrian tbody td:first-child strong {
    color: #334155;
    font-weight: 500;
}

#tab-dashboard tbody td:first-child span,
#tab-antrian tbody td:first-child span {
    color: #94a3b8;
    font-size: 0.75rem;
}

.queue-status-waiting {
    border: 1px solid rgba(253, 230, 138, 0.6);
    background: #fffbeb;
    color: #b45309;
}

#tab-dashboard .table-action-button,
#tab-antrian .table-action-button {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #94a3b8;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

#tab-dashboard .table-action-button:hover,
#tab-antrian .table-action-button:hover {
    background: #fff1f2;
    color: #e11d48;
}

#tab-dashboard .queue-toolbar .table-search,
#tab-antrian .queue-toolbar .table-search {
    background: #ffffff;
}

#tab-dashboard .queue-toolbar button[title*="Excel"] {
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: #047857;
    font-weight: 500;
    box-shadow: none;
}

#tab-dashboard .queue-toolbar button[title*="Excel"]:hover {
    background: #dcfce7;
}

#tab-dashboard div[id^="card-loket-"] button:nth-child(2) {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

#tab-dashboard div[id^="card-loket-"] button:nth-child(2):hover:not(:disabled) {
    border-color: #6ee7b7;
    background: #d1fae5;
}

#tab-dashboard div[id^="card-loket-"] button:nth-child(2):disabled {
    display: none;
}

#tab-dashboard div[id^="card-loket-"].desk-has-active > div:last-child {
    grid-template-columns: 1fr 1fr;
}

#tab-dashboard div[id^="card-loket-"].desk-has-active button:first-child {
    background: #2563eb;
}

#tab-dashboard div[id^="card-loket-"].desk-has-active span[id^="badge-loket-"] {
    background: #10b981;
    color: #ffffff;
    animation: servingBadgePulse 1.8s ease-in-out infinite;
}

@keyframes servingBadgePulse {
    50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12); }
}

@media (max-width: 640px) {
    .app-topbar {
        height: auto;
        min-height: 4rem;
        gap: 0.5rem;
    }

    .app-footer {
        padding: 0.75rem 1rem;
    }
}

#fullscreen-display {
    background:
        radial-gradient(circle at top, rgba(250, 204, 21, 0.10), transparent 22%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.08), transparent 25%),
        linear-gradient(180deg, rgba(2, 6, 23, 1) 0%, rgba(8, 20, 38, 1) 45%, rgba(7, 16, 30, 1) 100%);
}

.nav-item, .bg-white, .bg-slate-50, .rounded-2xl, .rounded-xl {
    transition: all 0.25s ease;
}

.nav-item:hover {
    transform: translateX(2px);
}

#sidebar {
    background: linear-gradient(180deg, rgba(9, 17, 31, 0.98), rgba(15, 23, 42, 0.96));
    box-shadow: 18px 0 40px rgba(2, 6, 23, 0.24);
}

#page-app .bg-white,
#tab-dashboard > .bg-white,
#tab-kios > .bg-white,
#tab-users > .bg-white,
#tab-profile > .bg-white {
    box-shadow: var(--premium-shadow);
}

.dashboard-metric {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(241,245,249,0.92));
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.metric-pulse {
    animation: pulseGlow 2.2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(250, 204, 21, 0.1); }
    50% { box-shadow: 0 0 0 12px rgba(250, 204, 21, 0.02); }
}

@keyframes marquee {
    0% { transform: translateX(12%); }
    100% { transform: translateX(-62%); }
}
.animate-marquee-smooth {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 52s linear infinite;
}

.fullscreen-header {
    backdrop-filter: blur(6px);
}

.display-datetime {
    min-width: 190px;
    padding-left: 1.25rem;
    border-left: 1px solid rgba(250, 204, 21, 0.22);
}

@media (max-width: 640px) {
    .fullscreen-header {
        align-items: flex-start;
        gap: 1rem;
    }

    .display-datetime {
        min-width: 0;
        padding-left: 0;
        border-left: 0;
        text-align: left;
    }
}

.fullscreen-close {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.45);
}

.queue-panel {
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.6);
}

.display-number {
    text-shadow: 0 0 25px rgba(250, 204, 21, 0.3), 0 0 50px rgba(52, 211, 153, 0.12);
    letter-spacing: 0.06em;
}

.status-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.9));
}

.marquee-text {
    letter-spacing: 0.02em;
    opacity: 0.96;
}

/* Public display styling */
#fullscreen-display {
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(6, 182, 212, 0.12), transparent 28%),
        radial-gradient(circle at 88% 82%, rgba(16, 185, 129, 0.1), transparent 30%),
        #0b0f19;
}

#fullscreen-display::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(rgba(148, 163, 184, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    content: '';
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.fullscreen-header,
.display-ticker {
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(14px);
}

.display-clock {
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 18px rgba(103, 232, 249, 0.35);
}

.fullscreen-main {
    min-height: 0;
}

.queue-panel {
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.45), inset 0 0 60px rgba(6, 182, 212, 0.035);
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.queue-panel.queue-call-alert {
    animation: queueCallAlert 4.5s ease-out;
}

@keyframes queueCallAlert {
    0%, 100% { border-color: rgba(6, 182, 212, 0.25); box-shadow: 0 24px 70px rgba(2, 6, 23, 0.45), inset 0 0 60px rgba(6, 182, 212, 0.035); }
    12%, 32% { border-color: rgba(16, 185, 129, 0.95); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12), 0 0 48px rgba(6, 182, 212, 0.42), inset 0 0 80px rgba(16, 185, 129, 0.12); }
    20% { border-color: rgba(103, 232, 249, 1); box-shadow: 0 0 0 10px rgba(6, 182, 212, 0.06), 0 0 70px rgba(6, 182, 212, 0.55), inset 0 0 90px rgba(6, 182, 212, 0.12); }
}

.queue-grid-lines {
    background-image: linear-gradient(rgba(103, 232, 249, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(103, 232, 249, 0.04) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle, black, transparent 75%);
}

.queue-aura {
    background: radial-gradient(circle at center, rgba(6, 182, 212, 0.1), transparent 46%);
    animation: auraBreath 4s ease-in-out infinite;
}

@keyframes auraBreath {
    0%, 100% { opacity: 0.55; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1.04); }
}

.live-dot {
    animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}

.display-number {
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.16), 0 0 42px rgba(6, 182, 212, 0.38), 0 0 80px rgba(16, 185, 129, 0.18);
}

.display-idle-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1.25rem, 4vw, 3.25rem);
    min-height: clamp(5rem, 15vw, 13rem);
}

.display-idle-bars span {
    display: block;
    width: clamp(3.5rem, 9vw, 7rem);
    height: clamp(1.25rem, 3vw, 2.25rem);
    border-radius: 0.1rem;
    background: #f8fafc;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.75), 0 0 34px rgba(6, 182, 212, 0.6), 0 0 58px rgba(16, 185, 129, 0.2);
    animation: idleBarPulse 2.4s ease-in-out infinite;
}

.display-idle-bars span:nth-child(2) { animation-delay: 240ms; }
.display-idle-bars span:nth-child(3) { animation-delay: 480ms; }

@keyframes idleBarPulse {
    0%, 100% { opacity: 0.72; transform: scaleY(0.88); }
    50% { opacity: 1; transform: scaleY(1); }
}

.display-idle-state {
    min-height: 24px;
}

.idle-wave {
    display: inline-flex;
    height: 18px;
    align-items: center;
    gap: 3px;
}

.idle-wave i {
    display: block;
    width: 3px;
    height: 7px;
    border-radius: 999px;
    background: #22d3ee;
    animation: idleWave 1.2s ease-in-out infinite;
}

.idle-wave i:nth-child(2) { animation-delay: 120ms; }
.idle-wave i:nth-child(3) { animation-delay: 240ms; }
.idle-wave i:nth-child(4) { animation-delay: 360ms; }
.idle-wave i:nth-child(5) { animation-delay: 480ms; }

@keyframes idleWave {
    0%, 100% { height: 7px; opacity: 0.5; }
    50% { height: 18px; opacity: 1; }
}

.desk-status-grid {
    display: grid;
    gap: 10px;
}

.desk-status-card {
    position: relative;
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) auto;
    min-height: 72px;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    border: 1px solid rgba(71, 85, 105, 0.55);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    padding: 10px 12px 10px 0;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.desk-status-card:hover {
    transform: translateX(-2px);
    border-color: rgba(148, 163, 184, 0.65);
    background: rgba(30, 41, 59, 0.85);
}

.desk-status-accent {
    align-self: stretch;
    background: #22d3ee;
    box-shadow: 0 0 14px currentColor;
}

.desk-status-card p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 500;
}

.desk-status-card strong {
    display: block;
    margin-top: 4px;
    color: #f8fafc;
    font-family: 'Courier New', monospace;
    font-size: 1.45rem;
    line-height: 1;
}

.desk-status-badge {
    border: 1px solid rgba(100, 116, 139, 0.55);
    border-radius: 999px;
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 5px 7px;
    text-transform: uppercase;
}

.desk-status-u .desk-status-accent { color: #a78bfa; background: #a78bfa; }
.desk-status-a .desk-status-accent { color: #60a5fa; background: #60a5fa; }
.desk-status-b .desk-status-accent { color: #34d399; background: #34d399; }
.desk-status-c .desk-status-accent { color: #fb7185; background: #fb7185; }
.desk-status-d .desk-status-accent { color: #22d3ee; background: #22d3ee; }
.desk-status-e .desk-status-accent { color: #fbbf24; background: #fbbf24; }

.desk-status-card.is-serving .desk-status-badge {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    animation: badgePulse 1.8s ease-in-out infinite;
}

@media (max-width: 1023px) {
    #page-app .app-topbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.625rem;
        height: auto !important;
        min-height: 0;
        padding: 0.75rem 1rem;
    }

    #page-app .app-topbar > div:first-child,
    #page-app .app-topbar > div:last-child {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    #page-app .app-topbar > div:first-child {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.625rem;
    }

    #page-app .app-topbar > div:first-child > div {
        min-width: 0;
        flex: 1 1 auto;
    }

    #page-app .app-topbar #page-title {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        overflow: visible !important;
    }

    #page-app .app-topbar .topbar-user-profile {
        min-width: 2.5rem;
        flex: 0 0 auto;
        margin-right: auto;
    }

    #page-app .app-topbar > div:last-child > button {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        width: auto;
        min-width: 2.75rem;
        min-height: 2.75rem;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child > .topbar-logout {
        width: 2.75rem;
        min-width: 2.75rem;
    }
}

@media (max-width: 639px) {
    #page-app .app-topbar {
        padding: 0.625rem 0.75rem;
    }

    #page-app .app-topbar > div:last-child > button:not(.topbar-logout) {
        width: 2.75rem;
        padding: 0;
    }

    #page-app .app-topbar > div:last-child > button:not(.topbar-logout) span {
        display: none;
    }
}

@media (min-width: 640px) and (max-width: 820px) {
    #page-app .app-topbar .topbar-user-profile > div {
        display: none;
    }

    #page-app .app-topbar > div:last-child > button:not(.topbar-logout) {
        width: 2.75rem;
        padding: 0;
    }

    #page-app .app-topbar > div:last-child > button:not(.topbar-logout) span {
        display: none;
    }
}

@keyframes badgePulse {
    50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08); }
}

@media (max-aspect-ratio: 4 / 3) {
    #fullscreen-display {
        overflow: hidden;
    }

    .fullscreen-main {
        flex: none;
    }
}

@media (max-width: 640px) {
    #fullscreen-display {
        padding: 1rem;
    }

    .fullscreen-header {
        gap: 0.75rem;
    }

    .display-logo {
        display: none;
    }

    .display-datetime {
        min-width: 0;
    }

    .display-clock {
        font-size: 1.5rem;
    }

    .queue-panel {
        min-height: 390px;
    }

    .desk-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .desk-status-card {
        grid-template-columns: 4px minmax(0, 1fr);
    }

    .desk-status-badge {
        grid-column: 2;
        justify-self: start;
    }
}

@keyframes scanLine {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}
.scan-line {
    animation: scanLine 2.5s ease-in-out infinite;
}

.toaster {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    align-items: center;
    width: min(92vw, 420px);
}

.toast {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    padding: 14px 18px;
    background: rgba(8, 20, 38, 0.97);
    color: white;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transform: translateY(10px) scale(0.96);
    opacity: 0;
    animation: toastIn 0.3s ease forwards;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    font-size: 17px;
}

.toast-message {
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.58);
}

.toast.success .toast-icon { color: #34d399; background: rgba(16, 185, 129, 0.14); }

.toast.warning {
    border-color: rgba(250, 204, 21, 0.58);
}

.toast.warning .toast-icon { color: #facc15; background: rgba(250, 204, 21, 0.14); }
.toast.error { border-color: rgba(244, 63, 94, 0.58); }
.toast.error .toast-icon { color: #fb7185; background: rgba(244, 63, 94, 0.14); }
.toast.info .toast-icon { color: #38bdf8; background: rgba(56, 189, 248, 0.14); }

.notice-card {
    animation: noticeCardIn 0.24s ease-out both;
}

.notice-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: #f43f5e;
    background: #fff1f2;
    font-size: 21px;
    box-shadow: 0 0 0 8px #fff1f2;
}

.notice-card-icon-danger {
    color: #e11d48;
}

.notice-card-icon-info {
    color: #0284c7;
    background: #e0f2fe;
    box-shadow: 0 0 0 8px #e0f2fe;
}

@keyframes noticeCardIn {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1023px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    #page-app,
    #page-app.app-shell,
    #page-app .app-shell-content {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 100dvh;
        overflow: visible !important;
    }

    #page-app .app-topbar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    #page-app .app-topbar > div:first-child {
        width: auto !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        justify-content: flex-start !important;
    }

    #page-app .app-topbar > div:first-child > div {
        min-width: 0 !important;
    }

    #page-app .app-topbar #page-title {
        max-width: calc(100vw - 5rem) !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child {
        width: auto !important;
        min-width: 0 !important;
        flex: 0 1 auto !important;
        margin-left: auto;
    }

    #page-app .app-footer {
        position: static !important;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        max-height: none !important;
        min-height: 0 !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 1023px) {
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    #page-app,
    #page-app.app-shell,
    #page-app .app-shell-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    #page-app .app-topbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        gap: 0.625rem;
        padding: 0.75rem 1rem;
        overflow: visible !important;
    }

    #page-app .app-topbar > div:first-child,
    #page-app .app-topbar > div:last-child {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    #page-app .app-topbar > div:first-child {
        display: flex;
        align-items: center;
        gap: 0.625rem;
    }

    #page-app .app-topbar > div:first-child > div,
    #page-app .app-topbar #page-title {
        min-width: 0;
        max-width: 100%;
    }

    #page-app .app-topbar #page-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #page-app .app-topbar > div:last-child {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    #page-app .app-topbar .topbar-user-profile {
        margin-right: auto;
        flex: 0 0 auto;
    }

    #page-app .app-topbar > div:last-child > button {
        display: inline-flex !important;
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
        min-height: 2.75rem;
        flex: 0 0 2.75rem !important;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    #page-app .app-topbar > div:last-child > button span {
        display: none;
    }

    #page-app .app-footer {
        position: static !important;
    }

    #tab-dashboard .dashboard-table-wrap,
    #tab-antrian .dashboard-table-wrap {
        max-height: none !important;
        min-height: 0 !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    #tab-dashboard table,
    #tab-antrian table {
        width: max-content;
        min-width: 760px;
    }
}

@media (max-width: 639px) {
    #page-app .app-topbar {
        padding: 0.625rem 0.75rem;
    }

    #tab-dashboard,
    #tab-antrian,
    #tab-users,
    #tab-profile {
        padding: 0.75rem;
    }

    #tab-dashboard > .grid:first-child,
    #tab-dashboard > .grid:nth-of-type(2) {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}
