/* New Age · Control — Soft deck. Alb / Negru / Custom.
   Carduri rotunjite + umbra moale, font Inter.
   Fara gri fix: liniile/estomparea/panourile se deriva din --fg cu transparenta. */

/* ---- tema ALB (light, implicit pe :root) ---- */
:root {
  --bg: #ffffff;
  --fg: #14161a;
  --accent: #0ea371;
  --warn: #e0912a;
  --crit: #e05561;
  --shadow: 0 8px 24px rgba(20,30,50,.08), 0 1px 2px rgba(20,30,50,.06);
  --shadow-sm: 0 2px 8px rgba(20,30,50,.06);
  color-scheme: light;
}
/* ---- tema NEGRU prin setarea OS, daca nu s-a ales explicit alb/custom ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="custom"]) {
    --bg: #0e1015;
    --fg: #e9ecf2;
    --accent: #39d98a;
    --shadow: 0 12px 34px rgba(0,0,0,.5);
    --shadow-sm: 0 3px 12px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
/* ---- toggle explicit NEGRU ---- */
:root[data-theme="dark"] {
  --bg: #0e1015;
  --fg: #e9ecf2;
  --accent: #39d98a;
  --shadow: 0 12px 34px rgba(0,0,0,.5);
  --shadow-sm: 0 3px 12px rgba(0,0,0,.4);
  color-scheme: dark;
}
/* ---- CUSTOM: --bg/--fg/--accent vin inline din base.html; restul se deriva ---- */
:root[data-theme="custom"] {
  --bg: #0e1015;
  --fg: #e9ecf2;
  --accent: #39d98a;
  --shadow: 0 12px 34px rgba(0,0,0,.5);
  --shadow-sm: 0 3px 12px rgba(0,0,0,.4);
  color-scheme: dark;
}

:root {
  --line: color-mix(in srgb, var(--fg) 12%, transparent);
  --line-soft: color-mix(in srgb, var(--fg) 7%, transparent);
  --dim: color-mix(in srgb, var(--fg) 60%, transparent);
  --faint: color-mix(in srgb, var(--fg) 42%, transparent);
  --panel: color-mix(in srgb, var(--fg) 3%, var(--bg));
  --panel-2: color-mix(in srgb, var(--fg) 6%, var(--bg));
  --r: 18px;
  --r-sm: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--dim); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong { font-weight: 700; letter-spacing: -.01em; font-size: 15px; }
.brand .sep { padding-left: 10px; border-left: 1px solid var(--line); font-size: 12px; }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
  display: inline-block;
}
.topctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.clock { font-weight: 700; letter-spacing: .02em; font-size: 15px; }
.user { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: 12.5px; }

.switch { display: inline-flex; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 2px; }
.switch a { padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--dim); }
.switch a:hover { color: var(--fg); }
.switch a.on { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 57px); }
.rail { border-right: 1px solid var(--line); padding: 16px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 3px; }
.rail a {
  display: block; padding: 9px 13px; color: var(--dim);
  letter-spacing: .01em; font-size: 13px; font-weight: 500;
  border-radius: var(--r-sm); border: 1px solid transparent;
}
.rail a:hover { color: var(--fg); background: var(--panel-2); }
.rail a.on {
  color: var(--fg); font-weight: 600;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.rail a.disabled { opacity: .4; cursor: default; }
.rail a.disabled:hover { background: transparent; color: var(--dim); }
.content { padding: 26px 30px; max-width: 1180px; }

.h { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.sub { font-size: 13.5px; margin: 0 0 18px; }
.rowhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ---------- Panels / cards ---------- */
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 18px; }
.card { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head .ci { width: 30px; height: 30px; border-radius: 9px; background: var(--panel-2); display: grid; place-items: center; color: var(--dim); flex: none; }
.card-head .ci svg { width: 16px; height: 16px; }
.metric { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric .u { font-size: 16px; font-weight: 600; color: var(--dim); margin-left: 4px; letter-spacing: -.01em; }
.card .label { color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.card-head .label { margin: 0; }
.state { display: inline-flex; align-items: center; gap: 7px; margin-top: 11px; font-size: 12.5px; font-weight: 600; color: var(--dim); }
.sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.sdot.warn { background: var(--warn); }
.sdot.off { background: var(--faint); }

/* ---------- Table ---------- */
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.grid th { color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.grid tr:last-child td { border-bottom: 0; }
.grid tr:hover td { background: var(--line-soft); }
.actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.actions form { margin: 0; }
.tag { border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); font-size: 10px; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ok { color: var(--accent); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { color: var(--dim); text-transform: uppercase; letter-spacing: .07em; font-size: 11px; font-weight: 600; margin-top: 12px; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form select {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; font-family: inherit; font-size: 14px;
}
.form input:focus, .form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.form .check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; color: var(--fg); font-size: 13px; }
.roles { display: flex; flex-wrap: wrap; gap: 14px; }
.hint { font-size: 12px; margin-top: 2px; color: var(--dim); }
.formpanel { padding: 24px; max-width: 580px; }
.formactions { display: flex; gap: 10px; margin-top: 20px; }

.segmented { display: inline-flex; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg { padding: 8px 14px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--dim); }
.seg:has(input:checked) { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }
.seg input { accent-color: var(--accent); }
.custombox { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; gap: 22px; flex-wrap: wrap; background: var(--panel-2); }
.colorrow { display: flex; align-items: center; gap: 9px; }
.colorrow input[type="color"] { width: 42px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: .01em;
  padding: 10px 18px; border-radius: var(--r-sm);
  border: 1px solid var(--accent); background: var(--accent); color: #04110a;
  box-shadow: var(--shadow-sm);
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); font-weight: 600; box-shadow: none; }
.btn.ghost:hover { border-color: var(--fg); background: var(--panel-2); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.danger:hover { border-color: var(--crit); color: var(--crit); }

/* ---------- Login ---------- */
.no-shell { display: flex; align-items: center; justify-content: center; }
.loginwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 10%, var(--bg)), var(--bg)); }
.loginpanel { width: 390px; max-width: 100%; padding: 30px; }
.loginhead { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.prompt { color: var(--dim); margin: 14px 0 6px; font-size: 13.5px; }
.err { border: 1px solid var(--crit); color: var(--crit); background: color-mix(in srgb, var(--crit) 10%, var(--bg)); border-radius: var(--r-sm); padding: 9px 12px; margin: 10px 0; font-size: 12.5px; }
.loginfoot { display: flex; justify-content: space-between; margin-top: 20px; }
.loginpanel .btn { width: 100%; justify-content: center; margin-top: 18px; }

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); gap: 6px; }
  .content { padding: 20px 16px; }
  .topctl { gap: 9px; }
  .topbar { padding: 12px 16px; }
}

/* guide + docs */
.guidebtn { position: fixed; right: max(18px, env(safe-area-inset-right,0px)); bottom: max(18px, env(safe-area-inset-bottom,0px)); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--accent); color: #04110a; font-size: 20px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); z-index: 30; }
.guidebtn:hover { filter: brightness(1.06); }
.guidedrawer { position: fixed; top: 0; right: 0; height: 100%; width: 360px; max-width: 92vw; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); z-index: 40; padding: 20px max(18px, env(safe-area-inset-right,0px)) 24px 20px; overflow-y: auto; }
.gd-head { display: flex; align-items: center; justify-content: space-between; }
.gd-badge { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; }
.gd-close { border: 0; background: transparent; color: var(--dim); font-size: 16px; cursor: pointer; }
.gd-close:hover { color: var(--fg); }
.gd-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 10px 0 14px; }
.gd-points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }
.gd-points li { line-height: 1.5; }
.doc-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.doc-intro { color: var(--dim); font-size: 14px; }
.doc-section { padding: 20px; }
.doc-section h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.doc-section .dk { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
.doc-section ul { margin: 12px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 9px; }
.doc-section li { line-height: 1.55; }
.doc-super { font-size: 11.5px; color: var(--faint); }

/* docs layout */
.docs-layout { display: flex; gap: 22px; align-items: flex-start; }
.docs-toc { width: 236px; flex: none; position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.docfind { position: relative; display: flex; align-items: center; }
.docfind .dff-ic { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--dim); pointer-events: none; }
.docfind input { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 10px 9px 32px; font: inherit; font-size: 13px; }
.docfind input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.docfind .dff-count { position: absolute; right: 88px; font-size: 11px; color: var(--dim); }
.docfind .dff-btn { position: absolute; width: 24px; height: 24px; border: 0; background: transparent; color: var(--dim); cursor: pointer; border-radius: 6px; font-size: 13px; line-height: 1; }
.docfind .dff-btn:hover { color: var(--fg); background: var(--panel-2); }
#docFindPrev { right: 58px; }
#docFindNext { right: 32px; }
#docFindClear { right: 6px; }
.toc-nav { display: flex; flex-direction: column; gap: 2px; }
.toc-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 600; padding: 10px 10px 4px; }
.toc-link { display: block; padding: 6px 12px; color: var(--dim); font-size: 13px; border-left: 2px solid var(--line); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.toc-link:hover { color: var(--fg); background: var(--panel-2); }
.toc-link.on { color: var(--fg); border-left-color: var(--accent); font-weight: 600; }
.docs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.doc-section h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 4px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; scroll-margin-top: 80px; }
.doc-section h2 svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.doc-section ul { margin: 12px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 9px; }
.doc-section li { line-height: 1.55; }
::highlight(docfind) { background: color-mix(in srgb, var(--accent) 38%, transparent); border-radius: 2px; }
@media (max-width: 860px) {
  .docs-layout { flex-direction: column; }
  .docs-toc { width: 100%; position: static; }
  .toc-nav { flex-direction: row; flex-wrap: wrap; }
  .toc-cat { width: 100%; padding: 6px 2px 2px; }
  .toc-link { border-left: 0; }
}

/* MFA */
.qrbox { background: #fff; padding: 14px; border-radius: var(--r-sm); width: max-content; margin: 6px 0 14px; }
.qrbox svg { display: block; width: 200px; height: 200px; }
.mono-secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--panel-2); padding: 6px 10px; border-radius: 8px; letter-spacing: .08em; display: inline-block; }
.codes { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes li { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--panel-2); padding: 8px 10px; border-radius: 8px; text-align: center; letter-spacing: .1em; }
.warn-note { color: var(--accent); font-weight: 600; }
.dim-note, .ok-note { color: var(--dim); }
.h2 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
/* tenant pricing */
.pz{width:120px;text-align:right}
.price-tbl td,.price-tbl th{padding:6px 10px}
