:root {
    color-scheme: dark;
    --bg: #020202;
    --fg: #ffffff;
    --muted: rgba(255, 255, 255, .42);
    --muted-2: rgba(255, 255, 255, .3);
    --border: rgba(255, 255, 255, .08);
    --card: color-mix(in srgb, #0D0B0B 55%, transparent);
    --card-border: rgba(255, 255, 255, .14);
    --aside-bg: color-mix(in srgb, #0D0B0B 70%, transparent);
    --nav: rgba(255, 255, 255, .42);
    --nav-active-bg: rgba(255, 255, 255, .07);
    --chip: rgba(255, 255, 255, .06);
    --lime: #7CCF00;
    --lime-soft: #A3E635;
    --red: #f87171;
    --amber: #fbbf24;
    --radius: 24px;
    --aside-w: 228px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    min-height: 100%;
    color: var(--fg);
    font-family: Sora, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
}
body {
    background:
        radial-gradient(42% 30% at 48% -4%, rgba(80, 140, 0, .08) 0%, transparent 70%),
        radial-gradient(48% 38% at 4% 104%, rgba(124, 207, 0, .1) 0%, transparent 68%),
        linear-gradient(180deg, #020202 0%, #050505 50%, #010101 100%);
    background-attachment: fixed;
}
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.aurora {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: .55;
}
.aurora::before,
.aurora::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    filter: blur(90px);
}
.aurora::before {
    width: 34vw; height: 28vw; left: -12vw; top: 68vh; opacity: .28;
    background: radial-gradient(circle, rgba(124,207,0,.45) 0%, transparent 72%);
}
.aurora::after {
    width: 32vw; height: 26vw; left: 28vw; top: -12vw; opacity: .22;
    background: radial-gradient(circle, rgba(163,230,53,.3) 0%, transparent 76%);
}

.shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--aside-w) 1fr;
    min-height: 100dvh;
}

.aside {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    border-right: 1px solid var(--border);
    background: var(--aside-bg);
    backdrop-filter: blur(40px) saturate(140%);
    -webkit-backdrop-filter: blur(40px) saturate(140%);
}
.aside-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 18px;
    color: var(--fg);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -.03em;
}
.aside-brand:hover { text-decoration: none; }
.aside-mark {
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, #B8F015, var(--lime));
    display: grid; place-items: center;
    color: #111; font-size: 12px; font-weight: 700;
}
.aside-section-label {
    padding: 6px 10px 8px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.aside nav { display: grid; gap: 2px; padding: 0 2px; }
.aside-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    color: var(--nav);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.aside-item:hover {
    background: var(--nav-active-bg);
    color: var(--fg);
    text-decoration: none;
}
.aside-item.is-on {
    background: var(--nav-active-bg);
    color: var(--fg);
}
.aside-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.aside-foot {
    margin-top: auto;
    padding: 12px 10px 4px;
    border-top: 1px solid var(--border);
}
.aside-foot .meta { font-size: 12px; color: var(--muted); line-height: 1.4; word-break: break-all; }
.aside-foot .meta strong { display: block; color: var(--fg); font-weight: 500; margin-bottom: 2px; }

.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, #0D0B0B 55%, transparent);
    backdrop-filter: blur(24px);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.crumb-parent { color: var(--muted); }
.crumb-sep { opacity: .35; }
.crumb-current { font-weight: 600; letter-spacing: -.02em; }
.content {
    padding: 28px 28px 56px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

h1 {
    margin: 0;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 600;
    letter-spacing: -.035em;
}
.page-sub {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
    backdrop-filter: blur(40px);
}
.stat span {
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.stat b {
    display: block;
    margin-top: 8px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.03em;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px;
    backdrop-filter: blur(40px);
    margin-bottom: 14px;
}
.card h2 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}

.table-wrap {
    overflow: auto;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    background: var(--card);
    backdrop-filter: blur(40px);
    margin-bottom: 18px;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}
th, td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    vertical-align: middle;
}
th {
    color: var(--muted);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: rgba(255,255,255,.02);
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255,255,255,.02); }

.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.badge-ok { background: rgba(124,207,0,.15); color: #b6f25c; }
.badge-bad { background: rgba(248,113,113,.15); color: #fca5a5; }
.badge-warn { background: rgba(251,191,36,.14); color: #fde68a; }
.badge-muted { background: var(--chip); color: var(--muted); }

.flash {
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 13px;
}
.flash-ok { background: rgba(124,207,0,.12); color: #c8f28a; border: 1px solid rgba(124,207,0,.25); }
.flash-err { background: rgba(248,113,113,.12); color: #fecaca; border: 1px solid rgba(248,113,113,.25); }
.flash-warn { background: rgba(251,191,36,.12); color: #fde68a; border: 1px solid rgba(251,191,36,.25); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #B8F015, var(--lime));
    color: #111;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--nav-active-bg); }
.btn-danger {
    background: #7f1d1d;
    color: #fecaca;
}
.btn-sm { height: 32px; font-size: 12px; padding: 0 11px; border-radius: 10px; }

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}
.row > * { flex: 1; min-width: 120px; }
.field label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}
input, select, textarea {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.35);
    color: var(--fg);
    padding: 0 12px;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(124,207,0,.55);
    box-shadow: 0 0 0 3px rgba(124,207,0,.12);
}
.search {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.search input { max-width: 360px; }

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
}
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--chip);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.user-cell-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.user-cell-meta strong {
    font-size: 13px;
    font-weight: 560;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-cell-meta .muted {
    font-size: 11px;
}
.muted { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.login-wrap {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 28px;
    backdrop-filter: blur(40px);
}
.login-card h1 {
    font-size: 24px;
    margin-bottom: 6px;
}
.err { color: var(--red); font-size: 13px; margin: 0 0 12px; }
.secret-box {
    background: rgba(0,0,0,.35);
    border: 1px dashed rgba(255,255,255,.18);
    border-radius: 14px;
    padding: 14px;
    margin: 10px 0;
}
.qr {
    width: 180px;
    height: 180px;
    border-radius: 14px;
    background: #fff;
    padding: 8px;
}

.bar-row {
    display: flex;
    align-items: end;
    gap: 4px;
    height: 56px;
    margin-top: 10px;
}
.bar-row span {
    flex: 1;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, var(--lime-soft), var(--lime));
    min-height: 4px;
    opacity: .85;
}

@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .aside {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .aside nav { grid-template-columns: repeat(3, 1fr); }
    .content { padding: 20px 16px 40px; }
    .topbar { padding: 12px 16px; }
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; }
}
