/* Administrare și instalare – separat de CSS-ul public (folosește aceleași variabile de temă). */
.admin-body { background: var(--bg); }
.adm { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
@media (min-width: 1000px) { .adm { grid-template-columns: 252px minmax(0, 1fr); } }

/* ---------- Bara laterală ---------- */
.adm-side { background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; }
@media (min-width: 1000px) { .adm-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.adm-brand:hover { text-decoration: none; color: var(--ink); }
.adm-brand strong { display: block; font-size: 1.05rem; letter-spacing: -.01em; }
.adm-brand small { display: block; font-size: .74rem; color: var(--muted); letter-spacing: .04em; }
.adm-brand .brand-tile { width: 38px; height: 38px; }
.adm-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.adm-nav a, .adm-nav button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink); font: inherit; font-size: .93rem; font-weight: 550; background: none; border: 0; cursor: pointer; text-align: left; transition: background var(--t), color var(--t); }
.adm-nav .i { width: 18px; height: 18px; color: var(--muted); transition: color var(--t); }
.adm-nav a:hover, .adm-nav button:hover { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.adm-nav a:hover .i, .adm-nav button:hover .i { color: var(--accent-text); }
.adm-nav a[aria-current] { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.adm-nav a[aria-current] .i { color: var(--accent-text); }
.adm-nav-foot { margin-top: 14px !important; padding-top: 12px !important; border-top: 1px solid var(--line); }
.adm-logout { color: #B91C1C !important; }
:root[data-theme="dark"] .adm-logout { color: #FCA5A5 !important; }
.adm-menu-btn { display: none; }
@media (max-width: 999px) {
  .adm-side { flex-direction: row; flex-wrap: wrap; align-items: center; position: sticky; top: 0; z-index: 30; }
  .adm-brand { border: 0; margin: 0; padding: 4px; margin-right: auto; }
  .adm-menu-btn { display: inline-flex; }
  .adm-nav { flex-basis: 100%; }
  html.js .adm-nav:not(.open) { display: none; }
}

/* ---------- Conținut ---------- */
.adm-main { min-width: 0; padding: 26px clamp(16px, 2.6vw, 36px) 48px; }
.adm-main > * { max-width: 1680px; }
.adm-flash { margin-bottom: 14px; }
.adm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.adm-head h1 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); display: flex; align-items: center; gap: 10px; }
.adm-head h1 .i { width: 26px; height: 26px; color: var(--accent-text); }
.adm-sub { margin: 6px 0 0; color: var(--muted); max-width: 90ch; font-size: .95rem; }
.adm-main h2 { font-size: 1.15rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.adm-main h2 .i { width: 20px; height: 20px; color: var(--accent-text); }
.adm-main h3 { font-size: 1rem; margin: 18px 0 8px; }
.adm-main section { margin-bottom: 18px; }
.adm-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.adm-card > :last-child { margin-bottom: 0; }
.adm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-card-head h2 { margin: 0; }
.adm-card-head p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.adm-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; margin-bottom: 18px; }
.adm-grid > .adm-card { margin: 0; height: 100%; }
.adm-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); }
.adm-grid-wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .adm-grid-wide { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Formulare ---------- */
.fields { display: grid; gap: 16px 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); align-items: start; }
.fields .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-weight: 400; }
.field > .lbl { font-weight: 650; font-size: .88rem; line-height: 1.35; }
.field input, .field select, .field textarea { width: 100%; }
.field .help { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.secret-state { font-size: .76rem; font-weight: 700; }
.secret-set { color: #047857; } :root[data-theme="dark"] .secret-set { color: #6EE7B7; }
.secret-unset { color: var(--muted); }
.clear-secret { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); font-weight: 500; cursor: pointer; }
.clear-secret input { width: 15px !important; height: 15px; min-height: 0; margin: 0; }
.switch-list { display: grid; gap: 0 1px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 0 0 18px; background: var(--line); }
.switch-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--paper); cursor: pointer; transition: background var(--t); margin: 0 0 1px; font-weight: 400; }
.switch-row:hover { background: var(--bg); }
.switch-row .sr-text { display: flex; flex-direction: column; gap: 2px; font-weight: 600; font-size: .9rem; line-height: 1.35; }
.switch-row .sr-text small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.switch-row input, .tg { appearance: none; -webkit-appearance: none; width: 42px !important; height: 24px; min-height: 0; border-radius: 999px; background: var(--line-strong); border: 0; padding: 0; margin: 0; position: relative; cursor: pointer; transition: background var(--t); flex: none; }
.switch-row input::after, .tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--t) var(--ease); }
.switch-row input:checked, .tg:checked { background: var(--accent); }
.switch-row input:checked::after, .tg:checked::after { transform: translateX(18px); }
.switch-row input:focus-visible, .tg:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-actions.flat { border: 0; padding-top: 0; margin-top: 12px; }
.chips-check { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-weight: 600; font-size: .86rem; cursor: pointer; transition: border-color var(--t), background var(--t); }
.chip-check input { width: 16px !important; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.adm-main label.check input { width: 18px !important; height: 18px; flex: none; }
.adm-main textarea.code, .adm-main textarea.md { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; min-height: 280px; line-height: 1.5; }
.adm-main textarea.code { min-height: 140px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: .88rem; padding: 0 6px; }
.adm-main input[type="file"] { padding: 6px; font-size: .88rem; width: 100%; }
.adm-main input[type="file"]::file-selector-button { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 6px 12px; margin-right: 10px; font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- Tabele ---------- */
.adm-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); margin-bottom: 18px; }
.adm-card .adm-table-wrap { box-shadow: none; margin-bottom: 0; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.adm-table th, .adm-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg); font-weight: 700; white-space: nowrap; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr { transition: background var(--t); }
.adm-table tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.adm-table td.num, .adm-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table .t-actions { text-align: right; white-space: nowrap; }
.adm-table .t-sub { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.adm-table .ua { font-family: ui-monospace, monospace; font-size: .8rem; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-main code { font-family: ui-monospace, monospace; font-size: .82em; background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: #DCFCE7; color: #14532D; } :root[data-theme="dark"] .pill-ok { background: #12372B; color: #86EFAC; }
.pill-warn { background: #FEF3C7; color: #78350F; } :root[data-theme="dark"] .pill-warn { background: #3A2A12; color: #FCD34D; }
.pill-err { background: #FFE4E6; color: #9C3045; } :root[data-theme="dark"] .pill-err { background: #4C2230; color: #FECDD3; }
.pill-muted { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.status-ok { color: #047857; font-weight: 700; } .status-err { color: #B91C1C; font-weight: 700; } .status-warn { color: #B45309; font-weight: 700; }
:root[data-theme="dark"] .status-ok { color: #6EE7B7; } :root[data-theme="dark"] .status-err { color: #FCA5A5; } :root[data-theme="dark"] .status-warn { color: #FCD34D; }
.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.problems li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: .9rem; }

/* ---------- Tab-uri și filtre ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-weight: 650; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a .i { width: 17px; height: 17px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current] { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs .count { background: #DC2626; color: #fff; font-size: .7rem; padding: 1px 7px; border-radius: 999px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: .85rem; font-weight: 650; }
.seg a:hover { color: var(--ink); text-decoration: none; background: var(--bg); }
.seg a[aria-current] { background: var(--accent); color: var(--accent-ink); }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }

/* ---------- KPI și grafice (SVG fără stiluri inline, compatibil CSP) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .l { font-size: .78rem; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.kpi .l .i { width: 15px; height: 15px; }
.kpi .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .d { font-size: .76rem; color: var(--muted); }
.kpi .d.up { color: #047857; } .kpi .d.down { color: #B91C1C; }
:root[data-theme="dark"] .kpi .d.up { color: #6EE7B7; } :root[data-theme="dark"] .kpi .d.down { color: #FCA5A5; }
.kpi svg.spark { width: 100%; height: 34px; margin-top: 4px; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.spark-area { fill: var(--accent); opacity: .12; }
.kpi:nth-child(5n+2) .spark-line { stroke: #2563EB; } .kpi:nth-child(5n+2) .spark-area { fill: #2563EB; }
.kpi:nth-child(5n+3) .spark-line { stroke: #9333EA; } .kpi:nth-child(5n+3) .spark-area { fill: #9333EA; }
.kpi:nth-child(5n+4) .spark-line { stroke: #DB2777; } .kpi:nth-child(5n+4) .spark-area { fill: #DB2777; }
.kpi:nth-child(5n) .spark-line { stroke: #D97706; } .kpi:nth-child(5n) .spark-area { fill: #D97706; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: #DB2777; opacity: .55; }
.chart .bar-alt { fill: var(--accent); opacity: .8; }
.chart .bar-amber { fill: #F59E0B; } .chart .bar-red { fill: #EF4444; } .chart .bar-green { fill: #22C55E; } .chart .bar-blue { fill: #3B82F6; } .chart .bar-teal { fill: #14B8A6; } .chart .bar-purple { fill: #A855F7; }
.chart .line { fill: none; stroke: #0EA5E9; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: #0EA5E9; opacity: .12; }
.chart .dot { fill: #0EA5E9; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: #0EA5E9; }
.chart-legend span.lg-bar::before { background: #DB2777; opacity: .6; }
.donut-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; }
@media (max-width: 520px) { .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; } }
.donut { width: 150px; height: 150px; }
.donut circle.track { fill: none; stroke: var(--bg); stroke-width: 18; }
.donut circle.seg { fill: none; stroke-width: 18; }
.donut text.big { fill: var(--ink); font-size: 26px; font-weight: 800; font-family: var(--font); }
.donut text.small { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.c1 { stroke: #3B82F6; fill: #3B82F6; } .c2 { stroke: #A855F7; fill: #A855F7; } .c3 { stroke: #14B8A6; fill: #14B8A6; } .c4 { stroke: #F59E0B; fill: #F59E0B; }
.c5 { stroke: #EC4899; fill: #EC4899; } .c6 { stroke: #64748B; fill: #64748B; } .c7 { stroke: #22C55E; fill: #22C55E; } .c8 { stroke: #EF4444; fill: #EF4444; }
.donut circle.seg.c1, .donut circle.seg.c2, .donut circle.seg.c3, .donut circle.seg.c4, .donut circle.seg.c5, .donut circle.seg.c6, .donut circle.seg.c7, .donut circle.seg.c8 { fill: none; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: .88rem; }
.rank .nm { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.rank .nm .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .nm .tag { font-size: .68rem; padding: 1px 7px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.rank .vl { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank .vl small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.rank svg.rbar { grid-column: 1 / -1; width: 100%; height: 6px; display: block; }
.rbar .bg { fill: var(--bg); } .rbar .fg { fill: #3B82F6; }
.rank.green .rbar .fg { fill: #22C55E; } .rank.purple .rbar .fg { fill: #A855F7; } .rank.pink .rbar .fg { fill: #EC4899; } .rank.amber .rbar .fg { fill: #F59E0B; } .rank.teal .rbar .fg { fill: #14B8A6; } .rank.red .rbar .fg { fill: #EF4444; }
.heat { width: 100%; height: auto; display: block; }
.heat text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.heat rect.h0 { fill: var(--bg); } .heat rect.h1 { fill: #0EA5E9; opacity: .18; } .heat rect.h2 { fill: #0EA5E9; opacity: .36; } .heat rect.h3 { fill: #0EA5E9; opacity: .55; } .heat rect.h4 { fill: #0EA5E9; opacity: .75; } .heat rect.h5 { fill: #0EA5E9; opacity: 1; }
.empty-state { color: var(--muted); font-size: .9rem; padding: 18px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 12px; }
.online { display: grid; gap: 18px; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); align-items: center; }
@media (max-width: 700px) { .online { grid-template-columns: minmax(0, 1fr); } }
.online .now { font-size: 3rem; font-weight: 800; line-height: 1; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #22C55E; display: inline-block; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- Diverse ---------- */
.preview { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 16px; background: var(--bg); }
.diff { white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: .85rem; max-height: 260px; overflow: auto; background: var(--bg); padding: 10px; border-radius: 10px; border: 1px solid var(--line); }
.q-list { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; box-shadow: var(--shadow); }
.q-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.q-item:last-child { border-bottom: 0; }
.q-text { font-family: var(--serif); font-size: 1rem; line-height: 1.5; }
.q-meta { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.q-item details { grid-column: 1 / -1; }
.q-item summary { cursor: pointer; color: var(--accent-text); font-weight: 650; font-size: .86rem; list-style: none; display: inline-flex; }
.q-item summary::-webkit-details-marker { display: none; }
.q-item details[open] summary { margin-bottom: 12px; }
.slot-card .fields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

/* ---------- Instalare și ecrane simple ---------- */
.install-main { padding: 32px clamp(16px, 2.6vw, 32px); display: grid; justify-items: center; gap: 14px; }
.install-card { width: min(100%, 980px); }
.install-card.narrow { width: min(100%, 440px); }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; width: min(100%, 980px); counter-reset: s; }
.steps li { counter-increment: s; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: .88rem; }
.steps li::before { content: counter(s) ". "; }
.steps li.current { border-color: var(--accent); font-weight: 700; color: var(--accent-text); }
.steps li.done { opacity: .7; }
.admin-body .site-header { position: static; }
details.card > summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.install-card .form-grid label.check input { width: 20px; }
.adm-main .seg { margin-bottom: 4px; }

/* ---------- Utilitare de aranjare (admin) ---------- */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 9px 18px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd .t-sub { display: block; font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 8px; } }
.kpi-link { color: var(--ink); transition: border-color var(--t), transform var(--t) var(--ease); }
.kpi-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.kpi-link .d { color: var(--accent-text); font-weight: 650; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }
.btn-row.end, .inline-fields.end { justify-content: flex-end; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin: 0; }
.inline-fields input, .inline-fields select { width: auto; min-width: 0; }
.inline-fields .field { min-width: 140px; }
.w-180 { width: 180px !important; }
.top-gap { margin-top: 16px; }
.top-gap-s { margin-top: 8px; }
.adm-crumbs { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; margin-bottom: 10px; }
.adm-crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.adm-crumbs a:hover { color: var(--accent-text); text-decoration: none; }
.adm-crumbs .i { width: 14px; height: 14px; }
.btn-danger { color: #B91C1C; border-color: #FECACA; }
.btn-danger:hover { background: #FEF2F2; border-color: #DC2626; color: #991B1B; }
:root[data-theme="dark"] .btn-danger { color: #FCA5A5; border-color: #7F1D1D; }
:root[data-theme="dark"] .btn-danger:hover { background: #3B1414; color: #FECACA; }
.adm-collapse > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; font-weight: 700; font-size: 1.02rem; min-height: 28px; }
.adm-collapse > summary::-webkit-details-marker { display: none; }
.adm-collapse > summary > span { display: inline-flex; align-items: center; gap: 8px; }
.adm-collapse > summary .i { width: 18px; height: 18px; color: var(--accent-text); }
.adm-collapse > summary .chev { transform: rotate(90deg); transition: transform var(--t); color: var(--muted); }
.adm-collapse[open] > summary .chev { transform: rotate(-90deg); }
.adm-collapse[open] > summary { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.adm-collapse.inner { margin-top: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 16px; }
.adm-collapse.inner > summary { font-size: .92rem; color: var(--accent-text); }
.adm-grid > details.adm-card { height: auto; }
.rule-rows { display: grid; gap: 12px; }
.rule-row { padding: 12px 16px 16px; }
.fields-5 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.proposal-list { display: grid; gap: 12px; }
.proposal { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg); display: grid; gap: 10px; }
.proposal-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.proposal-head h3 { margin: 0 auto 0 0; font-size: 1rem; }
.proposal p { margin: 0; }
.msg .adm-card-head h2 { font-size: 1rem; }
.msg .diff { margin: 0; }
.review-form { display: grid; gap: 6px; }
.adm-main ul.notice { padding-left: 34px; }
.adm-table .live-dot { margin-right: 2px; }
.adm-table td .t-sub + .t-sub { margin-top: 3px; }
.adm-card > h3 { margin: 18px 0 10px; }

/* ---------- Statistici detaliate ---------- */
.kpis-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.kpi .d + .d { margin-top: 0; }
.tabs-flat { margin-bottom: 0; border-bottom: 0; }
.toolbar-row .tabs-flat a { border-radius: 10px; border-bottom: 0; padding: 8px 12px; }
.toolbar-row .tabs-flat a[aria-current] { background: var(--accent-soft); }
.adm-card-head .seg { flex: 0 1 auto; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .86rem; min-width: 0; }
.donut-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.donut-legend .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .vl { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.donut-legend .vl small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.legend-dot { display: inline-block; }
.bg-c1 { background: #3B82F6; } .bg-c2 { background: #A855F7; } .bg-c3 { background: #14B8A6; } .bg-c4 { background: #F59E0B; }
.bg-c5 { background: #EC4899; } .bg-c6 { background: #64748B; } .bg-c7 { background: #22C55E; } .bg-c8 { background: #EF4444; }
.adm-card .donut-wrap { grid-template-columns: 132px minmax(0, 1fr); }
.adm-card .donut { width: 132px; height: 132px; }
@media (max-width: 520px) { .adm-card .donut-wrap { grid-template-columns: minmax(0, 1fr); } }
.rank .nm a.t { color: var(--ink); }
.rank .nm a.t:hover { color: var(--accent-text); }
.split { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.split li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: .86rem; align-items: center; }
.split .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.split .vl { color: var(--muted); font-variant-numeric: tabular-nums; }
.split svg.rbar { grid-column: 1 / -1; width: 100%; height: 8px; display: block; }
.rbar .sp-h { fill: #3B82F6; } .rbar .sp-b { fill: #F59E0B; opacity: .55; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.sw-h { background: #3B82F6; } .sw-b { background: #F59E0B; opacity: .7; }
.adm-grid-flat { margin: 0; gap: 22px 28px; }
.adm-grid-flat h3, .two-col h3 { margin: 0 0 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.two-col { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.online-now { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.online-now .now { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.adm-main h2 .live-dot { margin: 0 4px; }
.adm-table td.w-bar, .adm-table th.w-bar { width: 22%; min-width: 120px; }
.adm-table td.w-bar svg { width: 100%; height: 6px; display: block; }
.adm-table td.ua a { color: var(--ink); }
.problems li .grow { flex: 1; min-width: 0; }
.problems li form { margin: 0; }
.problems li { align-items: center; }
.chart .bar { fill: #DB2777; opacity: .5; }
.adm-grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.adm-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.donut-legend .t { white-space: normal; overflow: visible; line-height: 1.25; }
.adm-main .adm-card { container-type: inline-size; }
@container (max-width: 400px) {
  .donut-wrap, .adm-card .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
  .donut-legend { width: 100%; }
}

/* Liste de comutatoare fără celule goale; câmpuri aliniate pe rând chiar dacă etichetele au lungimi diferite */
.switch-list { background: var(--paper); gap: 0; }
.switch-row { margin: 0 -1px -1px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@supports (grid-template-rows: subgrid) {
  .fields { row-gap: 18px; }
  .field { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; align-content: start; }
  .field > .lbl { align-self: end; }
  .field > .help { align-self: start; }
}
.seg { max-width: 100%; }

/* ---------- Setări în tab-uri (meniu vertical pe ecran lat, orizontal pe ecran îngust) ---------- */
.set-layout { display: grid; gap: 18px 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1240px) { .set-layout { grid-template-columns: 224px minmax(0, 1fr); } .set-nav { position: sticky; top: 20px; } }
.set-nav ul { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.set-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: .92rem; transition: background var(--t), color var(--t); }
.set-nav a .i { width: 18px; height: 18px; color: var(--muted); }
.set-nav a:hover { background: var(--bg); text-decoration: none; }
.set-nav a[aria-current] { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 3px 0 0 var(--accent); }
.set-nav a[aria-current] .i { color: var(--accent-text); }
@media (max-width: 1239px) {
  .set-nav ul { flex-direction: row; overflow-x: auto; scrollbar-width: thin; }
  .set-nav a { white-space: nowrap; }
  .set-nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--accent); }
}
.set-panel { scroll-margin-top: 20px; min-width: 0; }
.set-panel > :last-child { margin-bottom: 0; }
.set-panels .fields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.set-panels .adm-card > ul.small { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }

/* Liste de comutatoare: o singură coloană, eticheta la stânga, comutatorul la dreapta (fără celule goale) */
.switch-list { grid-template-columns: minmax(0, 1fr); }
.switch-row { margin: 0; border-right: 0; }
.switch-row:last-child { border-bottom: 0; }

/* ---------- Listă uniformă: conținut la stânga, acțiuni la dreapta ---------- */
.adm-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.adm-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); transition: background var(--t); }
.adm-list > li:last-child { border-bottom: 0; }
.adm-list > li:hover { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.li-main { min-width: 0; }
.li-title { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.li-title .i { width: 15px; height: 15px; }
.li-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .82rem; color: var(--muted); margin-top: 5px; }
.li-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.li-actions form { margin: 0; display: flex; gap: 8px; align-items: center; }
.li-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; border-top: 1px dashed var(--line); }
.li-extra .lbl-inline { font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.li-extra form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.li-extra .dp, .li-extra input[type="date"] { width: 200px; }
@media (max-width: 760px) { .adm-list > li { grid-template-columns: minmax(0, 1fr); } .li-actions { justify-content: flex-start; } .li-extra { justify-content: flex-start; } }

/* Buton-comutator (funcționează fără JavaScript: trimite formularul) */
.sw-btn { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer; transition: border-color var(--t); }
.sw-btn:hover { border-color: var(--accent); }
.sw-btn::before { content: ""; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); flex: none; transition: background var(--t); background-image: radial-gradient(circle at 10px 10px, #fff 7px, transparent 7.5px); }
.sw-btn[aria-checked="true"]::before { background-color: var(--accent); background-image: radial-gradient(circle at 24px 10px, #fff 7px, transparent 7.5px); }
.adm-main label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; min-height: 0; font-weight: 550; font-size: .86rem; cursor: pointer; }
.proposal .btn-row { justify-content: flex-end; }

/* Reclame: 2 sloturi pe rând; câmpurile irelevante pentru furnizorul ales sunt ascunse */
.slot-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); align-items: start; }
@media (min-width: 1500px) { .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot-grid > .adm-card { margin: 0; }
.slot-card .fields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.slot-card:has(.provider-select option[value="adsense"]:checked) :is(.only-banner, .only-html),
.slot-card:has(.provider-select option[value="local_banner"]:checked) :is(.only-adsense, .only-html),
.slot-card:has(.provider-select option[value="html"]:checked) :is(.only-adsense, .only-banner) { display: none; }
.field label.check { min-height: 44px; }

/* Citate: acțiunea „Editează” ca buton în dreapta rândului, aliniată cu starea */
.q-item { position: relative; align-items: center; }
.q-item > .pill { margin-right: 104px; }
.q-item details > summary { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: .86rem; font-weight: 650; transition: border-color var(--t), color var(--t); }
.q-item details > summary:hover { border-color: var(--accent); color: var(--accent-text); }
.q-item details[open] > summary { top: 26px; transform: none; margin: 0; background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.q-item details[open] { padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 4px; }
.q-item details:not([open]) { margin: -8px 0 0; }
