/* IPKalix Shield console - design tokens */
:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e5e9f1;
    --line-strong: #d3dae6;

    --brand: #3157d5;
    --brand-600: #2644b3;
    --brand-50: #eef2ff;
    --brand-100: #dfe6ff;

    --side: #0a1226;
    --side-text: #a9b4cb;

    --ok: #107a55;      --ok-bg: #e6f6ef;
    --danger: #c0352b;  --danger-bg: #fdecea;
    --warn: #a86400;    --warn-bg: #fff3d9;
    --neutral: #475569; --neutral-bg: #edf0f6;

    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
    --shadow-md: 0 8px 28px rgba(15, 23, 42, .07);
    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; font-weight: 500; }
a:hover { color: var(--brand-600); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.015em; }
code, .mono { font-family: var(--mono); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; background: var(--side); color: var(--side-text); }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 26px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em; line-height: 1.1; }
.brand-name small { display: block; margin-top: 3px; font-weight: 500; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6f7c97; }

.nav-label { padding: 0 12px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #5f6c88; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-weight: 500; font-size: 14px; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(88, 118, 255, .16); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #7b95ff; }
.nav a.active .ico { color: #9db0ff; }

.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
.nav-scroll .nav-label { padding-top: 18px; }
.nav-scroll .nav-label:first-child { padding-top: 0; }
.nav a { padding: 9px 12px; }
.nav a span { flex: 1; }
.nav a .soon { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); color: #7f8cab; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-card { display: flex; align-items: center; gap: 11px; padding: 8px 8px 10px; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, #4d6bff, #7a52ff); color: #fff; font-weight: 650; font-size: 13px; letter-spacing: .02em; }
.user-meta { min-width: 0; }
.user-meta b { display: block; color: #e8edf8; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 11.5px; color: #6f7c97; }
.logout-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: transparent; color: var(--side-text); font: inherit; font-weight: 500; font-size: 13px; cursor: pointer; transition: all .15s; }
.logout-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.main { min-width: 0; }
.content { max-width: 1320px; margin: 0 auto; padding: 38px 44px 64px; }

/* ---------- Page header ---------- */
.page-head, .toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.content h1 { margin: 0; font-size: 26px; font-weight: 650; line-height: 1.2; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.content h2 { margin: 34px 0 14px; font-size: 16px; font-weight: 650; }

/* ---------- Cards & KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 15px; }
.card-body { padding: 22px; }

.cards, .kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 8px; }
@media (max-width: 1100px) { .cards, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards, .kpis { grid-template-columns: 1fr; } }
.kpi { display: flex; align-items: center; gap: 15px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand-50); color: var(--brand); }
.kpi-ico .ico { width: 21px; height: 21px; }
.kpi-green .kpi-ico { background: var(--ok-bg); color: var(--ok); }
.kpi-slate .kpi-ico { background: var(--neutral-bg); color: var(--neutral); }
.kpi-amber .kpi-ico { background: var(--warn-bg); color: var(--warn); }
.kpi-red .kpi-ico { background: var(--danger-bg); color: var(--danger); }
.kpi .value { font-size: 28px; font-weight: 650; line-height: 1.1; color: var(--ink); letter-spacing: -.02em; }
.kpi .label { margin-top: 3px; font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
th { padding: 12px 18px; background: #f8f9fd; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 15px 18px; border-bottom: 1px solid #eef1f6; font-size: 13.5px; vertical-align: middle; color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fafbff; }
td a { white-space: nowrap; }
td .name { color: var(--ink); font-weight: 600; }
td .mono { display: block; margin-top: 2px; font-size: 11.5px; color: var(--faint); word-break: break-all; }
td form { margin: 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: var(--neutral-bg); color: var(--neutral); }
.badge + .badge { margin-left: 4px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; background: var(--brand); color: #fff; font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1.3; cursor: pointer; box-shadow: 0 1px 2px rgba(49, 87, 213, .35); transition: background .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--brand-600); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: #f8faff; color: var(--ink); border-color: #bcc7dc; }
.btn-danger { background: var(--danger); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }

/* ---------- Forms ---------- */
form.stacked { display: flex; flex-direction: column; gap: 20px; max-width: 640px; }
form.stacked label { display: block; margin-bottom: 7px; color: var(--ink); font-weight: 600; font-size: 13px; }
form.stacked input[type=text], form.stacked input[type=email], form.stacked input[type=password], form.stacked input:not([type]), form.stacked select, form.stacked textarea,
.filters input, .filters select { width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
form.stacked input:focus, form.stacked select:focus, form.stacked textarea:focus, .filters input:focus, .filters select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
form.stacked textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: -3px; margin-right: 8px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.form-actions { display: flex; gap: 10px; padding-top: 6px; }

.check-list { display: grid; gap: 8px; }
.check-list label { display: flex; align-items: center; margin: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s; }
.check-list label:hover { border-color: #bfcbf5; background: #fafbff; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding: 16px 18px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filters > div:last-child { margin-left: auto; }
.filters label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 130px; max-width: 190px; min-width: 130px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Alerts / empty ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 18px; border-radius: 12px; font-size: 13.5px; font-weight: 500; border: 1px solid transparent; }
.alert-info { background: var(--brand-50); color: #243b9c; border-color: var(--brand-100); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f8cdc8; }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty .empty-ico { width: 46px; height: 46px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-50); color: var(--brand); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- Planned pages ---------- */
.content h1 .badge { margin-left: 12px; vertical-align: middle; position: relative; top: -2px; }
.alert .ico { width: 18px; height: 18px; }
.planned-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.planned-h { margin: 0 0 14px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.plain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 13px; }
.plain-list li { position: relative; padding-left: 22px; color: var(--ink); }
.plain-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.muted-list li { color: var(--text); }
.muted-list li::before { background: var(--faint); }

/* ---------- Detail header ---------- */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.detail-head h1 { display: flex; align-items: center; gap: 14px; }
.facts { display: flex; gap: 28px; flex-wrap: wrap; }
.facts div { min-width: 0; }
.facts small { display: block; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.facts span { color: var(--ink); font-weight: 500; font-size: 13.5px; }
.facts .mono { font-size: 12px; color: var(--muted); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 54px 64px; color: #fff; background: radial-gradient(900px 500px at 15% 105%, rgba(105, 130, 255, .45), transparent 60%), radial-gradient(700px 420px at 100% 0%, rgba(122, 82, 255, .35), transparent 55%), linear-gradient(150deg, #0a1226 0%, #12214a 55%, #1b3380 100%); }
.auth-brand .brand { padding: 0; }
.auth-brand h2 { margin: 0 0 14px; max-width: 460px; color: #fff; font-size: 38px; line-height: 1.12; font-weight: 650; letter-spacing: -.025em; border: 0; }
.auth-brand p { max-width: 430px; margin: 0; color: #b9c4e0; font-size: 15.5px; }
.auth-points { display: grid; gap: 14px; margin-top: 34px; }
.auth-points div { display: flex; align-items: center; gap: 12px; color: #d3dcf3; font-size: 14px; }
.auth-points .dot { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .1); color: #a9bbff; }
.auth-points .ico { width: 15px; height: 15px; }
.auth-foot { color: #7f8db0; font-size: 12.5px; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 650; }
.auth-card .subtitle { margin: 0 0 28px; }
.auth-card form.stacked { max-width: none; gap: 18px; }
.auth-card .btn { width: 100%; padding: 12px; font-size: 14.5px; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
    .brand { padding: 0 8px 0 0; }
    .nav-label, .brand-name small, .user-meta { display: none; }
    .nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
    .nav a.active::before { display: none; }
    .sidebar-foot { margin: 0; padding: 0; border: 0; }
    .nav-scroll { display: flex; flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; flex: 1; }
    .nav a .soon { display: none; }
    .planned-grid { grid-template-columns: 1fr; }
    .user-card { display: none; }
    .logout-btn { width: auto; padding: 8px 12px; }
    .content { padding: 24px 16px 48px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}

.nav a .count-pill { font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 999px; background: #ef4444; color: #fff; }
.hint a { font-weight: 600; }

/* compact menu so the full list fits on a laptop screen */
.nav a { padding: 7px 12px; }
.nav-scroll .nav-label { padding-top: 12px; }
.brand { padding-bottom: 16px; }

/* ---------- Multi-client ---------- */
.owner-note { margin: 0 0 14px; padding: 12px 12px 14px; border-radius: 12px; background: rgba(122, 82, 255, .14); color: #d9d2ff; display: grid; gap: 6px; font-size: 12.5px; }
.owner-note b { color: #fff; font-size: 13.5px; }
.owner-note form { margin: 4px 0 0; }
.nav a.locked { opacity: .55; }

/* Two-step sign-in QR code: fixed box, the picture fills it */
.qr-box { width: 200px; height: 200px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-sizing: border-box; overflow: hidden; }
.qr-box svg { display: block; width: 100%; height: 100%; }
