/* ZyberFi website: shared tokens and the account/admin pages. Components match the device admin
   (pisowifi/admin/admin.css); the colors follow the ZyberLink logo blue. Public pages add public.css. */
:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --hover: #f1f4f9;
    --border: #e3e8f0;
    --text: #0b1220;
    --text-2: #334155;
    --muted: #64748b;
    --primary: #1b5fe0;
    --primary-hover: #154cb8;
    --primary-soft: #e9f0fe;
    --on-primary: #ffffff;
    --brand: #1b5fe0;
    --brand-grad: linear-gradient(135deg, #22b8ff 0%, #1b5fe0 55%, #1239b8 100%);
    --ok: #15803d;
    --ok-bg: #dcfce7;
    --warn: #b45309;
    --warn-bg: #fef3c7;
    --err: #dc2626;
    --err-bg: #fee2e2;
    --info: #0369a1;
    --info-bg: #e0f2fe;
    --track: #edf1f7;
    --code-bg: #0b1220;
    --code-text: #e2e8f0;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
    --radius: 8px;
    --radius-sm: 6px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #070b14;
        --surface: #0e1524;
        --surface-2: #0b111e;
        --hover: #16203a;
        --border: #1e2a42;
        --text: #e6ebf5;
        --text-2: #c2cbdc;
        --muted: #8592aa;
        --primary: #4ba3ff;
        --primary-hover: #7bbcff;
        --primary-soft: rgba(75, 163, 255, .13);
        --on-primary: #04101f;
        --ok: #4ade80;
        --ok-bg: rgba(74, 222, 128, .12);
        --warn: #fbbf24;
        --warn-bg: rgba(251, 191, 36, .12);
        --err: #f87171;
        --err-bg: rgba(248, 113, 113, .12);
        --info: #7dd3fc;
        --info-bg: rgba(125, 211, 252, .12);
        --track: #18233a;
        --code-bg: #050912;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
    font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; font-weight: 650; margin: 0; }
h2 { font-size: 1rem; font-weight: 650; margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font-size: .8rem; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 12px; }
small, .muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.ico { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Brand: the logo mark; the light version is used on dark backgrounds ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 8px; color: var(--text); font-weight: 750; font-size: 1.1rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; letter-spacing: 0; }
.brand-mark { height: 32px; width: 32px; flex-shrink: 0; display: block; border-radius: 8px; }
.brand-logo { height: 28px; width: auto; display: block; }
.logo-light { display: none !important; }
@media (prefers-color-scheme: dark) {
    .logo-dark { display: none !important; }
    .logo-light { display: block !important; }
}

/* ---------- App layout (account and admin) ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
    width: 240px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
    padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-head { display: flex; align-items: center; gap: 4px; padding: 0 0 18px; }
.side-head .brand { flex: 1; min-width: 0; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 500;
}
.side nav a .ico { color: var(--muted); }
.side nav a:hover { background: var(--hover); text-decoration: none; }
.side nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side nav a.on .ico { color: var(--primary); }
.nav-sep { display: block; height: 1px; background: var(--border); margin: 12px 8px; }
.nav-count { margin-left: auto; font-size: .72rem; font-weight: 700; background: var(--warn-bg); color: var(--warn); border-radius: 99px; padding: 1px 8px; }
.main { flex: 1; min-width: 0; }
.content { max-width: 1180px; margin: 0 auto; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head h1, .page-head > div:first-child { margin-right: auto; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0 auto 0 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; margin-bottom: 20px; }
.grid2 > .card { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
    box-shadow: var(--shadow); display: grid; gap: 2px; align-content: start;
}
.stat > span { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat > b { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat > small { font-size: .75rem; }
.stat.warn b { color: var(--warn); }
a.stat { color: var(--text); transition: border-color .15s; }
a.stat:hover { text-decoration: none; border-color: var(--primary); }
/* Short lists inside a card: icon, two lines, something on the right */
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: var(--text); min-width: 0; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--surface-2); text-decoration: none; }
.row-ico { flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.row-ico .ico { width: 18px; height: 18px; }
.row-main { flex: 1; min-width: 0; }
.row-main > b, .row-main > .key { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { flex: none; }
.card-note { margin: 0; padding: 12px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.warn-text { color: var(--warn); }
/* Buy a license: steps on the left, summary on the right */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; max-width: 1040px; }
.checkout-steps { display: grid; gap: 16px; min-width: 0; }
.checkout-steps .card { margin: 0; }
.step-card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1.05rem; }
.step-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: .8rem; flex: none; }
.pay-amount { margin-left: auto; font-size: 1.1rem; }
.plan-pick { display: grid; gap: 10px; }
.plan-pick input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.plan-opt:hover { border-color: var(--primary); }
.plan-pick input:checked + .plan-opt { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.plan-pick input:focus-visible + .plan-opt { outline: 2px solid var(--primary); outline-offset: 2px; }
.radio { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); }
.plan-pick input:checked + .plan-opt .radio { border: 5px solid var(--primary); }
.plan-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.plan-text small { color: var(--muted); }
.plan-price { font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.qty-row > div:first-child { display: grid; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.stepper button:hover { background: var(--hover); }
.stepper input { width: 56px; height: 40px; border: 0; border-radius: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; box-shadow: none !important; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pay-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pay-box + .pay-box { margin-top: 10px; }
.pay-logo { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #0a5bd8; color: #fff; font-weight: 800; font-size: 1.1rem; }
.pay-logo.bank { background: var(--primary-soft); color: var(--primary); }
.pay-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pay-info .key { font-size: 1.1rem; }
.seg-opt { cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: inline-flex; font-size: .88rem; font-weight: 600; color: var(--text-2); border-radius: 7px; padding: 7px 12px; }
.seg-opt input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.form-grid label.upload { display: block; position: relative; cursor: pointer; font-weight: 400; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload-empty { display: grid; justify-items: center; gap: 4px; padding: 22px 16px; border: 2px dashed var(--border); border-radius: 10px; text-align: center; transition: border-color .15s, background .15s; }
.upload-empty .ico { width: 26px; height: 26px; color: var(--primary); }
.upload:hover .upload-empty, .upload input:focus-visible ~ .upload-empty { border-color: var(--primary); background: var(--primary-soft); }
.upload-done { display: none; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--primary); border-radius: 10px; background: var(--primary-soft); }
.upload-done img { width: 56px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--surface); flex: none; }
.upload-done > span { display: grid; gap: 2px; min-width: 0; }
.upload-done b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload.has .upload-empty { display: none; }
.upload.has .upload-done { display: flex; }
.proof-thumb { display: inline-block; margin-top: 4px; }
.proof-thumb img { width: 44px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.dlg-proof { display: block; max-width: 100%; max-height: 55vh; margin: 0 auto; border-radius: 8px; border: 1px solid var(--border); }
.note-toggle summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .88rem; }
.note-toggle input { margin-top: 10px; }
.summary { position: sticky; top: 20px; margin: 0; display: grid; gap: 12px; }
.summary h2 { margin: 0 0 4px; font-size: 1.05rem; }
.summary p { margin: 0; font-size: .82rem; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 1px solid var(--border); }
.sum-total b { font-size: 1.6rem; letter-spacing: -.02em; }
.btn.block { width: 100%; justify-content: center; padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 900px) {
    .checkout { grid-template-columns: 1fr; }
    .summary { position: static; }
}

/* One machine or license */
.detail { max-width: 760px; }
.back { display: inline-block; color: var(--muted); font-size: .88rem; font-weight: 500; margin-bottom: 14px; }
.detail-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.detail-ico { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.detail-ico .ico { width: 26px; height: 26px; }
.detail-title { flex: 1 1 260px; min-width: 0; }
.detail-title h1 { margin: 0; font-size: 1.35rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.detail-title p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.info-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border); min-height: 52px; }
.info-list > div:last-child { border-bottom: 0; }
.info-list > div > span:first-child { color: var(--muted); flex: none; }
.info-list > div > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--muted); padding: 36px 20px; }
.empty .ico { width: 30px; height: 30px; margin-bottom: 8px; }
.empty p { margin: 0 0 14px; }

/* ---------- Messages ---------- */
.flash { background: var(--ok-bg); color: var(--text); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; border-left: 4px solid var(--ok); }
.flash.err { background: var(--err-bg); border-left-color: var(--err); }
.flash.warn { background: var(--warn-bg); border-left-color: var(--warn); }
.banner { background: var(--info-bg); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; }
.reveal { display: grid; gap: 8px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
.table-wrap { overflow-x: auto; }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell form, form.inline { display: inline; }
.sub { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pages { display: flex; gap: 4px; }
.pg { min-width: 34px; height: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); color: var(--text-2); font-size: .85rem; font-weight: 600; }
.pg:hover { background: var(--hover); text-decoration: none; }
.pg.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- Badges & buttons ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: var(--track); color: var(--text-2); white-space: nowrap; }
.badge.active { background: var(--ok-bg); color: var(--ok); }
.badge.paused { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.bad { background: var(--err-bg); color: var(--err); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
    color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 16px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-bg); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 5px 11px; font-size: .8rem; border-radius: 8px; }
.btn.lg { padding: 12px 22px; font-size: 1rem; border-radius: 10px; }
.btn .ico { width: 16px; height: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); border: 0; background: none; cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .ico { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
input, select, textarea {
    font: inherit; color: var(--text); background: var(--surface); padding: 9px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); padding: 0; }
input[type="file"] { padding: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid h3.full { margin: 8px 0 -4px; }
.form-grid label, .field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .85rem; }
.form-grid label small, .field small { font-weight: 400; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
.toolbar input[type="search"] { width: 240px; }
.key-box { display: flex; align-items: center; gap: 6px; }
.key { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .95rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
pre { background: var(--code-bg); color: var(--code-text); padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 12px; margin: 0; white-space: pre-wrap; word-break: break-all; }

/* Choice cards (plans in the buy form) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: border-color .15s, background .15s; height: 100%; }
.choice b { font-size: 1rem; }
.choice .price { font-size: 1.25rem; font-weight: 700; }
.choice small { font-weight: 400; }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Segmented tabs */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--track); border-radius: 10px; }
.seg a, .seg button { font: inherit; font-size: .88rem; font-weight: 600; color: var(--text-2); border: 0; background: transparent; cursor: pointer; border-radius: 7px; padding: 7px 12px; display: inline-flex; align-items: center; gap: 7px; }
.seg a:hover, .seg button:hover { color: var(--text); text-decoration: none; }
.seg a[aria-selected="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.seg-count { font-size: .72rem; background: var(--primary-soft); color: var(--primary); border-radius: 99px; padding: 1px 7px; }

/* Dialog */
.dlg { text-align: left; white-space: normal; border: 0; border-radius: var(--radius); padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
.dlg h2 { margin: 0; padding: 18px 20px 4px; font-size: 1.1rem; }
.dlg-body { padding: 12px 20px 20px; display: grid; gap: 14px; }
.dlg-body label { display: grid; gap: 6px; font-weight: 600; font-size: .85rem; }
.dlg-body label small { font-weight: 400; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------- Login / register ---------- */
.auth-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; gap: 22px; background: var(--bg); }
.auth { width: 100%; max-width: 380px; display: grid; gap: 14px; padding: 28px; margin: 0; border-radius: 14px; box-shadow: none; }
.auth-brand .brand-logo { height: 34px; }
.auth.wide { max-width: 460px; }
.auth h1 { margin: 0; font-size: 1.3rem; }
.auth .lead { margin: -8px 0 4px; color: var(--muted); }
.auth label { display: grid; gap: 6px; font-weight: 600; font-size: .85rem; }
.auth label small { font-weight: 400; }
.auth .btn { width: 100%; padding: 10px; }
.auth-foot { text-align: center; color: var(--muted); font-size: .9rem; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 1.2rem; }
.auth-brand:hover { text-decoration: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Account security ---------- */
.sec-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sec-row > div { flex: 1 1 320px; }
.codes-box { margin-top: 16px; padding: 16px; border-radius: 10px; border: 1px dashed var(--warn); background: var(--warn-bg); display: grid; gap: 10px; }
.codes-box p { margin: 0; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.codes span { background: var(--surface); border-radius: 6px; padding: 6px 10px; text-align: center; font-size: 1rem; letter-spacing: .04em; }
.setup-2fa { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.setup-2fa ol { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 6px; }
.setup-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.qr { width: 196px; height: 196px; padding: 8px; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.qr img, .qr canvas { display: block; }
.setup-side { display: grid; gap: 10px; align-content: start; }
.setup-key { font-size: 1.05rem; letter-spacing: .06em; overflow-wrap: anywhere; }
.code-input { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 1.15rem; letter-spacing: .15em; text-align: center; }

/* ---------- Phone ---------- */
.nav-toggle, .nav-close { display: none; border: 0; background: none; color: var(--text); cursor: pointer; border-radius: 10px; width: 40px; height: 40px; place-items: center; }
.nav-toggle:hover, .nav-close:hover { background: var(--hover); }
.nav-toggle .ico, .nav-close .ico { width: 22px; height: 22px; }
@media (max-width: 860px) {
    .layout { flex-direction: column; }
    .side {
        width: auto; height: auto; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
        padding: 10px 12px 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible;
    }
    .brand { padding: 0; }
    .side-head { flex: 1; padding: 0; }
    .nav-toggle { display: grid; }
    .side nav {
        display: none; position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 86vw); z-index: 2;
        background: var(--surface); padding: 12px; overflow-y: auto; box-shadow: var(--shadow-lg);
    }
    .nav-close { display: grid; margin-left: auto; margin-bottom: 4px; }
    body.nav-open .side nav { display: flex; }
    body.nav-open { overflow: hidden; }
    body.nav-open::before { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 25; }
    .content { padding: 18px 16px 40px; }
    .grid2 { grid-template-columns: 1fr; }
    .stat > b { font-size: 1.4rem; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dd { margin-bottom: 8px; }
    .toolbar input[type="search"] { width: 100%; }
    .two { grid-template-columns: 1fr; }
    /* Tables become stacked rows */
    .stack thead { display: none; }
    .stack tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .stack td { border: 0; padding: 0 !important; }
    .stack td.actions-cell { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
    .stack td:not(:first-child):not(.actions-cell) { grid-column: 1; font-size: .86rem; color: var(--text-2); }
    .stack td.num { text-align: left; }
    .stack td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }
    .stack tbody tr:hover td { background: none; }
}
