/* ============================================================
   SecurePlusX Admin — Design tokens
   Theme: dark security console. Status pills (● / ○) are the
   signature element, reused from the app's own dashboard language.
   ============================================================ */

:root {
    --bg: #0B0F14;
    --surface: #121821;
    --surface-2: #1A222D;
    --border: #232C38;
    --text: #E6EDF3;
    --text-dim: #8A97A6;
    --accent: #14E0B4;      /* secure / active */
    --danger: #F0465B;      /* recording / destructive */
    --warning: #F5A623;     /* storage / caution */
    --success: #22C55E;     /* enabled / ok */
    --ai: #9B8CFA;          /* AI-related */

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

    --radius: 8px;
    --sidebar-w: 240px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
}

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

/* ---------- Layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.sidebar-brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.sidebar-brand strong {
    font-size: 15px;
    letter-spacing: 0.3px;
}

.sidebar-brand span {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.nav-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 16px 20px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--text-dim);
    font-size: 13.5px;
    border-left: 2px solid transparent;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); }

.nav-link.active {
    color: var(--text);
    background: var(--surface-2);
    border-left-color: var(--accent);
}

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 28px 32px 60px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
    font-weight: 600;
}

.topbar .meta {
    font-size: 12px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-dim);
}

.admin-user a { color: var(--danger); }

/* ---------- Status pills (signature element) ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.status-pill .dot { font-size: 10px; line-height: 1; }
.status-pill.on .dot { color: var(--success); }
.status-pill.off .dot { color: var(--text-dim); }
.status-pill.rec .dot { color: var(--danger); }
.status-pill.ai .dot { color: var(--ai); }

/* ---------- Cards / stat grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

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

.card .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.card .value {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 600;
}

.card .sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.panel h2 {
    font-size: 15px;
    margin: 0 0 14px;
    font-weight: 600;
}

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); }

/* ---------- Forms / buttons ---------- */
.form-row { margin-bottom: 14px; }

.form-row label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

input[type=text], input[type=email], input[type=password], input[type=number], select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 13.5px;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: #04120E;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); color: #fff; }

.toggle {
    position: relative;
    display: inline-block;
    width: 38px; height: 21px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
    position: absolute; inset: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: 0.15s;
}
.toggle .slider:before {
    content: "";
    position: absolute;
    height: 15px; width: 15px;
    left: 2px; top: 2px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: 0.15s;
}
.toggle input:checked + .slider { background: rgba(20,224,180,0.15); border-color: var(--accent); }
.toggle input:checked + .slider:before { transform: translateX(17px); background: var(--accent); }

.badge {
    display: inline-block;
    font-size: 11px;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.badge.plan-free { color: var(--text-dim); }
.badge.plan-pro, .badge.plan-premium_plus { color: var(--accent); border-color: var(--accent); }
.badge.plan-business, .badge.plan-enterprise { color: var(--ai); border-color: var(--ai); }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}
.alert.error { background: rgba(240,70,91,0.1); border: 1px solid var(--danger); color: var(--danger); }
.alert.success { background: rgba(34,197,94,0.1); border: 1px solid var(--success); color: var(--success); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 13.5px;
}

/* ---------- Login page ---------- */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, #131B24 0%, #0B0F14 60%);
}

.login-box {
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px 28px;
}

.login-box .brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-box .brand .dot {
    display: inline-block;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    margin-bottom: 10px;
}

.login-box .brand strong { display: block; font-size: 16px; }
.login-box .brand span { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
