/* HostScope – sistem de design (fără resurse externe; fonturi de sistem) */

/* ------------------------------------------------------------------ tokens */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --sidebar-w: 248px; --topbar-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 120ms; --t: 220ms; --t-slow: 420ms;
  color-scheme: dark;

  --bg: #0a1020;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(59,130,246,.10), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(34,211,238,.06), transparent 60%);
  --surface: #0f1729;
  --surface-2: #131d33;
  --surface-3: #1a263f;
  --border: #22304b;
  --border-strong: #2e3f60;
  --text: #e6edf7;
  --text-2: #b8c5da;
  --muted: #8a9bb8;
  --accent: #4c8dff;
  --accent-2: #3b74e6;
  --accent-soft: rgba(76,141,255,.14);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34,211,238,.12);
  --success: #22c55e; --success-soft: rgba(34,197,94,.14);
  --warning: #f59e0b; --warning-soft: rgba(245,158,11,.14);
  --danger: #ef4444; --danger-soft: rgba(239,68,68,.14);
  --info: #38bdf8; --info-soft: rgba(56,189,248,.12);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.25);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.45);
  --glow: 0 0 0 1px rgba(76,141,255,.35), 0 0 24px rgba(76,141,255,.18);
  --row-hover: rgba(76,141,255,.06);
  --row-selected: rgba(76,141,255,.14);
  --skeleton: linear-gradient(90deg, #162238 0%, #1e2c47 50%, #162238 100%);
  --chart-grid: #1f2c45;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(37,99,235,.06), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #edf1f8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5b6b82;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: rgba(37,99,235,.10);
  --cyan: #0891b2;
  --cyan-soft: rgba(8,145,178,.10);
  --success: #16a34a; --success-soft: rgba(22,163,74,.10);
  --warning: #d97706; --warning-soft: rgba(217,119,6,.12);
  --danger: #dc2626; --danger-soft: rgba(220,38,38,.10);
  --info: #0284c7; --info-soft: rgba(2,132,199,.10);
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 6px 20px rgba(15,23,42,.06);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.18);
  --glow: 0 0 0 1px rgba(37,99,235,.3), 0 0 18px rgba(37,99,235,.12);
  --row-hover: rgba(37,99,235,.04);
  --row-selected: rgba(37,99,235,.10);
  --skeleton: linear-gradient(90deg, #eef2f8 0%, #f8fafd 50%, #eef2f8 100%);
  --chart-grid: #e7ecf4;
}

/* ------------------------------------------------------------------ bază */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text); background: var(--bg);
  background-image: var(--bg-grad); background-attachment: fixed; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
html.theme-anim body, html.theme-anim .sidebar, html.theme-anim .card, html.theme-anim .topbar {
  transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease), border-color var(--t-slow) var(--ease);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
kbd { padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); font-size: .8rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; } .icon-lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app.collapsed { --sidebar-w: 72px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface);
  border-right: 1px solid var(--border); overflow: hidden; z-index: 20; transition: width var(--t) var(--ease);
}
.brand { display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 18px; border-bottom: 1px solid var(--border); flex: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--cyan)); box-shadow: 0 4px 14px rgba(76,141,255,.35); flex: none; }
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-name small { display: block; font-weight: 500; font-size: .7rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-section { margin: 14px 10px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); white-space: nowrap; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 9px;
  color: var(--text-2); font-weight: 500; white-space: nowrap; text-decoration: none; transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav a.active .icon { color: var(--accent); }
.nav .nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; }
.app.collapsed .brand-name, .app.collapsed .nav-section, .app.collapsed .nav a span, .app.collapsed .sidebar-foot .ver { display: none; }
.app.collapsed .nav a { justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }
.global-search { position: relative; width: min(520px, 42vw); }
.global-search input { width: 100%; padding-left: 36px; height: 38px; border-radius: 10px; background: var(--surface-2); }
.global-search > .icon { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.global-search .kbd-hint { position: absolute; right: 8px; top: 8px; }
.suggest { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; max-height: 420px; overflow: auto; }
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.suggest-item:hover, .suggest-item.active { background: var(--accent-soft); }
.suggest-item .sub { color: var(--muted); font-size: .8rem; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.suggest-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; }
.top-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: .82rem; cursor: pointer; white-space: nowrap; }
.top-pill.running { border-color: rgba(76,141,255,.45); color: var(--text); box-shadow: var(--glow); }
.top-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.top-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.top-btn .count { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 22px; cursor: pointer; border: 1px solid transparent; background: none; color: var(--text); }
.user-chip:hover { background: var(--surface-2); border-color: var(--border); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff; background: linear-gradient(135deg, #6366f1, var(--accent)); }
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; animation: pop var(--t) var(--ease); }
.dropdown a, .dropdown button.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.dropdown a:hover, .dropdown button.dd-item:hover { background: var(--surface-2); }
.dropdown .dd-sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown .dd-head { padding: 8px 10px; color: var(--muted); font-size: .8rem; }
.rel { position: relative; }

.banner { display: flex; align-items: center; gap: 10px; padding: 9px 22px; font-size: .86rem; border-bottom: 1px solid var(--border); }
.banner.warn { background: var(--warning-soft); color: var(--text); }
.banner.info { background: var(--info-soft); }

.content { padding: 22px 26px 40px; min-width: 0; flex: 1; animation: fadeUp var(--t-slow) var(--ease); }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ utilitare grid */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cols-wide { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-sm { margin-bottom: 8px; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .tiny { font-size: .74rem; }
.text-right { text-align: right; } .nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { word-break: break-all; }
.c-success { color: var(--success); } .c-warning { color: var(--warning); } .c-danger { color: var(--danger); } .c-accent { color: var(--accent); } .c-cyan { color: var(--cyan); }
@media (max-width: 1500px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .cols-3, .cols-2 { grid-template-columns: 1fr; } .span-2, .span-3 { grid-column: auto; } }

/* ------------------------------------------------------------------ carduri */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h3, .card-head h2 { margin: 0; font-size: 1rem; }
.card-head .sub { color: var(--muted); font-size: .8rem; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 10px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; display: flex; gap: 10px; align-items: center; }
.card.hoverable { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t); }
.card.hoverable:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow), var(--glow); }

.stat {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); cursor: pointer; overflow: hidden; text-align: left; color: var(--text); font: inherit;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t);
}
.stat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--accent-soft), transparent 55%); opacity: 0; transition: opacity var(--t); pointer-events: none; }
.stat:hover { transform: translateY(-2px); border-color: rgba(76,141,255,.45); box-shadow: var(--shadow), var(--glow); }
.stat:hover::after { opacity: 1; }
.stat:active { transform: translateY(0) scale(.99); }
.stat-top { display: flex; align-items: center; gap: 10px; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.stat-icon.cyan { background: var(--cyan-soft); color: var(--cyan); }
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat-value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.static { cursor: default; }

/* ------------------------------------------------------------------ butoane */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 550;
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none; overflow: hidden;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(76,141,255,.28); }
.btn-primary:hover { background: linear-gradient(180deg, var(--accent), var(--accent)); box-shadow: 0 6px 20px rgba(76,141,255,.38); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); border-color: rgba(239,68,68,.4); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-soft); border-color: rgba(34,197,94,.4); color: var(--success); }
.btn-sm { height: 30px; padding: 0 10px; font-size: .84rem; border-radius: 8px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: .76rem; border-radius: 6px; gap: 4px; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.loading { pointer-events: none; opacity: .85; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }
.btn-group .btn.active { background: var(--accent-soft); border-color: rgba(76,141,255,.5); color: var(--text); z-index: 1; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .25; transform: scale(0); animation: ripple 500ms ease-out; pointer-events: none; }

/* ------------------------------------------------------------------ formulare */
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm, .select.sm { height: 30px; font-size: .85rem; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.field .help { font-size: .76rem; color: var(--muted); }
.field .error { font-size: .78rem; color: var(--danger); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 11px; background: var(--border-strong); position: relative; transition: background var(--t); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t) var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.input-group { display: flex; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .btn { border-radius: 0 9px 9px 0; margin-left: -1px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 40px; }
.pw-toggle { position: absolute; right: 4px; top: 3px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { margin: 0; min-width: 140px; }

/* ------------------------------------------------------------------ tabele */
.table-wrap { overflow: auto; border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--row-hover); }
.table tbody tr.selected { background: var(--row-selected); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable::after { content: "↕"; opacity: .35; margin-left: 5px; font-size: .8em; }
.table th.asc::after { content: "↑"; opacity: 1; color: var(--accent); }
.table th.desc::after { content: "↓"; opacity: 1; color: var(--accent); }
.table .cell-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.table .cell-name .ellipsis { max-width: 420px; }
.table .path { color: var(--muted); font-size: .8rem; max-width: 460px; }
.table td.actions { white-space: nowrap; text-align: right; }
.table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); }
.table.compact td { padding: 6px 10px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; flex-wrap: wrap; }
.pager .spacer { flex: 1; }
.sizebar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.sizebar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width var(--t-slow) var(--ease); }
.ext-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.file-ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; font-size: .58rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: #fff; }

/* ------------------------------------------------------------------ badge, chip, callout */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: .74rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge .dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); font-size: .82rem; cursor: pointer; user-select: none; transition: all var(--t-fast); }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent-soft); border-color: rgba(76,141,255,.55); color: var(--text); }
.chip .x { opacity: .6; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); font-size: .87rem; }
.callout .icon { margin-top: 1px; }
.callout.info { background: var(--info-soft); border-color: rgba(56,189,248,.35); }
.callout.warn { background: var(--warning-soft); border-color: rgba(245,158,11,.4); }
.callout.danger { background: var(--danger-soft); border-color: rgba(239,68,68,.4); }
.callout.success { background: var(--success-soft); border-color: rgba(34,197,94,.4); }
.callout p:last-child { margin: 0; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { position: relative; padding: 9px 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tab-panel { animation: fadeUp var(--t) var(--ease); }

/* ------------------------------------------------------------------ progres, skeleton */
.progress { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > .bar { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width var(--t-slow) var(--ease); }
.progress.indeterminate > .bar { width: 35%; animation: indet 1.3s var(--ease) infinite; }
.progress.success > .bar { background: var(--success); }
.progress.danger > .bar { background: var(--danger); }
.skeleton { border-radius: 6px; background: var(--skeleton); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; min-height: 14px; }
.skeleton.line { height: 12px; margin: 8px 0; }
.skeleton.block { height: 160px; }
.loading-row td { padding: 14px 12px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; stroke-width: 1.3; color: var(--border-strong); margin-bottom: 10px; }
.empty h3 { color: var(--text); }

/* ------------------------------------------------------------------ modal, panou lateral, toast, tooltip */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5,10,20,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade var(--t) var(--ease); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop var(--t) var(--ease); }
.modal.wide { width: min(900px, 100%); } .modal.xl { width: min(1200px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.side-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(520px, 92vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform var(--t-slow) var(--ease); display: flex; flex-direction: column; }
.side-panel.open { transform: none; }
.side-panel .sp-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.side-panel .sp-head h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-panel .sp-body { padding: 16px 18px; overflow: auto; flex: 1; }
.side-panel .sp-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; background: var(--surface-2, var(--surface)); }
.side-panel .sp-foot:empty { display: none; }
.side-panel .sp-foot > .btn { width: 100%; justify-content: flex-start; }
.side-panel .sp-foot > .btn-primary { grid-column: 1 / -1; justify-content: center; }
/* carduri rădăcini */
.root-card .card-body { display: flex; flex-direction: column; }
.root-card .path-line { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .82rem; }
.root-card .path-line code { flex: 1; min-width: 0; }
.root-card .card-foot { flex-wrap: wrap; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-stats > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2, transparent); min-width: 0; }
.mini-stats span { display: block; color: var(--muted); font-size: .74rem; margin-bottom: 2px; }
.mini-stats strong { display: block; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv.compact { grid-template-columns: 130px 1fr; font-size: .82rem; }
.chip-code { display: inline-block; margin: 0 4px 4px 0; padding: 1px 6px; border-radius: 6px; background: var(--surface-2, rgba(127,127,127,.12)); font-size: .78rem; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; font-size: .86rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; word-break: break-word; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); box-shadow: var(--shadow-lg); animation: toastIn var(--t-slow) var(--ease); font-size: .88rem; }
.toast.success { border-left-color: var(--success); } .toast.error { border-left-color: var(--danger); } .toast.warning { border-left-color: var(--warning); }
.toast.leaving { animation: toastOut var(--t) var(--ease) forwards; }
.tooltip { position: fixed; z-index: 120; pointer-events: none; max-width: 340px; padding: 8px 10px; border-radius: 8px; background: #0b1222; color: #e6edf7; font-size: .8rem; box-shadow: var(--shadow-lg); border: 1px solid #22304b; animation: fade var(--t-fast); line-height: 1.4; }
.tooltip b { color: #fff; }

/* ------------------------------------------------------------------ arbore, breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .86rem; }
.breadcrumb button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 2px 6px; border-radius: 6px; font: inherit; }
.breadcrumb button:hover { background: var(--accent-soft); }
.breadcrumb .sep { color: var(--muted); }
.breadcrumb .current { color: var(--text); font-weight: 600; padding: 2px 6px; }
.tree { font-size: .87rem; user-select: none; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; }
.tree > ul { padding-left: 0; }
.tree-node { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.tree-node:hover { background: var(--surface-2); }
.tree-node.active { background: var(--accent-soft); color: var(--text); }
.tree-node .caret { width: 16px; height: 16px; display: grid; place-items: center; color: var(--muted); transition: transform var(--t) var(--ease); flex: none; }
.tree-node.open .caret { transform: rotate(90deg); }
.tree-node .size { margin-left: auto; color: var(--muted); font-size: .76rem; padding-left: 10px; }
.tree-children { overflow: hidden; animation: expand var(--t) var(--ease); }

/* ------------------------------------------------------------------ grafice */
.chart { position: relative; width: 100%; min-height: 220px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .series-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { opacity: .16; }
.chart .bar { transition: opacity var(--t-fast); cursor: pointer; }
.chart .bar:hover { opacity: .8; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 900ms var(--ease) forwards; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--text-2); }
.legend .item { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-empty { display: grid; place-items: center; height: 200px; color: var(--muted); font-size: .88rem; text-align: center; }

/* ------------------------------------------------------------------ autentificare */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; overflow: hidden; position: relative; }
.auth-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.auth-bg span { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; animation: float 18s ease-in-out infinite alternate; }
.auth-bg span:nth-child(1) { width: 420px; height: 420px; background: rgba(76,141,255,.35); top: -120px; right: -80px; }
.auth-bg span:nth-child(2) { width: 360px; height: 360px; background: rgba(34,211,238,.22); bottom: -120px; left: -60px; animation-delay: -6s; }
.auth-bg span:nth-child(3) { width: 260px; height: 260px; background: rgba(99,102,241,.25); top: 40%; left: 55%; animation-delay: -12s; }
.auth-card { position: relative; z-index: 1; width: min(410px, 100%); padding: 30px 30px 24px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop var(--t-slow) var(--ease); }
.auth-card .brand { border: 0; height: auto; padding: 0 0 18px; justify-content: center; }
.auth-card h1 { font-size: 1.3rem; text-align: center; }
.auth-card .lead { text-align: center; color: var(--muted); margin-bottom: 20px; font-size: .9rem; }
.auth-card .btn-primary { width: 100%; height: 42px; margin-top: 4px; }
.auth-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: .76rem; }
.auth-theme { position: fixed; top: 16px; right: 16px; z-index: 2; }
.shake { animation: shake 420ms var(--ease); }
.otp-input { text-align: center; letter-spacing: .5em; font-size: 1.3rem; font-family: var(--mono); height: 48px; }

/* ------------------------------------------------------------------ installer */
.install-wrap { max-width: 980px; margin: 0 auto; padding: 34px 22px 60px; position: relative; z-index: 1; }
.steps { display: flex; gap: 6px; margin: 18px 0 22px; }
.steps .step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.steps .step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: .78rem; flex: none; }
.steps .step.done .n { background: var(--success); color: #fff; }
.steps .step.current { border-color: var(--accent); color: var(--text); box-shadow: var(--glow); }
.steps .step.current .n { background: var(--accent); color: #fff; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: grid; grid-template-columns: 26px 220px 1fr; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.check-list li:last-child { border-bottom: 0; }
.check-list .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; }
.check-list .st.ok { background: var(--success); } .check-list .st.warn { background: var(--warning); } .check-list .st.fail { background: var(--danger); }
.check-list .rec { color: var(--muted); font-size: .8rem; }
.codebox { position: relative; font-family: var(--mono); font-size: .82rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 44px 12px 14px; word-break: break-all; }
.codebox .copy { position: absolute; top: 6px; right: 6px; }

/* ------------------------------------------------------------------ widgeturi dashboard */
.widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.widget { grid-column: span 6; transition: transform var(--t) var(--ease), opacity var(--t); }
.widget.w-4 { grid-column: span 4; } .widget.w-6 { grid-column: span 6; } .widget.w-8 { grid-column: span 8; } .widget.w-12 { grid-column: span 12; }
.widget.dragging { opacity: .45; }
.widget.drop-target { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--r-lg); }
.widget .drag-handle { cursor: grab; color: var(--muted); }
.editing .widget .card { box-shadow: var(--glow); }
@media (max-width: 1300px) { .widget.w-4, .widget.w-6, .widget.w-8 { grid-column: span 12; } }

/* ------------------------------------------------------------------ animații */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes indet { 0% { left: -35%; } 100% { left: 100%; } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes expand { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float { from { transform: translate(0, 0); } to { transform: translate(40px, 30px); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes celebrate { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
.celebrate { animation: celebrate 600ms var(--ease); }

/* dezactivare animații: preferința sistemului sau setarea utilizatorului */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important;
}
html[data-motion="off"] .auth-bg span { animation: none; }

@media print {
  .sidebar, .topbar, .page-actions, .toasts, .side-panel, .banner { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* QR 2FA */
.qr-box { background: #fff; padding: 10px; border-radius: var(--r); line-height: 0; flex: none; }
.qr-box svg { width: 200px; height: 200px; }
.install-wrap .row h1 { margin: 0; }

/* SVG-urile de grafic cu dimensiune explicită (donut, sunburst) își păstrează dimensiunea; restul se întind pe lățime */
.chart svg[width] { width: auto; height: auto; max-width: 100%; flex: none; }
