:root {
  --bg: #f4f6f8; --panel: #ffffff; --text: #18212d; --muted: #66707f; --line: #e3e7ec;
  --brand: #0f766e; --brand-2: #0b5e57; --brand-soft: #e6f4f2;
  --ok: #12805c; --ok-soft: #e7f6ef; --bad: #c0362c; --bad-soft: #fdeceb; --warn: #b54708; --warn-soft: #fef4e6;
  --chip: #eef1f5; --side: #0f1c24; --side-text: #c8d3dc; --side-active: #1d313d;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.07);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1218; --panel: #151c25; --text: #e6eaf0; --muted: #96a1b0; --line: #26303c;
          --brand: #2dd4bf; --brand-2: #5eead4; --brand-soft: #123331;
          --ok: #4ade80; --ok-soft: #12291c; --bad: #f87171; --bad-soft: #321718; --warn: #fbbf24; --warn-soft: #2f2410;
          --chip: #1f2833; --side: #0a1016; --side-text: #aab6c3; --side-active: #18242f; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- karkasas --- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; padding: 4px 10px 18px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: #0f766e; display: grid; place-items: center; flex: none; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--side-text); font-weight: 500; }
.side a.nav:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.side a.nav.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.side .sep { flex: 1; }
.side .me { border-top: 1px solid #22323d; padding: 12px 10px 0; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.side .me a { color: var(--side-text); }
.side .me button { background: transparent; color: var(--side-text); border-color: #2a3b47; }
.topbar { display: none; }
main { padding: 26px 30px 70px; max-width: 1280px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .topbar b { color: var(--brand); font-size: 17px; flex: 1; }
  main { padding: 16px 12px 70px; }
}

/* --- komponentai --- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cols { display: grid; gap: 16px; grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.kpi .l { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kpi.ok .v { color: var(--ok); } .kpi.bad .v { color: var(--bad); } .kpi.warn .v { color: var(--warn); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px; min-width: 0; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
textarea { min-height: 150px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: end; }
.form .full { grid-column: 1 / -1; }
button, .btn { font: inherit; font-weight: 500; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 9px; padding: 8px 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
button:hover, .btn:hover { border-color: var(--brand); text-decoration: none; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-2); }
button.danger { color: var(--bad); }
button.ghost { background: transparent; border-color: transparent; }
button.big { padding: 12px 18px; font-size: 15.5px; font-weight: 600; width: 100%; }
button:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: var(--chip); font-size: 12px; font-weight: 500; }
.chip.ok { color: var(--ok); background: var(--ok-soft); } .chip.bad { color: var(--bad); background: var(--bad-soft); }
.chip.warn { color: var(--warn); background: var(--warn-soft); } .chip.brand { color: var(--brand); background: var(--brand-soft); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.plate { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 700; letter-spacing: .06em;
  border: 1.5px solid var(--text); border-left: 7px solid #1d4ed8; border-radius: 4px; padding: 0 7px; background: var(--panel); white-space: nowrap; }
.err { color: var(--bad); margin: 8px 0; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 9px; padding: 10px 12px; font-size: 14px; }
.okbox { background: var(--ok-soft); color: var(--ok); border-radius: 9px; padding: 12px 14px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); }
.center-page { max-width: 420px; margin: 9vh auto; padding: 0 14px; }
.center-page .card { padding: 28px; }
.center-page .brand { display: flex; align-items: center; gap: 10px; color: var(--brand); font-weight: 700; font-size: 22px; margin-bottom: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.lane { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.gate { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gate:last-child { border-bottom: 0; }
.gate button { width: auto; }
.thumb { height: 34px; border-radius: 4px; border: 1px solid var(--line); background: var(--chip); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--chip); padding: 3px 7px; border-radius: 6px; word-break: break-all; }
.right { text-align: right; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.bars div { flex: 1; background: var(--brand); opacity: .8; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.bigplate { font-size: 26px; text-transform: uppercase; text-align: center; letter-spacing: .08em; font-weight: 700; }
@media (max-width: 640px) {
  th.hide-m, td.hide-m { display: none; } h1 { font-size: 20px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 10px 12px; } .kpi .v { font-size: 22px; } .kpi .l { font-size: 12px; }
  .card { padding: 14px; }
}

/* --- 1 etapas: pranešimai, sveikata, 2FA --- */
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff;
  font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.topbar .bell { position: relative; color: var(--text); display: grid; place-items: center; width: 36px; height: 36px; }
.topbar .bell .badge { position: absolute; top: 0; right: -4px; margin: 0; }
.notice { padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.notice.unread { border-color: var(--brand); background: var(--brand-soft); }
.notice a { font-size: 13px; }
tr.off td { opacity: .5; }
.note.warn { display: flex; flex-direction: column; gap: 4px; }
.note.warn > svg { display: inline; }
.sparks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.spark { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.spark .l { color: var(--muted); font-size: 13px; }
.spark .v { font-size: 20px; font-weight: 700; }
.spark .v.warn { color: var(--warn); }
.spark svg { width: 100%; height: 44px; display: block; margin: 4px 0; }
.spark polyline { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.totp-setup { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.totp-setup .qr { background: #fff; border-radius: 10px; padding: 6px; line-height: 0; }
.totp-setup .qr svg { width: 190px; height: 190px; }
.rcodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 6px; }
.rcodes .code { text-align: center; color: var(--text); }
.nowrap { white-space: nowrap; }
table.audit .act { white-space: nowrap; word-break: normal; }
table.audit td.det { max-width: 460px; word-break: break-word; }
.relnotes { margin-top: 8px; border-left: 3px solid var(--brand); padding: 4px 10px; }
@media (max-width: 900px) { .page-head .seg button { padding: 6px 10px; } .page-head h1 { font-size: 20px; } }
