:root {
    --bg-main: #090d16;
    --bg-card: rgba(17, 24, 39, 0.78);
    --bg-card-solid: #111827;
    --bg-elevated: rgba(30, 41, 59, 0.65);
    --border-subtle: rgba(148, 163, 184, 0.14);
    --border-focus: #38bdf8;
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-primary: #0ea5e9;
    --accent-secondary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 15% 10%, rgba(14, 165, 233, 0.12) 0px, transparent 45%),
        radial-gradient(at 85% 15%, rgba(99, 102, 241, 0.12) 0px, transparent 45%),
        radial-gradient(at 50% 90%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    margin: 0;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.center {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(9, 13, 22, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
}

.navbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 18px;
    letter-spacing: -0.02em;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.brand-text b {
    background: linear-gradient(90deg, #38bdf8, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-left: 2px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 8px;
    transition: all 0.18s ease;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(148, 163, 184, 0.1);
}

.nav-link.active {
    color: #fff;
    background: rgba(14, 165, 233, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Containers */
.container, .wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 20px 64px;
}

.narrow-container {
    max-width: 480px;
}

.medium-container {
    max-width: 780px;
}

/* Typography */
h1, .page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 6px 0 12px;
    background: linear-gradient(90deg, #f8fafc, #93c5fd, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text-main);
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text-main);
}

p {
    margin: 0 0 12px;
}

.muted, .text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

a {
    color: #38bdf8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Hero & Landing */
.hero {
    text-align: center;
    padding: 36px 20px 42px;
    max-width: 760px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.2;
    margin: 14px 0;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 620px;
    margin: 0 auto 28px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 12px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-decoration: none !important;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 12px 30px -10px rgba(14, 165, 233, 0.25);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 13.5px;
    flex: 1;
}

.feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 14px;
}

.icon-blue { background: rgba(14, 165, 233, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.icon-purple { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.3); }
.icon-emerald { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.icon-amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }

.feature-link {
    font-size: 13px;
    font-weight: 600;
    color: #38bdf8;
    margin-top: 8px;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 4px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.9);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.step.active .step-circle {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 14px rgba(14, 165, 233, 0.45);
}

.step.done .step-circle {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.45);
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--text-main);
    font-weight: 600;
}

.step.done .step-label {
    color: #6ee7b7;
}

.step-line {
    flex: 1;
    height: 2px;
    background: rgba(148, 163, 184, 0.16);
    margin: 0 10px;
}

.step-line.done {
    background: rgba(16, 185, 129, 0.5);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 18px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.45);
}

.card.narrow {
    width: 100%;
    max-width: 380px;
}

/* Forms & Inputs */
label {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 14px 0 6px;
}

label:first-child {
    margin-top: 0;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[readonly],
select {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

input[readonly] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    color: #93c5fd;
}

input:focus, select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 6px 20px -4px rgba(14, 165, 233, 0.45);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
}

.btn-secondary, .btn.alt {
    background: rgba(51, 65, 85, 0.75);
    border-color: rgba(148, 163, 184, 0.22);
    color: var(--text-main);
}

.btn-secondary:hover, .btn.alt:hover {
    background: rgba(71, 85, 105, 0.85);
    box-shadow: none;
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}

.btn-google {
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn-google:hover {
    background: #f8fafc;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 13px 22px;
    font-size: 15px;
    border-radius: 10px;
}

/* Alerts & Notifications */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.45;
}

.alert-success, p.ok, div.ok {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

.alert-warning, p.warn, div.warn {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

.alert-danger, p.error, div.error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-success, .b-success {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.32);
}

.badge-warning, .b-pending {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-danger, .b-failed {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.32);
}

.badge-info {
    background: rgba(14, 165, 233, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.32);
}

.badge-neutral, .b-none {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Ticket / Kode Antrean Display */
.ticket-box {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.75));
    border: 1px dashed rgba(56, 189, 248, 0.45);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    margin: 18px 0;
}

.ticket-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ticket-code {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.1;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
}

/* Operator Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.photo-item {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0f172a;
    border: 2px solid rgba(148, 163, 184, 0.18);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    margin: 0;
}

.photo-item:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.5);
}

.photo-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.photo-item img {
    width: 100%;
    height: 195px;
    object-fit: cover;
    display: block;
}

.photo-meta {
    padding: 8px 10px;
    font-size: 11.5px;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s ease;
}

.photo-item:has(input:checked),
.photo-item.selected {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
}

.photo-item input:checked ~ .photo-check {
    background: #0ea5e9;
    border-color: #fff;
    color: #fff;
}

/* Stats Summary Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    background: rgba(15, 23, 42, 0.75);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(148, 163, 184, 0.05);
}

/* Setup utilities */
.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.copy {
    display: flex;
    gap: 8px;
    align-items: center;
}

pre {
    background: #020617;
    padding: 13px;
    border-radius: var(--radius-sm);
    overflow: auto;
    font-size: 12.5px;
    border: 1px solid #1e293b;
    color: #e2e8f0;
}

.checks {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checks li {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-subtle);
}

.checks li.ok {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.25);
}

.checks li.error {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.25);
}

.checks small {
    display: block;
    color: var(--text-muted);
    margin-left: 22px;
    word-break: break-all;
}

.qr {
    margin-top: 10px;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 8px;
}

/* Halaman Kamera Fullscreen */
body.cam {
    background: #000;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.camtop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
}

#v {
    flex: 1;
    width: 100%;
    min-height: 0;
    object-fit: contain;
    background: #000;
}

.camctl {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--border-subtle);
}

.shutter {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 5px solid #fff;
    background: #ef4444;
    cursor: pointer;
    transition: transform 0.1s ease;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.shutter:active {
    transform: scale(0.92);
}

@media (max-width: 640px) {
    .navbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-menu {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .step-label {
        display: none;
    }
    .search-bar {
        flex-direction: column;
    }
}
