@font-face { font-family: "Sora"; src: url("../../assets/fonts/sora-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../../assets/fonts/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../../assets/fonts/manrope-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0a0a0a; --bg-2: #101010; --panel: #151515; --panel-2: #1c1c1c; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
  --ink: #f6f4ef; --ink-2: #ddd8cc; --mute: #9b968a; --gold: #f3c032; --gold-2: #ffd86a; --ok: #2ecc71; --err: #ff6b6b; --warn: #f5a623; --blue: #5aa9ff;
  --r: 16px; --head: "Sora", system-ui, sans-serif; --body: "Manrope", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 500 14.5px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }

.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; font: 700 15px var(--head); letter-spacing: -.01em; }
.side-brand img { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; }
.side-brand b { color: var(--gold); margin-left: 3px; }
.side-brand em { font: 700 10px var(--body); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: #111; background: var(--gold); padding: 3px 7px; border-radius: 999px; margin-left: auto; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); transition: .2s; }
.side-nav a svg { width: 19px; height: 19px; opacity: .85; }
.side-nav a:hover { background: var(--panel); color: var(--ink); }
.side-nav a.on { background: rgba(243,192,50,.12); color: var(--gold); }
.pill { margin-left: auto; font: 700 11px var(--body); font-style: normal; background: var(--gold); color: #111; border-radius: 999px; padding: 1px 8px; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.ghost-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; color: var(--mute); text-align: left; }
.ghost-link:hover { color: var(--ink); background: var(--panel); }
.ghost-link svg { width: 18px; height: 18px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: rgba(10,10,10,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { font: 700 20px var(--head); letter-spacing: -.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-site { margin-left: auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--mute); }
.top-site svg { width: 18px; height: 18px; }
.burger { display: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.burger i { width: 16px; height: 2px; background: var(--ink); border-radius: 2px; }
.content { padding: 24px 28px 60px; max-width: 1400px; width: 100%; }
.scrim { display: none; }

.flash { position: relative; margin: 16px 28px 0; padding: 12px 44px 12px 16px; border-radius: 12px; background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.35); color: #b9f5d0; transition: opacity .4s; }
.flash.err { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.4); color: #ffc9c9; }
.content .flash, .auth .flash { margin: 0 0 18px; }
.flash button { position: absolute; right: 10px; top: 9px; width: 26px; height: 26px; border-radius: 8px; color: inherit; opacity: .7; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 700; font-size: 13.5px; white-space: nowrap; transition: .2s; cursor: pointer; }
.btn:hover { border-color: var(--gold); }
.btn svg { width: 17px; height: 17px; }
.btn.gold { background: var(--gold); color: #111; border-color: var(--gold); }
.btn.gold:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); border-color: rgba(255,107,107,.4); background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--mute); border: 1px solid transparent; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn.danger:hover { color: var(--err); border-color: rgba(255,107,107,.4); }
.icon-btn svg { width: 17px; height: 17px; }
.link-muted { display: block; text-align: center; color: var(--mute); font-size: 13px; padding: 8px; }
.link-danger { color: var(--err); font-size: 12px; text-decoration: underline; }

.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field small { color: var(--mute); font-size: 12px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea { width: 100%; min-width: 0; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); outline: none; transition: border-color .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold) !important; }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px !important; }
select option { background: var(--panel); }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); width: 17px; height: 17px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.muted { color: var(--mute); }
.small { font-size: 12.5px; }
.block { display: block; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 4px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; min-width: 0; }
.panel h2 { font: 700 16px var(--head); letter-spacing: -.01em; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin-bottom: 4px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.filters input { max-width: 260px; }
.filters select { max-width: 220px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 700 11px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-2); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.table .c { text-align: center; }
.table .r { text-align: right; }
.table .chk { width: 36px; }
.table .thumb { width: 64px; }
.table .thumb img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: radial-gradient(ellipse at top, #ffe9a6, var(--gold) 60%, #d39a14); padding: 4px; }
.table tr.dim td { opacity: .5; }
.table tr.dim td.actions, .table tr.dim td.c { opacity: 1; }
.table .actions { white-space: nowrap; text-align: right; }
.table .empty { text-align: center; color: var(--mute); padding: 40px; }
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px; border-radius: 12px; background: rgba(243,192,50,.1); border: 1px solid rgba(243,192,50,.3); }
.bulk select { width: auto; }

.switch { position: relative; width: 40px; height: 23px; border-radius: 999px; background: #333; transition: .25s; vertical-align: middle; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #888; transition: .25s; }
.switch.on { background: rgba(243,192,50,.35); }
.switch.on::after { left: 20px; background: var(--gold); }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.editor-side { position: sticky; top: 88px; }
.save-box { display: grid; gap: 8px; }
.uploader { display: grid; gap: 10px; }
.uploader.busy { opacity: .55; pointer-events: none; }
.up-preview { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; background: radial-gradient(ellipse 80% 70% at 50% 0%, #ffe9a6 0%, var(--gold) 45%, #d39a14 100%); overflow: hidden; }
.up-preview.wide { aspect-ratio: 16/9; background: var(--bg-2); }
.up-preview img { max-width: 78%; max-height: 82%; object-fit: contain; filter: drop-shadow(0 12px 14px rgba(0,0,0,.35)); }
.up-preview.wide img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: cover; filter: none; }
.up-preview img.placeholder { opacity: .35; }
.up-err { color: var(--err); font-size: 12.5px; min-height: 0; }
.up-err:empty { display: none; }

.add-opt { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-opts { padding: 18px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--mute); font-size: 13.5px; }
.opt-card { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: var(--bg-2); }
.opt-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.opt-head input { flex: 1 1 160px; }
.tag { font: 700 11px var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: rgba(243,192,50,.14); color: var(--gold); white-space: nowrap; }
.order { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.order button { width: 30px; height: 32px; color: var(--mute); }
.order button:hover { color: var(--ink); background: var(--panel-2); }
.order button + button { border-left: 1px solid var(--line-2); }
.vals { display: grid; gap: 8px; }
.val { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.val > input { flex: 1 1 150px; }
.mini { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--mute); white-space: nowrap; }
.mini input { width: 86px !important; padding: 8px 10px !important; }
.mini-up { display: inline-flex; align-items: center; gap: 8px; }
.mini-up img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: var(--gold); padding: 2px; }
.mini-up.busy { opacity: .5; pointer-events: none; }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); vertical-align: -3px; margin-right: 6px; flex-shrink: 0; }
.swatch-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sw { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; color: var(--ink-2); transition: .15s; }
.sw i { width: 20px; height: 20px; border-radius: 50%; background: var(--c); border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; font-style: normal; font-weight: 700; color: var(--gold); }
.sw.on { border-color: var(--gold); background: rgba(243,192,50,.12); color: var(--ink); }
.sw.on i { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--gold); }
.sw.add { border-style: dashed; color: var(--gold); }
.sw.add i { background: transparent; border-color: var(--gold); }
.val-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bulk-add { display: grid; gap: 8px; margin-top: 10px; }
.bulk-add .btn { justify-self: start; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.radio { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; background: var(--bg-2); }
.radio:has(input:checked) { border-color: var(--gold); background: rgba(243,192,50,.08); }
.radio input { margin-top: 2px; }
.radio b { display: block; font-size: 13.5px; }
.radio small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.var-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.var-tools .fill { display: flex; gap: 6px; align-items: center; }
.var-tools .fill input { width: 100px; padding: 7px 10px; }
.var-table td input { width: 120px; text-align: right; padding: 7px 10px; }
.var-table tr.off td:not(:last-child) { opacity: .45; }
.var-table td { padding: 7px 14px; }

.cards4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.kpi span { display: block; font-size: 12px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.kpi b { display: block; font: 700 28px var(--head); letter-spacing: -.03em; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: var(--mute); font-size: 12px; }
.kpi.gold b { color: var(--gold); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--mute); font: 600 10px var(--body); }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
.bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row b { font-weight: 700; }
.bar-row i { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.bar-row i::before { content: ""; display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-radius: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.seg a { padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--mute); }
.seg a.on { background: var(--gold); color: #111; }

.status-select { width: auto !important; padding: 6px 30px 6px 10px !important; border-radius: 999px !important; font-size: 12.5px; font-weight: 700; }
.s-new { color: var(--gold); border-color: rgba(243,192,50,.5) !important; }
.s-confirmed { color: var(--blue); border-color: rgba(90,169,255,.5) !important; }
.s-done { color: var(--ok); border-color: rgba(46,204,113,.5) !important; }
.s-cancelled { color: var(--err); border-color: rgba(255,107,107,.5) !important; }
.order-items { margin-top: 6px; font-size: 12.5px; color: var(--mute); }
details.order summary { cursor: pointer; list-style: none; }
details.order summary::-webkit-details-marker { display: none; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line-2); font-weight: 700; font-size: 13px; color: var(--mute); }
.tabs button.on { background: var(--gold); color: #111; border-color: var(--gold); }
.text-row { display: grid; grid-template-columns: 200px 1fr 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.text-row code { font-size: 12px; color: var(--mute); word-break: break-all; padding-top: 8px; }
.sticky-save { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: linear-gradient(180deg, transparent, var(--bg) 40%); }
.cat-tree .sub td:first-child { padding-left: 34px; }
.cat-tree .sub td:first-child::before { content: "↳ "; color: var(--mute); }
.color-pick { display: flex; gap: 8px; align-items: center; }
.color-pick input[type=color] { width: 46px; height: 42px; border: 1px solid var(--line-2); border-radius: 10px; background: none; padding: 3px; cursor: pointer; }
.swatch-lg { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); display: inline-block; vertical-align: middle; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1 1 140px; }
.help { font-size: 12.5px; color: var(--mute); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; line-height: 1.6; }
.help code { color: var(--gold); }

.dialog-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.dialog-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.dialog { position: relative; width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.dialog h3 { font: 700 18px var(--head); margin-bottom: 14px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(243,192,50,.15), transparent 70%), var(--bg); }
.auth-box { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px; padding: 30px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 700 16px var(--head); margin-bottom: 22px; }
.auth-brand img { width: 40px; height: 40px; border-radius: 12px; }
.auth-brand b { color: var(--gold); margin-left: 3px; }
.auth h1 { font: 700 22px var(--head); letter-spacing: -.02em; }
.auth .muted { margin: 4px 0 20px; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .cards4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .3s; }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); }
  .burger { display: flex; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 16px 16px 60px; }
  .flash { margin: 12px 16px 0; }
  .two, .grid2, .grid3, .grid4, .mode { grid-template-columns: 1fr; }
  .text-row { grid-template-columns: 1fr; gap: 6px; }
  .filters input, .filters select { max-width: none; flex: 1 1 140px; }
}
@media (max-width: 640px) {
  .cards4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi b { font-size: 22px; }
  .panel { padding: 16px; }
  .products-table th:nth-child(4), .products-table td:nth-child(4), .products-table th:nth-child(8), .products-table td:nth-child(8) { display: none; }
  .table td, .table th { padding: 9px 10px; }
  .bar > .btn { width: 100%; }
}
.table .thumb { width: 64px; min-width: 64px; }
.table .thumb img { min-width: 48px; max-width: 48px; }
.field .up-preview:not(.wide) { max-width: 220px; }
