:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #1d2330;
  --muted: #667085;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --primary: #1f5eff;
  --primary-ink: #ffffff;
  --primary-soft: #eef3ff;
  --ok: #e7f6ec;
  --ok-ink: #17643a;
  --err: #fdecec;
  --err-ink: #9b1c1c;
  --info: #e8f0ff;
  --info-ink: #1d3f8f;
  --warn: #b45309;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --sidebar: 252px;
  --topbar: 60px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; margin: 0 0 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .87em; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.strong { font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
ul.plain { list-style: none; padding: 0; margin: 0; line-height: 1.9; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

/* Layout */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar); z-index: 20;
  display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: .6rem; }
.brand:hover { text-decoration: none; }
.brand > span:last-child { color: var(--primary); }
.brand .brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: #fff; font-size: .8rem; letter-spacing: .02em; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.topbar-user form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: .6rem; color: var(--text); padding: .3rem .6rem .3rem .3rem; border-radius: 999px; }
.user-chip:hover { background: var(--bg); text-decoration: none; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--info-ink); font-weight: 700; font-size: .85rem; }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip-text small { color: var(--muted); font-size: .78rem; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; padding: .25rem .5rem; }

.sidebar {
  position: fixed; top: var(--topbar); bottom: 0; left: 0; width: var(--sidebar); z-index: 10;
  background: var(--surface); border-right: 1px solid var(--border); padding: 1.25rem .9rem 2rem; overflow-y: auto;
}
.nav-section + .nav-section { margin-top: 1.6rem; }
.nav-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 0 .85rem .5rem; }
.sidebar a { display: flex; align-items: center; gap: .75rem; padding: .62rem .85rem; margin-bottom: .2rem; border-radius: var(--radius-sm); color: #344054; font-weight: 500; }
.sidebar a:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.sidebar a.active { background: var(--primary-soft); color: var(--info-ink); font-weight: 600; }
.sidebar a.active .nav-icon { color: var(--primary); }
.nav-icon { width: 20px; height: 20px; flex: none; color: var(--muted); }
.nav-label { flex: 1; }
.nav-backdrop { display: none; }

.content { margin-left: var(--sidebar); padding: calc(var(--topbar) + 2rem) 2.5rem 2.5rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.page-head .actions { margin-top: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); overflow-x: auto; }
.card > h2:first-child { margin-top: 0; }
.narrow-card { max-width: 680px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.grid-2 > .card { margin-bottom: 0; }
.section-gap { margin-top: 2rem; }

/* Ustawienia – zakładki */
.settings-head { margin-bottom: 1.75rem; }
.settings-head-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .6rem; }
.settings-tabs { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; border-bottom: 1px solid var(--border); }
.settings-tabs a { padding: .55rem .1rem .7rem; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tabs a:hover { color: var(--text); text-decoration: none; }
.settings-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow); }
.tile-label { color: var(--muted); font-size: .87rem; }
.tile-value { font-size: 1.45rem; font-weight: 700; margin-top: .35rem; font-variant-numeric: tabular-nums; }

/* Forms */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; min-height: 40px;
}
textarea { min-height: 80px; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--primary) 20%, transparent); border-color: var(--primary); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--text); }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; }
label.check, label.core-remember { flex-direction: row; align-items: center; gap: .6rem; font-weight: normal; }
.remember-hint { margin: -.4rem 0 0; }
/* Klasy zamiast atrybutów style= (CSP rdzenia bez stylów inline) */
.form-gap { margin-top: .75rem; }
.form-gap-lg { margin-top: 1rem; }
.mb-section { margin: 0 0 1.5rem; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.row > label { flex: 1 1 170px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 .4rem; }
input.money { text-align: right; min-width: 80px; }
input.narrow, .narrow { max-width: 120px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.1rem; min-height: 40px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); white-space: nowrap; font-weight: 500;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, black); }
.btn-warn { background: #fff7ed; border-color: #fdba74; color: var(--warn); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-small { padding: .3rem .7rem; min-height: 32px; font-size: .87rem; }
button.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; }
button.link.danger { color: var(--err-ink); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.1rem; }
.actions form { margin: 0; }
details > summary { cursor: pointer; list-style: none; margin-bottom: .75rem; }
details > summary::-webkit-details-marker { display: none; }
details.card > summary { font-weight: 600; margin-bottom: 0; }
details.card[open] > summary { margin-bottom: 1rem; }

/* Period picker */
.period { display: flex; gap: .5rem; align-items: center; margin: 0; }
.period select { width: auto; }
.period input[type=number] { width: 96px; }

/* Alerts */
.alert { padding: .85rem 1.15rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; border: 1px solid transparent; }
.alert-success { background: var(--ok); color: var(--ok-ink); border-color: #c4e8d1; }
.alert-error { background: var(--err); color: var(--err-ink); border-color: #f6caca; }
.alert-info { background: var(--info); color: var(--info-ink); border-color: #cddcff; }
.alert-warn { background: #fff7ed; color: var(--warn); border-color: #fdba74; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .7rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th.num, .table td.num { text-align: right; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--surface-2); border-bottom-color: var(--border); }
.table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.table thead th:last-child { border-top-right-radius: var(--radius-sm); }
.table tbody tr:hover td { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot th { border-top: 2px solid var(--border); border-bottom: 0; padding-top: .8rem; }
.table.compact td, .table.compact th { padding: .5rem .6rem; }
.table tr.inactive td { opacity: .55; }
.table tr.new-row td { background: var(--surface-2); }

/* Sortowanie i wyszukiwanie w tabelach (app.js) */
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable::after { content: "↕"; margin-left: .35rem; opacity: .35; font-size: .9em; }
.table th.sortable[aria-sort=ascending]::after { content: "↑"; opacity: 1; color: var(--primary); }
.table th.sortable[aria-sort=descending]::after { content: "↓"; opacity: 1; color: var(--primary); }
.table th.sortable[aria-sort=ascending], .table th.sortable[aria-sort=descending] { color: var(--text); }
.table-tools { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.table-tools .table-search { flex: 0 1 320px; padding-left: 2.2rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat .75rem center; }
.table-tools select { width: auto; max-width: 260px; }
.table-count { color: var(--muted); font-size: .87rem; margin-left: auto; }
.tag { font-size: .7rem; background: #fff; border: 1px solid #f5b5b5; color: var(--err-ink); border-radius: 4px; padding: 0 .3rem; }
.table tr.row-warn td { background: #fff7ed; }
.table tr.summary-total td { border-top: 2px solid var(--border-strong); background: var(--surface-2); }

.sticky-actions {
  position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border);
  padding: 1rem 0; margin-top: .75rem; display: flex; gap: 1rem; align-items: center;
}

.badge { display: inline-block; font-size: .76rem; padding: .15rem .55rem; border-radius: 999px; font-weight: 600; }
/* Zmiana szerokości kolumn */
.table thead th { position: relative; }
.col-resizer { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.col-resizer::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 1px; background: var(--border-strong); }
.col-resizer:hover::after, .col-resizing .col-resizer::after { background: var(--primary); width: 2px; }
body.col-resizing { cursor: col-resize; user-select: none; }
.table.resized { table-layout: fixed; }
.table.resized td, .table.resized th { overflow: hidden; text-overflow: ellipsis; }
.table.resized input, .table.resized select { min-width: 0; }
.tile-sub { color: var(--muted); font-size: .82rem; margin-top: .35rem; }
.tile-accent { border-color: var(--primary); background: var(--info); }
.tile-accent .tile-value { color: var(--info-ink); }
.bar { height: 6px; background: var(--bg); border-radius: 3px; margin-top: .6rem; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); transition: width .2s; }
.actions .reason { flex: 1 1 260px; }

/* Tabela jako karty na telefonie (Moja ewidencja) */
@media (max-width: 760px) {
  .stack-mobile thead { display: none; }
  .stack-mobile, .stack-mobile tbody, .stack-mobile tr, .stack-mobile td { display: block; width: 100% !important; }
  .stack-mobile tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .75rem; padding: .5rem .75rem; }
  .stack-mobile td { border: 0; display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: .5rem; padding: .25rem 0; }
  .stack-mobile td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
  .stack-mobile td.center, .stack-mobile td.num { text-align: left; }
  .stack-mobile tfoot { display: block; }
  .stack-mobile tfoot tr { display: flex; flex-wrap: wrap; gap: .5rem; }
  .stack-mobile tfoot th { display: inline; border: 0; }
  .selfreport .table-wrap { overflow: visible; }
}
.inline-form { display: flex; gap: .5rem; align-items: center; margin: 0; }
.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }

dl.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
dl.summary dt { color: var(--muted); font-size: .87rem; }
dl.summary dd { margin: .2rem 0 0; font-size: 1.12rem; font-weight: 600; }

/* Auth */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.auth-box { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.25rem; box-shadow: 0 4px 16px rgba(16, 24, 40, .06); }
.auth-box h1 { margin-bottom: 1.5rem; }

/* Mobile */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .topbar { padding: 0 1rem; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: min(300px, 85vw); }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 30px rgba(0,0,0,.15); }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(16, 24, 40, .3); z-index: 9; }
  .content { margin-left: 0; padding: calc(var(--topbar) + 1.25rem) 16px 2rem; }
  .card { padding: 1.15rem 1.1rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .user-chip-text { display: none; }
  .topbar-user { gap: .5rem; }
  .table-count { margin-left: 0; }
  .settings-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 1.25rem; scrollbar-width: none; }
  .settings-tabs a { white-space: nowrap; }
  .page-head { margin-bottom: 1.15rem; }
}
@media (max-width: 480px) {
  .topbar { gap: .5rem; }
  .brand { font-size: 1rem; gap: .45rem; min-width: 0; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36vw; }
  h1 { font-size: 1.35rem; }
}

@media print {
  .topbar, .sidebar, .no-print, .period, .tabs, .alert, .settings-head, .app-footer { display: none !important; }
  .content { margin: 0; padding: 0; }
  .card { border: 0; padding: 0; box-shadow: none; }
  body { background: #fff; }
  input { border: 0 !important; padding: 0 !important; }
  .table th.sortable::after { content: none; }
}

/* Licencja (Entevo CRM) */
.license-details { display: grid; grid-template-columns: 180px 1fr; gap: .65rem 1.25rem; margin: 0; }
.license-details dt { color: var(--muted); }
.license-details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .license-details { grid-template-columns: 1fr; gap: .15rem; } .license-details dd { margin-bottom: .6rem; }
}
.license-state { display: inline-block; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; }
.license-ok { background: var(--ok); color: var(--ok-ink); }
.license-warn { background: #fff7ed; color: var(--warn); }
.license-err { background: var(--err); color: var(--err-ink); }
.text-err { color: var(--err-ink); }

/* Dokumenty usługi, historia zmian */
.legal-form fieldset { gap: .75rem; }
.legal-form fieldset[disabled] { opacity: .55; }
.legal-content { max-width: 860px; line-height: 1.65; }
.legal-content h1 { font-size: 1.4rem; margin: .5rem 0 1rem; }
.legal-content h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.legal-content h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.legal-content blockquote { margin: .75rem 0; padding: .5rem 1rem; border-left: 3px solid var(--border); color: var(--muted); }
.legal-content ol, .legal-content ul { padding-left: 1.4rem; }
.legal-content li { margin-bottom: .3rem; }
.legal-content code { background: var(--bg); padding: .05rem .35rem; border-radius: 4px; font-size: .9em; }
.release { scroll-margin-top: calc(var(--topbar) + 1rem); }
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin-bottom: 1rem; }
.release-head h2 { margin: 0; font-size: 1.3rem; }
.release-current { border-color: var(--primary); }
.release .legal-content h3 { margin-top: 1.25rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.release .legal-content h3:first-child { margin-top: 0; }
.release-index { display: flex; flex-wrap: wrap; gap: .4rem; }
.release-index a { padding: .3rem .75rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: .87rem; color: var(--text); }
.release-index a:hover { background: var(--bg); text-decoration: none; }

.app-footer { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .87rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.app-footer a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.app-footer a:hover { color: var(--text); }
.auth-box .app-footer { margin-top: 1.75rem; justify-content: center; }
.legal-banner { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.legal-banner-close { margin: 0 0 0 auto; }
.legal-banner-close button { font-size: 1.2rem; line-height: 1; color: var(--info-ink); }

/* Weryfikacja dwuetapowa */
.qr { display: flex; justify-content: center; margin: 1rem 0; }
.qr svg { width: 220px; height: 220px; max-width: 100%; border-radius: 8px; background: #fff; }
.secret-key { text-align: center; padding: .6rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.secret-key code, .recovery-codes code { font: 600 15px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.code-input { font: 600 20px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .15em; text-align: center; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; margin: 1rem 0; padding-left: 1.5rem; }

/* ===== Maro Tur Firma (makiety docs/makiety) ===== */
:root { --core-border: var(--border); --core-hover: #fafbfc; --core-stripe: #fff; --core-head-bg: var(--surface-2); }
.subtitle { margin: .3rem 0 0; color: var(--muted); font-size: .93rem; }
.sub { color: var(--muted); font-size: .83rem; }
.none { color: var(--muted); }
.pos { color: var(--ok-ink); }
.neg { color: var(--err-ink); }
.warn-ink { color: var(--warn); }
.bdg { display: inline-block; font-size: .77rem; line-height: 1.5; padding: .1rem .55rem; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.b-in { background: var(--ok); color: var(--ok-ink); }
.b-out { background: var(--err); color: var(--err-ink); }
.b-info { background: var(--info); color: var(--info-ink); }
.b-warn { background: #fff7ed; color: var(--warn); }
.b-gray { background: #f2f4f7; color: #475467; }
.btn-accent { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-accent:hover { background: #1a50d9; color: #fff; text-decoration: none; }
.head-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.head-actions form { margin: 0; }
.head-actions label { min-width: 200px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label { flex: 0 1 190px; font-size: .87rem; }
.filters label.grow { flex: 1 1 260px; }
.tabs-line { display: flex; flex-wrap: wrap; gap: 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tabs-line a { padding: .5rem .1rem .65rem; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-line a:hover { color: var(--text); text-decoration: none; }
.tabs-line a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs-line .count { color: var(--muted); font-weight: 400; margin-left: .3rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.cat-bars { display: flex; flex-direction: column; gap: .75rem; font-size: .93rem; }
.cat-bar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; gap: .75rem; align-items: center; }
.cat-bar .track { height: 8px; background: #f2f4f7; border-radius: 4px; overflow: hidden; }
.cat-bar .track span { display: block; height: 8px; background: var(--primary); }
.cat-bar.cost .track span { background: #98a2b3; }
.cat-bar .val { text-align: right; font-variant-numeric: tabular-nums; }
.list-items { display: flex; flex-direction: column; gap: .75rem; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item .sub { display: block; }
.steps { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.steps li { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-weight: 500; }
.steps li .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #f2f4f7; font-size: .8rem; font-weight: 700; }
.steps li.done .n { background: var(--ok); color: var(--ok-ink); }
.steps li[aria-current] { color: var(--text); }
.steps li[aria-current] .n { background: var(--primary); color: #fff; }
.mapping { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .6rem 1.5rem; margin: .75rem 0; }
.mapping label { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .5rem; align-items: center; }
.mapping code { font-size: .85rem; background: var(--surface-2); padding: .15rem .4rem; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; }
.chart { display: flex; align-items: flex-end; gap: 1rem; height: 180px; padding: .5rem 0; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.chart .grp { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; }
.chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.chart .bars span { width: 40%; max-width: 26px; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 1px; }
.chart .bars span.cost { background: #98a2b3; }
.chart .lbl { font-size: .78rem; color: var(--muted); }
.legend { display: flex; gap: 1rem; font-size: .83rem; color: var(--muted); margin-bottom: .5rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--primary); margin-right: .35rem; vertical-align: -1px; }
.legend i.cost { background: #98a2b3; }
dl.props { display: grid; grid-template-columns: 140px 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; }
.perm-table td, .perm-table th { white-space: nowrap; }
.table tfoot td, .table tfoot th { font-weight: 700; border-top: 2px solid var(--border); }
.calc-input { max-width: 220px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-actions form { margin: 0; }
.nav-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .05rem .45rem; }
.core-tile.card { margin-bottom: 0; }
.grid-main { grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr); }
@media (max-width: 1100px) { .grid-main { grid-template-columns: 1fr; } }
