/* Panoul Zent (/dev/): un dashboard pe tot ecranul. Meniul închis la culoare în stânga, conținutul pe gri deschis. */

:root {
  --bg: #F3F6FA;
  --panel: #FFFFFF;
  --side: #0B1220;
  --side-2: #131D2E;
  --ink: #0B1220;
  --ink-2: #4A5361;
  --muted: #8A94A3;
  --line: #E3EAF2;
  --blue: #2DA1FF;
  --blue-2: #1E8FEA;
  --tint: #E8F4FF;
  --green: #1E9E5A;
  --green-bg: #E6FAEF;
  --amber: #B26A00;
  --amber-bg: #FFF1E0;
  --red: #D93A30;
  --red-bg: #FFECEB;
  --violet: #5B3FD9;
  --violet-bg: #EEE9FF;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden, [hidden] { display: none !important; }
a { color: var(--blue-2); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- Butoane și câmpuri ---------- */

.b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: #fff; color: var(--ink); font: 600 14px/1 var(--body); text-decoration: none; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s, box-shadow .2s, transform .2s; white-space: nowrap; }
.b:hover { background: #F8FBFE; box-shadow: inset 0 0 0 1px #C9D6E3; }
.b:disabled { opacity: .5; cursor: default; }
.b--primary { background: var(--blue); color: #fff; box-shadow: none; }
.b--primary:hover { background: var(--blue-2); box-shadow: none; }
.b--dark { background: var(--ink); color: #fff; box-shadow: none; }
.b--dark:hover { background: #1C2638; }
.b--danger { color: var(--red); }
.b--danger:hover { background: var(--red-bg); }
.b--small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.b--wide { width: 100%; height: 46px; }
.b svg, .i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.f > span { font: 600 12px/1 var(--body); color: var(--ink-2); }
.f small { color: var(--muted); font-size: 12px; }
.f input, .f select, .f textarea, .search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 400 14px/1.4 var(--body);
  transition: border-color .2s, box-shadow .2s;
}
.f textarea { min-height: 140px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 161, 255, .18); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 14px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; }
.toggle b { display: block; }
.toggle span { color: var(--muted); font-size: 13px; }
.switch { position: relative; flex: none; width: 44px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #C9D6E3; transition: background-color .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(18px); }
.note { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.note--error { background: var(--red-bg); color: #B3261E; }
.note--ok { background: var(--green-bg); color: #1E7E4A; }
.note--info { background: var(--tint); color: #12538A; font-weight: 500; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }

/* ---------- Intrarea ---------- */

.gate { min-height: 100%; display: grid; place-items: center; padding: 40px 20px; background: radial-gradient(80% 60% at 20% 0%, rgba(45, 161, 255, .35), transparent 60%), radial-gradient(60% 50% at 100% 100%, rgba(255, 176, 32, .2), transparent 60%), var(--side); }
.gate__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; color: #fff; }
.gate__brand svg { height: 28px; fill: currentColor; }
.gate__brand span { font: 900 28px/1 var(--display); letter-spacing: -.03em; }
.gate__brand b { color: var(--blue); font-weight: 900; }
.gate__card { width: min(420px, 100%); padding: 32px; border-radius: 22px; background: #fff; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); }
.gate__card h1 { margin: 0; font: 850 34px/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.gate__lead { margin: 10px 0 22px; color: var(--ink-2); }
.gate__status { margin: 0 0 14px; font-weight: 600; }
.gate__back { display: inline-block; margin-top: 18px; color: var(--muted); text-decoration: none; }
.gate > div { justify-self: center; }
.gate { grid-auto-flow: row; align-content: center; }

/* ---------- Cadrul dashboard-ului ---------- */

.dash { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 20px 14px; color: #C9D3E0; background: var(--side); }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; color: #fff; text-decoration: none; }
.side__brand svg { height: 24px; fill: currentColor; }
.side__brand span { font: 900 22px/1 var(--display); letter-spacing: -.03em; }
.side__brand b { color: var(--blue); }
.side__group { margin: 18px 10px 8px; font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #5C6B80; }
.side__link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 500; transition: background-color .2s, color .2s; }
.side__link:hover { background: var(--side-2); color: #fff; }
.side__link.is-on { background: linear-gradient(90deg, rgba(45, 161, 255, .22), rgba(45, 161, 255, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.side__link .i { width: 19px; height: 19px; }
.side__badge { margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--blue); color: #fff; font: 700 11px/16px var(--body); text-align: center; }
.side__foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid #1C2638; }
.side__user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.side__avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #1C2638; color: #fff; font-weight: 700; overflow: hidden; }
.side__avatar img { width: 100%; height: 100%; object-fit: cover; }
.side__user b { display: block; color: #fff; font-size: 13px; }
.side__user span { font-size: 12px; color: #6F7D91; }
.side__role { display: inline-block; margin-top: 2px; padding: 2px 7px; border-radius: 999px; background: rgba(45, 161, 255, .18); color: #8BD2FF; font: 600 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.side .b { width: 100%; background: var(--side-2); color: #C9D3E0; box-shadow: none; }
.side .b:hover { background: #1C2638; color: #fff; }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 28px; background: rgba(243, 246, 250, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font: 850 24px/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.top__crumb { color: var(--muted); font-weight: 500; }
.top__spacer { flex: 1; }
.top__menu { display: none; }
.content { padding: 26px 28px 60px; }

/* ---------- Carduri și cifre ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; padding: 18px 20px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.kpi__label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.kpi__label .i { color: var(--blue-2); }
.kpi__value { margin: 10px 0 2px; font: 850 34px/1 var(--display); font-stretch: 80%; }
.kpi__sub { color: var(--muted); font-size: 12px; }
.kpi--accent { background: linear-gradient(135deg, #2DA1FF, #1E6FB8); color: #fff; box-shadow: none; }
.kpi--accent .kpi__label, .kpi--accent .kpi__sub, .kpi--accent .kpi__label .i { color: rgba(255, 255, 255, .85); }
.panel { padding: 20px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.panel + .panel { margin-top: 16px; }
.panel h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 700 16px/1.2 var(--body); }
.panel h2 .row { margin-left: auto; }
.panel p { line-height: 1.55; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart__track { flex: 1; display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.chart__bar { width: 100%; max-width: 34px; min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #5BB8FF, #2DA1FF); transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.chart__bar--zero { background: var(--line); }
.chart__day { color: var(--muted); font: 500 10px/1 var(--mono); }
.chart__col:hover .chart__bar { background: linear-gradient(180deg, #1E8FEA, #0E6FC0); }

/* ---------- Tabele ---------- */

.table-wrap { overflow-x: auto; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; background: #FAFCFE; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background-color .15s; }
tbody tr.click:hover { background: #F8FBFE; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.thumb { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 10px; background: var(--tint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 80%; height: 80%; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--tint); color: #12538A; font: 600 11px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.chip--pending_payment, .chip--unpaid, .chip--hidden { background: var(--amber-bg); color: var(--amber); }
.chip--paid, .chip--delivered, .chip--published, .chip--ok { background: var(--green-bg); color: #1E7E4A; }
.chip--shipped { background: var(--violet-bg); color: var(--violet); }
.chip--cancelled, .chip--refunded { background: var(--red-bg); color: #B3261E; }
.chip--processing, .chip--placed { background: var(--tint); color: #12538A; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filters .search { width: 260px; height: 36px; padding: 0 12px; }
.pill { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff; color: var(--ink-2); font: 600 13px/1 var(--body); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.pill.is-on { background: var(--ink); color: #fff; box-shadow: none; }
.pill b { margin-left: 4px; color: var(--muted); }
.pill.is-on b { color: rgba(255, 255, 255, .6); }

/* ---------- Detaliile unei comenzi ---------- */

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.items { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.totals { display: grid; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; }
.totals .t-save { color: var(--green); font-weight: 600; }
.totals .t-total { font-weight: 800; font-size: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.totals .t-vat { color: var(--muted); font-size: 12px; }

/* ---------- Editorul de produse ---------- */

.editor { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.images { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.image-tile { position: relative; width: 104px; height: 104px; overflow: hidden; border-radius: 12px; background: var(--tint); }
.image-tile img { width: 100%; height: 100%; object-fit: cover; }
.image-tile__tools { position: absolute; inset: auto 4px 4px 4px; display: flex; justify-content: space-between; }
.image-tile__tools button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--ink); font-size: 12px; cursor: pointer; }
.image-tile__tools button:disabled { opacity: .35; cursor: default; }
.image-tile__main { position: absolute; top: 4px; left: 4px; padding: 3px 6px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 9px/1 var(--mono); text-transform: uppercase; }
.upload { position: relative; overflow: hidden; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.spec-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 6px; margin-bottom: 6px; }
.spec-row input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font: 400 14px/1.3 var(--body); }
.spec-row input:focus { outline: none; border-color: var(--blue); }
.icon-btn { width: 34px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.preview { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px; background: radial-gradient(80% 80% at 50% 30%, #F2FAFF, #C9E8FF); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview svg { width: 66%; height: 66%; }
.savebar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 18px; border-radius: 14px; background: rgba(255, 255, 255, .96); box-shadow: 0 -10px 30px -20px rgba(11, 18, 32, .3), inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); }
.savebar .grow { flex: 1; }

/* ---------- Unelte de developer ---------- */

.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; margin: 14px 0; }
.choice__option { display: grid; gap: 4px; padding: 14px; border: 0; border-radius: 12px; background: #F8FBFE; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); font: inherit; }
.choice__option strong { font-size: 15px; }
.choice__option span { color: var(--muted); font-size: 13px; }
.choice__option--on { background: var(--tint); box-shadow: inset 0 0 0 2px var(--blue); }
.version { font: 850 44px/1 var(--display); font-stretch: 80%; }
.steps-list { padding-left: 20px; line-height: 1.6; }
.steps-list li { margin-bottom: 6px; }
esp-web-install-button button { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font: 600 14px/1 var(--body); cursor: pointer; }
.copy-field { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.copy-field code { flex: 1; padding: 8px 10px; border-radius: 8px; background: #F8FBFE; box-shadow: inset 0 0 0 1px var(--line); font: 12px/1.4 var(--mono); word-break: break-all; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person__avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--tint); color: var(--blue-2); font-weight: 700; }
.person__info { flex: 1; min-width: 0; }
.person__info b { display: block; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .5); transform: translateY(20px); opacity: 0; transition: transform .3s, opacity .3s; pointer-events: none; }
.toast.is-on { transform: none; opacity: 1; }

/* ---------- Ecrane înguste ---------- */

@media (max-width: 1100px) {
  .cols, .cols--even, .editor { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .3s; }
  .dash.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(11, 18, 32, .45); }
  .top__menu { display: inline-flex; }
  .top { flex-wrap: wrap; gap: 10px 12px; height: auto; min-height: 60px; padding: 10px 16px; }
  .top h1 { font-size: 21px; }
  .top__spacer { display: none; }
  .top > .row { width: 100%; }
  .top > .row:empty { display: none; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px 16px; }
  .kpi--accent { grid-column: 1 / -1; }
  .kpi__value { font-size: 26px; }
  .content { padding: 18px 16px 60px; }
  .filters .search { width: 100%; }
}

/* ---------- Stocurile ---------- */

.loc { padding: 14px 0; border-top: 1px solid var(--line); }
.loc .f { margin-bottom: 10px; }
.loc .row { gap: 6px; }

/* ---------- Revestech (dev-revestech.js) ---------- */

/* Editorul descrierilor: bara cu butoane și textul editabil */
.rte { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.rte__bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: #FAFCFE; }
.rte__bar button { height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: 600 13px/1 var(--body); cursor: pointer; }
.rte__bar button:hover { background: var(--tint); color: var(--ink); }
.rte__area { min-height: 140px; max-height: 520px; overflow: auto; padding: 12px 14px; outline: none; line-height: 1.6; }
.rte__area:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.rte__area h3 { font: 700 17px/1.3 var(--display); margin: 14px 0 6px; }
.rte__area p { margin: 0 0 10px; }
.rte__area a { color: var(--blue-2); }

/* Categoriile bifate la un produs */
.rv-cats { display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.rv-cats label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.rv-cats label:hover { background: var(--tint); }
.rv-cats label.is-child { padding-left: 32px; font-weight: 500; color: var(--ink-2); }
.rv-cats input { width: 17px; height: 17px; accent-color: var(--blue); }
.person.click { cursor: pointer; border-radius: 10px; }
.person.click:hover { background: #F8FBFE; }

/* Filele unei secțiuni din meniu (ex. Revestech: Prezentare, Comenzi, Produse, Categorii, Setări) */
.subnav { display: flex; gap: 6px; padding: 14px 28px 0; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav__tab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; background: #fff; color: var(--ink-2); font: 600 14px/1 var(--body); text-decoration: none; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s, color .2s; }
.subnav__tab:hover { color: var(--ink); background: #F8FBFE; }
.subnav__tab.is-on { background: var(--ink); color: #fff; box-shadow: none; }
.subnav__tab .i { width: 17px; height: 17px; }
.subnav__tab .side__badge { margin-left: 2px; }
@media (max-width: 900px) { .subnav { padding: 12px 16px 0; } }
