/* Asistente Contable - interface styles. No external requests; system font stack. */

:root {
  --brand: #4338CA;
  --brand-hover: #3730A3;
  --brand-soft: #EEF0FF;
  --brand-ring: rgba(67, 56, 202, .32);
  --link: #4338CA;
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --border: #E3E6EF;
  --border-strong: #C9CFDF;
  --text: #151A30;
  --text-2: #444C6B;
  --muted: #5B6482;
  --side-bg: #111437;
  --side-text: #C4C8EA;
  --side-muted: #9096C8;
  --success: #0B7A4B; --success-bg: #E7F6EE; --success-border: #A8DEC3;
  --danger: #B42318;  --danger-bg: #FDECEA;  --danger-border: #F4B4AD;
  --warning: #7A4E00; --warning-bg: #FFF4DB; --warning-border: #F1D08A;
  --info: #1D4ED8;    --info-bg: #E8F0FF;    --info-border: #B5CBFA;
  --shadow-sm: 0 1px 2px rgba(17, 20, 55, .06);
  --shadow-md: 0 4px 16px rgba(17, 20, 55, .08), 0 1px 3px rgba(17, 20, 55, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --sidebar-w: 272px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5B54E6;
    --brand-hover: #6D67F0;
    --brand-soft: rgba(124, 119, 255, .14);
    --brand-ring: rgba(139, 147, 255, .45);
    --link: #A9AFFF;
    --bg: #0B0D1E;
    --surface: #14172F;
    --surface-2: #191D3A;
    --border: #272C52;
    --border-strong: #3A4072;
    --text: #E9EBF9;
    --text-2: #B6BBD9;
    --muted: #9CA2C6;
    --side-bg: #080A19;
    --success: #5FD9A0; --success-bg: rgba(46, 204, 140, .12); --success-border: rgba(95, 217, 160, .35);
    --danger: #FF9C92;  --danger-bg: rgba(255, 99, 84, .12);   --danger-border: rgba(255, 156, 146, .38);
    --warning: #F6C763; --warning-bg: rgba(246, 190, 70, .12); --warning-border: rgba(246, 199, 99, .35);
    --info: #9DBBFF;    --info-bg: rgba(96, 140, 255, .13);    --info-border: rgba(157, 187, 255, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 4px 18px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 var(--s3); }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sidebar :focus-visible, .brand-panel :focus-visible { outline-color: #fff; }
@media (prefers-color-scheme: dark) { :focus-visible { outline-color: #A9AFFF; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip-link { position: absolute; left: var(--s2); top: -48px; z-index: 100; background: var(--brand); color: #fff; padding: var(--s2) var(--s4); border-radius: var(--radius-sm); }
.skip-link:focus { top: var(--s2); }

/* Icons */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* App shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; gap: var(--s5);
  padding: var(--s5) var(--s4); position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2); color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.sidebar-brand img { width: 40px; height: 40px; padding: 4px; border-radius: 10px; background: #F3F8EF; box-shadow: 0 1px 2px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .6); flex: none; }
.sidebar-brand:hover { text-decoration: none; }
.company-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.company-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); }
.company-card .name { color: #fff; font-weight: 650; font-size: 14px; margin-top: var(--s1); overflow-wrap: anywhere; }
.company-card .rif { font-family: var(--mono); font-size: 13px; color: var(--side-text); }
.company-card .switch-link { display: inline-block; margin-top: var(--s2); font-size: 12px; color: #D6D9FF; }
.company-card .switch-link:hover { color: #fff; }
.company-card .badge { margin-top: var(--s2); background: rgba(165, 171, 255, .16); color: #D6D9FF; }
.nav { display: flex; flex-direction: column; gap: var(--s4); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 0 var(--s3) var(--s1); }
.nav a {
  display: flex; align-items: center; gap: var(--s3); padding: 9px var(--s3);
  color: var(--side-text); text-decoration: none; border-radius: var(--radius-sm); font-weight: 550; font-size: 14px;
  position: relative;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #A5ABFF; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--side-muted); padding: 0 var(--s2); display: flex; gap: var(--s2); align-items: flex-start; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s4);
  padding: var(--s3) var(--s6); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }
.period-picker { display: flex; align-items: center; gap: var(--s2); }
.period-picker label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.period-picker input { width: 188px; height: 36px; }
.user-menu { display: flex; align-items: center; gap: var(--s3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--link); display: grid; place-items: center; font-weight: 700; font-size: 14px; border: 1px solid var(--border); }
.user-name { font-weight: 600; font-size: 14px; }
.user-menu form { margin: 0; }
.content { width: 100%; max-width: 1360px; margin: 0 auto; padding: var(--s6); }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); padding: var(--s3) var(--s4); overflow: visible; }
  .company-card, .sidebar-foot, .nav-title { display: none; }
  .nav { flex-direction: row; gap: var(--s2); overflow-x: auto; flex: 1 1 100%; order: 3; padding-bottom: var(--s1); }
  .nav-group { flex-direction: row; gap: var(--s1); }
  .nav a { white-space: nowrap; }
  .nav a[aria-current="page"]::before { display: none; }
  .topbar { padding: var(--s3) var(--s4); position: static; }
  .content { padding: var(--s4); }
  .user-name { display: none; }
}

/* Page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-header .lead { color: var(--muted); margin: var(--s1) 0 0; max-width: 62ch; }
.page-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.breadcrumb { display: flex; gap: var(--s2); align-items: center; font-size: 13px; color: var(--muted); margin-bottom: var(--s2); }
.breadcrumb a { color: var(--muted); }
.title-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: var(--s5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: var(--s5); }
.card-foot { padding: var(--s3) var(--s5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); color: var(--muted); font-size: 13px; }
.card.flush .card-body { padding: 0; }
.cols { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + .cols { margin-top: var(--s5); }
@media (max-width: 1100px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* Stat cards */
.stats { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: var(--s5); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4) var(--s5); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: var(--s2); }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: var(--s2); line-height: 1.15; }
.stat-value .cur { font-size: 14px; font-weight: 600; color: var(--muted); margin-right: 6px; letter-spacing: 0; }
.stat-note { font-size: 12px; color: var(--muted); margin-top: var(--s2); }
.stat-hero { background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%); border-color: transparent; color: #fff; box-shadow: var(--shadow-md); }
.stat-hero .stat-label, .stat-hero .stat-value .cur, .stat-hero .stat-note { color: rgba(255, 255, 255, .82); }
.stat-credit .stat-value { color: var(--success); }
.stat-debit .stat-value { color: var(--text); }

/* Key/value lists */
.kv { margin: 0; }
.kv-row { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { color: var(--text-2); }
.kv-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv-row.total { background: var(--surface-2); }
.kv-row.total dt { font-weight: 650; color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s5) var(--s5); margin: 0; }
.facts dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: var(--s1); }
.facts dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--brand-soft); color: var(--link); white-space: nowrap; line-height: 20px; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge .icon { width: 14px; height: 14px; }

/* Alerts and banners */
.alert-list { display: flex; flex-direction: column; }
.alert { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--border); border-left: 4px solid transparent; align-items: start; }
.alert:last-child { border-bottom: 0; }
.alert .icon { margin-top: 2px; }
.alert-meta { display: flex; gap: var(--s2); align-items: center; margin-bottom: 2px; flex-wrap: wrap; }
.alert-text { font-size: 14px; }
.alert-danger { background: var(--danger-bg); border-left-color: var(--danger); color: var(--text); }
.alert-danger .icon { color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-left-color: #D99100; }
.alert-warning .icon { color: var(--warning); }
.alert-info { background: var(--info-bg); border-left-color: var(--info); }
.alert-info .icon { color: var(--info); }
.banner { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); padding: var(--s4) var(--s5); border: 1px solid; border-radius: var(--radius); margin-bottom: var(--s5); align-items: start; }
.banner .icon { margin-top: 1px; }
.banner p, .banner ul { margin: 0; }
.banner ul { padding-left: var(--s5); margin-top: var(--s2); }
.banner li + li { margin-top: var(--s1); }
.banner strong { display: block; }
.banner-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.banner-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.banner-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.banner-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }
.banner .banner-body { color: var(--text); }
.banner strong { color: inherit; }

/* Empty states */
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--link); display: grid; place-items: center; margin: 0 auto var(--s4); }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: var(--s1); }
.empty p { margin: 0 auto var(--s4); max-width: 44ch; }
.empty.compact { padding: var(--s5); }
.empty-ok .empty-icon { background: var(--success-bg); color: var(--success); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 40px; padding: 0 var(--s4);
  background: var(--brand); color: #fff; border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--brand-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-2); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--brand-soft); color: var(--link); }
.btn-danger { background: #B42318; }
.btn-danger:hover { background: #912018; }
.btn-sm { height: 34px; padding: 0 var(--s3); font-size: 13px; }
.btn-lg { height: 46px; padding: 0 var(--s5); font-size: 15px; }
.btn-block { width: 100%; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.req { color: var(--danger); margin-left: 2px; }
input, select, textarea {
  width: 100%; height: 40px; padding: 0 var(--s3); font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: var(--s2) var(--s3); }
input::placeholder { color: #7B839F; }
@media (prefers-color-scheme: dark) { input::placeholder { color: #7C83AA; } }
input:hover, select:hover { border-color: var(--text-2); }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
input[readonly] { background: var(--surface-2); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--brand); padding: 0; flex: none; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .hint.ok { color: var(--success); }
.field .hint.bad { color: var(--danger); }
.field-error { font-size: 13px; color: var(--danger); display: flex; gap: 6px; align-items: flex-start; font-weight: 550; }
.field-error .icon { width: 16px; height: 16px; margin-top: 2px; }
.field.invalid input, .field.invalid select { border-color: var(--danger); background: var(--danger-bg); }
.field.invalid input:focus, .field.invalid select:focus { box-shadow: 0 0 0 3px var(--danger-border); }
.check-field { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.check-field label { font-size: 14px; font-weight: 550; color: var(--text); }
.check-field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s4) var(--s5); }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 560px) { .form-grid .span-2 { grid-column: auto; } }
.input-affix { position: relative; }
.input-affix input { padding-left: 36px; }
.input-affix .affix { position: absolute; left: var(--s3); top: 0; bottom: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 600; pointer-events: none; }
.input-affix.num input { text-align: right; font-variant-numeric: tabular-nums; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s5); align-items: start; }
@media (max-width: 1180px) { .form-layout { grid-template-columns: minmax(0, 1fr); } }
.form-layout .card { margin-bottom: var(--s5); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; gap: 2px; }
.seg a, .seg label { padding: 6px var(--s4); border-radius: 8px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s2); }
.seg a[aria-current="true"] { background: var(--surface); color: var(--link); box-shadow: var(--shadow-sm); }
.seg a:hover { color: var(--text); }

.amounts { display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3) var(--s4); align-items: start; }
.amounts .head { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.amounts .rate { display: flex; align-items: center; height: 40px; gap: var(--s2); font-weight: 600; }
.amounts .rate small { color: var(--muted); font-weight: 500; }
@media (max-width: 640px) { .amounts { grid-template-columns: 1fr 1fr; } .amounts .head:first-child { display: none; } .amounts .rate { grid-column: 1 / -1; height: auto; } }
.form-section-title { display: flex; align-items: center; gap: var(--s3); }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--link); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }

.submit-bar {
  position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
  padding: var(--s3) var(--s5); margin-top: var(--s5);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 20px rgba(17, 20, 55, .08);
}
.submit-bar .note { flex: 1; min-width: 220px; font-size: 13px; color: var(--muted); display: flex; gap: var(--s2); align-items: flex-start; }

.live-summary { position: sticky; top: 88px; display: none; }
.js .live-summary { display: block; }
.live-summary .kv-row { padding: var(--s2) var(--s4); }
.live-summary .big { font-size: 22px; letter-spacing: -.01em; }
@media (max-width: 1180px) { .live-summary { position: static; } }

/* Tables */
.table-wrap { overflow: auto; max-width: 100%; }
.table-wrap.tall { max-height: 68vh; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
th, td { padding: 11px var(--s3); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); background: var(--surface); }
th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); border-bottom: 1px solid var(--border-strong); }
tbody tr:nth-child(even) td { background: var(--surface-2); }
tbody tr:hover td { background: var(--brand-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; min-width: 200px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.zero { color: var(--muted); opacity: .75; }
td.num { font-feature-settings: "tnum"; }
tfoot td { position: sticky; bottom: 0; z-index: 2; font-weight: 700; background: var(--brand-soft); border-top: 1px solid var(--border-strong); border-bottom: 0; }
tfoot td.num { font-variant-numeric: tabular-nums; }
.sticky-1, .sticky-2 { position: sticky; z-index: 1; }
th.sticky-1, th.sticky-2 { z-index: 4; }
.sticky-1 { left: 0; min-width: 56px; }
.sticky-2 { left: 56px; min-width: 104px; box-shadow: 1px 0 0 var(--border); }
tfoot td.sticky-1, tfoot td.sticky-2 { z-index: 3; }
.table-link { font-weight: 650; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.table-compact th, .table-compact td { padding: 9px var(--s4); }

/* Dropzone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; cursor: pointer;
  padding: var(--s6) var(--s5); border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
  transition: border-color .12s, background-color .12s;
}
.dropzone:hover, .dropzone.dragover, .dropzone:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--link); display: grid; place-items: center; }
.dropzone strong { font-size: 15px; }
.dropzone .file-name { font-weight: 650; color: var(--link); font-family: var(--mono); font-size: 13px; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.no-js-file { display: none; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.radio-card .box { display: flex; gap: var(--s3); padding: var(--s4); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); height: 100%; }
.radio-card input:checked + .box { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); background: var(--brand-soft); }
.radio-card input:focus-visible + .box { outline: 2px solid var(--brand); outline-offset: 2px; }
.radio-card .box .icon { color: var(--link); margin-top: 2px; }
.radio-card strong { display: block; font-size: 14px; }
.radio-card span.desc { font-size: 13px; color: var(--muted); }
.template-links { display: flex; gap: var(--s3); flex-wrap: wrap; }
.error-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.error-list li { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--border); font-size: 14px; }
.error-list li:last-child { border-bottom: 0; }
.error-list .icon { color: var(--danger); margin-top: 2px; }

/* Integrity */
.status-card { display: flex; gap: var(--s4); align-items: center; padding: var(--s5); }
.status-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.status-ok .status-icon { background: var(--success-bg); color: var(--success); }
.status-bad .status-icon { background: var(--danger-bg); color: var(--danger); }
.status-card h2 { font-size: 18px; }
.hash-field { display: flex; gap: var(--s2); }
.hash-field input { font-family: var(--mono); font-size: 13px; letter-spacing: .01em; background: var(--surface-2); }
.copy-btn { display: none; }
.js .copy-btn { display: inline-flex; }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; }
.inline-form { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { min-width: 200px; }

/* Voucher form */
.voucher-form { padding: var(--s5); background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.voucher-form h3 { margin-bottom: var(--s4); }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.brand-panel {
  position: relative; overflow: hidden; color: #fff; padding: var(--s7); display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 0% 0%, #4F46E5 0%, transparent 60%), linear-gradient(160deg, #1E1B6E 0%, #111437 100%);
}
.brand-panel::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 0 0 60px rgba(255, 255, 255, .03), 0 0 0 120px rgba(255, 255, 255, .02); }
.brand-panel > * { position: relative; z-index: 1; }
.brand-panel .brand { display: flex; align-items: center; gap: var(--s3); font-size: 20px; font-weight: 700; }
.brand-panel .brand img { width: 48px; height: 48px; padding: 5px; border-radius: 12px; background: #F3F8EF; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); flex: none; }
.brand-panel h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; max-width: 16ch; margin-bottom: var(--s4); }
.brand-panel .tagline { color: #C7CBF5; max-width: 44ch; font-size: 16px; }
.feature-list { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s4); }
.feature-list li { display: flex; gap: var(--s3); align-items: flex-start; color: #E0E2FB; font-size: 15px; }
.feature-list .icon { color: #A5ABFF; margin-top: 2px; }
.brand-panel .legal { font-size: 12px; color: #9096C8; }
.login-main { display: grid; place-items: center; padding: var(--s6) var(--s5); }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand-mobile { display: none; align-items: center; gap: var(--s3); font-weight: 700; font-size: 18px; margin-bottom: var(--s5); }
.login-card .brand-mobile img { width: 44px; height: 44px; padding: 4px; border-radius: 10px; background: #F3F8EF; border: 1px solid var(--border); flex: none; }
.login-card h1 { font-size: 26px; margin-bottom: var(--s2); }
.login-card .lead { color: var(--muted); margin-bottom: var(--s5); }
.login-card form { display: grid; gap: var(--s4); }
.login-card .banner { margin-bottom: var(--s4); }
.login-foot { margin-top: var(--s5); text-align: center; font-size: 13px; color: var(--muted); display: flex; gap: var(--s2); justify-content: center; align-items: center; }
@media (max-width: 880px) {
  .login-page { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .login-card .brand-mobile { display: flex; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .topbar, .submit-bar, .page-actions { display: none !important; } .app { display: block; } .card { box-shadow: none; } }
.page-actions.center { justify-content: center; }
.amounts .dash { height: 40px; display: flex; align-items: center; color: var(--muted); }
.total-row { margin-top: var(--s5); grid-template-columns: minmax(230px, 360px); }
.doc-cols { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); margin-bottom: var(--s5); }
@media (max-width: 1100px) { .doc-cols { grid-template-columns: minmax(0, 1fr); } }
.kv-row dd.big, .big { font-size: 20px; font-weight: 700; }
.form-actions-row { margin-top: var(--s5); display: flex; justify-content: flex-end; }
.banner.inset { margin: var(--s5); }
.banner .banner-body strong { display: inline; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 var(--s5); min-width: 0; }
fieldset.plain legend { padding: 0; margin-bottom: var(--s3); }
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.tight { margin: var(--s1) 0 0; }
.hash-block { border-top: 1px solid var(--border); }
.import-file { margin-top: var(--s2); }
.alert .badge-danger { background: var(--surface); border: 1px solid var(--danger-border); }
.alert .badge-warning { background: var(--surface); border: 1px solid var(--warning-border); }
.alert .badge-info { background: var(--surface); border: 1px solid var(--info-border); }
th:first-child, td:first-child { padding-left: var(--s5); }
th:last-child, td:last-child { padding-right: var(--s5); }
.cols + p { margin-top: var(--s5); }
