:root {
  --ink: #182c3a;
  --muted: #526678;
  --paper: #f3f6f8;
  --surface: #fff;
  --line: #dce4eb;
  --rail: #172731;
  --rail-text: #b8c8d5;
  --blue: #2254a8;
  --blue-dark: #163e82;
  --blue-pale: #e9f2ff;
  --green: #1d664e;
  --green-pale: #e7f4ee;
  --gold: #87591c;
  --gold-pale: #fcf0d9;
  --red: #9b3832;
  --red-pale: #faecea;
  --shadow: 0 1px 2px #1930450d;
  --radius: 12px;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font: 14px/1.58 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: 3px; }
button { cursor: pointer; }
button[disabled] { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #678ce6; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 2.3vw, 32px); font-weight: 700; letter-spacing: -.035em; line-height: 1.3; }
h2 { font-size: 18px; letter-spacing: -.02em; line-height: 1.4; }
h3 { font-size: 15px; font-weight: 700; }
strong { font-weight: 700; }
svg { flex: 0 0 auto; vertical-align: middle; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.boot { padding: 40px; color: var(--muted); }
.dim { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.tabular { font-variant-numeric: tabular-nums lining-nums; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; height: 100dvh; position: sticky; top: 0; background: var(--rail); color: var(--rail-text); padding: 28px 14px 16px; overflow: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: white; margin: 0 8px 28px; text-decoration: none; white-space: nowrap; }
.brand img { width: 40px; height: 40px; }
.brand strong { font-size: 17px; letter-spacing: .045em; display: block; }
.brand small { display: block; font-size: 11px; color: #b1c6d8; letter-spacing: .07em; }
.nav-group { margin: 0 0 18px; }
.nav-label { padding: 0 12px; font-size: 11px; color: #a1b4c6; margin: 0 0 7px; }
.nav-link { color: var(--rail-text); text-decoration: none; display: flex; gap: 11px; align-items: center; min-height: 40px; padding: 7px 12px; margin: 3px 0; border-radius: 7px; font-size: 13px; position: relative; }
.nav-link:hover { background: #243944; color: white; }
.nav-link[aria-current="page"] { background: #324c62; color: #f6fbff; font-weight: 700; }
.nav-link[aria-current="page"]::before { content: ""; height: 16px; width: 3px; border-radius: 5px; background: #a5ccfc; position: absolute; left: 0; }
.rail-footer { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #344955; }
.rail-user { display: flex; gap: 10px; align-items: center; min-width: 0; }
.rail-user strong { color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #3b5670; color: white; font-size: 13px; flex: 0 0 auto; }
.main { min-width: 0; }
.topbar { height: 59px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px, 3vw, 36px); gap: 16px; }
.topbar-title { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.topbar-title strong { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 9px; }
.top-date { white-space: nowrap; color: var(--muted); font-size: 12px; margin-right: 4px; }
.content { max-width: 1540px; margin: 0 auto; padding: 27px clamp(16px, 3vw, 36px) 56px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 23px; }
.page-head p { margin-top: 7px; color: var(--muted); max-width: 72ch; }
.actions, .inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions { gap: 9px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; min-height: 37px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f5f8fc; border-color: #b5c7d8; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.subtle { color: var(--blue); background: var(--blue-pale); border-color: transparent; }
.btn.subtle:hover { background: #dceaff; }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: inherit; }
.btn.ghost:hover { background: #a6b7c51c; }
.btn.icon-only { width: 36px; padding: 6px; min-height: 36px; }
.btn.compact { padding: 4px 9px; min-height: 31px; font-size: 12px; }
.btn.text { min-height: 30px; padding: 0; color: var(--blue); background: transparent; border-color: transparent; }
.btn.text:hover { text-decoration: underline; }
.hero { min-height: 188px; position: relative; overflow: hidden; isolation: isolate; border-radius: 14px; background: #193b53; color: #fff; padding: 22px 26px; margin-bottom: 18px; display: flex; align-items: center; }
.hero-content { max-width: 68%; z-index: 1; }
.hero-label { color: #cfdfed; display: flex; align-items: center; gap: 7px; font-size: 12px; margin-bottom: 8px; }
.hero-total { font-variant-numeric: tabular-nums lining-nums; font-size: clamp(33px, 4.6vw, 60px); line-height: 1; letter-spacing: -.06em; font-weight: 680; margin-bottom: 8px; }
.hero-total small { font-size: .41em; letter-spacing: 0; color: #c5dbed; }
.hero-sub { color: #d8e6f3; font-size: 13px; }
.hero-actions { margin-top: 14px; }
.hero .btn { color: #17374f; }
.hero .btn.subtle { color: #edf6ff; background: #ffffff20; }
.hero .btn.subtle:hover { background: #ffffff34; }
.hero-art { position: absolute; top: 0; right: 0; height: 100%; width: min(52%, 540px); opacity: .9; z-index: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: #fff; border-radius: 11px; box-shadow: var(--shadow); margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 6px; min-height: 108px; padding: 15px 18px; border-right: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.kpi:first-child { border-radius: 10px 0 0 10px; }
.kpi:last-child { border-right: 0; border-radius: 0 10px 10px 0; }
.kpi:hover { background: #f5f9ff; }
.kpi-name { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: var(--muted); font-size: 12px; }
.kpi-value { font-size: clamp(19px, 2vw, 28px); font-weight: 700; line-height: 1.15; letter-spacing: -.04em; overflow-wrap: anywhere; }
.kpi-value small { font-size: 12px; font-weight: 500; letter-spacing: 0; margin-left: 3px; }
.kpi-desc { color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, 1fr); gap: 16px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; box-shadow: var(--shadow); }
.card-head { min-height: 55px; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.card-head p { margin-top: 4px; }
.card-body { padding: 16px 17px; }
.stack { display: grid; gap: 14px; }
.stack.tight { gap: 8px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 14px; }
.zone { border-top: 3px solid var(--blue); }
.zone.gold { border-top-color: #d6a548; }
.zone.green { border-top-color: #4c9a7c; }
.zone h2 { display: flex; align-items: center; gap: 7px; }
.zone .card-head { min-height: 66px; }
.zone-list { display: grid; gap: 9px; }
.zone-row { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.zone-row:hover { background: #f6f9fd; }
.zone-row div { flex: 1; min-width: 0; }
.zone-row small { overflow-wrap: anywhere; display: block; }
.meter-rows { display: grid; gap: 15px; }
.meter-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.meter { height: 6px; background: #e8eff4; border-radius: 12px; overflow: hidden; margin-top: 6px; }
.meter > span { height: 100%; min-width: 0; display: block; background: #5688cf; border-radius: inherit; }
.meter.gold > span { background: #d3a252; }
.meter.green > span { background: #52a486; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; }
.filters input, .filters select { min-width: 132px; }
.filters .search-field { min-width: min(250px, 100%); }
.filters .search-field input { width: 100%; }
.searchbox { position: relative; }
.searchbox svg { position: absolute; top: 9px; left: 10px; color: var(--muted); pointer-events: none; }
.searchbox input { padding-left: 33px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-spacing: 0; text-align: left; font-size: 13px; }
th, td { padding: 12px 15px; border-bottom: 1px solid #e7edf2; white-space: nowrap; vertical-align: middle; }
th { color: #4e6576; background: #f6f8fb; font-weight: 650; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fbff; }
.cell-main { font-weight: 680; }
.cell-sub { display: block; color: var(--muted); font-size: 11px; padding-top: 1px; }
.table-foot { border-top: 1px solid var(--line); min-height: 42px; padding: 10px 16px; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; white-space: nowrap; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 650; color: #485f70; background: #eaf0f4; }
.badge.blue { background: var(--blue-pale); color: var(--blue-dark); }
.badge.green { background: var(--green-pale); color: var(--green); }
.badge.gold { background: var(--gold-pale); color: var(--gold); }
.badge.red { background: var(--red-pale); color: var(--red); }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.empty { min-height: 166px; display: grid; justify-items: center; align-content: center; gap: 5px; text-align: center; padding: 20px; color: var(--muted); }
.empty > svg { color: #617d96; margin-bottom: 3px; }
.empty h3 { color: var(--ink); }
.empty .btn { margin-top: 6px; }
.empty.slim { min-height: 96px; }
.tabs { display: flex; gap: 16px; overflow: auto; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); font-weight: 650; background: transparent; padding: 11px 2px 9px; border: 0; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tab:hover, .tab[aria-selected="true"] { color: var(--blue); }
.tab[aria-selected="true"] { border-bottom-color: var(--blue); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field > label { font-size: 12px; font-weight: 650; color: #355064; }
.field > small { font-size: 11px; color: var(--muted); }
.field > span b { color: var(--red); }
input, select, textarea { min-height: 38px; border-radius: 6px; border: 1px solid #c7d4df; background: white; padding: 7px 9px; color: var(--ink); min-width: 0; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--blue); width: 16px; height: 16px; vertical-align: middle; }
input[type="file"] { max-width: 100%; }
input::placeholder, textarea::placeholder { color: #667b8b; }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
.form-section { border: 1px solid var(--line); padding: 13px; border-radius: 8px; background: #f7f9fc; }
.form-section h3 { margin-bottom: 8px; }
.check-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.form-error { color: var(--red); background: var(--red-pale); padding: 9px 12px; border-radius: 6px; font-size: 13px; white-space: pre-wrap; }
.notice { background: #edf4fd; color: #294c6f; padding: 10px 12px; border: 1px solid #d9e8f9; border-radius: 7px; font-size: 12px; }
.notice.warn { background: #fff5e2; color: #795526; border-color: #f1dfb9; }
.modal { width: min(700px, calc(100% - 28px)); padding: 0; max-height: calc(100dvh - 30px); margin: auto; overflow: auto; border: 1px solid #bacbd9; border-radius: 14px; box-shadow: 0 18px 64px #132b4140; color: var(--ink); }
.modal.wide { width: min(1000px, calc(100% - 28px)); }
.modal::backdrop { background: #0d23316b; }
.dialog-head { position: sticky; top: 0; z-index: 2; padding: 15px 19px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-head p { color: var(--muted); margin-top: 3px; }
.dialog-body { padding: 16px 19px 20px; }
.dialog-foot { position: sticky; bottom: 0; padding: 12px 19px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; background: #fff; z-index: 1; }
.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; margin: 0; }
.details dt { color: var(--muted); font-size: 12px; }
.details dd { margin: 3px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.photo { border: 1px solid var(--line); display: block; border-radius: 8px; overflow: hidden; text-decoration: none; text-align: center; color: var(--ink); font-size: 12px; background: #f5f8fb; }
.photo img { display: block; width: 100%; height: 110px; object-fit: cover; }
.photo .photo-placeholder { height: 74px; display: grid; place-content: center; color: #7a91a6; }
.photo > span:last-child { display: block; padding: 7px; }
.photo-input { display: flex; flex-direction: column; gap: 6px; padding: 9px; border: 1px dashed #a8bccd; background: #f7faff; border-radius: 7px; }
.photo-input input { min-height: 0; border: 0; font-size: 11px; padding: 0; background: transparent; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline li time { color: var(--muted); font-size: 11px; }
.toast-stack { position: fixed; bottom: 16px; right: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(360px, calc(100% - 32px)); }
.toast { border-radius: 8px; box-shadow: 0 7px 27px #152b4440; color: white; background: #20394e; padding: 10px 13px; display: flex; align-items: flex-start; gap: 8px; }
.toast.error { background: #883832; }
.login-layout { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: #193b53; color: #fff; display: grid; align-content: center; position: relative; isolation: isolate; padding: clamp(25px, 7vw, 98px); overflow: hidden; }
.login-art .brand { margin: 0 0 34px; }
.login-art h1 { font-size: clamp(32px, 4vw, 54px); line-height: 1.22; }
.login-art p { margin-top: 13px; color: #d6e7f7; max-width: 30ch; }
.login-art .hero-art { bottom: 0; top: auto; height: auto; width: 85%; opacity: .28; }
.login-pane { display: grid; place-items: center; padding: 26px; }
.login-form { width: min(100%, 356px); }
.login-form h2 { font-size: 26px; }
.login-form p { color: var(--muted); margin: 6px 0 20px; }
.login-form .btn { width: 100%; min-height: 43px; }
.mobile-toggle, .mobile-bottom { display: none; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .rail { padding-inline: 10px; }
  .kpi { padding-inline: 12px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .content { padding-inline: 19px; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .rail { position: fixed; z-index: 5; left: 0; top: 0; width: min(265px, 85vw); padding: 18px 14px; box-shadow: 0 0 0 100vmax #12263862; display: none; }
  .rail.open { display: flex; }
  .rail .brand { margin-bottom: 16px; }
  .nav-group { margin-bottom: 11px; }
  .mobile-toggle { display: inline-flex; }
  .topbar { padding-inline: 12px; height: 54px; }
  .top-date { display: none; }
  .content { padding: 18px 13px 90px; }
  .mobile-bottom { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: #fff; border-top: 1px solid var(--line); padding: 5px 5px max(5px, env(safe-area-inset-bottom)); }
  .mobile-bottom a { color: var(--muted); display: grid; justify-items: center; gap: 2px; text-decoration: none; min-height: 42px; align-content: center; font-size: 11px; }
  .mobile-bottom a[aria-current="page"] { color: var(--blue); font-weight: 700; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { min-height: 92px; padding: 12px; }
  .kpi:nth-child(2) { border-right: 0; border-radius: 0 10px 0 0; }
  .kpi:nth-child(3) { border-radius: 0 0 0 10px; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .hero { padding: 17px; }
  .hero-content { max-width: 86%; }
  .hero-art { width: 66%; opacity: .65; }
  .page-head { gap: 11px; margin-bottom: 15px; }
  .page-head p { font-size: 13px; }
  .board { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-art { padding: 22px; align-content: start; }
  .login-art .brand { margin-bottom: 13px; }
  .login-art p { margin-top: 8px; }
  .login-pane { align-items: start; }
}
@media (max-width: 480px) {
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .dialog-head, .dialog-body, .dialog-foot { padding-inline: 12px; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo img { height: 76px; }
  .filters { padding-inline: 10px; }
  .filters .search-field { flex: 1 0 100%; }
  .gallery.photo-grid { grid-template-columns: 1fr; }
  th, td { padding: 9px 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav-link { transition: background-color .13s, border-color .13s; }
}
.queue-body { padding-block: 4px; }
.queue-row { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.queue-row:last-child { border-bottom: 0; }
.queue-row span { flex: 1; }
.queue-row svg { color: #537895; }
.queue-row:hover { color: var(--blue); }
.summary-strip { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 11px 15px; color: var(--muted); border-bottom: 1px solid var(--line); background: #f8fbfe; font-size: 12px; font-variant-numeric: tabular-nums; }
.summary-strip strong { color: var(--ink); }
.summary-strip strong.pos { color: var(--green); }
.summary-strip strong.neg { color: var(--red); }
.card-head.divider { border-top: 1px solid var(--line); }
.data-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:18px; }
.data-stack { display:grid; gap:15px; }
.data-line { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px 16px; padding-bottom:11px; border-bottom:1px solid var(--line); }
.data-feedback { padding:10px 12px; border-radius:6px; border:1px solid #b5d9cb; background:#eef9f4; color:#18513f; }
.data-feedback.failed { border-color:#e3b4b4; background:#fcf0f0; color:#952c32; }
.data-admin { margin-top:18px; }
.stock-mobile { display:none; }
@media (max-width: 640px) {
  .stock-desktop { display:none; }
  .stock-mobile { display:grid; padding-inline:11px; }
  .stock-mobile article { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 3px; border-bottom:1px solid var(--line); }
  .stock-mobile-actions { display:grid; justify-items:end; }
  .stock-mobile>p { padding-block:10px; }
}
.dashboard-period { margin:12px 0; }
.dashboard-period .tabs { padding-inline:0; border:0; }
.dashboard-period .filters { background:transparent; padding-inline:0; }
.cash-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:-3px 0 17px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.cash-strip a { display:flex; align-items:center; gap:7px; padding:9px 12px; color:var(--muted); text-decoration:none; border-right:1px solid var(--line); font-size:12px; min-width:0; }
.cash-strip a:last-child { border-right:0; }
.cash-strip strong { margin-left:auto; color:var(--ink); white-space:nowrap; }
.cash-strip a:hover { background:#f4f8fc; color:var(--blue); }
@media (max-width: 1000px) { .cash-strip { grid-template-columns:repeat(2,minmax(0,1fr)); } .cash-strip a:nth-child(2) { border-right:0; } .cash-strip a:nth-child(-n+2) { border-bottom:1px solid var(--line); } }
@media (max-width: 390px) { .cash-strip a { flex-wrap:wrap; } .cash-strip a strong { margin-left:0; } }
@media (max-width: 850px) { .data-grid { grid-template-columns:minmax(0,1fr); } }
.demo-ribbon { display: flex; align-items: center; gap: 8px; color: #365e88; font-size: 11px; font-weight: 700; letter-spacing: .04em; margin-bottom: 12px; }
.demo-ribbon::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #567ba2; }
.demo-ribbon span { color: var(--muted); font-weight: 500; letter-spacing: 0; }
.catalog-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.purchase-group { display: grid; gap: 9px; border-radius: 8px; border: 1px solid var(--line); background: #f6f9fc; padding: 10px 13px 13px; }
.group-heading { justify-content: space-between; min-height: 30px; }
.payment-details summary { cursor: pointer; color: var(--ink); font-weight: 650; }
.payment-details summary .small { margin-left: 5px; font-weight: 500; }
.payment-grid { margin-top: 12px; }
.photo-help { margin: -4px 0 8px; }
.photo-input img { display: block; max-height: 96px; width: 100%; object-fit: cover; border-radius: 5px; }
.selection, .allocation-grid { border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 290px; }
.selection-head { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 42px; padding: 6px 10px; background: #f0f5fa; border-bottom: 1px solid var(--line); }
.selection-items label, .allocation-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); min-height: 44px; }
.selection-items label:last-child, .allocation-row:last-child { border-bottom: 0; }
.selection-items label { cursor: pointer; }
.selection-items label:hover { background: #f6faff; }
.selection-items label > span:nth-child(2), .allocation-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.allocation-row .field { width: 132px; }
@media (max-width: 480px) {
  .catalog-fields { grid-template-columns: 1fr; }
  .modal .card-head { padding-inline: 11px; }
}
@media (max-width: 760px) {
  .hero > .hero-art { opacity: .32; -webkit-mask-image: linear-gradient(90deg, transparent, #000 43%); mask-image: linear-gradient(90deg, transparent, #000 43%); }
  input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]), select, textarea { font-size: 16px; min-height: 42px; }
  .dialog-head .icon-only { min-width: 44px; min-height: 44px; margin: -3px -5px 0 0; }
  .ops-table .table-wrap { overflow: visible; }
  .ops-table table, .ops-table tbody { display: block; }
  .ops-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .ops-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--line);
  }
  .ops-table tbody tr:last-child { border-bottom: 0; }
  .ops-table tbody td {
    padding: 0;
    border: 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .ops-table tbody tr:hover td { background: transparent; }
  .ops-table td[data-label]:not(:first-child, :last-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }
  .ops-table tbody td:first-child, .ops-table tbody td:last-child { grid-column: 1 / -1; }
  .ops-table tbody td:first-child { font-size: 15px; }
  .ops-table tbody td:first-child .cell-sub { font-size: 12px; }
  .ops-table tbody td:last-child { border-top: 1px solid #edf1f5; margin-top: 2px; }
  .ops-table tbody td:last-child .btn { min-height: 42px; }
  .ops-table tbody td:last-child .inline { gap: 16px; }
  .ops-table tbody td:last-child .btn:first-child { font-weight: 750; }
}
@media (max-width: 760px) {
  .ops-table .filters .field:not(.search-field) { flex: 1; min-width: 0; }
  .ops-table .filters select { width: 100%; min-width: 0; }
  .ops-table .filters .btn { padding-inline: 9px; }
  .ledger-table .tabs { flex-wrap: wrap; gap: 0 13px; overflow: visible; }
  .ledger-table td:last-child[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 11px;
  }
  .intake-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intake-table tbody td:first-child { grid-column: 1; grid-row: 1; }
  .intake-table tbody td:last-child { grid-column: 2; grid-row: 1; border-top: 0; margin: 0; }
  .intake-table tbody td:last-child .inline { justify-content: flex-end; gap: 4px 7px; }
  .intake-table tbody td:last-child .btn:first-child { background: var(--blue-pale); padding-inline: 7px; }
}
.top-crumb { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.mobile-role { display: none; }
.demo-login-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.more-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.more-link:hover { border-color: #9eb7d3; background: #f9fbff; }
.more-link strong, .more-link small { display: block; }
.more-link strong { font-size: 15px; }
.more-link small { color: var(--muted); margin-top: 2px; }
.more-glyph { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; color: var(--blue); background: var(--blue-pale); }
@media (max-width: 760px) {
  .top-crumb { display: none; }
  .topbar-title { min-width: 0; }
  .topbar-title > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-role { display: inline-flex; white-space: nowrap; color: var(--blue-dark); background: var(--blue-pale); border-radius: 5px; padding: 3px 6px; font-size: 11px; font-weight: 650; }
  .mobile-bottom.mobile-business { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .mobile-bottom.mobile-sales { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mobile-bottom a { min-height: 48px; text-align: center; line-height: 1.2; }
  .mobile-bottom a[aria-current="true"] { color: var(--blue); font-weight: 700; }
  .more-grid { grid-template-columns: 1fr; }
  .sales-stock tbody td:first-child { grid-column: 1; grid-row: 1; }
  .sales-stock tbody td:last-child { grid-column: 2; grid-row: 1; border-top: 0; margin: 0; justify-self: end; }
}

/* Record forms and inventory summary */
.entry-section { min-width: 0; margin: 0; padding: 10px 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #f7fafc; }
.entry-section legend { padding: 0 5px; font-size: 13px; font-weight: 720; color: #294962; }
.entry-section input:not([type="file"]), .entry-section select, .entry-section textarea { border-color: #8296a9; }
.entry-hint { margin-top: 7px; color: var(--muted); font-size: 12px; }
.entry-section .form-grid > .entry-hint { margin: 0; }
.entry-section .photo-input img, .photo img { outline: 1px solid oklch(0 0 0 / 0.1); outline-offset: -1px; }
.modal { overscroll-behavior: contain; }
.inventory-overview { margin-bottom: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.inventory-totals { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.inventory-totals p { margin-top: 3px; }
.inventory-totals dl { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 0; }
.inventory-totals dt { color: var(--muted); font-size: 12px; }
.inventory-totals dd { margin: 2px 0 0; color: var(--ink); font-size: clamp(24px, 2.5vw, 34px); line-height: 1.13; font-weight: 730; letter-spacing: -.035em; overflow-wrap: anywhere; }
.inventory-totals dd small { font-size: .53em; font-weight: 650; }
.inventory-totals .inventory-scope-counts { flex-basis: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 420px; padding-block-start: 10px; border-block-start: 1px solid var(--line); }
.inventory-scope-counts dd { font-size: clamp(19px,2.4vw,26px); }
.inventory-scope-counts .inventory-scope-cost { display: block; margin-block-end: 4px; color: var(--ink); font-size: clamp(13px,2vw,16px); font-weight: 650; }
.rental-asset-name { justify-content: flex-start; padding-inline: 0; text-align: start; }
#dashboard-detail { scroll-margin-block-start: 65px; }
.dashboard-stock-kpi { display: grid; gap: 4px; color: inherit; text-decoration: none; }
.dashboard-stock-kpi:hover > span { text-decoration: underline; }
.purchase-group textarea[name="vins"] { min-height: 60px; }
.vehicle-options-label { margin-bottom: 5px; overflow-wrap: anywhere; }
.purchase-vehicle-options > summary { margin-bottom: 6px; }
.site-totals .inventory-totals { border-bottom: 0; }
.site-total-count, .inventory-total-count { display: inline-block; padding: 2px 8px; margin-inline-start: -8px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--blue-dark); font: inherit; }
.site-area { cursor: pointer; }
.site-area-count { border: 1px solid var(--line); }
.site-area-selected { outline: 2px solid var(--blue); outline-offset: -2px; }
.site-area-count[aria-pressed="true"], .site-total-count[aria-pressed="true"], .inventory-total-count[aria-pressed="true"] { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-pale); }
.site-vehicles { margin-block-start: 16px; scroll-margin-block-start: 66px; }
.inventory-vehicles { scroll-margin-block-start: 66px; }
.site-vehicles:focus, .inventory-vehicles:focus { outline: none; }
.external-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(144px, 100%), 1fr)); gap: 12px; margin-block-end: 14px; }
.external-metric { display: grid; align-content: start; gap: 5px; padding: 12px 14px; }
.external-metric strong { font-size: clamp(20px, 2.5vw, 28px); line-height: 1.2; overflow-wrap: anywhere; }
.external-metric small { font-size: 12px; }
.rental-tabs { margin-block-end: 14px; }
.rental-tabs .tab[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }
.rental-metric { color: inherit; text-decoration: none; }
.rental-metric:hover, .rental-metric[aria-current="true"] { border-color: var(--blue); }
.rental-metric:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.external-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-block-end: 16px; }
.handoff-vin-action { min-height: 32px; border: 1px solid var(--line); cursor: pointer; }
.handoff-vin-action:hover { text-decoration: underline; }
@media (max-width: 760px) { .handoff-vin-action { min-height: 44px; } }
.external-return-checks { gap: 10px; }
.inventory-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr)); gap: 8px; padding: 11px; }
.inventory-area { display: grid; justify-items: start; align-content: center; gap: 1px; min-width: 0; padding: 8px 10px; border: 1px solid #dce7ef; border-radius: 7px; background: #f8fafc; color: var(--ink); text-align: left; }
.inventory-area[aria-pressed="true"] { border-color: #8faed5; background: var(--blue-pale); color: var(--blue-dark); }
.inventory-area-title { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 670; }
.inventory-area-title svg { color: #496c8b; }
.inventory-area > strong { font-size: 18px; line-height: 1.2; margin-top: 3px; }
.inventory-area > strong small { font-size: 11px; }
.inventory-area-cost { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.inventory-area-link { display: inline-flex; align-items: center; gap: 4px; color: var(--blue-dark); font-size: 12px; font-weight: 650; }
.inventory-filter-summary > strong { color: var(--blue-dark); }
@media (hover: hover) { button.inventory-area:hover { border-color: #91aed0; background: #eff5fd; } }
@media (prefers-reduced-motion: no-preference) {
  .dialog-foot .btn { transition: background-color .13s, border-color .13s, scale 150ms ease-out; }
  .dialog-foot .btn:enabled:active { scale: .96; }
}
@media (max-width: 760px) {
  .entry-section { padding-inline: 9px; }
  .inventory-totals { padding: 12px; }
  .inventory-totals dl { width: 100%; gap: 8px 18px; }
  .desktop-purchase-import { display: none; }
  .inventory-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; }
  .inventory-filter-summary { gap: 6px 13px; }
  .inventory-filter-summary > strong { width: 100%; }
}

/* Photo-assisted VIN review */
.vin-capture { display: grid; gap: 8px; min-width: 0; }
.purchase-vin-check { margin-block: 6px; }
.purchase-vin-check summary { cursor: pointer; font-size: 13px; }
.purchase-vin-check[open] summary { margin-bottom: 8px; }
.vin-capture-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.vin-capture-review {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--recess, var(--surface));
}
.vin-capture-photo { display: grid; gap: 5px; margin: 0; min-width: 0; }
.vin-capture-photo img { display: block; width: min(100%, 460px); max-height: 178px; object-fit: contain; object-position: left center; border-radius: 4px; }
.vin-capture-hint, .vin-capture-photo figcaption, .vin-capture-warnings { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.vin-capture-warnings { margin: 0; padding-inline-start: 20px; }
.vin-capture-status, .vin-capture-match { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.vin-capture-status[data-tone="error"], .vin-capture-match[data-tone="error"] { color: var(--red); }
.vin-capture-status[data-tone="success"], .vin-capture-match[data-tone="success"] { color: var(--green); }
.vin-capture-field { display: grid; gap: 5px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 650; }
.vin-capture-field input { width: 100%; font-variant-numeric: tabular-nums; }
.vin-capture-manual { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; color: var(--gold); }
.vin-capture-actions [data-vin-option] { max-width: 100%; overflow-wrap: anywhere; white-space: normal; text-align: start; }
@media (max-width: 760px) {
  .vin-capture-actions .btn { min-height: 42px; }
}
