/* Mori Motors — dark by default; "Daylight" theme via [data-theme="light"]. */

:root {
  --bg: #0c0a09;
  --bg-2: #13100e;
  --panel: #1a1512;
  --panel-2: #221b17;
  --panel-3: #2b221d;
  --line: #3a2f28;
  --line-2: #4c3e35;
  --ink: #efe6d8;
  --ink-2: #bfb09c;
  --ink-3: #8a7c6c;
  --accent: #ff583c;       /* logo orange-red */
  --accent-2: #ff8064;     /* lighter, for accent text on dark */
  --accent-ink: #1c0703;   /* text on accent fills */
  --red: #e5432f;
  --neon: #ff5640;
  --green: #7ccf6e;
  --amber: #f0b23e;
  --muted: #8a7c6c;
  --loss: #f2557a;
  --chart-pos: #3d95c0;
  --chart-neg: #f2557a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
  --glow-red: 0 0 4px #ff5640, 0 0 12px rgba(255, 86, 64, .8), 0 0 28px rgba(255, 60, 40, .55);
  --glow-accent: 0 0 6px rgba(255, 128, 100, .5), 0 0 18px rgba(255, 88, 60, .35);
  --radius: 10px;
  --font-display: "Pirata One", "Old English Text MT", Georgia, serif;
  --font-head: "Oswald", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .9  0 0 0 0 .8  0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #efe7d9;
  --bg-2: #e7ddcc;
  --panel: #fbf7ef;
  --panel-2: #f3ece0;
  --panel-3: #eadfce;
  --line: #d6c8b2;
  --line-2: #c4b398;
  --ink: #1f1814;
  --ink-2: #54473c;
  --ink-3: #7d6f60;
  --accent: #b3321a;
  --accent-2: #9c2a14;
  --accent-ink: #fff7f2;
  --red: #b8321f;
  --neon: #c9341f;
  --green: #2f7d32;
  --amber: #9a6200;
  --muted: #7d6f60;
  --loss: #b0174a;
  --chart-pos: #1b6fa0;
  --chart-neg: #b0174a;
  --shadow: 0 8px 24px rgba(60, 40, 20, .15);
  --glow-red: none;
  --glow-accent: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 88, 60, .09), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(229, 67, 47, .06), transparent 50%),
    var(--noise),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
}
:root[data-theme="light"] body {
  background: radial-gradient(ellipse at 50% -10%, rgba(179, 50, 26, .08), transparent 55%), var(--noise), var(--bg);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: .02em; line-height: 1.15; margin: 0 0 .5em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding-inline: clamp(16px, 3vw, 32px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none !important; }
.brand-mark { height: 60px; width: auto; flex: none; filter: drop-shadow(0 0 10px rgba(255, 88, 60, .22)); }
:root[data-theme="light"] .brand-mark, :root[data-theme="light"] .login-logo { filter: none; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-word b { font-family: var(--font-display); font-weight: 400; font-size: 30px; letter-spacing: .01em; color: var(--ink); }
.brand-word small { font: 500 10.5px/1 var(--font-head); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a, .nav button.link {
  font: 500 14px/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); padding: 10px 12px; border-radius: 6px; text-decoration: none;
}
.nav a:hover, .nav a.active { color: var(--ink); background: var(--panel-2); }
.live {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 11px/1 var(--font-head); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3);
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px;
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.live.on { color: var(--ink-2); }
.live.on i { background: var(--neon); box-shadow: var(--glow-red); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 18px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--ink); cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-3); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink);
  border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 rgba(0, 0, 0, .35);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffa085, var(--accent-2)); border-color: transparent; }
:root[data-theme="light"] .btn-primary:hover { background: linear-gradient(180deg, #cc4126, var(--accent)); }
.btn-danger { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 45%, var(--line)); }
.btn-danger:hover { background: color-mix(in srgb, var(--loss) 14%, var(--panel-2)); border-color: var(--loss); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
.btn-sm { padding: 8px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

label.field { display: block; }
.field > span, .label {
  display: block; margin-bottom: 6px;
  font: 500 12px/1.2 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
}
.field > span em { font-style: normal; color: var(--ink-3); letter-spacing: .04em; text-transform: none; font-family: var(--font-body); }
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="url"],
input[type="datetime-local"], input[type="date"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
  font: 15px/1.4 var(--font-body);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { resize: vertical; min-height: 90px; }
select { appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 5px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-grid .span-all { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 20px; }
.form-error { color: var(--loss); font-size: 14px; min-height: 1.2em; margin: 10px 0 0; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 0; color: var(--ink-2); user-select: none; }
.check input { appearance: none; width: 18px; height: 18px; flex: none; margin: 0; border-radius: 4px; border: 1.5px solid var(--line-2); background: var(--bg-2); display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input[type="radio"] { border-radius: 50%; }
.check input[type="radio"]:checked::after { width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--accent-ink); transform: none; }
.check:hover { color: var(--ink); }
.check .count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.seg button {
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  font: 500 12.5px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; padding: 10px 12px;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--panel-3); color: var(--accent-2); }
.seg button:hover:not(.on) { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(36px, 6vw, 72px) clamp(24px, 4vw, 40px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-family: var(--font-head); font-size: clamp(38px, 6vw, 74px); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: .98; margin: 0 0 18px; }
.hero h1 .script { display: block; font-family: var(--font-display); font-weight: 400; text-transform: none; color: var(--accent-2); font-size: .72em; letter-spacing: 0; margin-bottom: 6px; text-shadow: var(--glow-accent); }
.hero p.lede { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 56ch; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.tally { display: flex; gap: 0; margin-top: 28px; flex-wrap: wrap; border-top: 1px dashed var(--line-2); padding-top: 18px; }
.tally div { padding-right: 26px; margin-right: 26px; border-right: 1px solid var(--line); }
.tally div:last-child { border: 0; }
.tally b { display: block; font: 600 30px/1 var(--font-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.tally span { font: 500 11.5px/1 var(--font-head); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }

.neon-board {
  position: relative; justify-self: center; width: min(100%, 380px); aspect-ratio: 1 / 1;
  border-radius: 18px; padding: 26px; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, #241a15, #0e0b09 70%);
  border: 1px solid #2c221c;
  box-shadow: inset 0 0 0 6px #120e0c, inset 0 0 40px rgba(0, 0, 0, .8), var(--shadow);
}
:root[data-theme="light"] .neon-board { background: radial-gradient(circle at 50% 40%, #2a1f19, #15100d 70%); }
.neon-board::before, .neon-board::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; top: 14px; background: radial-gradient(circle at 35% 35%, #b9a68c, #4a3c30); }
.neon-board::before { left: 14px; }
.neon-board::after { right: 14px; }
.neon-board .open {
  font: 700 clamp(46px, 7vw, 74px)/1 var(--font-head); letter-spacing: .14em; color: #ffd9d2;
  text-shadow: 0 0 4px #ff5640, 0 0 12px rgba(255, 86, 64, .9), 0 0 30px rgba(255, 60, 40, .7), 0 0 60px rgba(255, 60, 40, .4);
  animation: flicker 7s infinite;
}
.neon-board .sub { margin-top: 14px; font: 400 clamp(26px, 3.4vw, 36px)/1 var(--font-display); color: #fff1e8; text-shadow: 0 0 4px #ff8064, 0 0 14px rgba(255, 128, 100, .7), 0 0 30px rgba(255, 88, 60, .45); }
.neon-board .small { margin-top: 18px; font: 500 12px/1.4 var(--font-head); letter-spacing: .3em; text-transform: uppercase; color: #a89582; }
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: .35; text-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .neon-board .open, .live.on i { animation: none; }
}

/* ---------- Showroom layout ---------- */
.showroom { padding-block: 8px 64px; }
.showroom .wrap { display: grid; grid-template-columns: 270px 1fr; gap: 28px; align-items: start; }
.filters {
  position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
}
.filters-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.filters-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: 0; color: var(--accent-2); }
.filter-group { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.filter-group .label { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-2); cursor: pointer;
  font: 500 13px/1 var(--font-head); letter-spacing: .06em; padding: 8px 10px; border-radius: 999px;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filters-close { display: none; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { flex: 1 1 260px; position: relative; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.toolbar .search input { padding-left: 38px; }
.toolbar select { width: auto; min-width: 190px; }
.filters-open { display: none; }
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; color: var(--ink-3); font-size: 14px; }
.result-line b { color: var(--ink); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.active-filters .chip { font-size: 12px; padding: 6px 9px; }
.active-filters .chip::after { content: " ✕"; opacity: .7; }

/* ---------- Bike cards ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease;
  text-align: left; color: inherit; font: inherit; padding: 0;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 2;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .7;
}
.card-media { position: relative; aspect-ratio: 16 / 10; background: radial-gradient(ellipse at 50% 85%, var(--panel-3), var(--bg-2) 70%); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--line-2); padding: 10%; }
.placeholder svg { width: 100%; height: auto; max-height: 100%; }
.placeholder .ph-word { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font: 500 11px/1 var(--font-head); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); opacity: .7; }
.stamp {
  position: absolute; top: 12px; right: 10px; z-index: 1;
  font: 700 12px/1 var(--font-head); letter-spacing: .16em; text-transform: uppercase;
  padding: 6px 9px 5px; border: 2px solid currentColor; border-radius: 4px; transform: rotate(4deg);
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(2px);
}
.stamp.stock { color: var(--green); }
.stamp.order { color: var(--amber); }
.stamp.out { color: var(--ink-3); }
.plate {
  position: absolute; left: 10px; bottom: 10px; z-index: 1;
  font: 600 12px/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase;
  background: #e9e2cf; color: #1d2a55; border: 2px solid #1d2a55; border-radius: 4px; padding: 5px 8px 4px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .4);
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.make { font: 500 12px/1 var(--font-head); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.card-body h3 { font-size: 23px; margin: 0; text-transform: uppercase; }
.specs { display: flex; gap: 14px; color: var(--ink-3); font-size: 13.5px; flex-wrap: wrap; }
.specs span { display: inline-flex; align-items: center; gap: 5px; }
.specs svg { width: 15px; height: 15px; }
.card-foot { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price { font: 600 24px/1 var(--font-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.price.ask { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); }
.cost { font-size: 12px; color: var(--ink-3); text-align: right; line-height: 1.3; }
.cost b { color: var(--ink-2); font-weight: 600; }

.card.flash { animation: cardflash 2.4s ease; }
@keyframes cardflash { 0%, 30% { border-color: var(--neon); box-shadow: 0 0 0 2px var(--neon), var(--glow-red); } }
.sold-burst {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none;
  font: 700 46px/1 var(--font-head); letter-spacing: .12em; color: var(--neon); text-shadow: var(--glow-red);
  background: color-mix(in srgb, var(--bg) 55%, transparent); animation: burst 2.6s ease forwards;
}
@keyframes burst { 0% { opacity: 0; transform: scale(1.6) rotate(-8deg); } 15% { opacity: 1; transform: scale(1) rotate(-8deg); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1) rotate(-8deg); } }

/* table view */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  text-align: left; white-space: nowrap; padding: 12px 14px; background: var(--panel-2);
  font: 500 12px/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--panel-3) 60%, transparent); }
table.data tr.clickable { cursor: pointer; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .muted { color: var(--ink-3); }
table.data tr.voided td { opacity: .5; text-decoration: line-through; }
table.data tr.voided td.keep { text-decoration: none; opacity: 1; }
.thumb { width: 64px; height: 40px; border-radius: 5px; overflow: hidden; background: var(--bg-2); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .placeholder { padding: 4px; }
.name-cell { display: flex; align-items: center; gap: 12px; }
.name-cell b { display: block; font-family: var(--font-head); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.name-cell small { color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.stock { color: var(--green); }
.pill.order { color: var(--amber); }
.pill.out, .pill.off { color: var(--ink-3); }
.pill.loss { color: var(--loss); }
.pill.accent { color: var(--accent-2); }
.pos { color: var(--green); }
.neg { color: var(--loss); }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty h3 { font-family: var(--font-display); font-weight: 400; color: var(--ink-2); font-size: 30px; }

/* ---------- Modal ---------- */
dialog {
  width: min(940px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(5, 3, 2, .72); backdrop-filter: blur(3px); }
dialog.narrow { width: min(520px, calc(100vw - 32px)); }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 5; }
.modal-pad { padding: 26px; }
.modal-head { padding: 22px 26px 0; }
.modal-head h2 { font-size: 26px; text-transform: uppercase; margin: 0; padding-right: 44px; }
.detail { display: grid; grid-template-columns: 1.15fr 1fr; }
.detail-media { position: relative; background: radial-gradient(ellipse at 50% 80%, var(--panel-3), var(--bg-2) 70%); min-height: 280px; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { padding: 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.detail-info h2 { font-size: 34px; text-transform: uppercase; margin: 0; }
.detail-info .desc { color: var(--ink-2); margin: 0; }
dl.spec-sheet { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
dl.spec-sheet dt, dl.spec-sheet dd { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); }
dl.spec-sheet dt { font: 500 12px/1.5 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); background: var(--panel-2); }
dl.spec-sheet dt:nth-last-of-type(1), dl.spec-sheet dd:last-of-type { border-bottom: 0; }
.visit-note { font-size: 14px; color: var(--ink-3); border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-left: 4px solid var(--accent);
  box-shadow: var(--shadow); animation: toastin .25s ease;
}
.toast.sold { border-left-color: var(--neon); }
.toast.error { border-left-color: var(--loss); }
.toast.ok { border-left-color: var(--green); }
.toast b { display: block; font: 600 14px/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 2px; }
.toast.sold b { color: var(--neon); text-shadow: var(--glow-red); }
.toast p { margin: 0; font-size: 14px; color: var(--ink-2); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Visit / footer ---------- */
.visit { padding-block: 10px 60px; }
.visit .board {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: var(--shadow);
}
.visit .board > div { padding: 24px; border-right: 1px solid var(--line); }
.visit .board > div:last-child { border-right: 0; }
.visit h3 { font-family: var(--font-display); font-weight: 400; font-size: 28px; color: var(--accent-2); margin-bottom: 6px; }
.visit p { margin: 0; color: var(--ink-2); }
.site-footer { border-top: 1px solid var(--line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); color: var(--ink-3); font-size: 14px; }
.site-footer .wrap { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.site-footer .motto { font-family: var(--font-display); font-size: 22px; color: var(--ink-2); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 30px 28px; box-shadow: var(--shadow); position: relative;
}
.login-logo { display: block; width: min(260px, 80%); margin: -6px auto 6px; filter: drop-shadow(0 0 18px rgba(255, 88, 60, .2)); }
.login-logo img { width: 100%; height: auto; }
.login-card h1 { text-align: center; font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); margin: 6px 0 24px; }
.login-card form { display: grid; gap: 16px; }
.login-back { display: block; text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-3); }

/* ---------- Staff app ---------- */
.staff { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 69px); }
.side {
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 70%, transparent);
  padding: 18px 12px; position: sticky; top: 69px; height: calc(100vh - 69px); overflow: auto;
}
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px;
  font: 500 14px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); text-decoration: none;
}
.side a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side a:hover { background: var(--panel-2); color: var(--ink); }
.side a.active { background: var(--panel-3); color: var(--accent-2); box-shadow: inset 3px 0 0 var(--accent); }
.side .who { padding: 14px 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.side .who b { display: block; font-family: var(--font-head); font-size: 17px; letter-spacing: .04em; }
.side .who span { font-size: 13px; color: var(--ink-3); }
.side .sep { height: 1px; background: var(--line); margin: 10px 4px; }
.main { padding: 28px clamp(16px, 3vw, 36px) 64px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(28px, 3vw, 38px); text-transform: uppercase; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel + .panel, .panel + .table-wrap, .table-wrap + .panel, .stack > * + * { margin-top: 20px; }
.panel h2 { font-size: 18px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: 16px; }
.cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.cols > .panel + .panel, .cols > * + * { margin-top: 0; }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 20px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.tile .label { margin-bottom: 10px; color: var(--ink-3); }
.tile b { display: block; font: 600 30px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.tile small { display: block; margin-top: 8px; color: var(--ink-3); font-size: 13px; }
.tile.hero-tile { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.tile.hero-tile b { color: var(--accent-2); }

.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filter-row > * { flex: 0 1 auto; }
.filter-row label.field { min-width: 170px; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: var(--panel-2); color: var(--ink); cursor: pointer; font-size: 16px; }
.qty button:hover:not(:disabled) { background: var(--panel-3); color: var(--accent-2); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 36px; text-align: center; font: 600 15px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }

.summary-box { background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 8px; padding: 14px 16px; display: grid; gap: 6px; font-size: 15px; }
.summary-box div { display: flex; justify-content: space-between; gap: 10px; }
.summary-box div span:first-child { color: var(--ink-3); }
.summary-box .total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font: 600 18px/1.2 var(--font-head); }

.perm-matrix th:not(:first-child), .perm-matrix td:not(:first-child) { text-align: center; }
.perm-matrix td:first-child small { display: block; color: var(--ink-3); font-size: 12.5px; }
.perm-matrix .group-row td { background: var(--panel-2); font: 500 11.5px/1 var(--font-head); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); padding-block: 8px; }
.perm-matrix .check { justify-content: center; padding: 0; }

.image-drop { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.image-drop .preview { width: 160px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.image-drop .preview img { width: 100%; height: 100%; object-fit: cover; }

/* chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .zero-line { stroke: var(--line-2); stroke-width: 1; }
.chart .axis-text { fill: var(--ink-3); font: 11px var(--font-body); font-variant-numeric: tabular-nums; }
.chart .bar-pos { fill: var(--chart-pos); }
.chart .bar-neg { fill: var(--chart-neg); }
.chart .hit { fill: transparent; cursor: default; }
.chart .bar-pos.hl, .chart .bar-neg.hl { opacity: .8; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px;
  background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px;
  font-size: 13px; box-shadow: var(--shadow); transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip b { display: block; font-family: var(--font-head); letter-spacing: .06em; margin-bottom: 4px; }
.chart-tip div { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); }
.chart-tip div span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }

.menu-btn { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .neon-board { width: min(100%, 320px); aspect-ratio: 4 / 3; justify-self: start; }
  .showroom .wrap { grid-template-columns: 1fr; }
  .filters {
    position: fixed; inset: 0 auto 0 0; top: 0; z-index: 60; width: min(320px, 88vw); max-height: none; border-radius: 0;
    padding-top: calc(18px + env(safe-area-inset-top, 0px)); transform: translateX(-105%); transition: transform .25s ease;
  }
  .filters.open { transform: none; }
  .filters-close { display: inline-grid; }
  .filters-open { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 55; }
  .detail { grid-template-columns: 1fr; }
  .detail-media { min-height: 0; aspect-ratio: 16 / 10; }
  .staff { grid-template-columns: 1fr; }
  .side {
    position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(280px, 85vw); height: auto;
    background: var(--panel); transform: translateX(-105%); transition: transform .25s ease;
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
  }
  .side.open { transform: none; }
  .menu-btn { display: inline-grid; }
}
@media (max-width: 640px) {
  .site-header .wrap { gap: 8px; }
  .brand-word small { display: none; }
  .brand-word b { font-size: 25px; }
  .brand-mark { height: 44px; }
  .nav a.hide-sm, .live span { display: none; }
  .live { padding: 9px; }
  .toolbar select { flex: 1 1 100%; }
  .tally div { padding-right: 16px; margin-right: 16px; }
  .tally b { font-size: 24px; }
  .modal-pad, .detail-info { padding: 20px 18px; }
  .panel { padding: 16px; }
}
button.pill { background: transparent; cursor: pointer; }
button.pill:hover { background: var(--panel-3); }
.btn, .brand-word b { white-space: nowrap; }
input[type="file"] { color: var(--ink-2); font: 14px var(--font-body); max-width: 100%; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--ink); cursor: pointer;
  font: 600 12.5px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent); }
@media (max-width: 480px) {
  .staff-header .brand-word { display: none; }
}
.price-block { display: flex; flex-direction: column; gap: 4px; }
.after-tax { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.detail-info .summary-box { max-width: 340px; }
.who-cell small { display: block; color: var(--ink-3); font-size: 12.5px; }
.edited-mark { font-size: 12px; color: var(--ink-3); font-style: italic; }
.dialog-extra { margin-right: auto; }
.paid-check { justify-content: flex-end; }
.rate-input { display: flex; align-items: center; gap: 8px; }
.rate-input input { width: 110px; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
