/* RubyBug Apps demo console — follows the landing site: #050505 base, #FF4500 accent, Inter + Playfair Display. */
:root {
  --bg: #050505; --surface: #0c0c0c; --raised: #121212; --hover: rgba(255,255,255,.04);
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #f4f4f5; --muted: #a1a1aa; --faint: #71717a;
  --accent: #FF4500; --accent-2: #ff6a33; --accent-soft: rgba(255,69,0,.12); --glow: 0 0 24px rgba(255,69,0,.35);
  --ok: #34d399; --ok-soft: rgba(52,211,153,.12); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.12);
  --err: #f87171; --err-soft: rgba(248,113,113,.12); --info: #60a5fa; --info-soft: rgba(96,165,250,.12);
  --r-sm: 8px; --r: 14px; --r-lg: 20px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; --serif: "Playfair Display", Georgia, serif;
  --ease: cubic-bezier(.22,1,.36,1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: .05; mix-blend-mode: overlay; background-image: url("../assets/images/noise.svg"); }
::selection { background: var(--accent); color: #fff; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #fff; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .num { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; } .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 13px;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); color: #fff; }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 rgba(255,69,0,0); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); box-shadow: var(--glow); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--err); border-color: rgba(248,113,113,.35); }
.btn.danger:hover { background: var(--err-soft); }
.btn.danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
input, select { height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: rgba(255,255,255,.03); outline: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
select option { background: #111; }
input[aria-invalid=true] { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.field { display: grid; gap: 6px; } .field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input { height: 44px; }
.form-error { color: var(--err); font-size: 13px; min-height: 18px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { width: 100%; padding-left: 36px; }

/* pills / badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: rgba(255,255,255,.06); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(255,69,0,.3); }
.ch { width: 28px; height: 28px; border-radius: var(--r-sm); display: inline-grid; place-items: center; font-weight: 700; font-size: 10.5px; color: #fff; flex: none; letter-spacing: .02em; border: 1px solid var(--line-2); }
.ch.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 13px; }
.ch.tiktok { background: linear-gradient(135deg, #25f4ee22, #fe2c5533), #0b0b0b; } .ch.shopify { background: #2f4f1f; } .ch.amazon { background: #3a2a10; color: #ffb648; }
.chlabel { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; border-right: 1px solid var(--line); }
.auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .42; filter: grayscale(.6) contrast(1.15); }
.auth-art { background: #050505; }
.auth-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 55% at 15% 85%, rgba(255,69,0,.28), transparent 70%), linear-gradient(180deg, rgba(5,5,5,.35), rgba(5,5,5,.7) 50%, #050505 92%); }
.auth-copy { position: absolute; left: 56px; right: 56px; bottom: 56px; z-index: 1; }
.kicker { font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.auth-copy h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(36px, 4vw, 56px); line-height: 1.06; margin: 14px 0 18px; color: #ffe0e0; }
.auth-copy h1 em { font-weight: 400; }
.auth-facts { display: flex; gap: 28px; flex-wrap: wrap; color: rgba(255,224,224,.7); font-size: 13px; }
.auth-facts b { display: block; color: #fff; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: radial-gradient(80% 60% at 50% 0%, rgba(255,69,0,.07), transparent 70%); }
.auth-form { width: 100%; max-width: 400px; display: grid; gap: 18px; }
.auth-form .logo { height: 36px; width: auto; margin-bottom: 18px; }
.auth-form h2 { font-family: var(--serif); font-weight: 500; font-size: 34px; letter-spacing: -.01em; }
.auth-form .lead { color: var(--muted); margin: -8px 0 6px; }
.auth-form .btn.primary { height: 46px; font-size: 14px; }
.demo-box { border: 1px solid var(--line-2); background: rgba(255,255,255,.03); border-radius: var(--r); padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: 13px; }
.demo-box .k { grid-column: 1 / -1; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.legal { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; } .legal a { color: var(--faint); } .legal a:hover { color: #fff; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: #080808; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 25; }
.side .logo { height: 32px; width: auto; margin: 2px 6px; display: block; }
.nav { display: grid; gap: 2px; }
.nav .grp { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 14px 12px 6px; }
.nav .grp:first-child { padding-top: 0; }
.nav a { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: var(--hover); color: #fff; }
.nav a.on { background: rgba(255,255,255,.07); color: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.nav a.on svg { color: var(--accent); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font-size: 11px; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a.on .count, .nav .count.hot { background: var(--accent-soft); color: var(--accent-2); }
.workspace { margin-top: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: rgba(255,255,255,.02); display: grid; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > div { min-width: 0; } .who strong { display: block; font-size: 13px; font-weight: 600; color: var(--text); } .who > div span { display: block; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar, .who .avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; background: linear-gradient(135deg, #FF4500, #990026); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; letter-spacing: .02em; box-shadow: 0 2px 10px rgba(255,69,0,.25); }
.workspace .legal { gap: 4px 12px; }
.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(5,5,5,.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 15; }
.crumb { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; min-width: 0; white-space: nowrap; }
.crumb .ws { color: var(--faint); } .crumb .sep { color: var(--line-2); }
.top .spacer { flex: 1; }
.menu-btn { display: none; }
.store-switcher { position: relative; }
.store-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; }
.store-btn:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.24); }
.store-btn .chev { width: 14px; height: 14px; color: var(--faint); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,.5); flex: none; }
.status-dot.off { background: var(--warn); box-shadow: 0 0 8px rgba(251,191,36,.4); }
.store-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px; background: #101012; border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; box-shadow: 0 16px 48px rgba(0,0,0,.65); z-index: 35; display: grid; gap: 2px; }
.store-menu[hidden] { display: none; }
.store-menu .sm-head { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 6px 10px 4px; }
.store-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: none; color: var(--muted); padding: 8px 10px; border-radius: 8px; font-size: 13px; text-align: left; cursor: pointer; }
.store-menu button:hover { background: var(--hover); color: #fff; }
.store-menu button.on { background: rgba(255,255,255,.06); color: #fff; font-weight: 500; }
.store-menu .sm-div { height: 1px; background: var(--line); margin: 4px 0; }
.setup-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r); border: 1px solid rgba(255,69,0,.28); background: linear-gradient(90deg, rgba(255,69,0,.1), rgba(255,69,0,.02)); margin-bottom: 20px; }
.setup-bar .sb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.setup-bar .sb-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); flex: none; }
.setup-bar .sb-ic svg { width: 16px; height: 16px; }
.setup-bar strong { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.setup-bar span { display: block; font-size: 12px; color: var(--muted); }
.content { padding: 28px 32px 64px; width: 100%; max-width: 1320px; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; position: relative; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-h .sub { font-size: 12px; color: var(--faint); }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt { margin-top: 16px; } .mt-l { margin-top: 28px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack { display: grid; gap: 16px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.pagehead h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -.015em; }
.pagehead p { margin: 6px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .count { margin-left: auto; color: var(--faint); font-size: 12.5px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.02); flex-wrap: wrap; }
.seg button { border: 0; background: none; height: 30px; padding: 0 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.seg button:hover { color: #fff; }
.seg button.on { background: rgba(255,255,255,.09); color: #fff; }
.seg button .n { color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* KPI */
.kpi { padding: 18px 20px 14px; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 30px; font-weight: 600; margin-top: 6px; letter-spacing: -.03em; line-height: 1.1; }
.kpi .delta { font-size: 12px; margin-top: 6px; color: var(--faint); }
.kpi .delta b { font-weight: 600; } .up { color: var(--ok); } .down { color: var(--err); } .hot { color: var(--accent-2); }
.kpi svg.spark { display: block; width: 100%; height: 40px; margin-top: 10px; }
.kpi-bar { display: grid; gap: 8px; margin-top: 18px; font-size: 11.5px; color: var(--faint); }
.kpi.accent { background: radial-gradient(120% 100% at 100% 0%, rgba(255,69,0,.16), transparent 60%), var(--surface); border-color: rgba(255,69,0,.25); }

/* charts */
.chart { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .grid-l { stroke: rgba(255,255,255,.06); }
.chart text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.area .plot { position: relative; height: 220px; }
.area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.area .ylab { position: absolute; left: 0; transform: translateY(-120%); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; pointer-events: none; }
.area .xax { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 10px; }
.area .xax span { flex: 1; text-align: center; white-space: nowrap; } .area .xax span:first-child { text-align: left; } .area .xax span:last-child { text-align: right; }
.area .hit { position: absolute; top: 0; bottom: 0; cursor: crosshair; }
.area .cursor { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); transform: translate(-50%, -50%); box-shadow: var(--glow); opacity: 0; pointer-events: none; transition: opacity .12s; }
.area .cursor.show { opacity: 1; }
.donut { position: relative; width: 140px; aspect-ratio: 1; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg) scaleY(-1); }
.donut .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .c b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; } .donut .c span { font-size: 11px; color: var(--faint); }
.bars { display: flex; align-items: stretch; gap: 16px; height: 240px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.bar span { font-size: 12px; color: var(--muted); }
.bar i { display: block; width: 100%; max-width: 72px; margin-top: auto; border-radius: 10px; background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.05)); border: 1px solid var(--line); transition: height .5s var(--ease); }
.bar i.cur { background: linear-gradient(180deg, #FF4500, rgba(255,69,0,.35)); border-color: rgba(255,69,0,.5); box-shadow: var(--glow); }
.bar em { font-style: normal; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.tip { position: absolute; pointer-events: none; background: #1a1a1a; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 6px 10px; font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s; }
.tip.show { opacity: 1; }
.donut-wrap { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: center; }
.legend { display: grid; gap: 12px; }
.legend .li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .v { font-variant-numeric: tabular-nums; color: var(--muted); }
.meter { height: 6px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; } .meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; } .ring .c span { font-size: 11px; color: var(--faint); }
.sla { display: flex; gap: 20px; align-items: center; }
.facts { display: grid; gap: 10px; font-size: 13px; flex: 1; }
.facts div { display: flex; justify-content: space-between; gap: 10px; } .facts span { color: var(--muted); } .facts b { font-weight: 600; font-variant-numeric: tabular-nums; }
.alerts, .feed { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.alerts li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 10px; margin: 0 -10px; border-radius: 10px; }
.alerts li:hover { background: var(--hover); }
.alerts .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.alerts .ic svg { width: 16px; height: 16px; }
.alerts .ic.warn { background: var(--warn-soft); color: var(--warn); } .alerts .ic.err { background: var(--err-soft); color: var(--err); } .alerts .ic.info { background: var(--info-soft); color: var(--info); } .alerts .ic.ok { background: var(--ok-soft); color: var(--ok); }
.alerts strong { display: block; font-size: 13px; font-weight: 600; } .alerts span { font-size: 12px; color: var(--faint); }
.feed li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 13px; padding: 6px 0; }
.feed .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin: 6px 0 0 4px; } .feed li:first-child .pip { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.feed .t { font-size: 12px; color: var(--faint); }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.015); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr.click { cursor: pointer; } tbody tr:hover { background: rgba(255,255,255,.025); }
td.right, th.right { text-align: right; }
td .title { font-weight: 500; color: var(--text); } td .sub { font-size: 12px; color: var(--faint); }
.prod { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.thumb { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85); border: 1px solid var(--line); overflow: hidden; background: #141416; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.upload-box { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 14px; background: rgba(255,255,255,.02); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.upload-box input[type="file"] { height: auto; padding: 6px 0; border: 0; background: none; font-size: 12.5px; color: var(--muted); max-width: 100%; }
.upload-box input[type="file"]::file-selector-button { height: 30px; padding: 0 12px; margin-right: 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.06); color: var(--text); font-size: 12px; font-weight: 500; cursor: pointer; }
.upload-box input[type="file"]::file-selector-button:hover { background: rgba(255,255,255,.12); }
.onboard-hero { padding: 48px 28px; text-align: center; display: grid; justify-items: center; gap: 14px; background: radial-gradient(70% 60% at 50% 0%, rgba(255,69,0,.1), transparent 70%), var(--surface); }
.onboard-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 720px; margin-top: 10px; text-align: left; }
.onboard-step { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: rgba(255,255,255,.02); }
.onboard-step b { display: block; font-size: 12px; color: var(--accent-2); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.onboard-step span { font-size: 13px; color: var(--muted); }
.stock-in { width: 84px; height: 32px; text-align: right; }
.stock-in.low { border-color: rgba(251,191,36,.45); }

/* empty / error / skeleton */
.empty { padding: 56px 20px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.empty .em-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); margin-bottom: 8px; }
.empty .em-ic svg { width: 22px; height: 22px; } .empty.err .em-ic { color: var(--err); background: var(--err-soft); border-color: rgba(248,113,113,.25); }
.empty strong { color: var(--text); font-size: 15px; font-weight: 600; }
.empty p { margin: 0; max-width: 380px; }
.empty .row { margin-top: 12px; justify-content: center; }
.skel { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: sh 1.2s infinite linear; border-radius: 6px; height: 14px; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.notice { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); border-radius: var(--r); margin-bottom: 20px; font-size: 13px; }
.notice svg { width: 18px; height: 18px; flex: none; }
.notice.err { border-color: rgba(248,113,113,.35); background: var(--err-soft); color: #fecaca; }
.notice.accent { border-color: rgba(255,69,0,.3); background: var(--accent-soft); }
.notice .grow { flex: 1; }

/* stores */
.stores { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.store { display: grid; gap: 18px; transition: border-color .2s; }
.store:hover { border-color: var(--line-2); }
.store.off { opacity: .72; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--faint); } .kv dd { margin: 0; min-width: 0; }
.connect-card { display: grid; place-items: center; text-align: center; gap: 10px; border-style: dashed; border-color: var(--line-2); background: transparent; min-height: 230px; color: var(--muted); }

/* drawer + modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 40; opacity: 0; transition: opacity .2s; }
.overlay.show { opacity: 1; }
.drawer { position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(500px, calc(100% - 20px)); background: #0b0b0b; border: 1px solid var(--line-2); border-radius: var(--r-lg); z-index: 41; display: flex; flex-direction: column; transform: translateX(calc(100% + 20px)); transition: transform .3s var(--ease); box-shadow: 0 24px 80px rgba(0,0,0,.6); }
.drawer.show { transform: none; }
.drawer .d-h { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer .d-b { padding: 22px 24px; overflow-y: auto; flex: 1; display: grid; gap: 24px; align-content: start; }
.drawer .d-f { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.drawer h3, .modal h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -.01em; }
.sec-t { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 10px; }
.lines { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lines .ln { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.lines .ln:last-child { border-bottom: 0; background: rgba(255,255,255,.02); }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: all .22s var(--ease); width: min(480px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; background: #0b0b0b; border: 1px solid var(--line-2); z-index: 41; border-radius: var(--r-lg); padding: 26px; box-shadow: 0 24px 80px rgba(0,0,0,.6); display: grid; gap: 16px; }
.modal.show { transform: translate(-50%, -50%); opacity: 1; }
.modal p { margin: 0; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; font-size: 13px; padding-bottom: 14px; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline li.done:not(:last-child)::before { background: rgba(52,211,153,.4); }
.timeline .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg); margin-top: 2px; position: relative; }
.timeline li.done .dot { border-color: var(--ok); background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.timeline li:not(.done) span { color: var(--faint); }
.scopes { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.scopes > div { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.scopes > div:last-child { border-bottom: 0; }
.scopes svg { width: 16px; height: 16px; color: var(--ok); margin-top: 2px; }
.scopes code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: #fff; }
.masked { display: inline-flex; align-items: center; gap: 6px; } .masked svg { width: 13px; height: 13px; color: var(--faint); }

/* settings */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.subnav { display: grid; gap: 2px; position: sticky; top: 96px; }
.subnav button { text-align: left; border: 0; background: none; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--muted); cursor: pointer; font-weight: 500; }
.subnav button:hover { background: var(--hover); color: #fff; }
.subnav button.on { background: rgba(255,255,255,.07); color: #fff; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.set-row:first-child { padding-top: 0; } .set-row:last-child { border-bottom: 0; padding-bottom: 0; }
.set-row strong { display: block; font-weight: 600; font-size: 14px; } .set-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 520px; }
.switch { width: 40px; height: 24px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.08); position: relative; cursor: pointer; flex: none; transition: background .2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch[aria-checked=true] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked=true]::after { transform: translateX(16px); }
.retention { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.retention div { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(255,255,255,.02); }
.retention b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; } .retention span { font-size: 12px; color: var(--faint); }

/* toast */
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 70; max-width: calc(100% - 40px); }
.toast { display: flex; align-items: center; gap: 10px; background: #161616; border: 1px solid var(--line-2); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13px; box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: tin .28s var(--ease); }
.toast svg { width: 16px; height: 16px; color: var(--ok); flex: none; } .toast.err svg { color: var(--err); }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .2s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .settings { grid-template-columns: 1fr; } .subnav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; }
  .subnav button { white-space: nowrap; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; width: 272px; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .side.open { transform: none; box-shadow: 24px 0 60px rgba(0,0,0,.6); }
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 24; background: rgba(0,0,0,.55); }
  .menu-btn { display: inline-flex; }
  .top { padding: 0 16px; height: 60px; gap: 8px; } .crumb .ws, .crumb .sep { display: none; }
  .top .store-switcher, .top .avatar, .top #refreshBtn { display: none; }
  .form-grid-2, .onboard-steps { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 48px; }
  .pagehead h2 { font-size: 24px; }
  .kpi .value { font-size: 24px; }
  .donut-wrap { grid-template-columns: 110px 1fr; gap: 16px; }
  .sla { flex-direction: column; align-items: stretch; } .ring { margin: 0 auto; }
  .search { max-width: none; flex-basis: 100%; }
  .toolbar .count { margin-left: 0; }
  .kv { grid-template-columns: 110px 1fr; }
  .retention div { padding: 12px; } .retention b { font-size: 17px; }
  .hide-sm, .chlabel .muted { display: none; }
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .cards-sm thead { display: none; }
  .cards-sm table, .cards-sm tbody { display: block; }
  .cards-sm tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .cards-sm tr:last-child { border-bottom: 0; }
  .cards-sm td { display: block; padding: 0; border: 0; min-width: 0 !important; }
  .cards-sm td.right, .cards-sm td.end-sm { justify-self: end; text-align: right; }
  .cards-sm .prod { min-width: 0; }
  .cards-sm .hide-sm { display: none; }
  .seg button { white-space: nowrap; flex: none; }
  .set-row { flex-direction: column; align-items: flex-start; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: var(--r-lg); transform: translateY(100%); }
  .auth-form h2 { font-size: 28px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.warn-t { color: var(--warn); }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-error:empty { display: none; }
