:root{
  color-scheme: light;
  --bg:#f4f3f0;
  --surface:#ffffff;
  --surface-2:#ececea;
  --border:#dfddd8;
  --text:#16181c;
  --muted:#6b6f76;
  --accent:#e3392a;
  --accent-ink:#ffffff;
  --accent-soft:#e3392a1a;
  --ok:#1f8a4c;
  --ok-soft:#1f8a4c1a;
  --warn:#b8790a;
  --warn-soft:#b8790a1a;
  --danger:#c0392b;
  --danger-soft:#c0392b1a;
  --shadow: 0 1px 2px rgba(20,20,20,.06), 0 8px 24px -12px rgba(20,20,20,.18);
  --radius: 14px;
}
@media (prefers-color-scheme: dark){
  :root{
    color-scheme: dark;
    --bg:#111214;
    --surface:#191b1f;
    --surface-2:#212327;
    --border:#2c2f34;
    --text:#f2f2f0;
    --muted:#9a9da3;
    --accent:#ff5240;
    --accent-ink:#161616;
    --accent-soft:#ff52401f;
    --ok:#3fd07d;
    --ok-soft:#3fd07d1f;
    --warn:#f0b429;
    --warn-soft:#f0b4291f;
    --danger:#ff6b5e;
    --danger-soft:#ff6b5e1f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px -14px rgba(0,0,0,.6);
  }
}

*{box-sizing:border-box;}
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:"Work Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  padding-inline:16px;
  padding-block:24px 60px;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.brand,.num{ font-family:"Rajdhani","Work Sans",sans-serif; }
.mono{ font-family:"JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
a{ color:inherit; }
img{ max-width:100%; }

.wrap{ max-width:1180px; margin:0 auto; }

header.top{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  flex-wrap:wrap; margin-bottom:18px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:700; font-size:26px; letter-spacing:.5px; text-transform:uppercase;
}
.brand .dot{ width:11px; height:11px; border-radius:3px; background:var(--accent); transform:rotate(45deg); flex:none; }
.brand small{ display:block; font-family:"Work Sans",sans-serif; text-transform:none; letter-spacing:0; font-weight:500; font-size:12.5px; color:var(--muted); }

nav.tabs{
  display:flex; gap:4px; background:var(--surface); border:1px solid var(--border);
  border-radius:999px; padding:4px;
}
nav.tabs button, nav.tabs a{
  border:0; background:transparent; color:var(--muted); font:inherit; font-weight:600;
  font-size:13.5px; padding:8px 16px; border-radius:999px; cursor:pointer; text-decoration:none;
  transition:background .15s, color .15s;
}
nav.tabs button.active, nav.tabs a.active{ background:var(--accent); color:var(--accent-ink); }
nav.tabs button:hover:not(.active), nav.tabs a:hover:not(.active){ color:var(--text); }

.stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }
@media (max-width:680px){ .stats{ grid-template-columns:repeat(2,1fr);} }
.stat{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--shadow); }
.stat .label{ font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.6px; font-weight:600; }
.stat .value{ font-size:24px; font-weight:700; margin-top:4px; }
.stat .value.warn{ color:var(--warn); }

.filters{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.filters.center{ justify-content:center; }
.pill{
  border:1px solid var(--border); background:var(--surface); color:var(--muted);
  font:inherit; font-size:13px; font-weight:600; padding:7px 14px; border-radius:999px;
  cursor:pointer; transition:.15s;
}
.pill.active{ background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
.search{
  margin-left:auto; display:flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:7px 12px;
  min-width:180px; flex:1; max-width:260px;
}
.search input{ border:0; background:transparent; outline:0; color:var(--text); font:inherit; font-size:13.5px; width:100%; }
.search svg{ flex:none; opacity:.6; }

.grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); gap:14px; }
.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  overflow:hidden; box-shadow:var(--shadow); display:flex; flex-direction:column;
}
.card .shot{ aspect-ratio:1/1; width:100%; background:var(--surface-2); position:relative; overflow:hidden; }
.card .shot img{ width:100%; height:100%; object-fit:cover; display:block; }
.card .shot .noimg{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:12px; }
.card .cat{
  position:absolute; top:10px; left:10px; background:rgba(0,0,0,.55); color:#fff;
  font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
  padding:4px 9px; border-radius:999px; backdrop-filter:blur(3px);
}
.card .avail{
  position:absolute; top:10px; right:10px; font-size:10.5px; font-weight:700; text-transform:uppercase;
  letter-spacing:.4px; padding:4px 9px; border-radius:999px;
}
.card .dots{ position:absolute; bottom:9px; left:0; right:0; display:flex; gap:5px; justify-content:center; }
.card .dots span{ width:5px; height:5px; border-radius:50%; background:rgba(255,255,255,.55); }
.card .dots span.on{ background:#fff; }
.card .body{ padding:12px 14px 14px; display:flex; flex-direction:column; gap:8px; flex:1; }
.card .name{ font-size:15.5px; font-weight:600; line-height:1.25; }
.card .price{ font-size:17px; font-weight:700; color:var(--accent); }
.card .sizes{ display:flex; gap:5px; flex-wrap:wrap; }
.chip{
  font-size:11px; font-weight:600; border:1px solid var(--border); color:var(--muted);
  padding:2px 7px; border-radius:6px; background:var(--surface-2);
}
.card .row{ display:flex; align-items:center; justify-content:space-between; margin-top:auto; gap:8px; }
.stockbadge{ display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; }
.stockbadge .led{ width:8px; height:8px; border-radius:50%; flex:none; }
.card .actions{ display:flex; gap:6px; }
.iconbtn{
  border:1px solid var(--border); background:var(--surface-2); color:var(--muted);
  width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:.15s;
}
.iconbtn:hover{ color:var(--text); border-color:var(--muted); }
.iconbtn.danger:hover{ color:var(--danger); border-color:var(--danger); }

.empty{ grid-column:1/-1; text-align:center; padding:60px 20px; color:var(--muted); border:1px dashed var(--border); border-radius:var(--radius); }
.empty.plain{ border:0; }
.empty .big{ font-size:15px; color:var(--text); font-weight:600; margin-bottom:4px; }

.btn{
  display:inline-flex; align-items:center; gap:8px; border:0; border-radius:10px;
  background:var(--accent); color:var(--accent-ink); font:inherit; font-weight:700; font-size:13.5px;
  padding:10px 18px; cursor:pointer; transition:filter .15s, transform .05s;
}
.btn:hover{ filter:brightness(1.06); }
.btn:active{ transform:scale(.98); }
.btn.ghost{ background:transparent; color:var(--text); border:1px solid var(--border); }
.btn.small{ padding:7px 13px; font-size:12.5px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.formwrap{ max-width:640px; margin:0 auto; }
.formcard{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow); }
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:12.5px; font-weight:600; color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.4px; }
.field input[type="text"], .field input[type="password"], .field input[type="number"], .field select, .field textarea{
  width:100%; background:var(--surface-2); border:1px solid var(--border); color:var(--text);
  border-radius:9px; padding:10px 12px; font:inherit; font-size:14px; outline:0;
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color:var(--accent); }
.field textarea{ resize:vertical; min-height:70px; }
.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:480px){ .two-col{ grid-template-columns:1fr; } }
.sizepick{ display:flex; gap:8px; flex-wrap:wrap; }
.sizebtn{
  border:1px solid var(--border); background:var(--surface-2); color:var(--muted);
  font:inherit; font-weight:700; font-size:13px; width:42px; height:36px; border-radius:8px; cursor:pointer;
}
.sizebtn.on{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }

.imgpicker{ display:flex; gap:10px; flex-wrap:wrap; }
.thumb{ width:76px; height:76px; border-radius:9px; overflow:hidden; position:relative; border:1px solid var(--border); background:var(--surface-2); flex:none; }
.thumb.main{ border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
.thumb img{ width:100%; height:100%; object-fit:cover; }
.thumb .rm{
  position:absolute; top:3px; right:3px; width:19px; height:19px; border-radius:50%;
  background:rgba(0,0,0,.65); color:#fff; border:0; display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:12px; line-height:1;
}
.thumb .star{
  position:absolute; top:3px; left:3px; width:19px; height:19px; border-radius:50%;
  background:rgba(0,0,0,.65); color:#fff; border:0; display:flex; align-items:center; justify-content:center;
  cursor:pointer; padding:0;
}
.thumb .star svg{ width:11px; height:11px; }
.thumb.main .star{ background:var(--accent); color:var(--accent-ink); }
.thumb .maintag{
  position:absolute; left:0; right:0; bottom:0; background:var(--accent); color:var(--accent-ink);
  font-size:8.5px; font-weight:700; text-align:center; text-transform:uppercase; letter-spacing:.4px; padding:2px 0;
}
.addshot{
  width:76px; height:76px; border-radius:9px; border:1.5px dashed var(--border);
  display:flex; align-items:center; justify-content:center; color:var(--muted); cursor:pointer; flex:none;
  background:var(--surface-2);
}
.addshot:hover{ border-color:var(--accent); color:var(--accent); }
.addshot input{ display:none; }
.formactions{ display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }
.helper{ font-size:12px; color:var(--muted); margin-top:6px; }
.uploading{ font-size:12px; color:var(--accent); margin-top:6px; }
.error{ font-size:12.5px; color:var(--danger); margin-top:6px; }

.loginwrap{ min-height:70vh; display:flex; align-items:center; justify-content:center; }
.logincard{ width:100%; max-width:360px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:28px; box-shadow:var(--shadow); text-align:center; }
.logincard .brand{ justify-content:center; margin-bottom:4px; }
.logincard p{ color:var(--muted); font-size:13px; margin:4px 0 20px; }
.logincard .field{ text-align:left; }
.logincard .btn{ width:100%; justify-content:center; margin-top:6px; }

.toast{
  position:fixed; bottom:calc(20px + env(safe-area-inset-bottom,0px)); left:50%; transform:translateX(-50%);
  background:var(--text); color:var(--bg); padding:10px 18px; border-radius:999px; font-size:13px; font-weight:600;
  box-shadow:var(--shadow); z-index:50; opacity:0; pointer-events:none; transition:opacity .2s, transform .2s;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(-4px); }

footer.foot{ text-align:center; margin-top:34px; color:var(--muted); font-size:12px; }

[hidden]{ display:none !important; }
