/* ============================================================
   SellerLab — design system
   Light SaaS · airy · rounded · emerald brand + violet spice
   Palette aligned to the marketing landing (brand #078B61 / #6d28d9)
   ============================================================ */

:root {
  /* ---- brand (emerald green) ---- */
  --accent: #078B61;
  --accent-hover: #067A56;
  --accent-press: #065F46;
  --accent-soft: #EDF7F3;
  --accent-soft-bd: #B8DCCE;
  --accent-ink: #087B58;

  /* ---- secondary (chart purple) ---- */
  --accent-2: #7C5CFC;
  --accent-2-soft: #f1ecfe;
  --accent-2-ink: #5b21b6;

  /* ---- signature gradients ---- */
  --grad: linear-gradient(135deg, #078B61, #6d28d9);       /* text accents: green -> violet (brand signature) */
  --grad-brand: linear-gradient(135deg, #078B61, #067A56); /* primary buttons */

  /* ---- neutrals (cool slate) ---- */
  --bg: #F4F5F6;
  --bg-sunk: #EBEDEF;
  --surface: #ffffff;
  --surface-2: #F0F2F3;
  --surface-glass: rgba(255, 255, 255, 0.82);
  --bd: #E5EBE8;
  --bd-strong: #D8E1DD;
  --ink: #111827;
  --ink-2: #344054;
  --ink-3: #667085;
  --ink-4: #98A2B3;

  /* ---- status ---- */
  --ok: #179467;
  --ok-soft: #ECF8F3;
  --ok-ink: #12825B;
  --warn: #F59E0B;
  --warn-soft: #FFF7E8;
  --warn-ink: #9A6700;
  --err: #EF5964;
  --err-soft: #FFF0F1;
  --err-ink: #DF414D;
  --info: #3B82F6;
  --info-soft: #EFF6FF;
  --info-ink: #1D4ED8;
  --muted: #98A2B3;
  --muted-soft: #F5F8F7;
  --muted-ink: #667085;

  /* ---- radii (data-dense; no pill containers) ---- */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-full: 999px;

  /* ---- shadows (minimal) ---- */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .02);
  --sh-sm: 0 1px 2px rgba(16, 24, 40, .02), 0 4px 12px rgba(16, 24, 40, .025);
  --sh-md: 0 4px 14px rgba(16, 24, 40, .04);
  --sh-lg: 0 6px 20px rgba(16, 24, 40, .06);
  --sh-pop: 0 8px 20px rgba(16, 24, 40, .08), 0 20px 48px rgba(16, 24, 40, .10);

  /* ---- type ---- */
  --font: "Inter", "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- layout ---- */
  --topbar-h: 72px;
  --sidebar-w: 240px;
  --density: 1; /* scaled by tweaks: 0.85 compact, 1 regular */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
}
h1, h2 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; color: var(--ink); }
h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--accent-soft); }

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.02em; }
.tnum { font-variant-numeric: tabular-nums; }

/* gradient text accent (matches landing hero highlight) */
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- scrollbars ---- */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #D8E1DD; border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #C9D4CE; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-weight: 600; font-size: 14px; line-height: 1;
  padding: 0 16px; height: 40px; white-space: nowrap;
  transition: background .15s ease-out, border-color .15s ease-out, color .15s ease-out, box-shadow .15s ease-out;
  user-select: none;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: #078B61; color: #fff; box-shadow: 0 2px 6px rgba(7, 139, 97, .15); }
.btn-primary:hover { background: #067A56; }
.btn-primary:active { background: #065F46; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: #DDE4E1; }
.btn-ghost:hover { background: #F7F9F8; border-color: #D8E2DE; }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-soft-bd); }
.btn-soft:hover { background: #ddf5ec; }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--bg-sunk); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--err-ink); border-color: #f6c9c4; }
.btn-danger:hover { background: var(--err-soft); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; font-weight: 600; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }

/* ============================================================
   Cards & surfaces
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.card-pad { padding: 22px; }
.panel {
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}

/* ============================================================
   Badges & status dots
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 23px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; letter-spacing: 0;
  border: 1px solid transparent; white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge .dot { width: 6px; height: 6px; border-radius: 99px; flex: none; }
.b-ok   { background: var(--ok-soft);   color: var(--ok-ink);   border-color: #bce9d6; }
.b-warn { background: var(--warn-soft); color: var(--warn-ink); border-color: #f5dca0; }
.b-err  { background: var(--err-soft);  color: var(--err-ink);  border-color: #f6c9c4; }
.b-info { background: var(--info-soft); color: var(--info-ink); border-color: #c7d7fb; }
.b-mut  { background: var(--muted-soft);color: var(--muted-ink);border-color: var(--bd); }
.b-acc  { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-soft-bd); }

.dot { width: 8px; height: 8px; border-radius: 99px; flex: none; display: inline-block; }
.dot-ok   { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-err  { background: var(--err); }
.dot-info { background: var(--info); }
.dot-mut  { background: var(--muted); }
.dot-pulse { position: relative; }
.dot-pulse::after {
  content: ""; position: absolute; inset: -3px; border-radius: 99px;
  background: inherit; opacity: .4; animation: dotpulse 1.8s ease-out infinite;
}
@keyframes dotpulse { 0% { transform: scale(1); opacity: .45; } 70%,100% { transform: scale(2.4); opacity: 0; } }

/* ============================================================
   Form fields
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; background: var(--surface); border: 1px solid #E1E7E4;
  border-radius: var(--r-md); padding: 0 14px; height: 42px; font-size: 14px; color: var(--ink);
  transition: border-color .15s ease-out, box-shadow .15s ease-out; outline: none;
}
.textarea { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:hover, .select:hover, .textarea:hover { border-color: #D8E2DE; }
.input:focus, .select:focus, .textarea:focus { border-color: #7EC8AD; box-shadow: 0 0 0 3px rgba(8, 139, 97, .08); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }

/* ============================================================
   Image placeholder (product photos)
   ============================================================ */
.ph {
  position: relative; overflow: hidden; background: var(--bg-sunk);
  background-image: repeating-linear-gradient(135deg, oklch(0.94 0.004 264) 0 9px, oklch(0.965 0.003 264) 9px 18px);
  display: flex; align-items: flex-end; justify-content: flex-start;
  border-radius: var(--r-md); border: 1px solid var(--bd);
}
.ph span {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em; color: var(--ink-4);
  background: oklch(1 0 0 / 0.78); padding: 3px 6px; border-radius: 5px; margin: 7px;
  backdrop-filter: blur(2px);
}

/* ============================================================
   Misc helpers
   ============================================================ */
.divider { height: 1px; background: var(--bd); border: 0; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--bd); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink-3); }
.skel { background: linear-gradient(100deg, var(--bg-sunk) 30%, oklch(0.95 0.004 264) 50%, var(--bg-sunk) 70%); background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; border-radius: var(--r-sm); }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.fade-in { animation: fadein .34s ease; }
@keyframes fadein { from { transform: translateY(7px); } to { transform: none; } }

/* progress bar */
.bar { height: 8px; border-radius: 99px; background: #EEF1F0; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s ease; }

/* tooltip-ish meta */
.meta { font-size: 12.5px; color: var(--ink-3); }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }

/* tiny segmented */
.seg { display: inline-flex; background: var(--bg-sunk); border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 6px; height: 30px; padding: 0 13px; font-size: 13px; font-weight: 540; color: var(--ink-3); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); }

/* mini stat */
.stat-k { font-size: 12px; color: var(--ink-3); font-weight: 540; }
.stat-v { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; color: var(--ink); }

/* ============================================================
   Dark theme (admin)
   ============================================================ */
[data-theme="dark"] {
  --accent: oklch(0.68 0.14 162);
  --accent-hover: oklch(0.73 0.14 162);
  --accent-press: oklch(0.63 0.14 162);
  --accent-soft: oklch(0.32 0.05 162);
  --accent-soft-bd: oklch(0.4 0.07 162);
  --accent-ink: oklch(0.82 0.11 162);

  --accent-2: #a78bfa;
  --accent-2-soft: #2a2152;
  --accent-2-ink: #B9A7FD;
  --grad: linear-gradient(135deg, #2bbd97, #a78bfa);
  --grad-brand: linear-gradient(135deg, #18a886, #0c7559);

  --bg: oklch(0.19 0.008 264);
  --bg-sunk: oklch(0.165 0.008 264);
  --surface: oklch(0.225 0.009 264);
  --surface-2: oklch(0.245 0.009 264);
  --surface-glass: oklch(0.225 0.009 264 / 0.82);
  --bd: oklch(0.31 0.01 264);
  --bd-strong: oklch(0.4 0.012 264);
  --ink: oklch(0.96 0.004 264);
  --ink-2: oklch(0.82 0.006 264);
  --ink-3: oklch(0.66 0.008 264);
  --ink-4: oklch(0.54 0.008 264);

  --ok: oklch(0.7 0.13 156);
  --ok-soft: oklch(0.3 0.06 156);
  --ok-ink: oklch(0.82 0.12 156);
  --warn: oklch(0.78 0.13 78);
  --warn-soft: oklch(0.33 0.06 70);
  --warn-ink: oklch(0.86 0.11 82);
  --err: oklch(0.66 0.18 26);
  --err-soft: oklch(0.32 0.08 26);
  --err-ink: oklch(0.82 0.13 26);
  --info: oklch(0.68 0.12 236);
  --info-soft: oklch(0.3 0.06 236);
  --info-ink: oklch(0.82 0.1 236);
  --muted: oklch(0.5 0.006 264);
  --muted-soft: oklch(0.28 0.006 264);
  --muted-ink: oklch(0.72 0.006 264);

  --sh-xs: 0 1px 2px oklch(0 0 0 / 0.3);
  --sh-sm: 0 1px 2px oklch(0 0 0 / 0.3), 0 2px 6px oklch(0 0 0 / 0.25);
  --sh-md: 0 2px 4px oklch(0 0 0 / 0.3), 0 6px 16px oklch(0 0 0 / 0.35);
  --sh-lg: 0 4px 10px oklch(0 0 0 / 0.3), 0 18px 40px oklch(0 0 0 / 0.5);
  --sh-pop: 0 8px 20px oklch(0 0 0 / 0.45), 0 24px 60px oklch(0 0 0 / 0.6);
}
[data-theme="dark"] .ph {
  background-image: repeating-linear-gradient(135deg, oklch(0.27 0.008 264) 0 9px, oklch(0.24 0.008 264) 9px 18px);
}
[data-theme="dark"] .ph span { background: oklch(0.2 0 0 / 0.78); }
[data-theme="dark"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] *::-webkit-scrollbar-thumb { background: oklch(0.38 0.01 264); }
html { color-scheme: light dark; }
.theme-anim, .theme-anim * { transition: background-color .25s ease, border-color .25s ease, color .2s ease !important; }

/* ============================================================
   Cabinet-only structural rules (theme tokens are global now)
   ============================================================ */
.sl-cab aside nav button { height: 44px; font-size: 14px !important; }
.sl-cab table thead tr { background: var(--surface-2) !important; }
.sl-cab .page-head h1 { font-size: 28px; }
.sl-cab .page-head .meta { font-size: 14px; }

/* impersonation banner (client cabinet, set by admin "login as") */
body.sl-imp { padding-top: 46px; }
body.sl-imp header { top: 46px !important; }
.sl-imp-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 46px; z-index: 250;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: oklch(0.74 0.13 78); color: oklch(0.28 0.06 70);
  font-size: 13.5px; font-weight: 540; padding: 0 18px;
  box-shadow: 0 1px 4px oklch(0.5 0.05 70 / 0.3);
}
.sl-imp-exit {
  border: 0; background: oklch(0.28 0.06 70); color: #fff; font-weight: 600;
  font-size: 12.5px; padding: 6px 12px; border-radius: 7px; cursor: pointer;
}
.sl-imp-exit:hover { background: oklch(0.22 0.06 70); }

/* horizontal carousel (landing variant strip) — hide scrollbar */
.sl-carousel { scrollbar-width: none; -ms-overflow-style: none; }
.sl-carousel::-webkit-scrollbar { display: none; }

/* variant photo hover actions (download / remove) */
.v-photo .v-hover { opacity: 0; transition: opacity .14s ease; }
.v-photo:hover .v-hover { opacity: 1; }
@media (hover: none) { .v-photo .v-hover { opacity: 1; } }

/* ============================================================
   MOBILE / RESPONSIVE
   The app styles inline, so structural layouts are switched in JS
   (useIsMobile). This layer handles the broad, className/attribute
   cases that don't have per-element JS.
   ============================================================ */
@media (max-width: 760px) {
  /* Collapse inline multi-equal-column grids (repeat(...)) to one column.
     Attribute selector reaches the inline style; !important beats it. */
  [style*="grid-template-columns"][style*="repeat"] { grid-template-columns: 1fr !important; }

  /* Keep everything inside the viewport. */
  html, body { overflow-x: hidden; }
  img, svg, video { max-width: 100%; }

  /* Tame heading sizes set via classes (not inline). */
  h1 { font-size: clamp(23px, 7vw, 32px); line-height: 1.12; }
  h2 { font-size: clamp(20px, 6vw, 26px); }

  /* Wide tables / strips scroll instead of overflowing. */
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Touch targets: 32px sm-buttons are too small for thumbs. */
  .btn-sm { height: 40px; padding: 0 16px; }
  .btn-icon.btn-sm { width: 40px; padding: 0; }
  footer nav a { padding: 10px 4px; display: inline-block; }

  /* Modal/sheet dialogs: near full-width on phones. */
  .panel { max-width: 100%; }
}
