:root {
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #1e293b;
    --border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --muted: #94a3b8;
    --emerald: #10b981;
    --cyan: #06b6d4;
    --indigo: #6366f1;
    --amber: #f59e0b;
    --rose: #ef4444;
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.14), transparent 40%),
                radial-gradient(circle at 85% 90%, rgba(6, 182, 212, 0.12), transparent 40%),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.45;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(11, 17, 32, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
}

.topbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.05rem;
}

.brand img { width: 28px; height: 28px; }

.nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
}

.pill:hover { background: rgba(255, 255, 255, 0.12); }
.pill.active { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.45); color: #6ee7b7; }

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 18px 16px 48px;
}

.container-narrow {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 14px 64px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.muted { color: var(--muted); font-size: 0.86rem; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 720px) {
    .grid-2 { grid-template-columns: 1fr; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--emerald), var(--cyan)); color: #06281e; }
.btn-secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-danger { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.btn-sm { padding: 7px 11px; font-size: 0.8rem; border-radius: 9px; }
.btn-block { width: 100%; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: #0f172a;
    color: var(--text);
    font-family: inherit;
    font-size: 0.93rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-ok { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-warn { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-err { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.badge-info { background: rgba(6, 182, 212, 0.16); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.35); }

.flash {
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 0.88rem;
    font-weight: 600;
}

.flash-ok { background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.flash-error { background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }

.qr-box {
    background: #ffffff;
    padding: 14px;
    border-radius: 16px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.qr-code-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    color: #334155;
    word-break: break-all;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }

.gate-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.14));
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform 0.12s ease, border-color 0.15s ease;
}

.gate-btn:hover { border-color: var(--emerald); }
.gate-btn:active { transform: scale(0.985); }
.gate-btn-title { font-size: 1rem; font-weight: 800; }
.gate-btn-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.gate-btn-action {
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--emerald);
    color: #052e16;
    font-weight: 800;
    font-size: 0.8rem;
    white-space: nowrap;
}
