/* =====================================================================
   Freevry dashboard — design tokens
   Palette is lifted from the logo: rider green, leaf green, parcel orange.
   Signature motif: the three orange "speed lines" behind the scooter.
   ===================================================================== */
:root {
  --green-950: #04311A;
  --green-900: #06401F;
  --green: #0A6B34;
  --green-600: #0C7A3C;
  --leaf: #5BAA1F;
  --leaf-100: #E9F5DF;
  --orange: #FF6A0D;
  --orange-600: #E25A05;
  --orange-100: #FFEBDD;

  --ink: #14261B;
  --ink-2: #2E4035;
  --muted: #5F6F65;
  --paper: #F3F6F2;
  --surface: #FFFFFF;
  --surface-2: #F8FAF7;
  --line: #DFE7E0;
  --line-2: #EBF0EB;

  --ok: #1D8A47;     --ok-bg: #E3F4E8;
  --warn: #A45A00;   --warn-bg: #FFF1DE;
  --info: #155E9C;   --info-bg: #E3EFFA;
  --bad: #B42318;    --bad-bg: #FDE7E4;

  --font: "Figtree", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --sidebar-w: 264px;
  --topbar-h: 68px;
  --focus: 0 0 0 3px rgba(255, 106, 13, .35);
  --shadow-pop: 0 18px 40px -12px rgba(6, 64, 31, .28);
  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #E4EEE7;
  --ink-2: #C3D2C8;
  --muted: #8EA396;
  --paper: #0C1510;
  --surface: #131F18;
  --surface-2: #17251D;
  --line: #24362B;
  --line-2: #1D2C23;
  --leaf-100: #1C3317;
  --orange-100: #3A2212;
  --ok-bg: #173323;  --ok: #6FD39A;
  --warn-bg: #3A2A12; --warn: #F5B461;
  --info-bg: #14283A; --info: #86BFF0;
  --bad-bg: #3A1815;  --bad: #F79B91;
  --shadow-pop: 0 18px 40px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
[data-theme="dark"] a { color: #7CCB8F; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 1rem; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* ---------------------------------------------------------------------
   Speed lines (signature motif)
   --------------------------------------------------------------------- */
.speed {
  display: inline-grid; gap: 3px; width: 18px; flex: none;
}
.speed i { display: block; height: 3px; border-radius: 3px; background: var(--orange); }
.speed i:nth-child(1) { width: 70%; margin-left: 30%; }
.speed i:nth-child(2) { width: 100%; }
.speed i:nth-child(3) { width: 45%; margin-left: 10%; }

/* =====================================================================
   App shell
   ===================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
}
.sidebar-brand {
  display: flex; align-items: center;
  height: 92px; padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.brand-logo { height: 60px; width: auto; display: block; }
[data-theme="dark"] .sidebar-brand .brand-plate,
[data-theme="dark"] .auth-card .brand-plate {
  background: #fff; border-radius: 12px; padding: 0 8px;
}
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 14px 12px 20px; scrollbar-width: thin; }
.nav-label {
  font-size: .78rem; font-weight: 700; color: var(--muted);
  padding: 14px 12px 6px; letter-spacing: .02em;
}
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: 10px;
  color: var(--ink-2); font-weight: 600; font-size: .95rem;
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-link .bi { font-size: 1.1rem; width: 22px; text-align: center; color: var(--muted); }
.nav-link.is-active { background: var(--leaf-100); color: var(--green); }
[data-theme="dark"] .nav-link.is-active { color: #9BE2AE; }
.nav-link.is-active .bi { color: inherit; }
.nav-link.is-active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 13px;
  background:
    linear-gradient(var(--orange), var(--orange)) 3px 0 / 5px 3px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 0 5px / 8px 3px no-repeat,
    linear-gradient(var(--orange), var(--orange)) 2px 10px / 4px 3px no-repeat;
}
.nav-count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--orange); color: #fff;
  font-size: .75rem; font-weight: 800;
}
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.who-meta { min-width: 0; }
.who-name { display: block; font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { display: block; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #fff; font-weight: 800; font-size: .85rem;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.orange { background: var(--orange); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 750; font-size: 1.05rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  cursor: pointer; font-size: 1.1rem;
}
.icon-btn:hover { border-color: var(--green); color: var(--green); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--orange); border: 2px solid var(--surface);
}
.menu-toggle { display: none; }
.content { padding: 28px; max-width: 1440px; width: 100%; }

.store-switch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: .88rem; cursor: pointer; color: var(--ink-2);
}
.store-switch .pip { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.store-switch.is-open .pip { background: var(--leaf); box-shadow: 0 0 0 4px var(--leaf-100); }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-pop); padding: 6px; display: none; z-index: 60;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; gap: 10px; align-items: center; width: 100%;
  padding: 9px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--ink); font: inherit; font-size: .92rem; text-align: left; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-head { padding: 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }

/* =====================================================================
   Page structure
   ===================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  min-width: 0;
}
.panel + .panel { margin-top: 20px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.panel-body { padding: 20px; }
.panel-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); }
.panel.flush .panel-body { padding: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }

/* KPI strip — one band, numbers separated by rules */
.kpi-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: 20px; overflow: hidden;
}
.kpi { padding: 18px 20px; border-right: 1px solid var(--line-2); }
.kpi:last-child { border-right: 0; }
.kpi-label { font-size: .85rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.kpi.hot { background: linear-gradient(180deg, var(--orange-100), transparent 80%); }
.kpi.hot .kpi-value { color: var(--orange-600); }

/* Greeting band on dashboard */
.hello {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 24px 28px; margin-bottom: 20px;
  background: var(--green-900); color: #EAF6EC;
}
.hello h1 { color: #fff; }
.hello p { color: #BFE0C7; margin: 6px 0 0; }
.hello .lines { position: absolute; right: -10px; top: 50%; transform: translateY(-50%); display: grid; gap: 12px; opacity: .9; }
.hello .lines i { display: block; height: 12px; border-radius: 12px; background: var(--orange); }
.hello .lines i:nth-child(1) { width: 120px; margin-left: 60px; }
.hello .lines i:nth-child(2) { width: 180px; }
.hello .lines i:nth-child(3) { width: 90px; margin-left: 30px; }
.hello-actions { position: relative; margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .93rem;
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .bi { font-size: 1.05em; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-900); }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-600); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: var(--surface); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-light:hover { background: rgba(255,255,255,.2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--green); cursor: pointer; font-weight: 600; }

/* =====================================================================
   Badges
   ===================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok   { background: var(--ok-bg);   color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-bad  { background: var(--bad-bg);  color: var(--bad); }
.badge-muted { background: var(--line-2); color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: .82rem; font-weight: 600; color: var(--ink-2);
}

/* =====================================================================
   Tables
   ===================================================================== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th {
  text-align: left; font-weight: 700; font-size: .82rem; color: var(--muted);
  padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr[data-href] { cursor: pointer; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data .right, table.data th.right { text-align: right; }
.cell-main { font-weight: 700; color: var(--ink); }
.cell-sub { font-size: .83rem; color: var(--muted); }
.thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line-2); flex: none; }
.thumb.sm { width: 32px; height: 32px; border-radius: 8px; }
.entity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* =====================================================================
   Forms
   ===================================================================== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field label, .label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { font-size: .82rem; color: var(--muted); margin: 5px 0 0; }
.field-error { color: var(--bad); font-size: .83rem; font-weight: 600; margin: 5px 0 0; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%235F6F65' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(10, 107, 52, .15); }
.input.is-invalid, .select.is-invalid { border-color: var(--bad); }
.input-group { display: flex; }
.input-group .prefix {
  display: grid; place-items: center; padding: 0 12px;
  border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px;
  background: var(--surface-2); color: var(--muted); font-weight: 700;
}
.input-group .input { border-radius: 0 10px 10px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.check-card {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600;
}
.check-card:has(input:checked) { border-color: var(--green); background: var(--leaf-100); }
.check-card input { accent-color: var(--green); }
.check-card img { width: 26px; height: 26px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

.form-section { padding: 20px; border-bottom: 1px solid var(--line-2); }
.form-section:last-child { border-bottom: 0; }
.form-section > h3 { margin-bottom: 4px; }
.form-section > .hint { color: var(--muted); font-size: .88rem; margin: 0 0 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.filters .input, .filters .select { height: 38px; width: auto; min-width: 150px; }
.filters .search { position: relative; flex: 1; min-width: 220px; }
.filters .search .input { width: 100%; padding-left: 36px; }
.filters .search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: .86rem; color: var(--muted); text-decoration: none; }
.seg a.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg a .n { margin-left: 4px; color: var(--orange-600); }

.variant-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 40px; gap: 10px; align-items: end; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; margin-bottom: 10px; }
.img-drop {
  display: grid; place-items: center; gap: 6px; text-align: center;
  aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--muted); cursor: pointer; overflow: hidden; position: relative;
}
.img-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-drop:hover { border-color: var(--green); }

/* =====================================================================
   Pagination / empty states / alerts
   ===================================================================== */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line-2); font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager a, .pager span.cur {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px;
  display: inline-grid; place-items: center; font-weight: 700; border: 1px solid var(--line); color: var(--ink-2);
}
.pager span.cur { background: var(--green); border-color: var(--green); color: #fff; }
.pager a:hover { border-color: var(--green); text-decoration: none; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .bi { font-size: 2rem; color: var(--leaf); display: block; margin-bottom: 8px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; border: 1px solid; }
.alert .bi { font-size: 1.15rem; margin-top: 1px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert p { margin: 2px 0 0; font-weight: 500; color: var(--ink-2); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 200; width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px; background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow-pop); font-weight: 600; font-size: .92rem;
  animation: toast-in .25s ease-out;
}
[data-theme="dark"] .toast { background: #E4EEE7; color: #0C1510; }
.toast .bi { font-size: 1.15rem; }
.toast.success .bi { color: var(--leaf); }
.toast.error .bi { color: #FF8A7A; }
.toast.warning .bi, .toast.info .bi { color: var(--orange); }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 1rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* =====================================================================
   New-order buzz bar
   ===================================================================== */
.buzz {
  position: fixed; left: 50%; top: 14px; transform: translate(-50%, -140%);
  z-index: 300; width: min(620px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px 14px 18px; border-radius: 16px;
  background: var(--orange); color: #fff; box-shadow: 0 20px 50px -10px rgba(226, 90, 5, .6);
  visibility: hidden;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), visibility 0s linear .35s;
}
.buzz.show { transform: translate(-50%, 0); visibility: visible; transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), visibility 0s; }
.buzz.show .buzz-lines i { animation: dash 0.9s ease-in-out infinite; }
.buzz-lines { display: grid; gap: 4px; width: 30px; flex: none; }
.buzz-lines i { display: block; height: 4px; border-radius: 4px; background: #fff; }
.buzz-lines i:nth-child(1) { width: 70%; margin-left: 30%; animation-delay: .1s !important; }
.buzz-lines i:nth-child(2) { width: 100%; }
.buzz-lines i:nth-child(3) { width: 50%; margin-left: 10%; animation-delay: .2s !important; }
@keyframes dash { 50% { transform: translateX(-6px); opacity: .6; } }
.buzz-text { flex: 1; min-width: 0; }
.buzz-title { font-weight: 800; font-size: 1.02rem; }
.buzz-sub { font-size: .88rem; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buzz .btn { background: #fff; color: var(--orange-600); }
.buzz .icon-btn { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.sound-hint { display: none; }
.sound-hint.show { display: inline-flex; }

/* =====================================================================
   Order timeline
   ===================================================================== */
.track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 4px 0 8px; }
.track-step { position: relative; text-align: center; font-size: .82rem; font-weight: 700; color: var(--muted); padding-top: 30px; }
.track-step::before { content: ""; position: absolute; top: 9px; left: 50%; width: 20px; height: 20px; transform: translateX(-50%); border-radius: 50%; background: var(--surface); border: 3px solid var(--line); z-index: 1; }
.track-step::after { content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 4px; background: var(--line); }
.track-step:first-child::after { display: none; }
.track-step.done { color: var(--ink); }
.track-step.done::before { background: var(--green); border-color: var(--green); }
.track-step.done::after { background: var(--green); }
.track-step.current::before { background: var(--orange); border-color: var(--orange-100); box-shadow: 0 0 0 4px var(--orange-100); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: .9rem; }
.history li:last-child { border-bottom: 0; }
.history .when { color: var(--muted); min-width: 140px; }

.totals { width: 100%; max-width: 360px; margin-left: auto; border-collapse: collapse; }
.totals td { padding: 6px 0; font-size: .93rem; }
.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.totals tr.grand td { font-size: 1.15rem; font-weight: 800; border-top: 2px solid var(--line); padding-top: 10px; }

/* =====================================================================
   Dialog (native <dialog>)
   ===================================================================== */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(4, 49, 26, .45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 220px); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); }

/* =====================================================================
   Misc widgets
   ===================================================================== */
.meter { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--leaf); border-radius: 8px; }
.meter.high > span { background: var(--orange); }
.chart-box { position: relative; height: 280px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }
.code-block { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.cat-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--leaf-100); display: grid; place-items: center; flex: none; }
.cat-icon img { width: 28px; height: 28px; object-fit: contain; }
.map-picker { height: 280px; border-radius: 12px; border: 1px solid var(--line); z-index: 0; }
.qr-box { display: inline-grid; place-items: center; padding: 14px; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; font-weight: 700; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.codes span { padding: 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.plan-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; background: var(--surface); position: relative; }
.plan-card .price { font-size: 1.8rem; font-weight: 800; margin: 8px 0 2px; }
.plan-card ul { padding-left: 18px; margin: 12px 0 0; color: var(--ink-2); }
.plan-card.off { opacity: .6; }

/* API docs */
.docs { max-width: 920px; }
.docs h1 { font-size: 1.8rem; margin: 0 0 12px; }
.docs h2 { margin: 36px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.3rem; }
.docs h3 { margin: 26px 0 8px; font-size: 1.05rem; }
.docs pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .84rem; background: var(--green-950); color: #D9F2DF; padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.docs code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--line-2); padding: 1px 5px; border-radius: 5px; }
.docs pre code { background: none; border: 0; padding: 0; color: inherit; }
.docs table { border-collapse: collapse; width: 100%; margin: 10px 0 16px; font-size: .9rem; }
.docs th, .docs td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.docs th { background: var(--surface-2); }
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.docs-toc { position: sticky; top: calc(var(--topbar-h) + 20px); max-height: calc(100vh - 120px); overflow-y: auto; font-size: .88rem; }
.docs-toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink-2); }
.docs-toc a:hover { background: var(--surface); text-decoration: none; }
.docs-toc a.l3 { padding-left: 22px; color: var(--muted); font-size: .84rem; }

/* =====================================================================
   Auth pages
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden;
  background: var(--green-900); color: #DCEFE1;
  padding: 56px; display: flex; flex-direction: column; justify-content: flex-end;
}
.auth-art .road { position: absolute; inset: 0; pointer-events: none; }
.auth-art .road i {
  position: absolute; height: 18px; border-radius: 18px; background: var(--orange);
  animation: zoom 1.1s cubic-bezier(.2,.8,.2,1) both;
}
.auth-art .road i.g { background: var(--leaf); }
.auth-art .road i.d { background: rgba(255,255,255,.08); }
@keyframes zoom { from { transform: translateX(-60vw); } }
.auth-art h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; color: #fff; line-height: 1.12; max-width: 14ch; letter-spacing: -.02em; }
.auth-art p { font-size: 1.05rem; max-width: 44ch; color: #BFE0C7; margin-top: 14px; }
.auth-art .facts { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.auth-art .facts div { font-size: .9rem; color: #BFE0C7; }
.auth-art .facts strong { display: block; color: #fff; font-size: 1.2rem; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.auth-card { width: min(420px, 100%); }
.auth-card .brand-logo { margin-bottom: 30px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 26px; }
.auth-card .field + .field { margin-top: 16px; }
.auth-card .btn { height: 46px; font-size: 1rem; }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 800; height: 58px; font-variant-numeric: tabular-nums; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; width: 34px; height: 34px; border-radius: 8px; }
.auth-foot { margin-top: 28px; font-size: .85rem; color: var(--muted); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1180px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(4,49,26,.4); z-index: 35; }
  .menu-toggle { display: inline-grid; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 720px) {
  .content { padding: 18px 14px; }
  .topbar { padding: 0 14px; }
  .grid-2, .grid-3, .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .variant-row { grid-template-columns: 1fr 1fr; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .track-step { font-size: .7rem; }
  .hide-sm { display: none !important; }
  .hello .lines { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .no-print, .toasts, .buzz { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* File inputs */
input[type="file"].input { padding: 7px 8px; cursor: pointer; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 700; font-size: .85rem; margin-right: 12px;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2, #F3F6F2); color: var(--ink); cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--green); color: var(--green); }

/* =====================================================================
   Bid marketplace: catalog cards, stars, offers, countdown
   ===================================================================== */
.stars { color: #F2A900; white-space: nowrap; font-size: .9rem; }
.stars b { color: var(--ink); font-weight: 800; margin-left: 2px; }
.stars .muted { font-weight: 500; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.cat-card:hover { box-shadow: var(--shadow-pop, 0 12px 30px -16px rgba(0,0,0,.25)); transform: translateY(-2px); }
.cat-card .ph { aspect-ratio: 4 / 3; background: var(--surface-2, #F3F6F2); display: grid; place-items: center; overflow: hidden; }
.cat-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-card .brand { font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cat-card .name { font-weight: 800; line-height: 1.25; color: var(--ink); }
.cat-card .mrp { font-size: 1.15rem; font-weight: 800; }
.cat-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); font-size: .82rem; }
.cat-card.off { opacity: .55; }
.hero-product { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 28px; align-items: start; }
.hero-product .ph { border-radius: 16px; overflow: hidden; background: var(--surface-2, #F3F6F2); aspect-ratio: 1; display: grid; place-items: center; }
.hero-product .ph img { width: 100%; height: 100%; object-fit: cover; }
.benefits { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.benefits li { display: flex; gap: 10px; align-items: flex-start; }
.benefits li::before { content: "\F26E"; font-family: "bootstrap-icons"; color: var(--leaf); font-size: 1.1rem; line-height: 1.2; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 8px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.spec-table td:first-child { color: var(--muted); width: 40%; }
.countdown { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .85rem; padding: 4px 10px; border-radius: 99px; background: #FFF1E6; color: var(--orange-600, #C44F00); }
.countdown.calm { background: var(--green-50, #E6F3EA); color: var(--green); }
.countdown.closed { background: var(--line-2); color: var(--muted); }
.offer-list { display: grid; gap: 10px; }
.offer { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.offer .rank { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--line-2); color: var(--muted); }
.offer.best { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(91,170,31,.15); }
.offer.best .rank { background: var(--leaf); color: #fff; }
.offer.won { border-color: var(--green); background: var(--green-50, #E6F3EA); }
.offer .price { font-size: 1.25rem; font-weight: 800; text-align: right; }
.offer .save { font-size: .8rem; color: var(--leaf); font-weight: 700; text-align: right; }
.offer.dim { opacity: .6; }
.bid-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-pill { display: inline-flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; background: var(--surface-2, #F3F6F2); min-width: 120px; }
.stat-pill b { font-size: 1.1rem; }
.stat-pill span { font-size: .78rem; color: var(--muted); }
.dist-bar { display: grid; grid-template-columns: 36px 1fr 36px; gap: 8px; align-items: center; font-size: .82rem; }
.dist-bar .track { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.dist-bar .track span { display: block; height: 100%; background: #F2A900; border-radius: 8px; }
.market-banner { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 20px 22px; border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, var(--green-900, #06401F), var(--green)); position: relative; overflow: hidden; }
.market-banner h2 { color: #fff; margin: 0 0 4px; }
.market-banner p { margin: 0; opacity: .9; max-width: 640px; }
.review-card { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.review-card:last-child { border-bottom: 0; }
.review-reply { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--leaf); background: var(--surface-2, #F3F6F2); border-radius: 0 10px 10px 0; font-size: .9rem; }
@media (max-width: 760px) { .hero-product { grid-template-columns: 1fr; } .offer { grid-template-columns: 1fr; } .offer .price, .offer .save { text-align: left; } .offer .rank { display: none; } }
