:root{
  --bg:#ffffff;
  --fg:#0f172a;
  --muted:#64748b;
  --card:#f8fafc;
  --border:#e2e8f0;
  --primary:#0f766e;
  --danger:#b91c1c;
  --warn:#b45309;
  --shadow: 0 1px 2px rgba(0,0,0,.06);
  --radius: 14px;
}
html[data-theme="dark"]{
  --bg:#0b1220;
  --fg:#e5e7eb;
  --muted:#94a3b8;
  --card:#0f172a;
  --border:#1f2a44;
  --primary:#14b8a6;
  --danger:#ef4444;
  --warn:#f59e0b;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background:var(--bg);
  color:var(--fg);
}
a{color:inherit}
.container{max-width: 1100px; margin: 0 auto; padding: 16px;}
.topbar{
  position: sticky; top:0; z-index:10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand a{font-weight:700; text-decoration:none}
.nav{display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:flex-end}
.nav a{padding:8px 10px; text-decoration:none; border-radius:10px;}
.nav a:hover{background:var(--card)}
.row{display:flex; align-items:center}
.space-between{justify-content:space-between}
.wrap{flex-wrap:wrap}
.gap{gap:10px}
.stack{display:flex; flex-direction:column; gap:10px}
.grid{display:grid; grid-template-columns: 1fr; gap:16px}
.grid2{display:grid; grid-template-columns: 1fr; gap:12px}
@media (min-width: 900px){
  .grid{grid-template-columns: 1fr 1fr}
  .grid2{grid-template-columns: 1fr 1fr}
}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card.narrow{max-width: 420px; margin: 32px auto}
h1{margin: 6px 0 14px 0; font-size: 26px}
.h2{margin: 4px 0 10px 0; font-size: 18px}
.muted{color:var(--muted)}
.field{min-width: 200px}
label{display:block; font-size: 13px; color:var(--muted); margin-bottom:6px}
input, select{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}
button{font:inherit}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  text-decoration:none;
  cursor:pointer;
}
.btn:hover{filter:brightness(1.02)}
.btn.primary{background: var(--primary); border-color: transparent; color: #fff}
.btn.danger{background: var(--danger); border-color: transparent; color: #fff}
.btn.ghost{background: transparent}
.btn.tiny{padding:6px 10px; border-radius: 10px; font-size: 12px}
.flash{margin-bottom:12px; padding:10px 12px; border-radius: 12px; border:1px solid var(--border)}
.flash.ok{border-color: rgba(20,184,166,.35)}
.flash.err{border-color: rgba(239,68,68,.35)}
.pill{font-size:12px; padding:4px 8px; border-radius:999px; border:1px solid var(--border); margin-left:8px}
.pill.warn{border-color: rgba(245,158,11,.4)}
.table-wrap{overflow:auto}
table{width:100%; border-collapse: collapse}
th, td{padding:10px 8px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top}
th.right, td.right{text-align:right}
.neg{color: var(--danger); font-weight:600}
.list{list-style:none; padding:0; margin:0}
.list li{padding:8px 0; border-bottom:1px dashed var(--border)}
.quick-left {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.image-frame {
  width: 360px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.product-img,
.product-img.placeholder {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-img.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
