:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-muted: #f7f8fa;
  --ink: #1c1e24;
  --muted: #747982;
  --line: #e6e8ec;
  --accent: #6c4ff8;
  --accent-soft: #eeeaff;
  --good: #15966f;
  --good-soft: #e8f7f1;
  --bad: #d45858;
  --bad-soft: #fff0ef;
  --warn: #b67a16;
  --sidebar: #17191e;
  --shadow: 0 1px 2px rgb(17 24 39 / 4%), 0 8px 28px rgb(17 24 39 / 4%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 22px 14px; color: #e9eaf0; background: var(--sidebar); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 9px 26px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: linear-gradient(145deg, #8a73ff, #5e42e6); border-radius: 10px; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand span, .sidebar-footer strong, .sidebar-footer span { display: block; }
.brand strong { font-size: 14px; }
.brand span { color: #8f949f; font-size: 12px; margin-top: 1px; }
.nav { display: grid; gap: 4px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #aeb2bc; text-decoration: none; border-radius: 9px; position: relative; }
.nav-item:hover { color: #fff; background: #21242b; }
.nav-item.active { color: #fff; background: #292c34; }
.nav-item.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 20px; border-radius: 3px; background: #8f7bff; }
.nav-icon { width: 19px; text-align: center; color: #9297a2; font-size: 16px; }
.nav-divider { height: 1px; margin: 16px 12px; background: #2b2e35; }
.nav-item.disabled { color: #656a75; cursor: default; }
.nav-item.disabled em { margin-left: auto; font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .06em; color: #8173d1; }
.sidebar-footer { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 14px 10px 0; border-top: 1px solid #2b2e35; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer span { color: #7f8490; font-size: 11px; }
.status-dot { width: 9px; height: 9px; background: #24bd8b; border-radius: 50%; box-shadow: 0 0 0 4px rgb(36 189 139 / 10%); }

.main { margin-left: 232px; width: calc(100% - 232px); padding: 26px 30px 48px; max-width: 1700px; }
.topbar { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 2px 0 0; font-size: 27px; line-height: 1.2; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; padding-top: 8px; }
.topbar-meta strong { color: var(--ink); font-weight: 600; }
.data-badge { background: #fff4db; color: #936319; padding: 5px 8px; border-radius: 6px; font-weight: 650; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.filters { display: grid; grid-template-columns: 1fr 1.35fr .85fr auto auto 1.15fr auto; gap: 10px; align-items: end; padding: 13px 14px; margin: 18px 0; position: sticky; top: 0; z-index: 15; }
.filter-field { display: grid; gap: 5px; min-width: 0; }
.filter-field > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; }
select, input[type="date"], input[type="search"], .select-button { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 0 10px; outline: none; }
select:focus, input:focus, .select-button:focus { border-color: #a397f2; box-shadow: 0 0 0 3px rgb(108 79 248 / 9%); }
.date-field input { width: 126px; }
.select-button { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.product-filter-wrap { position: relative; }
.product-popover { position: absolute; left: 0; top: 62px; width: 360px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 18px 45px rgb(17 24 39 / 14%); z-index: 40; }
.product-options { max-height: 260px; overflow: auto; margin: 8px -4px; padding: 0 4px; }
.product-option { display: grid; grid-template-columns: auto 30px 1fr; align-items: center; gap: 9px; padding: 8px 6px; border-radius: 7px; cursor: pointer; }
.product-option:hover { background: var(--panel-muted); }
.product-option input { accent-color: var(--accent); }
.product-option strong, .product-option span { display: block; }
.product-option strong { font-size: 12px; }
.product-option span { color: var(--muted); font-size: 10px; }
.popover-actions { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.text-button, .primary-button { border: 0; border-radius: 7px; padding: 8px 12px; }
.text-button { background: transparent; color: var(--muted); }
.primary-button { color: #fff; background: var(--accent); font-weight: 650; }
.refresh-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 19px; }
.refresh-button.loading { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { padding: 11px 14px; margin-bottom: 14px; border: 1px solid #f0d291; border-radius: 9px; background: #fff8e8; color: #835d12; font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { min-width: 0; padding: 15px 15px 12px; }
.kpi-label { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .065em; }
.kpi-value { margin-top: 9px; font-size: clamp(19px, 1.8vw, 28px); font-weight: 750; letter-spacing: -.045em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { height: 18px; color: var(--muted); font-size: 11px; }
.kpi-bottom { display: flex; justify-content: space-between; align-items: end; gap: 7px; margin-top: 8px; }
.delta { display: inline-flex; padding: 4px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.delta.good { color: var(--good); background: var(--good-soft); }
.delta.bad { color: var(--bad); background: var(--bad-soft); }
.delta.neutral { color: #666d78; background: #f0f1f3; }
.sparkline { width: 62px; height: 26px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.dashboard-grid > .card, .economics-card, .table-card { padding: 17px; }
.card-header { min-height: 42px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.chart-header { align-items: center; }
.segmented { display: flex; padding: 3px; background: var(--panel-muted); border: 1px solid var(--line); border-radius: 8px; }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 6px 9px; border-radius: 6px; font-size: 11px; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 8%); }
.metric-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 3px; }
.metric-tabs button { border: 1px solid transparent; background: transparent; color: var(--muted); padding: 6px 8px; border-radius: 7px; font-size: 11px; }
.metric-tabs button.active { border-color: #d9d3ff; background: var(--accent-soft); color: #5539dd; font-weight: 650; }
.chart-legend { display: flex; justify-content: flex-end; gap: 15px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 17px; height: 2px; background: var(--accent); }
.chart-legend .legend-previous { background: repeating-linear-gradient(90deg, #a9adb5 0 4px, transparent 4px 7px); }
.line-chart { min-height: 260px; margin-top: 6px; }
.chart-svg { width: 100%; height: 270px; overflow: visible; }
.grid-line { stroke: #eceef1; stroke-width: 1; }
.axis-label { fill: #8b9098; font-size: 10px; }
.chart-current { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#area-gradient); opacity: .8; }
.chart-previous { fill: none; stroke: #a8adb7; stroke-width: 1.7; stroke-dasharray: 5 5; }
.chart-dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.empty-state { min-height: 180px; display: grid; place-items: center; color: var(--muted); text-align: center; }

.funnel { display: grid; gap: 9px; padding-top: 10px; }
.funnel-row { position: relative; min-height: 46px; padding: 7px 10px; background: var(--panel-muted); border-radius: 8px; overflow: hidden; }
.funnel-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #f0edff, #faf9ff); }
.funnel-content { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.funnel-label { color: var(--muted); font-size: 11px; }
.funnel-value { display: block; font-size: 17px; font-weight: 720; }
.funnel-conversion { color: var(--muted); font-size: 10px; }

.status-layout { display: grid; grid-template-columns: 145px 1fr; gap: 18px; align-items: center; min-height: 230px; }
.donut { width: 138px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; width: 82px; aspect-ratio: 1; border-radius: 50%; background: #fff; position: absolute; }
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center strong, .donut-center span { display: block; }
.donut-center strong { font-size: 21px; }
.donut-center span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.status-list { display: grid; gap: 10px; }
.status-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.status-row i { width: 8px; height: 8px; border-radius: 50%; }
.status-row span { color: var(--muted); }

.neutral-chip, .tooltip-chip { color: var(--muted); background: var(--panel-muted); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 10px; }
.inventory-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding-top: 13px; }
.inventory-item { padding: 13px; background: var(--panel-muted); border-radius: 9px; }
.inventory-item span, .inventory-item strong { display: block; }
.inventory-item span { color: var(--muted); font-size: 10px; }
.inventory-item strong { margin-top: 5px; font-size: 20px; letter-spacing: -.035em; }

.economics-card, .table-card { margin-top: 14px; }
.settings-card { margin-top: 14px; padding: 17px; scroll-margin-top: 16px; }
.settings-header { align-items: center; }
.settings-auth { max-width: 720px; margin-top: 14px; padding: 18px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(280px, 1fr); gap: 18px; align-items: end; background: var(--panel-muted); border: 1px solid var(--line); border-radius: 11px; }
.settings-auth-copy strong { display: block; font-size: 14px; }
.settings-auth-form { display: flex; gap: 8px; align-items: end; }
.settings-auth-form label { flex: 1; display: grid; gap: 5px; }
.settings-auth-form label span, .token-field span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; }
.settings-auth-form input, .token-field input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 10px; outline: none; }
.settings-auth-form input:focus, .token-field input:focus { border-color: #a397f2; box-shadow: 0 0 0 3px rgb(108 79 248 / 9%); }
.settings-auth-form .primary-button { height: 38px; white-space: nowrap; }
.form-message, .settings-message { grid-column: 1 / -1; padding: 9px 11px; border-radius: 8px; color: var(--bad); background: var(--bad-soft); font-size: 11px; }
.settings-message.success { color: var(--good); background: var(--good-soft); }
.token-guide { margin-top: 14px; padding: 14px 16px; border: 1px solid #ddd8ff; border-radius: 10px; background: #faf9ff; }
.token-guide summary { cursor: pointer; color: #5037d2; font-weight: 700; }
.token-guide ol { margin: 12px 0; padding-left: 20px; color: #565b66; font-size: 12px; }
.token-guide li + li { margin-top: 6px; }
.permission-list { display: flex; flex-wrap: wrap; gap: 7px; }
.permission-list span, .service-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; color: #4f3bc5; background: #eeeaff; border: 1px solid #ddd6ff; font-size: 10px; font-weight: 650; }
.permission-list .read-only { color: var(--good); background: var(--good-soft); border-color: #ccecdf; }
.account-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.account-setting { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.account-setting-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.account-setting-head h3 { margin: 0; font-size: 15px; }
.account-setting-head p { margin-top: 2px; }
.connection-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.connection-status.connected { color: var(--good); background: var(--good-soft); }
.connection-status.missing { color: var(--warn); background: #fff6e5; }
.connection-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.token-field { display: grid; gap: 5px; margin-top: 16px; }
.token-actions { display: flex; gap: 8px; margin-top: 10px; }
.token-actions button { min-height: 36px; }
.secondary-button { border: 1px solid var(--line); border-radius: 7px; padding: 8px 12px; background: #fff; color: var(--ink); }
.secondary-button:disabled, .primary-button:disabled { opacity: .55; cursor: wait; }
.service-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.service-badge.ok { color: var(--good); background: var(--good-soft); border-color: #ccecdf; }
.service-badge.fail { color: var(--bad); background: var(--bad-soft); border-color: #f5d2cf; }
.sync-meta { margin-top: 12px; color: var(--muted); font-size: 10px; }
.economics-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, .7fr); gap: 24px; padding-top: 12px; }
.waterfall { display: grid; gap: 7px; }
.waterfall-row { display: grid; grid-template-columns: 145px 1fr 105px; gap: 12px; align-items: center; }
.waterfall-label { color: var(--muted); font-size: 11px; }
.waterfall-track { height: 12px; background: var(--panel-muted); border-radius: 5px; overflow: hidden; }
.waterfall-bar { height: 100%; border-radius: 5px; background: #c8cbd2; }
.waterfall-bar.revenue { background: var(--accent); }
.waterfall-bar.addition { background: #57b995; }
.waterfall-value { text-align: right; font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 650; }
.profit-summary { display: grid; align-content: start; gap: 10px; padding-left: 20px; border-left: 1px solid var(--line); }
.profit-main { padding: 16px; color: #fff; background: linear-gradient(140deg, #5e43df, #765dfa); border-radius: 11px; }
.profit-main span, .profit-main strong { display: block; }
.profit-main span { opacity: .78; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.profit-main strong { margin-top: 5px; font-size: 25px; }
.profit-detail { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.profit-detail span { color: var(--muted); font-size: 11px; }
.profit-detail strong { font-size: 12px; }

.table-header { align-items: center; }
.table-tools { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.table-tools input { width: 230px; }
.table-scroll { overflow-x: auto; margin: 10px -17px -17px; }
table { width: 100%; border-collapse: collapse; min-width: 1080px; }
th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; color: #737881; background: #fafbfc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .045em; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid #eff0f2; font-size: 11px; white-space: nowrap; }
tbody tr:hover { background: #fafaff; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.sort-active { color: var(--accent); }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 245px; white-space: normal; }
.product-thumb { position: relative; width: 44px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; color: #5c45cf; background: linear-gradient(145deg, #f0ecff, #e5e0ff); border: 1px solid #e7e4f7; border-radius: 8px; font-size: 9px; font-weight: 800; }
.product-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.product-thumb-small { width: 30px; height: 40px; border-radius: 6px; font-size: 7px; }
.product-cell strong, .product-cell span { display: block; }
.product-cell strong { font-size: 11px; }
.product-cell span { color: var(--muted); font-size: 9px; margin-top: 2px; }
.account-pill { padding: 4px 6px; border-radius: 5px; color: #555b66; background: #f0f1f3; font-size: 9px; }
.positive { color: var(--good); }
.negative { color: var(--bad); }
.skeleton { min-height: 95px; background: linear-gradient(100deg, #fff 20%, #f6f7f8 40%, #fff 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(4, 1fr); }
  .date-field input { width: 100%; }
  .inventory-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .sidebar { width: 78px; }
  .brand > div:last-child, .nav-item:not(.active) > :not(.nav-icon), .nav-item.active > :not(.nav-icon), .sidebar-footer > div:last-child, .nav-item em { display: none; }
  .brand { padding-inline: 6px; }
  .nav-item { justify-content: center; padding: 0; }
  .main { margin-left: 78px; width: calc(100% - 78px); padding: 22px 18px 40px; }
  .span-8, .span-4 { grid-column: span 12; }
  .filters { position: static; grid-template-columns: repeat(2, 1fr); }
  .economics-layout { grid-template-columns: 1fr; }
  .profit-summary { padding-left: 0; border-left: 0; }
  .account-settings-grid { grid-template-columns: 1fr; }
  .settings-auth { grid-template-columns: 1fr; }
}

/* Cost calendar is a separate route with the same global filters. */
[hidden] { display: none !important; }
.costs-filters { grid-template-columns: 1fr 1.35fr .85fr auto auto auto; }
.costs-intro { padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; }
.costs-legend { display: flex; gap: 15px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.costs-copy-toast { position: fixed; top: 18px; left: 50%; z-index: 30; display: flex; align-items: center; gap: 8px; max-width: min(420px, calc(100vw - 32px)); padding: 9px 12px; border: 1px solid #d9f1df; border-radius: 8px; background: #fff; color: #1f6b38; box-shadow: 0 8px 24px rgb(17 24 39 / 14%); font-size: 12px; font-weight: 500; opacity: 0; pointer-events: none; transform: translate(-50%, -14px); transition: opacity .18s ease, transform .18s ease; }
.costs-copy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.costs-copy-toast.is-leaving { opacity: 0; transform: translate(-50%, -18px); }
.costs-copy-toast-check { display: grid; place-items: center; width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%; background: #2f9e5b; color: #fff; font-size: 11px; line-height: 1; }
.costs-card { padding-bottom: 0; }
.costs-card .table-header { padding-bottom: 14px; }
#costs-search { max-width: 260px; }
.costs-table-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.costs-page-size { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.costs-page-size select { width: 72px; min-width: 72px; padding: 7px 24px 7px 9px; font-size: 11px; }
.costs-scroll { max-height: 65vh; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.costs-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 0; font-variant-numeric: tabular-nums; }
.costs-table td, .costs-table th { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; background: #fff; }
.costs-table thead { position: sticky; top: 0; z-index: 10; isolation: isolate; }
.costs-table thead th { position: sticky; top: 0; z-index: 11; width: 44px; min-width: 44px; max-width: 44px; padding: 3px 0; text-align: center; background: #f7f8fa; background-clip: padding-box; }
.costs-table thead th strong { display: block; font-size: 10px; color: var(--ink); }
.costs-table thead th > span { display: block; font-size: 9px; color: var(--muted); font-weight: 400; margin-top: 0; }
.costs-table .costs-product { position: sticky; left: 0; width: 230px; min-width: 230px; max-width: 230px; z-index: 1; text-align: left; padding: 3px 6px; box-shadow: none; }
.costs-product .product-cell { min-width: 0; gap: 6px; }
.costs-product .product-thumb { width: 24px; height: 30px; border-radius: 3px; font-size: 7px; }
.costs-product .product-details { min-width: 0; display: grid; gap: 1px; }
.costs-product .costs-product-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 500; font-size: 10px; line-height: 1.3; text-decoration: none; text-transform: none; letter-spacing: normal; }
.costs-product .costs-product-title:hover { color: var(--accent); text-decoration: underline; }
.costs-product .costs-code { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 3px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 9px; line-height: 1.2; cursor: pointer; text-transform: none; letter-spacing: normal; }
.costs-product .costs-code-prefix { flex: 0 0 auto; color: var(--muted); margin-top: 0; }
.costs-product .costs-code-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); margin-top: 0; padding: 1px 2px; border-radius: 3px; transition: color .12s ease, background-color .12s ease; }
.costs-product .costs-code svg { width: 11px; height: 11px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.35; }
.costs-product .costs-code:hover, .costs-product .costs-code:focus-visible { outline: 0; }
.costs-product .costs-code:hover .costs-code-value, .costs-product .costs-code:focus-visible .costs-code-value, .costs-product .costs-code.copied .costs-code-value { color: var(--accent); background: #f1eeff; font-weight: 600; }
.costs-product .costs-code-empty { color: var(--muted); font-size: 9px; line-height: 1.2; }
.costs-cell { position: relative; z-index: 0; width: 44px; min-width: 44px; max-width: 44px; height: 36px; }
.costs-cell input { display: block; width: 43px; min-width: 0; height: 35px; border: 0; border-radius: 0; color: var(--ink); font-size: 11px; text-align: right; background: transparent; padding: 0 3px; }
.costs-cell input:hover:not(:disabled) { border-color: var(--line); background: #fff; }
.costs-cell input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: #fff; box-shadow: none; }
.costs-cell input:disabled { cursor: default; opacity: 1; -webkit-text-fill-color: var(--ink); }
.costs-cell input[aria-invalid="true"] { outline: 2px solid var(--bad); }
.costs-table .costs-pending { background: #f1eeff; }
.costs-table .costs-missing { background: #fffaf1; }
.costs-pagination { display: flex; align-items: center; justify-content: center; padding: 10px; gap: 16px; color: var(--muted); }
.costs-savebar { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; margin-top: 14px; z-index: 10; box-shadow: 0 4px 24px rgb(17 24 39 / 12%); gap: 15px; }
.costs-savebar > span { color: var(--muted); font-size: 12px; }
button:disabled { cursor: default; opacity: .5; }
@media (max-width: 1100px) { .costs-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .costs-intro { align-items: start; flex-direction: column; gap: 10px; } }

@media (max-width: 700px) {
  .costs-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .costs-savebar { position: static; }
  .costs-table .costs-product { position: static; }
  .costs-card .table-header { flex-wrap: wrap; gap: 10px; }
  .costs-table-tools { width: 100%; justify-content: space-between; }
  .topbar { flex-wrap: wrap; }
  .topbar-meta { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .sidebar { width: 52px; padding: 16px 5px; }
  .brand { padding-inline: 2px; }
  .nav-icon { flex-shrink: 0; }
  .main { margin-left: 52px; width: calc(100% - 52px); padding: 18px 10px 30px; }
  .costs-filters { grid-template-columns: minmax(0, 1fr); }
  .costs-legend { flex-wrap: wrap; white-space: normal; }
  .costs-savebar > div { display: grid; gap: 6px; }
  .product-popover { width: min(360px, calc(100vw - 86px)); }
}

@media (max-width: 700px) { .costs-table .costs-product { min-width: 200px; max-width: 200px; width: 200px; position: static; } .costs-savebar { flex-direction: column; align-items: stretch; } }

.costs-table thead .costs-product { z-index: 12; }
#costs-access-link { color: var(--accent); font-size: 12px; }
