/* FirmaYa · consola de facturación. Tokens y componentes derivados de los mockups de design/. */
:root {
  --bg: #F4F5F2; --surface: #FFFFFF; --border: #E2E4DE; --border-input: #CDD2CA; --border-btn: #D5D9D2; --divider: #EEF0EB; --row-sel: #F1F7F3;
  --text: #17201B; --text-2: #3A443E; --muted: #5B655F;
  --pri: #1D6B47; --pri-hover: #14523A; --pri-tint: #E3F0E8; --pri-bar: #B9D6C5; --pri-fg: #FFFFFF;
  --warn-bg: #FBF0DC; --warn-fg: #7A4600; --warn-fg-2: #6B3F00; --warn-fg-3: #9A5B00;
  --info-bg: #E5EDF8; --info-fg: #1F4F8F;
  --dan-bg: #FBE7E5; --dan-fg: #A3221B; --dan-fg-2: #B3261E; --dan-fg-3: #7E1A14; --dan-border: #E7B7B2;
  --neutral-bg: #EEF0EB;
  --sans: 'IBM Plex Sans', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--pri); } a:hover { color: var(--pri-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--pri); color: var(--pri-fg); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; flex: none; }

/* layout */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 220px; max-width: 260px; padding: 20px 16px 24px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.side .spacer { flex: 1; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px clamp(16px, 3vw, 40px) 48px; display: flex; flex-direction: column; gap: 24px; }
.main.tight { gap: 20px; }
@media (max-width: 760px) { .side { flex-direction: row; flex-wrap: wrap; max-width: none; border-right: 0; border-bottom: 1px solid var(--border); } .side .company-switch { flex-basis: 100%; } .side .spacer, .side .userbox { display: none; } }

.nav { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav:hover { background: var(--neutral-bg); color: var(--text); }
.nav.on { background: var(--pri-tint); color: var(--pri-hover); font-weight: 600; }
.nav svg { flex: none; }

.company-switch { position: relative; margin-bottom: 12px; }
.company-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.company-btn:hover { background: var(--neutral-bg); }
.company-btn:focus-visible { outline: 2px solid var(--pri); }
.company-btn .names { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.company-btn .names b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-btn .names span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(23, 32, 27, 0.12); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.company-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.company-menu a:hover { background: var(--neutral-bg); }
.company-menu a.on { background: var(--pri-tint); }
.company-menu .add { border-top: 1px solid var(--divider); margin-top: 4px; padding-top: 8px; color: var(--pri); font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; color: var(--pri-fg); background: var(--pri); }
.avatar.round { border-radius: 50%; color: var(--text); font-size: 13px; width: 36px; height: 36px; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--divider); margin-top: 8px; font-size: 13px; }
.userbox .names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.userbox .names b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox a.names { color: inherit; text-decoration: none; } .userbox a.names:hover b { text-decoration: underline; }
.linkbtn { all: unset; cursor: pointer; color: var(--pri); font-weight: 500; font-size: 13px; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.dan { color: var(--dan-fg); }
.linkbtn:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; border-radius: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn.pri { background: var(--pri); color: var(--pri-fg); border-color: var(--pri); } .btn.pri:hover { background: var(--pri-hover); color: var(--pri-fg); }
.btn.sec { background: var(--surface); color: var(--text); border-color: var(--border-btn); } .btn.sec:hover { background: var(--bg); color: var(--text); }
.btn.dan { background: var(--surface); color: var(--dan-fg); border-color: var(--dan-border); } .btn.dan:hover { background: var(--dan-bg); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.full { width: 100%; }
.btn[disabled], .btn.busy { opacity: 0.6; cursor: progress; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
.iconbtn { width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; }
.iconbtn:hover { background: var(--neutral-bg); }
.iconbtn.bordered { width: 44px; height: 44px; border: 1px solid var(--border-input); border-radius: 8px; background: var(--surface); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 0; }
.field input, .field select, .field textarea, .input { min-height: 44px; padding: 0 12px; border: 1px solid var(--border-input); border-radius: 8px; font-size: 14px; font-weight: 400; color: var(--text); background: var(--surface); width: 100%; }
.field textarea { padding: 10px 12px; min-height: 72px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .cell:focus { outline: 2px solid var(--pri); outline-offset: -1px; border-color: var(--pri); }
.field input[readonly] { background: var(--bg); color: var(--text-2); }
.field .hint, .hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.field.sm input, .field.sm select { min-height: 40px; }
.row { display: flex; gap: 6px; } .row > * { flex: 1; min-width: 0; } .row > .flex-none { flex: none; }
.grid { display: grid; gap: 16px; } .grid.g12 { gap: 12px; }
.cols-auto-200 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cols-auto-220 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cols-auto-240 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cols-auto-180 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cols-auto-160 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--border-input); border-radius: 8px; font-size: 14px; background: var(--surface); }
.cell { min-height: 40px; padding: 0 10px; border: 1px solid var(--border-input); border-radius: 6px; font-size: 14px; color: var(--text); background: var(--surface); width: 100%; }
.cell.r { text-align: right; }

/* cards & tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.card.p0 { padding: 0; gap: 0; }
.card.p20 { padding: 20px; }
.card.g18 { gap: 18px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.card-head.pad { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head.pad-lg { padding: 18px 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.kpi .label { font-size: 13px; color: var(--muted); } .kpi .value { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.kpi .value.dan { color: var(--dan-fg-2); } .kpi .delta { font-size: 13px; font-weight: 500; color: var(--pri); } .kpi .delta.down { color: var(--dan-fg); } .kpi .sub { font-size: 13px; color: var(--muted); }
.kpi.sm { padding: 14px 16px; border-radius: 10px; gap: 4px; } .kpi.sm .label { font-size: 12px; } .kpi.sm .value { font-size: 20px; }
.bar { height: 6px; border-radius: 3px; background: var(--pri-tint); overflow: hidden; } .bar > div { height: 100%; background: var(--pri); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-weight: 500; color: var(--muted); font-size: 12px; text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--divider); font-size: 14px; white-space: nowrap; vertical-align: middle; }
td.wrap { white-space: normal; min-width: 160px; }
table.lines td { padding: 8px 6px; } table.lines th { padding: 10px 6px; }
td.r, th.r { text-align: right; }
td.sel, th.sel { width: 36px; padding-right: 0; } .check, .field input.check { width: 16px; height: 16px; min-height: 0; flex: none; margin: 0; padding: 0; accent-color: var(--pri); cursor: pointer; vertical-align: middle; }
tr.sel { background: var(--row-sel); box-shadow: inset 3px 0 0 var(--pri); }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: var(--row-sel); }
.rowbtn { all: unset; cursor: pointer; font-weight: 500; color: var(--text); }
.rowbtn:hover { text-decoration: underline; text-underline-offset: 3px; } .rowbtn:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; border-radius: 2px; }
.stack { display: flex; flex-direction: column; gap: 2px; } .stack .sub { font-size: 13px; color: var(--muted); } .stack .sub.xs { font-size: 12px; }
.empty { margin: 0; padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty.lg { padding: 64px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; font-size: 13px; color: var(--muted); }
.pager .btns { display: flex; gap: 6px; }

/* pills, badges, alerts */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--neutral-bg); color: var(--text-2); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--pri-tint); color: var(--pri-hover); } .pill.info { background: var(--info-bg); color: var(--info-fg); } .pill.warn { background: var(--warn-bg); color: var(--warn-fg); } .pill.dan { background: var(--dan-bg); color: var(--dan-fg); }
.pill.lg { height: 32px; padding: 0 12px; font-size: 13px; } .pill.lg::before { width: 8px; height: 8px; }
.pill.nodot::before { display: none; }
.badge { display: inline-block; min-width: 28px; padding: 2px 6px; border-radius: 4px; background: var(--neutral-bg); font-size: 12px; font-weight: 600; text-align: center; }
.badge.ok { background: var(--pri-tint); color: var(--pri-hover); }
.alert { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-fg-2); font-size: 14px; }
.alert svg { flex: none; } .alert .text { flex: 1 1 320px; } .alert a, .alert .linkbtn { color: inherit; font-weight: 600; }
.alert.info { background: var(--info-bg); color: var(--info-fg); } .alert.dan { background: var(--dan-bg); color: var(--dan-fg-3); } .alert.ok { background: var(--pri-tint); color: var(--pri-hover); }
.alert.compact { padding: 10px 12px; font-size: 13px; border-radius: 8px; gap: 8px; }
.notice { padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.notice.warn { background: var(--warn-bg); color: var(--warn-fg-2); } .notice.dan { background: var(--dan-bg); color: var(--dan-fg-3); } .notice.ok { background: var(--pri-tint); color: var(--pri-hover); } .notice.info { background: var(--info-bg); color: var(--info-fg); }

/* tabs & radio cards */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; cursor: pointer; border: 1px solid var(--border-btn); background: var(--surface); color: var(--text-2); }
.chip[aria-selected="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; font-size: 14px; cursor: pointer; background: transparent; color: var(--text-2); }
.tab[aria-selected="true"] { background: var(--neutral-bg); color: var(--text); font-weight: 600; }
.tab .n { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 4px; }
.tabs.line { gap: 4px; border-bottom: 1px solid var(--border); }
.tabs.line .tab { min-height: 44px; padding: 0 16px; margin-bottom: -1px; border-radius: 0; border-bottom: 2px solid transparent; font-size: 15px; color: var(--muted); }
.tabs.line .tab[aria-selected="true"] { background: transparent; border-bottom-color: var(--pri); color: var(--text); }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.radio-card { text-align: left; padding: 14px 16px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1.5px solid var(--border); color: var(--text); }
.radio-card[aria-checked="true"] { background: var(--pri-tint); border-color: var(--pri); }
.radio-card b { font-size: 14px; font-weight: 600; } .radio-card span { font-size: 12px; color: var(--muted); }
.radio-card.sm { min-height: 44px; align-items: center; justify-content: center; flex-direction: row; font-size: 14px; border-color: var(--border-btn); } .radio-card.sm[aria-checked="true"] { border-color: var(--pri); font-weight: 600; }
.subnav { display: flex; flex-direction: column; gap: 2px; }
.sub { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 8px; }
.sub:hover { background: var(--neutral-bg); } .sub:focus-visible { outline: 2px solid var(--pri); }
.sub[aria-current="page"] { background: var(--surface); box-shadow: inset 3px 0 0 var(--pri); }
.sub b { font-size: 14px; font-weight: 500; color: var(--text); } .sub[aria-current="page"] b { font-weight: 600; } .sub span { font-size: 12px; color: var(--muted); }

/* detail pages */
.back { font-size: 13px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.narrow { max-width: 880px; }
dl.dl.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
dl.dl.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { dl.dl.cols-3, dl.dl.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.totals { margin-left: auto; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; padding: 16px 24px 20px; }
.user-head { display: flex; align-items: center; gap: 16px; } .user-head .avatar.round { width: 56px; height: 56px; font-size: 20px; }

/* misc */
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .grow { flex: 999 1 560px; min-width: 0; } .split > .aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; } .split > .aside.w380 { flex-basis: 360px; } .split > .aside.w360 { flex-basis: 340px; }
.split > .grow2 { flex: 2 1 480px; min-width: 0; } .split > .grow1 { flex: 1 1 300px; min-width: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); font-size: 14px; } .kv:last-child { border-bottom: 0; }
.kv .ok { color: var(--pri); font-weight: 500; } .kv .warn { color: var(--warn-fg-3); font-weight: 500; } .kv .dan { color: var(--dan-fg); font-weight: 500; }
dl.dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; font-size: 14px; }
dl.dl > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; } dl.dl dt { font-size: 12px; color: var(--muted); } dl.dl dd { margin: 0; overflow-wrap: anywhere; }
.clave { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--bg); } .clave span { flex: 1; font-family: var(--mono); font-size: 12px; line-height: 1.5; word-break: break-all; }
.timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 12px; } .timeline .rail { display: flex; flex-direction: column; align-items: center; width: 14px; }
.timeline .dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--pri); border: 2px solid var(--pri); } .timeline .line { flex: 1; width: 2px; min-height: 14px; background: var(--pri-bar); }
.timeline li:last-child .line { background: transparent; }
.timeline .dot.pending { background: #fff; border-color: var(--info-fg); } .timeline .dot.dan { background: var(--dan-fg); border-color: var(--dan-fg); } .timeline .dot.warn { background: #fff; border-color: var(--warn-fg); }
.timeline .body { display: flex; flex-direction: column; gap: 1px; padding-bottom: 12px; } .timeline .body b { font-size: 14px; font-weight: 500; } .timeline .body span { font-size: 12px; color: var(--muted); }
.timeline .body b.info { color: var(--info-fg); } .timeline .body b.dan { color: var(--dan-fg); } .timeline .body b.warn { color: var(--warn-fg); }
.chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; height: 230px; }
.chart .col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; } .chart .col .v { font-family: var(--mono); font-size: 12px; color: var(--muted); } .chart .col .b { width: 100%; max-width: 56px; border-radius: 6px 6px 2px 2px; background: var(--pri-bar); } .chart .col.last .b { background: var(--pri); } .chart .col.last .v { color: var(--text); } .chart .col .l { font-size: 12px; color: var(--muted); }
.list { display: flex; flex-direction: column; } .list .item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); font-size: 14px; }
.box { border: 1px solid var(--border); border-radius: 10px; } .box .boxrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--divider); } .box .boxrow:last-child { border-bottom: 0; }
.dashed { border: 1px dashed var(--border-input); border-radius: 10px; padding: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.logo-ph { width: 64px; height: 64px; border-radius: 10px; background: var(--neutral-bg); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); overflow: hidden; } .logo-ph img { max-width: 100%; max-height: 100%; }
/* brand colour picker (Configuración › Empresa) */
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.swatch { all: unset; box-sizing: border-box; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(23, 32, 27, 0.12); flex: none; }
.swatch:hover { transform: scale(1.08); } .swatch:focus-visible, .swatch:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.swatch[aria-pressed="true"], .swatch.on { box-shadow: inset 0 0 0 1px rgba(23, 32, 27, 0.12), 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatch.custom { background: conic-gradient(#B3261E, #C2540A, #8A6400, #1D6B47, #0E7C7B, #1F4F8F, #6A3FA0, #B3261E); position: relative; }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.theme-preview { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.combo { position: relative; } .combo-list { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px rgba(23, 32, 27, 0.12); padding: 4px; max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; }
.res { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; border-radius: 8px; } .res:hover, .res:focus-visible { background: var(--bg); } .res .top { display: flex; justify-content: space-between; gap: 8px; } .res .top b { font-family: var(--mono); font-size: 13px; font-weight: 500; } .res .top span { font-size: 12px; color: var(--muted); } .res .d { font-size: 13px; color: var(--text-2); white-space: normal; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.total-row { display: flex; justify-content: space-between; font-size: 14px; } .total-row span:first-child { color: var(--text-2); }
.total-final { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); } .total-final b { font-size: 15px; font-weight: 600; } .total-final .v { font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hstack { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hstack > .btn { flex: none; }
.actions.top { border-top: 1px solid var(--divider); padding-top: 16px; }
.actions > .btn { flex: 1 1 140px; } .actions > .btn.full { flex-basis: 100%; }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(23, 32, 27, 0.4); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 64px rgba(23, 32, 27, 0.25); }
.modal.wide { width: min(760px, 100%); }
#toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--text); color: #fff; font-size: 14px; box-shadow: 0 12px 32px rgba(23, 32, 27, 0.25); animation: toast-in 0.2s ease-out; }
.toast.err { background: var(--dan-fg); } .toast.ok { background: var(--pri); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.skeleton { color: var(--muted); padding: 24px; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .card { width: min(420px, 100%); padding: 32px; gap: 20px; }
.login .brand { display: flex; align-items: center; gap: 12px; } .login .brand .t { display: flex; flex-direction: column; } .login .brand b { font-size: 18px; font-weight: 600; } .login .brand span { font-size: 13px; color: var(--muted); }

/* companies */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.company-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.company-card .head { display: flex; align-items: center; gap: 12px; } .company-card .head .avatar { width: 44px; height: 44px; border-radius: 10px; font-size: 18px; }
.company-card .meta { display: flex; flex-wrap: wrap; gap: 6px; }

@media print { .side, #toasts { display: none !important; } }
