/* ---------- themes ---------- */
:root, [data-theme="nebula"] {
  --bg: #0b0a14; --bg-2: #120f24;
  --surface: rgba(24, 21, 42, 0.72); --surface-solid: #18152a; --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f2ff; --text-2: #c9c3e6; --muted: #8b84ad;
  --accent: #8b5cf6; --accent-2: #f472b6; --accent-ink: #ffffff;
  --good: #34d399; --warn: #fbbf24; --bad: #fb7185; --info: #60a5fa;
  --box-a: #8b5cf6; --box-b: #6d28d9; --box-c: #4c1d95; --tape: #f9a8d4;
  --glow: rgba(139, 92, 246, 0.35);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
[data-theme="ocean"] {
  --bg: #06121f; --bg-2: #0a1d33;
  --surface: rgba(12, 30, 52, 0.72); --surface-solid: #0c1e34; --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef8ff; --text-2: #b8d4ea; --muted: #7896b3;
  --accent: #22d3ee; --accent-2: #3b82f6; --accent-ink: #04202b;
  --good: #34d399; --warn: #fbbf24; --bad: #fb7185; --info: #93c5fd;
  --box-a: #38bdf8; --box-b: #0284c7; --box-c: #075985; --tape: #a5f3fc;
  --glow: rgba(34, 211, 238, 0.3);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
[data-theme="ember"] {
  --bg: #120504; --bg-2: #1e0a06;
  --surface: rgba(36, 14, 10, 0.72); --surface-solid: #240e0a; --surface-2: rgba(255, 241, 214, 0.05);
  --line: rgba(255, 241, 214, 0.09); --line-strong: rgba(255, 241, 214, 0.18);
  --text: #fff1d6; --text-2: #ebcbb0; --muted: #a8877a;
  --accent: #ffb020; --accent-2: #ff5a36; --accent-ink: #2b0a05;
  --good: #5fd08a; --warn: #ffb02e; --bad: #ff4a3d; --info: #7cb8ff;
  --box-a: #d9a066; --box-b: #b07a45; --box-c: #8a5a2e; --tape: #ff5a36;
  --glow: rgba(255, 122, 0, 0.3);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
[data-theme="sakura"] {
  --bg: #fff4f7; --bg-2: #ffe4ec;
  --surface: rgba(255, 255, 255, 0.78); --surface-solid: #ffffff; --surface-2: rgba(190, 24, 93, 0.05);
  --line: rgba(80, 7, 36, 0.08); --line-strong: rgba(80, 7, 36, 0.16);
  --text: #3b0a1f; --text-2: #6b2a45; --muted: #a0687f;
  --accent: #db2777; --accent-2: #f59e0b; --accent-ink: #ffffff;
  --good: #059669; --warn: #b45309; --bad: #e11d48; --info: #2563eb;
  --box-a: #f9a8d4; --box-b: #ec4899; --box-c: #be185d; --tape: #fde68a;
  --glow: rgba(236, 72, 153, 0.22);
  --shadow: 0 24px 60px rgba(131, 24, 67, 0.14);
  color-scheme: light;
}
[data-theme="paper"] {
  --bg: #f5f4f0; --bg-2: #e9e7f5;
  --surface: rgba(255, 255, 255, 0.8); --surface-solid: #ffffff; --surface-2: rgba(17, 24, 39, 0.04);
  --line: rgba(17, 24, 39, 0.08); --line-strong: rgba(17, 24, 39, 0.16);
  --text: #111827; --text-2: #374151; --muted: #6b7280;
  --accent: #4f46e5; --accent-2: #0ea5e9; --accent-ink: #ffffff;
  --good: #059669; --warn: #b45309; --bad: #dc2626; --info: #2563eb;
  --box-a: #818cf8; --box-b: #4f46e5; --box-c: #3730a3; --tape: #7dd3fc;
  --glow: rgba(79, 70, 229, 0.18);
  --shadow: 0 24px 60px rgba(17, 24, 39, 0.1);
  color-scheme: light;
}

:root {
  --radius: 20px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background .4s, color .4s;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- ambient background ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; background: radial-gradient(1200px 700px at 70% -10%, var(--bg-2), transparent 70%); }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.orb.a { width: 520px; height: 520px; background: var(--accent); top: -180px; right: -120px; opacity: .22; animation: drift 18s ease-in-out infinite alternate; }
.orb.b { width: 420px; height: 420px; background: var(--accent-2); bottom: -160px; left: -140px; opacity: .14; animation: drift 22s ease-in-out infinite alternate-reverse; }
.grid-floor { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; transform: perspective(600px) rotateX(62deg); transform-origin: bottom; mask-image: linear-gradient(to top, #000 10%, transparent 75%); opacity: .7; }
@keyframes drift { to { transform: translate(-60px, 50px) scale(1.1); } }

/* ---------- shell + header ---------- */
.shell { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand svg { width: 34px; height: 34px; filter: drop-shadow(0 6px 14px var(--glow)); }
.brand stop:first-child { stop-color: var(--accent); }
.brand stop:last-child { stop-color: var(--accent-2); }
.brand b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; backdrop-filter: blur(12px); }
.chip i { font-style: normal; color: var(--text); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 10px 16px; border-radius: 14px; cursor: pointer; font-weight: 700; font-size: 14px; transition: transform .15s, box-shadow .2s, border-color .2s; white-space: nowrap; text-decoration: none; backdrop-filter: blur(12px); }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 10px 30px var(--glow); }
.btn.primary:hover { box-shadow: 0 14px 38px var(--glow); transform: translateY(-1px); }
.btn.ghost { background: transparent; backdrop-filter: none; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 11px; }
.btn svg { width: 16px; height: 16px; }

.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; list-style: none; backdrop-filter: blur(12px); transition: border-color .2s; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.themes { position: relative; }
.theme-menu { position: absolute; right: 0; top: 48px; z-index: 30; background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 16px; padding: 6px; min-width: 170px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.theme-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; }
.theme-menu button:hover { background: var(--surface-2); }
.theme-menu button[aria-checked="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sw { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 0 3px var(--c), 0 0 0 4px var(--line-strong); flex: none; }

/* ---------- hero with the 3D parcel ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 20px; padding: 30px 32px; border-radius: 28px; background: linear-gradient(135deg, var(--surface), transparent), var(--surface); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 260px at 85% 50%, var(--glow), transparent 70%); pointer-events: none; }
.hero .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero .big { font-size: clamp(42px, 7vw, 68px); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: 10px 0 6px; font-variant-numeric: tabular-nums; background: linear-gradient(120deg, var(--text) 30%, var(--accent) 70%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { color: var(--text-2); font-size: 15px; }
.hero .facts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.fact { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); font-weight: 600; }
.fact b { color: var(--text); font-variant-numeric: tabular-nums; }
.fact .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.fact .dot.good { background: var(--good); }
.fact .dot.warn { background: var(--warn); }

.scene { position: relative; height: 260px; perspective: 900px; display: grid; place-items: center; z-index: 1; }
.float { animation: bob 5s ease-in-out infinite; transform-style: preserve-3d; }
.box { --s: 130px; position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; animation: turn 16s linear infinite; }
.face { position: absolute; inset: 0; border-radius: 10px; display: grid; place-items: center; backface-visibility: hidden; border: 1px solid rgba(255, 255, 255, .18); }
.face.front  { transform: translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, var(--box-a), var(--box-b)); }
.face.back   { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, var(--box-a), var(--box-b)); }
.face.right  { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, var(--box-b), var(--box-c)); }
.face.left   { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, var(--box-b), var(--box-c)); }
.face.top    { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(160deg, var(--box-a), var(--box-a)); filter: brightness(1.15); }
.face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); background: var(--box-c); }
.face .tape { position: absolute; left: 50%; top: 0; bottom: 0; width: 22%; transform: translateX(-50%); background: var(--tape); opacity: .9; }
.face.top .tape { top: 0; bottom: 0; }
.face svg { position: relative; width: 44%; height: 44%; color: #fff; opacity: .92; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
.shadow { position: absolute; bottom: 22px; width: 150px; height: 26px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent); animation: shadow 5s ease-in-out infinite; }
.orbit { position: absolute; inset: 0; transform-style: preserve-3d; animation: orbit 9s linear infinite; pointer-events: none; }
.orbit span { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 20px var(--glow); }
.orbit span:nth-child(1) { transform: rotateY(0deg) translateZ(130px) rotateY(0deg); }
.orbit span:nth-child(2) { transform: rotateY(120deg) translateZ(130px); width: 26px; height: 26px; margin: -13px; font-size: 12px; }
.orbit span:nth-child(3) { transform: rotateY(240deg) translateZ(130px); width: 22px; height: 22px; margin: -11px; font-size: 11px; }
.badge3d { position: absolute; top: 18px; right: 6px; padding: 8px 12px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 700; box-shadow: var(--shadow); transform: rotate(3deg); }
.badge3d b { color: var(--accent); font-size: 18px; margin-right: 4px; }
@keyframes turn { from { transform: rotateX(-18deg) rotateY(0deg); } to { transform: rotateX(-18deg) rotateY(360deg); } }
@keyframes bob { 50% { transform: translateY(-14px); } }
@keyframes shadow { 50% { transform: scale(.82); opacity: .6; } }
@keyframes orbit { from { transform: rotateX(-14deg) rotateY(0deg); } to { transform: rotateX(-14deg) rotateY(-360deg); } }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 22px 20px; }
  .scene { height: 200px; order: -1; margin: -6px 0 -10px; }
  .box { --s: 100px; }
  .orbit span:nth-child(1) { transform: translateZ(100px); }
  .orbit span:nth-child(2) { transform: rotateY(120deg) translateZ(100px); }
  .orbit span:nth-child(3) { transform: rotateY(240deg) translateZ(100px); }
}
@media (prefers-reduced-motion: reduce) {
  .box, .float, .orbit, .shadow, .orb { animation: none !important; }
  .box { transform: rotateX(-18deg) rotateY(-32deg); }
}

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 14px; }
@media (max-width: 960px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(14px); }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.stat .label svg { width: 16px; height: 16px; color: var(--accent); }
.stat .value { font-size: clamp(22px, 3.4vw, 28px); font-weight: 800; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }

/* ---------- panels + charts ---------- */
.panels { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-top: 14px; }
.panels .stack { display: grid; gap: 12px; align-content: start; }
@media (max-width: 960px) { .panels { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(14px); min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .15), inset 0 0 0 1px var(--line); }
.controls { display: flex; gap: 6px; flex-wrap: wrap; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 230px; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: url(#barGrad); }
.chart .bar.zero { fill: var(--line-strong); }
.chart g.col .hit { fill: transparent; }
.chart g.col:hover .bar { filter: brightness(1.15); }
.chart g.col:hover .hit { fill: var(--surface-2); }
.chart .chart-total { position: absolute; top: -4px; right: 0; text-align: right; font-size: 12px; color: var(--muted); }
.chart .chart-total b { display: block; color: var(--text); font-size: 18px; font-weight: 800; }
.tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: 7px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow); z-index: 5; }
.tip small { display: block; font-weight: 500; opacity: .75; }

.stackbar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.stackbar span { height: 100%; min-width: 4px; }
.legend { display: grid; gap: 8px; margin-top: 14px; }
.legend div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }

.shops { display: grid; gap: 12px; }
.shop .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.shop .row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.shop .row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop .row small { color: var(--muted); font-weight: 600; margin-left: 6px; }
.meter { height: 6px; background: var(--surface-2); border-radius: 6px; margin-top: 6px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- orders ---------- */
.orders-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 30px 0 12px; }
.orders-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.orders-head h2 small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 8px; letter-spacing: 0; }
.orders-head .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search input { width: 240px; max-width: 100%; padding: 10px 12px 10px 36px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line-strong); outline: 0; backdrop-filter: blur(12px); }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
@media (max-width: 560px) { .orders-head .right, .search, .search input { width: 100%; } }

.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.filters button { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; backdrop-filter: blur(12px); }
.filters button small { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: transparent; }
.filters button[aria-pressed="true"] small { color: inherit; opacity: .7; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); perspective: 1200px; }
@media (max-width: 400px) { .cards { grid-template-columns: 1fr; } }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: left; width: 100%; display: block; backdrop-filter: blur(14px); transform-style: preserve-3d; transition: transform .25s ease, border-color .2s, box-shadow .25s; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.card:hover { border-color: var(--line-strong); box-shadow: 0 18px 40px rgba(0, 0, 0, .25), 0 0 0 1px var(--glow); }
.card .row { display: flex; align-items: flex-start; gap: 12px; }
.card .grow { flex: 1; min-width: 0; }
.card h3 { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .money { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15.5px; }
.card .money small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.card .thumb { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex: none; background: var(--surface-2); cursor: zoom-in; transition: transform .2s; transform: translateZ(20px); box-shadow: 0 8px 18px rgba(0, 0, 0, .2); }
.card .thumb:hover { transform: translateZ(30px) scale(1.06); }
.card .noimg { width: 72px; height: 72px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.card .noimg svg { width: 28px; height: 28px; }
.card.is-cancelled { opacity: .5; }
.card .foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card .event { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; }
.card .event time { color: var(--muted); white-space: nowrap; }
.card .event span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; border: 1px solid var(--line); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.s-ordered { color: var(--warn); }
.pill.s-shipped_cn, .pill.s-warehouse, .pill.s-to_ph { color: var(--info); }
.pill.s-delivered { color: var(--accent); }
.pill.s-received { color: var(--good); }
.pill.s-cancelled { color: var(--muted); }
.pill.alert { color: var(--bad); }

.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-left: auto; width: 110px; }
.steps span { height: 4px; border-radius: 4px; background: var(--line-strong); }
.steps span.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 34px 18px; text-align: center; color: var(--muted); background: var(--surface); backdrop-filter: blur(12px); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------- drawer ---------- */
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); max-width: 100vw; border: 0; padding: 0; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); border-left: 1px solid var(--line); }
dialog.drawer[open] { animation: slide .25s cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(3px); }
@keyframes slide { from { transform: translateX(50px); opacity: 0; } }
.drawer form { display: flex; flex-direction: column; height: 100%; }
.drawer header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; font-size: 18px; font-weight: 800; }
.drawer .body { flex: 1; overflow: auto; padding: 18px; display: grid; gap: 14px; align-content: start; }
.drawer footer { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer footer .spacer { margin-right: auto; }

.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 11px; padding: 10px 12px; outline: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0; display: grid; gap: 10px; }
legend { padding: 0 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.note { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.note b { color: var(--text); }
.note a { color: var(--accent); font-weight: 700; text-decoration: none; }

.items { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: start; background: var(--surface-2); border-radius: 16px; padding: 10px; }
.item img { width: 104px; height: 104px; border-radius: 12px; object-fit: cover; cursor: zoom-in; box-shadow: 0 8px 18px rgba(0, 0, 0, .18); }
.item b { display: block; font-size: 14px; line-height: 1.35; }
.item small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.item .price { color: var(--text); font-weight: 800; font-size: 14px; margin-top: 6px; }

.stepper { display: grid; grid-template-columns: repeat(6, 1fr); margin: 6px 0 4px; }
.stepper div { position: relative; text-align: center; font-size: 11px; color: var(--muted); padding-top: 22px; line-height: 1.2; }
.stepper div::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--surface-solid); border: 2px solid var(--line-strong); z-index: 1; }
.stepper div::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.stepper div:first-child::after { display: none; }
.stepper div.on { color: var(--text); font-weight: 700; }
.stepper div.on::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.stepper div.on::after { background: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { position: relative; padding-left: 20px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.timeline li:first-child::before { background: var(--accent); }
.timeline time { display: block; color: var(--muted); font-size: 12px; }

/* ---------- photo viewer ---------- */
dialog.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; display: none; place-items: center; align-content: center; gap: 14px; cursor: zoom-out; }
dialog.viewer[open] { display: grid; animation: pop .22s cubic-bezier(.2, .8, .2, 1); }
dialog.viewer::backdrop { background: rgba(0, 0, 0, .85); backdrop-filter: blur(6px); }
dialog.viewer img { max-width: min(92vw, 900px); max-height: 80vh; border-radius: 18px; object-fit: contain; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
dialog.viewer p { margin: 0 16px; max-width: 900px; text-align: center; color: #fff; font-size: 14px; }
dialog.viewer button { position: fixed; top: 16px; right: 16px; color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

/* ---------- account ---------- */
.account { position: relative; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; list-style: none; font-weight: 800; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px var(--glow); }
.avatar::-webkit-details-marker { display: none; }
.account-menu { min-width: 240px; }
.account-menu .who { display: grid; padding: 8px 10px 4px; }
.account-menu .who span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.account-menu .hint { margin: 0; padding: 4px 10px 8px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- sign in ---------- */
.auth { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; padding: 16px; overflow: auto; background: radial-gradient(900px 500px at 70% 0%, var(--bg-2), var(--bg)); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 26px 26px 28px; box-shadow: var(--shadow); backdrop-filter: blur(18px); text-align: center; }
.auth-art { height: 150px; margin: -6px 0 4px; }
.scene.small { height: 150px; }
.scene.small .box { --s: 76px; }
.scene.small .shadow { bottom: 6px; width: 90px; }
.auth h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(120deg, var(--text) 20%, var(--accent) 60%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth .lead { margin: 4px 0 16px; color: var(--muted); font-size: 14px; }
.auth-tabs { width: 100%; margin-bottom: 14px; }
.auth-tabs button { flex: 1; padding: 8px; }
.auth form { display: grid; gap: 12px; text-align: left; }
.auth form .btn { margin-top: 4px; padding: 12px; }
.auth-error { margin: 0; color: var(--bad); font-size: 13.5px; font-weight: 600; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.google { width: 100%; padding: 12px; color: var(--text); }
.btn.google svg { width: 18px; height: 18px; }

/* ---------- toast ---------- */

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); z-index: 60; max-width: calc(100vw - 32px); animation: pop .2s ease-out; }
.toast.err { background: var(--bad); color: #fff; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Budol Deals: warm editorial workspace */
[data-theme="paper"] {
  --bg: #f8f7f3; --bg-2: #eeeafc; --surface: #ffffff; --surface-solid: #ffffff;
  --text: #262333; --text-2: #565064; --muted: #746d80;
  --accent: #7954ce; --accent-2: #a37bde; --accent-ink: #fff;
  --line: #e9e5ed; --line-strong: #d4ccdf; --glow: #9674d52b;
  --box-a: #bda4e4; --box-b: #9674ce; --box-c: #7353ae; --tape: #f5d9a5;
  --shadow: 0 12px 40px #34205208;
}
:root { --font: 'Segoe UI', system-ui, sans-serif; }
.shell { max-width: 1320px; padding: 28px 36px 32px; }
.top { margin-bottom: 25px; }
.brand b { letter-spacing: -.055em; font-size: 29px; }
.brand svg { width: 42px; height: 42px; }
.bg .orb { opacity: .06; }
.grid-floor { display: none; }
.workspace-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 10px; letter-spacing: .15em; font-weight: 700; }
.live-dot { display: inline-block; height: 7px; width: 7px; background: var(--good); border-radius: 50%; margin-right: 7px; }
.text-btn { border: 0; background: transparent; cursor: pointer; color: var(--text-2); font-size: 12px; }
.hero { min-height: 310px; padding: 40px 44px; border-radius: 24px; background: linear-gradient(115deg, var(--surface-solid) 10%, var(--bg-2)); }
.welcome-hero { min-height: 420px; }
.hero .big { font-size: clamp(42px, 5.4vw, 72px); letter-spacing: -.055em; line-height: 1.05; margin: 16px 0; color: var(--text); background: none; }
.hero .sub { max-width: 470px; line-height: 1.7; }
.hero .eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .16em; }
.hero-note { margin-top: 25px; font-size: 11px; color: var(--muted); }
.btn { border-radius: 11px; padding: 11px 17px; }
.btn.primary { background: var(--accent); box-shadow: 0 5px 12px var(--glow); }
.intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
.intro-grid article { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.intro-number { color: var(--accent); font-size: 10px; letter-spacing: .13em; font-weight: 700; }
.intro-grid h2 { font-size: 19px; letter-spacing: -.035em; margin: 22px 0 10px; }
.intro-grid p { font-size: 13px; color: var(--text-2); line-height: 1.8; margin: 0; }
.local-footer { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.panel, .stat, .card { box-shadow: 0 5px 20px #34205204; }
.stat { border-radius: 18px; }
.stats { margin-top: 24px; }
.import-list > div { display: flex; gap: 16px; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.import-list small { display: block; color: var(--muted); }
#rate { cursor: pointer; }
#rate small { font-size: 10px; color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@media(max-width: 760px) {
  .shell { padding: 20px 16px; }
  .top-actions { width: 100%; }
  .top-actions .btn { flex: 1; font-size: 12px; padding: 10px; }
  .hero { padding: 28px 24px; grid-template-columns: 1fr; }
  .welcome-hero .scene { height: 200px; }
  .intro-grid { grid-template-columns: 1fr; }
  .intro-grid article { padding: 22px; }
  .intro-grid h2 { margin-top: 14px; }
  .local-footer { flex-direction: column; }
  .workspace-bar { font-size: 8px; letter-spacing: .08em; }
}
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
