:root {
  --ink: #152235; --navy: #10243d; --navy-raised: #183653; --paper: #f4f7f9; --surface: #fff;
  --line: #dce4e9; --muted: #687789; --yellow: #ffe146; --blue: #3f79ff; --cyan: #38b7c9;
  --green: #1f9d74; --red: #d94c4c; --orange: #e88736; --radius-card: 16px; --radius-control: 10px;
  --shadow-layer: 0 24px 60px rgba(16, 36, 61, .22); --sidebar-width: 220px;
}
* { box-sizing: border-box; }
html { color-scheme: light; scrollbar-color: #9babb8 #eef2f5; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #eef2f5; }
*::-webkit-scrollbar-thumb { background: #9babb8; border: 2px solid #eef2f5; border-radius: 10px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; min-width: 320px; }
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid rgba(63, 121, 255, .42); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 14px; background: #fff; color: var(--navy); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff; padding: 24px 18px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 5px 28px; font-family: Bahnschrift, "Arial Narrow", sans-serif; }
.brand-logo { width: 52px; height: 52px; flex: 0 0 52px; object-fit: cover; border: 2px solid rgba(255,255,255,.92); border-radius: 50%; background: #fff; }
.brand > span { display: grid; gap: 2px; }
.brand small { color: #9fb0c1; font: 10px "Segoe UI", Arial, sans-serif; }
.nav-list { display: grid; gap: 6px; }
.nav-link { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #b9c7d6; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: var(--navy-raised); color: #fff; border-left-color: var(--yellow); }
.nav-link > span:first-child { color: var(--yellow); width: 20px; text-align: center; font-weight: 800; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #29445f; padding: 16px 10px 0; color: #9fb0c1; font-size: 12px; display: grid; gap: 3px; }
.sidebar-foot strong { color: #fff; }
.main-content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 28px 32px 56px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0; color: var(--blue); font: 700 11px "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 5px 0; font: 700 clamp(28px, 3vw, 34px)/1 Bahnschrift, "Arial Narrow", sans-serif; letter-spacing: -.03em; }
h2, h3 { font-family: Bahnschrift, "Arial Narrow", sans-serif; }
.page-subtitle, .section-heading p { color: var(--muted); }
.page-subtitle { margin: 0; font-size: 14px; }
.top-actions, .toolbar-actions { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.local-data-banner { margin: -8px 0 16px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid #b9ccef; border-radius: 10px; background: #edf3ff; color: #31527c; font-size: 12px; }
.local-data-banner strong { color: #203f67; white-space: nowrap; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: var(--radius-control); padding: 0 14px; border: 1px solid transparent; text-decoration: none; font-weight: 650; font-size: 13px; white-space: nowrap; }
.button-primary { background: var(--navy); color: #fff; }
.button-primary:hover { background: var(--navy-raised); }
.button-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button-secondary:hover, .button-ghost:hover { background: #edf2f6; }
.calculator-trigger { border-color: #9eb7df; color: #244f8d; }
.calculator-trigger > span { color: var(--blue); font: 800 15px "Cascadia Mono", Consolas, monospace; }
.button-ghost { background: transparent; color: var(--ink); border-color: transparent; }
.button-danger { background: var(--red); color: #fff; }
.danger-text { color: #b93e3e; }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-control); background: #fff; color: var(--ink); font-size: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.panel { padding: 20px; min-width: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0 0 3px; font-size: 18px; }
.section-heading p { margin: 0; font-size: 12px; }
.section-meta { color: var(--muted); font: 11px "Cascadia Mono", Consolas, monospace; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .search-wrap > label { color: #425368; font-size: 12px; font-weight: 650; }
.field input, .field select, .search-control input { min-height: 42px; width: 100%; border: 1px solid #cfd9e0; border-radius: var(--radius-control); background: #fff; color: var(--ink); padding: 0 12px; }
.field input[readonly] { background: #eef3f6; color: #46596d; border-style: dashed; cursor: default; }
.field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 2px rgba(217,76,76,.12); }
.compact-field { min-width: 185px; }
.compact-field span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kpi-grid { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-card { padding: 18px; min-height: 124px; position: relative; overflow: hidden; }
.kpi-card.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpi-card.primary::after { content: ""; position: absolute; width: 82px; height: 82px; right: -18px; bottom: -28px; border: 16px solid var(--yellow); border-radius: 50%; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.kpi-card.primary .kpi-label, .kpi-card.primary .kpi-note { color: #c5d2df; }
.kpi-value { margin-top: 11px; font: 700 25px/1 Bahnschrift, "Arial Narrow", sans-serif; letter-spacing: -.02em; }
.kpi-note { margin-top: 10px; color: var(--muted); font: 11px "Cascadia Mono", Consolas, monospace; }
.positive-dot::before { content: ""; width: 7px; height: 7px; display: inline-block; margin-right: 5px; border-radius: 50%; background: var(--green); }
.money-rail-card { margin-top: 14px; padding: 20px; }
.money-rail { min-height: 54px; display: flex; border-radius: 11px; overflow: hidden; color: #fff; }
.money-segment { min-width: 48px; padding: 9px 10px; display: flex; flex-direction: column; justify-content: center; font: 700 11px/1.05 "Cascadia Mono", Consolas, monospace; }

.login-page { min-height: 100vh; background: var(--navy); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr); }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 8vw, 112px); color: #fff; }
.login-brand::after { content: ""; position: absolute; width: 420px; height: 420px; right: -170px; bottom: -190px; border: 78px solid var(--yellow); border-radius: 50%; opacity: .95; }
.login-brand > img { width: 92px; height: 92px; margin-bottom: 30px; object-fit: cover; border: 3px solid #fff; border-radius: 50%; background: #fff; }
.login-brand .eyebrow { color: var(--yellow); }
.login-brand h1 { max-width: 650px; margin: 12px 0 18px; font-size: clamp(42px, 5.8vw, 76px); line-height: .96; letter-spacing: -.045em; }
.login-brand > p:not(.eyebrow) { max-width: 520px; margin: 0; color: #c5d2df; font-size: 17px; line-height: 1.6; }
.login-signal { display: flex; gap: 28px; margin-top: 44px; padding-top: 24px; border-top: 1px solid #38516a; color: #b8c8d6; font-size: 12px; }
.login-signal span { display: grid; gap: 4px; }
.login-signal strong { color: #fff; font: 700 22px Bahnschrift, "Arial Narrow", sans-serif; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 7vw, 104px); background: var(--paper); }
.login-card-heading { display: flex; align-items: center; gap: 15px; }
.login-seal { width: 62px; height: 62px; flex: 0 0 62px; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: #fff; }
.login-seal img { width: 100%; height: 100%; object-fit: cover; }
.login-card h2 { margin: 5px 0 0; font-size: 30px; }
.login-intro { max-width: 450px; margin: 28px 0 24px; color: var(--muted); line-height: 1.6; }
.login-form { width: min(100%, 450px); display: grid; gap: 18px; }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 84px; }
.password-control button { position: absolute; right: 6px; top: 6px; height: 30px; padding: 0 9px; border: 0; border-radius: 7px; background: #edf2f6; color: #30465e; font-size: 12px; font-weight: 700; }
.login-error { padding: 11px 12px; border: 1px solid #efb0b0; border-radius: var(--radius-control); background: #fff1f1; color: #9e2e2e; font-size: 13px; }
.login-submit { width: 100%; min-height: 48px; }
.login-help { max-width: 450px; margin: 20px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 40vh; padding: 40px 24px; }
  .login-brand > img { width: 70px; height: 70px; margin-bottom: 20px; }
  .login-brand h1 { font-size: clamp(34px, 10vw, 52px); }
  .login-brand::after { width: 220px; height: 220px; right: -115px; bottom: -120px; border-width: 42px; }
  .login-signal { gap: 18px; margin-top: 28px; }
  .login-card { padding: 38px 24px 56px; }
}
@media (max-width: 480px) { .login-signal { display: none; } }
.money-segment small { display: block; margin-top: 5px; font-size: 10px; font-weight: 400; opacity: .86; }
.split-grid { display: grid; grid-template-columns: 1.55fr .9fr; gap: 14px; margin-top: 14px; }
.equal-grid { grid-template-columns: 1fr 1fr; }
.rank-bars { display: grid; gap: 15px; }
.rank-row { display: grid; grid-template-columns: minmax(150px, 215px) 1fr 90px; gap: 12px; align-items: center; }
.rank-product { min-width: 0; }
.rank-product strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.rank-product small, .rank-amount small { color: var(--muted); font-size: 11px; }
.rank-track { height: 9px; border-radius: 10px; background: #e8eef2; overflow: hidden; }
.rank-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.rank-amount { text-align: right; font: 700 12px "Cascadia Mono", Consolas, monospace; }
.rank-amount small { display: block; margin-top: 3px; color: var(--green); }
.alert-stack { display: grid; gap: 10px; }
.alert-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 11px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.alert-symbol { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; font-weight: 800; }
.alert-symbol.danger { background: #fde8e8; color: var(--red); }
.alert-symbol.warning { background: #fff0df; color: #a85c1c; }
.alert-symbol.info { background: #e8efff; color: var(--blue); }
.alert-row strong { display: block; font-size: 12px; }
.alert-row small { display: block; margin-top: 2px; color: var(--muted); }
.alert-value { font: 700 18px Bahnschrift, sans-serif; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th, .mini-table td { padding: 10px 8px; border-bottom: 1px solid #edf1f3; text-align: left; }
.mini-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.mini-table th:not(:first-child), .mini-table td:not(:first-child) { text-align: right; }
.value-negative { color: var(--red); font-weight: 700; }
.value-positive { color: var(--green); font-weight: 700; }
.table-card { padding-bottom: 12px; }
.table-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.search-wrap { display: grid; gap: 6px; min-width: min(360px, 100%); }
.search-control { position: relative; }
.search-control input { padding-right: 44px; }
.clear-search { position: absolute; right: 2px; top: 2px; width: 38px; height: 38px; border: 0; background: transparent; }
.result-count { min-height: 17px; color: var(--muted); font-size: 11px; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.data-table { width: 100%; min-width: 920px; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.data-table th { position: sticky; top: 0; z-index: 2; background: #f1f5f7; color: #556578; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid #e7edf1; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fafb; }
.order-summary-row:has(+ .order-detail-row:not([hidden])) { background: #f8fbfd; }
.order-disclosure { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 3px 8px 3px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.order-disclosure:hover { background: #e8eef2; }
.order-disclosure:active { background: #dce6ec; }
.disclosure-icon { display: inline-grid; width: 24px; height: 24px; place-items: center; border-radius: 6px; background: var(--navy); color: #fff; font-family: var(--font-data); font-size: 15px; line-height: 1; }
.single-product { font-weight: 600; }
.order-detail-row td { padding: 0 12px 12px 12px; background: #f8fbfd; }
.order-detail { display: grid; gap: 0; margin-left: 12px; border: 1px solid #cfdae2; border-radius: 10px; background: #fff; overflow: hidden; }
.order-detail-heading { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid #e5ebef; background: #f1f5f7; color: #526377; }
.order-detail-heading strong { color: var(--ink); }
.order-detail-item { display: grid; grid-template-columns: minmax(220px, 1fr) 80px 100px 110px 80px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #edf1f4; }
.order-detail-item:last-child { border-bottom: 0; }
.order-detail-item > :not(:first-child) { text-align: right; }
.align-right { text-align: right !important; }
.sort-button { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.sort-button.align-right { display: flex; justify-content: flex-end; gap: 4px; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.row-button { min-width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #4d5e72; font-size: 12px; }
.row-button:hover { background: #e8eef2; }
.row-button.delete:hover { background: #fde8e8; color: var(--red); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-completed { color: #147859; background: #e3f5ef; }
.status-cancelled { color: #9a4040; background: #fbeaea; }
.status-returned { color: #9a5b1f; background: #fff0df; }
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state p { color: var(--muted); }
@media (max-width: 760px) {
  .order-detail { margin-left: 0; min-width: 650px; }
}
.compact-kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.cost-list { display: grid; gap: 14px; }
.cost-row { display: grid; grid-template-columns: 150px 1fr 100px; gap: 12px; align-items: center; }
.cost-row strong { font-size: 12px; }
.cost-bar { height: 10px; background: #e8eef2; border-radius: 8px; overflow: hidden; }
.cost-bar span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.cost-value { text-align: right; font: 700 12px "Cascadia Mono", Consolas, monospace; }
.detail-stack { display: grid; gap: 14px; }
.detail-alert { padding: 20px; }
.detail-alert h2 { margin: 0 0 4px; font-size: 18px; }
.detail-alert > p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(8, 22, 38, .48); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 21; right: 0; top: 0; width: min(620px, 100%); height: 100dvh; overflow-y: auto; padding: 24px; background: #fff; box-shadow: var(--shadow-layer); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.drawer-header h2 { margin: 5px 0 0; font-size: 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-wide { grid-column: span 2; }
.field-error { min-height: 16px; color: #b73535; font-size: 11px; }
.form-section-title { margin: 24px 0 12px; font-size: 15px; }
.items-heading { margin: 24px 0 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.items-heading .form-section-title { margin: 0 0 3px; }
.items-heading p { margin: 0; max-width: 390px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.order-items { display: grid; gap: 12px; }
.order-item { border: 1px solid var(--line); border-radius: 14px; background: #f8fafb; overflow: hidden; }
.order-item-header { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f1f5f7; }
.order-item-header strong { font: 700 13px Bahnschrift, sans-serif; }
.item-actions { display: flex; gap: 4px; }
.item-action { min-height: 34px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: #4d5e72; font-size: 11px; font-weight: 650; }
.item-action:hover { background: #e3eaef; }
.item-action.remove:hover { background: #fde8e8; color: var(--red); }
.order-item-fields { padding: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.order-item-fields .product-field { grid-column: span 3; }
.order-item-fields .field > span { font-size: 11px; }
.order-item-result { grid-column: span 4; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 18px; color: var(--muted); font: 11px "Cascadia Mono", Consolas, monospace; }
.order-item-result strong { color: var(--ink); }
.calculation-preview { margin: 22px 0; padding: 16px; border-radius: 12px; background: var(--navy); color: #fff; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; }
.calculation-preview span { color: #c5d2df; font-size: 12px; }
.calculation-preview strong { grid-row: span 2; align-self: center; font: 700 23px Bahnschrift, sans-serif; }
.calculation-preview small { color: #c5d2df; font: 11px "Cascadia Mono", Consolas, monospace; }
.order-preview { grid-template-columns: 1fr 1fr; gap: 20px; }
.order-summary { display: grid; gap: 5px; }
.order-summary:last-child { text-align: right; }
.order-summary span, .order-summary small { color: #c5d2df; font-size: 11px; }
.order-summary strong { grid-row: auto; font: 700 23px Bahnschrift, sans-serif; }
.drawer-actions { position: sticky; bottom: -24px; margin: 0 -24px -24px; padding: 16px 24px; display: flex; justify-content: flex-end; gap: 8px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
.error-summary { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid #f0bcbc; background: #fff0f0; color: #8d3030; font-size: 12px; }
.overlay-calculator { z-index: 30; }
.calculator-dialog { position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 24px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-layer); }
.calculator-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.calculator-header h2 { margin: 5px 0 4px; font-size: 27px; }
.calculator-header p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.calculator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.calculator-price { grid-column: span 2; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 36px; }
.input-suffix > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.calculator-rule { margin: 14px 0 18px; color: var(--muted); font-size: 12px; }
.calculator-results { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid #29445f; border-radius: 14px; background: var(--navy); color: #fff; }
.calculator-result-row { min-height: 68px; padding: 13px 15px; display: grid; gap: 6px; border-right: 1px solid #29445f; }
.calculator-result-row:nth-child(3) { border-right: 0; }
.calculator-result-row span, .calculator-main-result span, .calculator-main-result small, .recommended-price span, .recommended-price small { color: #b9c9d9; font-size: 11px; }
.calculator-result-row strong { font: 700 15px "Cascadia Mono", Consolas, monospace; }
.calculator-main-result, .recommended-price { min-height: 112px; padding: 18px; display: grid; align-content: center; gap: 5px; border-top: 1px solid #29445f; }
.calculator-main-result { grid-column: span 2; background: var(--navy-raised); }
.calculator-main-result strong, .recommended-price strong { font: 700 29px Bahnschrift, "Arial Narrow", sans-serif; }
.recommended-price { border-left: 1px solid #29445f; }
.recommended-price strong { color: var(--yellow); }
.calculator-status { min-height: 38px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #edf3ff; color: #31527c; font-size: 12px; font-weight: 650; }
.calculator-status.is-positive { background: #e3f5ef; color: #147859; }
.calculator-status.is-warning { background: #fff0df; color: #925016; }
.calculator-status.is-negative { background: #fde8e8; color: #a63535; }
.calculator-actions { margin-top: 18px; display: flex; justify-content: space-between; gap: 8px; }
.overlay-confirm { z-index: 30; }
.confirm-dialog { position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 28px)); background: #fff; border-radius: 18px; padding: 24px; box-shadow: var(--shadow-layer); text-align: center; }
.confirm-icon { width: 42px; height: 42px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 12px; background: #fde8e8; color: var(--red); font-weight: 800; }
.confirm-dialog h2 { margin: 0; }
.confirm-dialog p { color: var(--muted); line-height: 1.5; }
.confirm-actions { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.toast-region { position: fixed; z-index: 50; right: 20px; bottom: 20px; width: min(360px, calc(100% - 40px)); pointer-events: none; }
.toast { padding: 13px 15px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow-layer); font-size: 13px; }
.mobile-nav { display: none; }
@media (max-width: 1120px) {
  :root { --sidebar-width: 78px; }
  .brand > span, .nav-link span:last-child, .sidebar-foot { display: none; }
  .brand { padding-inline: 4px; justify-content: center; }
  .brand-logo { width: 46px; height: 46px; flex-basis: 46px; }
  .nav-link { justify-content: center; padding-inline: 8px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-card.primary { grid-column: span 2; }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 22px 16px 96px; }
  .topbar { display: block; }
  .local-data-banner { align-items: flex-start; flex-direction: column; gap: 3px; }
  .top-actions { margin-top: 16px; align-items: center; }
  .compact-field { flex: 1; }
  .kpi-grid, .compact-kpis { grid-template-columns: 1fr 1fr; }
  .kpi-card.primary { grid-column: span 2; }
  .split-grid, .equal-grid { grid-template-columns: 1fr; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-wrap { min-width: 100%; }
  .mobile-nav { position: fixed; z-index: 10; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px; border: 1px solid #2c4660; border-radius: 16px; background: rgba(16,36,61,.96); box-shadow: 0 14px 36px rgba(16,36,61,.26); }
  .mobile-nav .nav-link { min-height: 50px; display: grid; justify-items: center; gap: 1px; padding: 5px; border: 0; font-size: 10px; }
  .mobile-nav .nav-link > span:first-child { width: auto; }
  .mobile-nav .nav-link > span:last-child { display: inline; }
}
@media (max-width: 560px) {
  .top-actions { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; }
  .kpi-value { font-size: 22px; }
  .money-rail { display: grid; grid-template-columns: 1fr 1fr; }
  .money-segment { width: auto !important; min-height: 52px; }
  .rank-row { grid-template-columns: 1fr 78px; }
  .rank-track { grid-column: span 2; grid-row: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .items-heading { align-items: stretch; flex-direction: column; }
  .order-item-fields { grid-template-columns: 1fr 1fr; }
  .order-item-fields .product-field { grid-column: span 2; }
  .order-item-result { grid-column: span 2; flex-wrap: wrap; }
  .calculator-dialog { top: 0; left: 0; transform: none; width: 100%; max-height: 100dvh; min-height: 100dvh; border-radius: 0; padding: 18px; }
  .calculator-grid { grid-template-columns: 1fr 1fr; }
  .calculator-price { grid-column: span 2; }
  .calculator-results { grid-template-columns: 1fr; }
  .calculator-result-row { border-right: 0; border-bottom: 1px solid #29445f; }
  .calculator-main-result { grid-column: auto; }
  .recommended-price { border-left: 0; border-top: 1px solid #29445f; }
  .drawer { padding: 18px; }
  .drawer-actions { margin-inline: -18px; margin-bottom: -18px; padding-inline: 18px; }
  .cost-row { grid-template-columns: 1fr 84px; }
  .cost-bar { grid-column: span 2; }
}
@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: drawer-in .22s ease-out; }
  .calculator-dialog { animation: calculator-in .22s ease-out; }
  .toast { animation: toast-in .2s ease-out; }
  @keyframes drawer-in { from { transform: translateX(20px); opacity: .5; } }
  @keyframes calculator-in { from { transform: translate(-50%, -48%) scale(.98); opacity: 0; } }
  @keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
}
@media (max-width: 560px) and (prefers-reduced-motion: no-preference) {
  .calculator-dialog { animation: calculator-mobile-in .18s ease-out; }
  @keyframes calculator-mobile-in { from { transform: translateY(12px); opacity: 0; } }
}
@media (forced-colors: active) {
  * { forced-color-adjust: auto; }
  .money-segment, .status-badge, .alert-symbol { border: 1px solid CanvasText; }
}
