/* Onnesha Mart — one stylesheet for the shop and the back office.
   Colours are tokens so the whole site can be re-themed from :root. */
:root {
  --bg: #f6f7f4; --surface: #ffffff; --sunk: #eef0eb; --line: #dde1d8; --fg: #1d2420; --muted: #5f6a63;
  --brand: #0f6b5a; --brand-ink: #ffffff; --brand-soft: #dcefe9; --mark: #e3a21a; --mark-soft: #fbf0d6;
  --good: #1f8a4c; --warn: #b7791f; --bad: #c2412d; --info: #2e6fb5;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Hind Siliguri", "Segoe UI", system-ui, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.55; }
img, video, iframe { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--f-display); margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(24px, 3.4vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: 13px; }
.muted { color: var(--muted); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }
.stack { display: grid; gap: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.right { text-align: right; }
.hidden { display: none !important; }

/* buttons & chips */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 15px; border-radius: 8px;
  font-weight: 600; font-size: 14px; text-decoration: none; color: var(--fg); cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.lg { padding: 12px 20px; font-size: 16px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new, .st-pending_payment { color: var(--info); background: color-mix(in srgb, var(--info) 13%, transparent); }
.st-confirmed, .st-packed, .risk-medium, .flag-soon, .flag-low { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.st-shipped, .tag { color: var(--brand); background: var(--brand-soft); }
.st-delivered, .risk-low, .flag-ok { color: var(--good); background: color-mix(in srgb, var(--good) 13%, transparent); }
.st-returned, .st-cancelled, .risk-high, .flag-out { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.flag-slow { color: var(--muted); background: var(--sunk); }

/* flash messages */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; font-weight: 500; }
.flash.ok { background: color-mix(in srgb, var(--good) 13%, var(--surface)); }
.flash.error { background: color-mix(in srgb, var(--bad) 13%, var(--surface)); }

/* forms */
.field { display: grid; gap: 4px; }
.field > label, .label { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea, .input { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 11px; width: 100%; }
.field small { color: var(--muted); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 .full { grid-column: 1 / -1; }
.choice { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* panels & tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }
.ph { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; font-weight: 600; }

/* ---------------- shop ---------------- */
.s-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.s-top .wrap { display: flex; align-items: center; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.logo { text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.logo b { font-family: var(--f-display); font-size: 22px; color: var(--brand); }
.logo span { color: var(--muted); font-size: 13px; }
.search { flex: 1; min-width: 180px; display: flex; }
.search input { flex: 1; border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; background: var(--bg); }
.cartlink { margin-left: auto; }
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: center; background: var(--brand); color: var(--brand-ink); border-radius: 14px; padding: 26px; }
.hero p { margin: 8px 0 0; opacity: 0.92; max-width: 46ch; }
.perks { display: grid; gap: 8px; font-size: 14px; }
.perks div { background: color-mix(in srgb, var(--brand-ink) 13%, transparent); padding: 8px 12px; border-radius: 8px; }
.cats { display: flex; gap: 8px; flex-wrap: wrap; }
.cats a { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 14px; font-size: 14px; text-decoration: none; color: var(--fg); }
.cats a.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.thumb { aspect-ratio: 4 / 3; background: var(--sunk) center / cover no-repeat; position: relative; display: grid; place-items: center; color: var(--muted); font-family: var(--f-display); font-size: 30px; }
.badge-vid { position: absolute; left: 10px; bottom: 10px; font-size: 12px; font-weight: 600; background: rgba(0, 0, 0, 0.6); color: #fff; padding: 2px 9px; border-radius: 99px; font-family: var(--f-body); }
.badge-off { position: absolute; right: 10px; top: 10px; font-size: 12px; font-weight: 700; background: var(--mark); color: #1d1606; padding: 2px 8px; border-radius: 6px; font-family: var(--f-body); }
.card-b { padding: 12px 14px 14px; display: grid; gap: 4px; }
.card-b h3 { font-size: 16px; font-family: var(--f-body); font-weight: 600; }
.price { display: flex; align-items: baseline; gap: 8px; }
.price b { font-size: 18px; }
.price s { color: var(--muted); font-size: 13px; }
.pd { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
.gallery { display: grid; gap: 10px; }
.gallery .main { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.thumbs button.on { border-color: var(--brand); }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 12px; background: #000; }
.qtybox { width: 80px; }
.summary { position: sticky; top: 80px; }
.s-foot { border-top: 1px solid var(--line); margin-top: 40px; background: var(--surface); }
.s-foot .wrap { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; font-size: 14px; }
.s-foot a { color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 7px; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 22px; }

/* ---------------- admin ---------------- */
.a-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.a-side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.a-side .logo { padding: 0 10px 14px; }
.a-side a.nav { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.a-side a.nav.on { background: var(--brand-soft); color: var(--fg); font-weight: 600; }
.a-side .ct { font-size: 12px; background: var(--mark); color: #1d1606; border-radius: 99px; padding: 0 8px; font-weight: 700; }
.a-side .me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.a-main { padding: 22px; min-width: 0; }
.a-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kpi small { display: block; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.kpi b { font-family: var(--f-display); font-size: 26px; display: block; margin-top: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.bar { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.low i { background: var(--bad); }
.cols { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.cols div { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: 0.85; }
.cols div:hover { opacity: 1; }
.cols-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px; font-size: 13px; text-decoration: none; color: var(--fg); }
.tabs a.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { display: inline-flex; gap: 8px; align-items: center; }
.imgs { display: flex; gap: 10px; flex-wrap: wrap; }
.imgs figure { margin: 0; display: grid; gap: 4px; justify-items: center; }
.imgs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.login { max-width: 380px; margin: 10vh auto; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

@media (max-width: 900px) {
  .a-shell { grid-template-columns: 1fr; }
  .a-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .a-side .logo { width: 100%; padding-bottom: 6px; }
  .a-side .me { width: 100%; margin-top: 6px; }
  .a-main { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .two-1, .hero, .pd, .grid2 { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media print {
  .a-side, .no-print { display: none !important; }
  .a-shell { display: block; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
