:root {
    --bg: #eef2ff;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe1ec;
    --primary: #3b82f6;
    --primary-2: #1d4ed8;
    --danger: #ef4444;
    --shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: "Inter", "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--bg); }
body { min-height: 100vh; }

.container { width: min(1120px, 95vw); margin: 0 auto; padding: 16px; }

.topbar { background: linear-gradient(120deg, #0f172a, #1f2937); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow); }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: 0.2px; }

.menu-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    display: none;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
}
.nav a { color: #f8fafc; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 14px; transition: 0.2s; }
.nav a:hover { background: rgba(255, 255, 255, 0.12); }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3); }
.nav .spacer { flex: 1; }

main.container { padding-top: 16px; padding-bottom: 24px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    backdrop-filter: blur(2px);
}

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

.big { font-size: 34px; margin: 8px 0; line-height: 1; font-weight: 800; }
h1,h2,h3,h4 { margin: 0 0 12px; line-height: 1.2; }

form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; color: #334155; }

input, select, textarea, button, .btn {
    width: 100%;
    font: inherit;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    outline-offset: 1px;
    border-color: var(--primary);
}

button, .btn {
    cursor: pointer;
    border: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    background: linear-gradient(180deg, var(--primary), var(--primary-2));
    color: #fff;
    font-weight: 600;
    transition: transform 0.15s;
}
button:hover, .btn:hover { transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }
.btn.small { padding: 7px 10px; font-size: 12px; width: auto; }
.btn.danger, button.danger { background: linear-gradient(180deg, #ef4444, #dc2626); }

.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-check { display: flex; align-items: center; gap: 8px; grid-column: 1/-1; }

.nav.open { display: grid; }

.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { border-bottom: 1px solid #e5eaf2; padding: 11px; font-size: 14px; vertical-align: top; text-align: left; }
th { background: #f1f5f9; color: #334155; font-weight: 700; position: sticky; top: 0; }
td { background: #fff; }
.muted { color: var(--muted); font-size: 12px; }
.muted-row td { background: #f8fafc; color: #334155; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; border: 1px solid transparent; }
.alert-info { background: #dbeafe; color: #1e3a8a; border-color: #bfdbfe; }
.alert-success { background: #dcfce7; color: #14532d; border-color: #bbf7d0; }
.alert-error { background: #fee2e2; color: #7f1d1d; border-color: #fecaca; }

.secret-block { font-size: 13px; display: grid; gap: 4px; }
.stack-list { display: grid; gap: 7px; padding: 0; margin: 0; }
.stack-list li { list-style: none; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #f8fbff; border: 1px solid #dbeafe; border-radius: 10px; padding: 10px; }

.small { color: var(--muted); font-size: 12px; }

.auth { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(1200px 600px at 30% -20%, #bfdbfe 0%, transparent 40%), var(--bg); }
.auth-box { width: min(540px, 95vw); display: grid; gap: 16px; }
.auth-box .card { padding: 20px; }

pre { white-space: pre-wrap; margin: 0; max-width: 100%; }
footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }

.full { grid-column: 1 / -1; }
.qrcode { width: 280px; height: 280px; background: #fff; border-radius: 12px; display: block; border: 1px solid var(--border); }

@media (max-width: 900px) {
    .grid.cols-2 { grid-template-columns: 1fr; }
    .container { width: 100%; padding: 10px; }
    table { min-width: 560px; }
}

@media (max-width: 720px) {
    .menu-btn { display: inline-block; }
    .topbar .container, .nav { flex-direction: row; }
    .grid { gap: 10px; }
    .card, .table-wrap { border-radius: 12px; }
}
