:root {
    --bg: #08111f;
    --panel: rgba(9, 19, 37, 0.88);
    --panel-soft: rgba(17, 31, 57, 0.92);
    --line: rgba(255, 193, 7, 0.16);
    --text: #f5f7fb;
    --muted: #97a6ba;
    --accent: #ffbf3c;
    --accent-soft: #ff9f1c;
    --navy: #10243f;
    --cyan: #4bb8ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(75, 184, 255, 0.14), transparent 30%),
        linear-gradient(135deg, #050b14, #08111f 55%, #0a1628);
    min-height: 100vh;
}

a {
    text-decoration: none;
}

.guest-shell,
.public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.guest-shell,
.public-shell {
    padding: 2rem;
}

.guest-content,
.public-content {
    flex: 1;
    display: grid;
    place-items: center;
}

.login-wrapper,
.scan-page {
    width: min(100%, 1100px);
}

.login-card,
.scan-card,
.panel-card,
.metric-card,
.hero-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.login-card,
.scan-card {
    max-width: 560px;
    margin: auto;
    border-radius: 24px;
    padding: 2rem;
}

.scan-card {
    max-width: 880px;
}

.admin-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.sidebar {
    min-height: 100vh;
    padding: 2rem 1.5rem;
    background: linear-gradient(180deg, rgba(3, 8, 17, 0.96), rgba(9, 19, 37, 0.98));
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.content {
    padding: 2rem;
}

.content-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-footer {
    margin-top: auto;
    padding: 1rem 2rem 1.5rem;
    color: var(--muted);
    text-align: center;
    font-size: 0.9rem;
}

.nav-link {
    color: var(--text);
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.nav-link:hover,
.nav-link:focus {
    color: #fff;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.06);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--cyan);
    margin-bottom: 0.75rem;
}

.hero-panel,
.panel-card,
.metric-card {
    border-radius: 22px;
    padding: 1.5rem;
}

.metric-card span {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.metric-card strong {
    font-size: 2.1rem;
    font-weight: 800;
    color: #fff;
}

.table-dark {
    --bs-table-bg: transparent;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-row:last-child {
    border-bottom: 0;
}

.qr-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #fff;
    padding: 0.25rem;
}

.scan-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #091321;
    margin-bottom: 1rem;
}

.risk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.risk-grid article {
    background: var(--panel-soft);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 1.25rem;
}

.risk-grid ul {
    margin: 0;
    padding-left: 1rem;
    color: var(--muted);
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    border-color: rgba(255, 191, 60, 0.55);
    box-shadow: 0 0 0 0.25rem rgba(255, 191, 60, 0.14);
}

.btn-warning {
    color: #091321;
    font-weight: 700;
}

@media (max-width: 991px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        position: static;
    }

    .risk-grid {
        grid-template-columns: 1fr;
    }

    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
