:root {
    --bg: #0b1220;
    --panel: #111827;
    --panel-2: #1f2937;
    --border: #334155;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --ok: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: #93c5fd; text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; }
.brand { display: flex; gap: .9rem; align-items: center; margin-bottom: 1.5rem; }
.brand-icon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #3b82f6, #8b5cf6); display: grid; place-items: center; font-weight: 700; }
.brand h1, .topbar h1 { margin: 0; font-size: 1.2rem; }
.brand p, .brand small { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--border); padding: 1.25rem; display: flex; flex-direction: column; }
.sidebar nav { display: flex; flex-direction: column; gap: .35rem; margin-top: 1.5rem; }
.sidebar nav a { padding: .65rem .8rem; border-radius: 10px; color: var(--text); }
.sidebar nav a.active, .sidebar nav a:hover { background: var(--panel-2); text-decoration: none; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; }
.logout { color: var(--muted); font-size: .9rem; }

.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); background: rgba(17,24,39,.7); }
.host { color: var(--muted); font-size: .85rem; }
.content { padding: 1.5rem; }

.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
    .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.8rem; font-weight: 700; margin-top: .35rem; }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: .8rem .9rem; border-bottom: 1px solid var(--border); text-align: left; font-size: .92rem; }
th { color: var(--muted); font-weight: 600; background: rgba(31,41,55,.5); }
tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-ok { background: rgba(34,197,94,.15); color: #86efac; }
.badge-warn { background: rgba(245,158,11,.15); color: #fcd34d; }
.badge-bad { background: rgba(239,68,68,.15); color: #fca5a5; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 10px; padding: .6rem .95rem; cursor: pointer; font-weight: 600; font-size: .9rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(239,68,68,.15); color: #fecaca; border: 1px solid rgba(239,68,68,.35); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn-block { width: 100%; }

.form { display: grid; gap: 1rem; max-width: 520px; }
.form label span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .85rem; }
.form input, .form textarea, .form select {
    width: 100%; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--border);
    background: #0f172a; color: var(--text);
}
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.alert-ok { background: rgba(34,197,94,.12); color: #bbf7d0; border: 1px solid rgba(34,197,94,.25); }
.alert-bad { background: rgba(239,68,68,.12); color: #fecaca; border: 1px solid rgba(239,68,68,.25); }
.alert-warn { background: rgba(245,158,11,.12); color: #fde68a; border: 1px solid rgba(245,158,11,.25); }

.secret-box { background: #0f172a; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-top: 1rem; }
.secret-box pre { margin: .5rem 0 0; white-space: pre-wrap; word-break: break-all; font-size: .82rem; }
.muted { color: var(--muted); font-size: .85rem; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
