:root{--red:#FF0000;--red-text:#D40000;--bg:#F6F6F7;--card:#fff;--text:#404040;--heading:#1A1A1A;--muted:#5E5E5E;--border:#E4E4E7;--input:#A0A0A8;--radius:12px;--font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color-scheme:light}
[data-theme=dark]{--red-text:#FF4D4D;--bg:#0F0F10;--card:#1B1B1E;--text:#D6D6D9;--heading:#F5F5F6;--muted:#A1A1A8;--border:#2A2A2E;--input:#4A4A50;color-scheme:dark}
*,*::before,*::after{box-sizing:border-box}
body{margin:0;font-family:var(--font);font-size:.95rem;line-height:1.55;color:var(--text);background:var(--bg)}
a{color:var(--red-text)}
h1,h2,h3{color:var(--heading);line-height:1.25;margin:0 0 .75rem}
h1{font-size:1.6rem}
:focus-visible{outline:3px solid var(--red);outline-offset:2px;border-radius:4px}
.shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}
@media (max-width:820px){.shell{grid-template-columns:1fr}.side{position:static!important;height:auto!important}}
.side{background:var(--card);border-right:1px solid var(--border);padding:1.25rem 1rem;position:sticky;top:0;height:100vh;overflow:auto}
.side img{height:58px;width:auto;margin:0 .5rem 1.25rem}
.side nav a{display:block;padding:.5rem .75rem;border-radius:8px;color:var(--text);text-decoration:none;font-weight:550}
.side nav a:hover,.side nav a.active{background:var(--bg);color:var(--red-text)}
.side .group{font-size:.72rem;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin:1rem .75rem .25rem;font-weight:700}
.main{padding:1.5rem clamp(1rem,3vw,2.5rem) 3rem;min-width:0}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.5rem;flex-wrap:wrap}
.topbar .who{color:var(--muted);font-size:.88rem;display:flex;gap:.75rem;align-items:center}
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:1.25rem;margin-bottom:1.25rem}
.stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:1rem;margin-bottom:1.25rem}
.stat{display:block;text-decoration:none;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:1rem 1.25rem;color:var(--text)}
.stat b{display:block;font-size:1.8rem;color:var(--heading)}
.stat:hover{border-color:var(--red)}
table{width:100%;border-collapse:collapse;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
th,td{text-align:left;padding:.6rem .8rem;border-bottom:1px solid var(--border);vertical-align:top}
th{font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);background:var(--bg)}
.table-wrap{overflow-x:auto}
.btn{display:inline-flex;align-items:center;gap:.35rem;padding:.55rem 1rem;border-radius:8px;border:1px solid var(--border);background:var(--card);color:var(--heading);font:inherit;font-weight:600;text-decoration:none;cursor:pointer}
.btn:hover{border-color:var(--red)}
.btn--primary{background:#E00000;border-color:#E00000;color:#fff}.btn--primary:hover{background:#C00000}
.btn--danger{color:var(--red-text)}
.btn--sm{padding:.3rem .65rem;font-size:.85rem}
.inline{display:inline}
.actions{display:flex;gap:.4rem;flex-wrap:wrap}
.form-grid{display:grid;gap:1rem;grid-template-columns:minmax(0,1fr)}
.form-grid>*{min-width:0}
@media (min-width:1000px){.form-grid--2{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.field{display:grid;gap:.3rem}
.field label{font-weight:600;color:var(--heading);font-size:.88rem}
.field small{color:var(--muted)}
input,textarea,select{font:inherit;color:var(--heading);background:var(--bg);border:1px solid var(--input);border-radius:8px;padding:.55rem .7rem;width:100%}
textarea{min-height:6rem;resize:vertical}
textarea.long{min-height:18rem;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.85rem}
input[type=checkbox]{width:auto;accent-color:var(--red)}
.check{display:flex;gap:.5rem;align-items:center}
.span-2{grid-column:1/-1}
.err,.field-validation-error,.validation-summary-errors{color:var(--red-text);font-weight:600;font-size:.88rem}
.validation-summary-valid{display:none}
.flash{padding:.75rem 1rem;border-radius:8px;margin-bottom:1rem;font-weight:600;background:rgba(10,122,47,.1);color:#0a7a2f;border:1px solid rgba(10,122,47,.3)}
[data-theme=dark] .flash{color:#4ade80}
.flash--err{background:rgba(255,0,0,.08);color:var(--red-text);border-color:rgba(255,0,0,.3)}
.badge{display:inline-block;padding:.1rem .5rem;border-radius:999px;font-size:.75rem;font-weight:700;background:var(--bg);border:1px solid var(--border)}
.badge--on{background:rgba(10,122,47,.12);color:#0a7a2f;border-color:transparent}[data-theme=dark] .badge--on{color:#4ade80}
.badge--new{background:#E00000;color:#fff;border-color:transparent}
.auth{min-height:100vh;display:grid;place-items:center;padding:1.5rem}
.auth .card{width:min(420px,100%);padding:2rem}
.auth img.logo{height:72px;width:auto;margin-bottom:1.25rem}
.muted{color:var(--muted)}
.codes{display:grid;grid-template-columns:repeat(2,1fr);gap:.4rem;font-family:ui-monospace,Consolas,monospace;font-size:1rem}
.qr{background:#fff;padding:.5rem;border-radius:8px;width:200px;height:200px}
.thumb{width:72px;height:48px;object-fit:cover;border-radius:6px;border:1px solid var(--border)}
.icon-btn{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--border);border-radius:8px;background:transparent;color:var(--heading);cursor:pointer}
.icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.i-moon{display:none}[data-theme=dark] .i-sun{display:none}[data-theme=dark] .i-moon{display:block}
pre{white-space:pre-wrap;word-break:break-word;margin:0;font-size:.8rem}
.sticky-save{position:sticky;bottom:0;background:var(--bg);padding:1rem 0;border-top:1px solid var(--border);display:flex;gap:.5rem}
.otp{display:flex;gap:.5rem;justify-content:flex-start}
.otp__box{width:2.75rem;height:3.2rem;text-align:center;font-size:1.4rem;font-weight:700;border:1px solid var(--input);border-radius:10px;background:var(--card);color:var(--heading)}
.otp__box:focus{border-color:var(--red);outline:3px solid rgba(255,0,0,.25);outline-offset:0}
.side img{height:46px}
.auth .logo{height:72px;width:auto}
/* Brand logo: red on light, white on dark */
.logo-dark{display:none!important}
[data-theme=dark] .logo-light{display:none!important}
[data-theme=dark] .logo-dark{display:inline-block!important}
.side__brand{display:inline-block}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* Products */
.toolbar{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-bottom:1rem}
.filters{display:flex;flex-wrap:wrap;gap:.5rem;margin-left:auto}
.filters input,.filters select{width:auto;min-width:10rem}
.btn--ghost{background:transparent}
.note{background:#FDECEC;border:1px solid #FFD0D0;color:#5A1010;border-radius:10px;padding:.7rem 1rem}
[data-theme=dark] .note{background:#2A1416;border-color:#4A2226;color:#FFD9D9}
.badge--sample{background:#FFF4D6;color:#6B4A00;border-color:#F2D58A}
[data-theme=dark] .badge--sample{background:#3A2E10;color:#FFE3A0}
.handle{cursor:grab;color:var(--muted);user-select:none;font-weight:700;letter-spacing:-.15em;padding:.2rem .35rem;border-radius:6px}
.handle:focus-visible{background:var(--bg)}
.handle-col{width:2rem}
tr.dragging,.dragging{opacity:.45}
.drop-target{outline:2px dashed var(--red);outline-offset:-2px}
.thumb--empty{display:inline-block;width:64px;height:48px;border-radius:8px;background:repeating-linear-gradient(45deg,var(--bg),var(--bg) 6px,var(--border) 6px,var(--border) 7px)}
.thumb--lg{width:160px;height:120px;object-fit:cover;border-radius:10px;border:1px solid var(--border)}
.hidden-form{display:none}
.reorder-bar{margin-top:.75rem}
.tablist{display:flex;flex-wrap:wrap;gap:.25rem;margin-bottom:1rem;border-bottom:1px solid var(--border)}
.tablist button{font:inherit;font-weight:650;background:none;border:0;border-bottom:3px solid transparent;padding:.6rem .9rem;color:var(--muted);cursor:pointer;margin-bottom:-1px}
.tablist button[aria-selected=true]{color:var(--red-text);border-bottom-color:var(--red)}
.tablist button.has-error::after{content:" •";color:var(--red-text)}
.tabpanel[hidden]{display:none}
.checks{display:flex;flex-wrap:wrap;gap:.5rem 1.5rem}
.check-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:.4rem 1rem;margin-bottom:1.25rem}
.repeater{display:grid;gap:.5rem;margin-bottom:.5rem}
.rep-row{display:grid;grid-template-columns:auto 1fr 1fr auto;gap:.5rem;align-items:center;background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:.45rem}
.repeater--specs .rep-row,.rep-head{grid-template-columns:auto 1fr 1fr 1.3fr 1.3fr auto}
.rep-head{display:grid;gap:.5rem;font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:0 .45rem}
[data-sortable=files] .rep-row{grid-template-columns:auto 1fr 1fr auto auto}
@media (max-width:820px){.rep-row,.repeater--specs .rep-row{grid-template-columns:auto 1fr}.rep-head{display:none}}
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.75rem;margin-bottom:1rem}
.gallery__item{position:relative;display:grid;gap:.35rem;background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:.5rem}
.gallery__item img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:8px}
.gallery__item .handle{position:absolute;top:.8rem;left:.8rem;background:var(--card);box-shadow:0 1px 4px rgba(0,0,0,.2)}
.check--danger{color:var(--red-text)}
.file-list{margin:.4rem 0 0;padding-left:1.1rem;font-size:.85rem;color:var(--muted)}
.form-grid--3{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}
@media (max-width:820px){.form-grid--3{grid-template-columns:1fr}}
.upload-row{display:flex;gap:1rem;align-items:flex-start;flex-wrap:wrap}
.upload-inputs{display:grid;gap:.4rem;flex:1;min-width:240px}
.preview__grid{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}
@media (max-width:820px){.preview__grid{grid-template-columns:1fr}}
.preview__cover{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:12px}
.preview__thumbs{display:flex;gap:.4rem;margin-top:.4rem;flex-wrap:wrap}.preview__thumbs img{width:72px;height:54px;object-fit:cover;border-radius:6px}
.preview__empty{aspect-ratio:4/3;display:grid;place-items:center;border-radius:12px;background:#FDECEC;color:#7A1A1A;text-align:center;padding:1rem}
/* Visitor statistics */
.card__head{display:flex;justify-content:space-between;align-items:center;gap:.75rem;flex-wrap:wrap;margin-bottom:.5rem}
.card__head h2{margin:0}
.stats-head{display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap;align-items:flex-end;margin-bottom:.5rem}
.seg{display:flex;gap:.4rem;flex-wrap:wrap;align-items:flex-end}
.seg label{display:flex;flex-direction:column;font-size:.8rem;color:var(--muted);gap:.15rem}
.seg input[type=date]{width:auto;padding:.35rem .5rem}
.btn.is-on{background:var(--red);border-color:var(--red);color:#fff}
.stats--kpi{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))}
.stat b.stat__split{font-size:1.45rem;white-space:nowrap}
.stat small{display:block;color:var(--muted);font-size:.75rem}
.stat--live{position:relative}
.live-dot{position:absolute;top:1rem;right:1rem;display:block;width:.55rem;height:.55rem;border-radius:50%;background:var(--red);vertical-align:middle;animation:pulse 2s infinite}
@keyframes pulse{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.live-dot{animation:none}}
.chart{width:100%;min-width:0;overflow:hidden}
.chart + h2{margin-top:1.25rem}
.ch{display:block;max-width:100%;height:auto}
.ch-grid{stroke:var(--border);stroke-width:1}
.ch-label{fill:var(--muted);font-size:11px;font-family:var(--font)}
.ch-key{fill:var(--text);font-size:12.5px;font-family:var(--font)}
.ch-area{fill:var(--red);opacity:.12}
.ch-line{fill:none;stroke:var(--red);stroke-width:2.25;stroke-linejoin:round;stroke-linecap:round}
.ch-line--u{stroke:var(--heading);stroke-width:1.75;stroke-dasharray:5 4;opacity:.75}
.ch-dot{fill:var(--card);stroke:var(--red);stroke-width:2}
.ch-hit{fill:transparent}
.ch-hit:hover{fill:var(--red);opacity:.06}
.ch-bar{fill:var(--red)}
.ch-bar:hover{opacity:.8}
.ch-track{fill:var(--border)}
.legend{display:flex;gap:.4rem;align-items:center;font-size:.82rem;color:var(--muted)}
.lg{display:inline-block;width:16px;height:0;border-top:3px solid var(--red);margin-left:.4rem}
.lg--u{border-top:2px dashed var(--heading);opacity:.75}
.table--stats .num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.table--stats code{font-size:.8rem;color:var(--muted);word-break:break-all}
.share{min-width:90px}
.sharebar{display:block;width:80px;margin:0 0 .25rem auto}
.small{font-size:.82rem}
.visitors{margin-bottom:1.25rem}
.visitors__grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;margin-bottom:.75rem}
.visitors__kpi span{display:block;color:var(--muted);font-size:.82rem}
.visitors__kpi b{display:block;font-size:1.6rem;color:var(--heading);font-variant-numeric:tabular-nums}
.visitors__kpi small{color:var(--muted)}
@media (max-width:640px){.visitors__grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stats-head{align-items:stretch}}
@media (max-width:640px){.table--stats .share{display:none}.table--stats th{white-space:normal}.table--stats td,.table--stats th{padding-left:.45rem;padding-right:.45rem}}

.translate-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;margin:0 0 1rem}
