/*
 * Fucktura · tema claro estilo panel (referencia: Cloudflare) sobre Tabler 1.0
 * (Bootstrap 5). Tipografía Inter local (Nunito Black solo en el wordmark).
 * Movimiento sutil que se apaga con prefers-reduced-motion.
 *
 * Paleta de la marca (logo): rosa #FF0560 + negro. El rosa puro (3,9:1 sobre
 * blanco) es identidad: logo, menú activo, gráficos, foco. Botones con texto
 * blanco usan --brand-strong (4,7:1, AA) y los textos/links --brand-text.
 */
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 900; src: url('../assets/fonts/nunito-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('../assets/fonts/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('../assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --brand: #FF0560; --brand-strong: #E6004F; --brand-hover: #C70045; --brand-text: #D9004B; --brand-soft: #FFF0F5;
  --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --ink: #1c1c1e; --ink-2: #3f3f46; --muted: #71717a; --line: #e4e4e7; --line-2: #f0f0f2; --canvas: #fafafa; --panel: #ffffff;
  --radius: 8px; --ease: cubic-bezier(.2, .8, .2, 1);
  --tblr-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tblr-body-font-size: .875rem; --tblr-body-color: var(--ink); --tblr-body-bg: var(--canvas);
  --tblr-primary: var(--brand-strong); --tblr-primary-rgb: 230, 0, 79; --tblr-border-color: var(--line); --tblr-border-radius: var(--radius);
  --tblr-link-color: var(--brand-text); --tblr-link-color-rgb: 217, 0, 75; --tblr-link-hover-color: var(--brand-hover);
  --bs-primary: var(--brand-strong); --bs-primary-rgb: 230, 0, 79;
}
body { background: var(--canvas); color: var(--ink); font-family: var(--tblr-font-sans-serif); font-feature-settings: 'cv11', 'tnum' 0; -webkit-font-smoothing: antialiased; }
a { text-underline-offset: 2px; }
.muted, .text-secondary { color: var(--muted) !important; }
.small { font-size: .8rem; }
h1 { font-size: 1.45rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 1rem; }
h2 { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }

/* ---------- Menú lateral ---------- */
.sidebar.navbar-vertical { background: var(--panel); border-right: 1px solid var(--line); box-shadow: none; }
@media (min-width: 992px) { .sidebar.navbar-vertical { width: 15rem; } .sidebar.navbar-vertical ~ .page-wrapper { margin-left: 15rem; } }
.sidebar .container-fluid { padding: 0 .75rem; align-items: stretch; }
.sidebar.navbar-vertical .navbar-brand { justify-content: flex-start; }
.sidebar.navbar-vertical .navbar-collapse { align-items: stretch; }
.sidebar-switchers form { min-width: 0; }
.sidebar-brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.05rem; color: var(--ink) !important; padding: 1rem .75rem .75rem !important; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: .5rem; line-height: 1; }
.brand-word { font-family: 'Nunito', 'Inter', system-ui, sans-serif; font-weight: 900; font-size: 2.35rem; letter-spacing: -.01em; color: var(--ink); }
.brand-word-a { color: var(--brand); }
.sidebar-switchers { display: grid; gap: .6rem; padding: .25rem .5rem .9rem; border-bottom: 1px solid var(--line-2); margin-bottom: .5rem; }
.switcher-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .2rem; font-weight: 600; }
.sidebar-switchers .form-select { font-weight: 600; background-color: var(--canvas); }
.sidebar-company { font-weight: 600; font-size: .85rem; padding: .25rem; } .sidebar-company span { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.sidebar-nav { padding-bottom: 1rem; gap: 1px; }
.sidebar-nav .nav-group { font-size: .72rem; color: var(--muted); font-weight: 600; padding: .9rem .6rem .3rem; text-transform: none; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .6rem; padding: .42rem .6rem !important; border-radius: 6px; color: var(--ink-2); font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease); }
.sidebar-nav .nav-link .icon { color: var(--muted); flex: 0 0 auto; transition: color .15s var(--ease), transform .2s var(--ease); }
.sidebar-nav .nav-link:hover { background: var(--line-2); color: var(--ink); }
.sidebar-nav .nav-link:hover .icon { transform: translateX(1px); color: var(--ink-2); }
.sidebar-nav .nav-link.active { background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-nav .nav-link.active .icon { color: var(--brand); }
@media (max-width: 991.98px) {
  .sidebar.navbar-vertical { position: sticky; top: 0; z-index: 1030; }
  .sidebar .container-fluid { flex-wrap: wrap; align-items: center; }
  .sidebar-brand { padding: .7rem .25rem; }
}

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.5rem; background: rgba(250, 250, 250, .85); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-search { display: flex; align-items: center; gap: .5rem; width: min(360px, 100%); padding: .4rem .65rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); font-size: .85rem; transition: border-color .15s, box-shadow .15s; }
.topbar-search:hover { border-color: #c7c7cc; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.topbar-search kbd { margin-left: auto; background: var(--line-2); color: var(--muted); border: 0; box-shadow: none; font-size: .7rem; padding: .1rem .35rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.topbar-user { display: flex; align-items: center; gap: .5rem; border: 0; background: none; color: var(--ink-2); font-weight: 500; padding: .25rem .4rem; border-radius: 6px; }
.topbar-user:hover { background: var(--line-2); }
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: #e0e7ff; color: #3730a3; font-size: .75rem; font-weight: 700; }
.badge-env { background: #fef3c7; color: #92400e; font-weight: 600; } .badge-env.prod { background: #dcfce7; color: #166534; }
@media (max-width: 991.98px) { .topbar { display: none; } }

/* ---------- Página ---------- */
.page-body { margin: 0; padding: 1.75rem 0 3rem; }
.page-body > .container-xl { max-width: 1240px; padding-left: 1.5rem; padding-right: 1.5rem; }
@media (max-width: 600px) { .page-body > .container-xl { padding-left: 1rem; padding-right: 1rem; } }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.page-subtitle { margin: .3rem 0 0; color: var(--muted); }
.page-head .head-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-sub { margin: -.75rem 0 1.25rem; }
.min-w-0 { min-width: 0; }

/* ---------- Tarjetas ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; background: var(--panel); margin-bottom: 1.25rem; }
.card.panel > .card-header { background: var(--canvas); border-bottom: 1px solid var(--line); padding: .7rem 1rem; min-height: 0; border-radius: var(--radius) var(--radius) 0 0; }
.card.panel > .card-header .card-title { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin: 0; }
.card.panel > .card-header .card-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.card-flush > .table-wrap, .card-flush > .table-responsive { margin: 0; }
.card-flush .table { margin: 0; }
.card-flush .table > :not(caption) > * > *:first-child { padding-left: 1rem; }
.card-flush .table > :not(caption) > * > *:last-child { padding-right: 1rem; }
.card-flush .table tbody tr:last-child > * { border-bottom: 0; }
.card-flush .table td.empty { padding: 1.25rem 1rem; color: var(--muted); white-space: nowrap; }
.card-footer-note { padding: .65rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

/* Indicadores */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.25rem; }
.stat-grid > .card { margin: 0; }
.stat { overflow: hidden; display: flex; flex-direction: column; }
.stat .card-body { padding: .9rem 1rem .5rem; }
.stat-label { color: var(--muted); font-size: .8rem; } .stat-label a { color: inherit; }
.stat-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.stat-delta { display: inline-flex; align-items: center; gap: 1px; font-size: .78rem; font-weight: 600; letter-spacing: 0; }
.stat-delta.up { color: var(--ok); } .stat-delta.down { color: var(--bad); }
.stat-hint { color: var(--muted); font-size: .78rem; margin-top: .15rem; }
.stat-spark { margin-top: auto; height: 46px; }
.stat-bad .stat-value { color: var(--bad); }

/* Lista con barra proporcional */
.bar-list { list-style: none; margin: 0; padding: .25rem 0; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 38%) auto; gap: .9rem; align-items: center; padding: .45rem 1rem; }
.bar-list li.muted { display: block; }
.bar-list li + li { border-top: 1px solid var(--line-2); }
.bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-hint { color: var(--muted); font-size: .75rem; margin-left: .4rem; }
.bar-track { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--w); background: var(--brand); border-radius: 99px; transform-origin: left; animation: grow .8s var(--ease) both; }
.bar-value { font-variant-numeric: tabular-nums; text-align: right; min-width: 70px; }

/* Alertas de Inicio */
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: flex; gap: .65rem; align-items: flex-start; padding: .65rem 1rem; }
.alert-list li + li { border-top: 1px solid var(--line-2); }
.alert-list .icon { flex: 0 0 auto; margin-top: 1px; }
.alert-list .bad .icon { color: var(--bad); } .alert-list .warn .icon { color: var(--warn); }
.alert-list a { color: var(--ink); text-decoration: none; } .alert-list a:hover { text-decoration: underline; }

/* ---------- Barra de filtros ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-bar > .field { flex: 1 1 140px; min-width: 0; }
.filter-bar > .field.wide { flex-basis: 240px; }
.filter-bar > .filter-actions { display: flex; gap: .5rem; flex: 0 0 auto; }
.filter-bar .form-label { font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- Formularios y botones ---------- */
.btn { border-radius: 6px; font-weight: 500; transition: transform .12s var(--ease), box-shadow .15s var(--ease), background-color .15s, border-color .15s, color .15s; }
.btn:hover { box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-primary { --tblr-btn-bg: var(--brand-strong); --tblr-btn-border-color: var(--brand-strong); --tblr-btn-hover-bg: var(--brand-hover); --tblr-btn-hover-border-color: var(--brand-hover); --tblr-btn-active-bg: var(--brand-hover); --bs-btn-bg: var(--brand-strong); --bs-btn-border-color: var(--brand-strong); --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover); --bs-btn-active-bg: var(--brand-hover); }
/* En tablas y listas los links van en negro (una grilla rosa cansa) y toman el rosa al pasar. */
.table a:not(.btn):not(.badge), .bar-list a, .alert-list a { color: var(--ink); font-weight: 500; text-decoration: none; }
.table a:not(.btn):not(.badge):hover, .bar-list a:hover, .alert-list a:hover { color: var(--brand-text); text-decoration: underline; }
.form-check-input:checked { background-color: var(--brand-strong); border-color: var(--brand-strong); }
.btn-outline-secondary { --tblr-btn-color: var(--ink-2); --tblr-btn-border-color: var(--line); --tblr-btn-hover-bg: var(--line-2); --tblr-btn-hover-color: var(--ink); --tblr-btn-hover-border-color: #d4d4d8; background: var(--panel); }
.form-control, .form-select { border-color: var(--line); border-radius: 6px; transition: border-color .15s, box-shadow .15s; }
.form-control:focus, .form-select:focus { border-color: #ff8ab3; box-shadow: 0 0 0 3px rgba(255, 5, 96, .12); }
.form-label { font-weight: 500; color: var(--ink-2); }
.table thead th { background: var(--canvas); color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.table > :not(caption) > * > * { padding: .6rem .75rem; border-color: var(--line-2); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover > * { background: #fcfcfd; }
.flash { border-radius: var(--radius); }

/* ---------- Paleta Ctrl+K ---------- */
.modal-dialog-top { margin-top: 12vh; max-width: 560px; }
.palette { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.palette-input { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { border: 0; outline: 0; flex: 1; font-size: 1rem; color: var(--ink); background: none; }
.palette-list { list-style: none; margin: 0; padding: .35rem; max-height: 50vh; overflow: auto; }
.palette-list li { padding: .55rem .7rem; border-radius: 6px; cursor: pointer; }
.palette-list li:hover { background: var(--line-2); }
.palette-list li.sel { background: var(--brand-soft); color: var(--brand-strong); }

/* ---------- Movimiento ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.page-body .card, .page-body .page-head { animation: rise .45s var(--ease) both; }
.page-body .stat-grid > .card:nth-child(2) { animation-delay: .05s; } .page-body .stat-grid > .card:nth-child(3) { animation-delay: .1s; } .page-body .stat-grid > .card:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Rejillas de paneles y de campos (CSS grid; Bootstrap .row queda para su propio uso). */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid > *, .fields > *, .field { min-width: 0; }
.fields .field { margin-bottom: 0 !important; }
.fields .mb-3 { margin-bottom: 0 !important; }
form.fields { margin-bottom: 0; }
.field .form-label { font-size: .78rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
/* Campos lado a lado alineados: rótulo, control y ayuda de cada campo van
   en las mismas filas que los de la columna vecina (subgrid). Si un rótulo
   ocupa dos líneas y el de al lado una, los controles quedan a la misma
   altura igual. */
@supports (grid-template-rows: subgrid) {
  .fields > .field:not(.full-row) { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
  .fields > .field:not(.full-row) > .form-label { align-self: end; }
}

/* Tablas: números a la derecha, tabulares. */
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.items-table input, .items-table select { padding: 4px 8px; }

/* Estados de comprobante / venta. */
.badge-issued { background: #dcfce7; color: #166534; }
.badge-rejected, .badge-failed { background: #fee2e2; color: #991b1b; }
.badge-draft { background: #e0e7ff; color: #3730a3; }
.badge-issuing { background: #fef3c7; color: #92400e; }
.badge-status { background: #e5e7eb; color: #374151; }

.kpi { font-size: 1.8rem; font-weight: 700; }
.totals { text-align: right; font-size: 1rem; }
.totals strong { font-size: 1.2rem; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
dl.kv dd { margin: 0; }
code { background: #f1f3f6; padding: 1px 5px; border-radius: 4px; font-size: .8rem; color: inherit; }
[hidden] { display: none !important; }

.tabs .nav-link { padding: 5px 12px; color: inherit; }
/* Pestañas de página (Sistema, Configuración): en celular, una sola fila que se desliza. */
.page-tabs { gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.page-tabs .nav-link { padding: 6px 12px; color: var(--ink-2); font-weight: 500; white-space: nowrap; border-radius: 6px; }
.page-tabs .nav-link:hover { background: var(--line-2); color: var(--ink); }
.page-tabs .nav-link.active { background: var(--brand-soft); color: var(--brand-text); }
[data-pane][hidden] { display: none !important; }
.tabs .nav-link.active .badge { background: rgba(255,255,255,.25) !important; color: #fff; }
.tabs form .form-control { width: 260px; }
.bulk-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 10px; margin-top: 10px; background: #f1f3f6; border-radius: 8px; }
.bulk-bar label { display: flex; gap: 6px; align-items: center; margin: 0; }
.bulk-bar select { width: auto; }
.bulk-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Autocompletado (clientes, productos). */
.suggest-wrap { position: relative; }
.suggest { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 260px; overflow: auto; }
.suggest div { padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.suggest div:hover { background: #eef3fb; }

@media (max-width: 600px) {
  .page-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -1rem 1rem; padding: 0 1rem 8px; }
  .page-tabs::-webkit-scrollbar { display: none; }
  /* Formas de pago: cada medio es una tarjetita (orden + nombre arriba; activa, comisión y recargo abajo). */
  .pm-table thead { display: none; }
  .pm-table tr { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .pm-table td { display: block; width: auto !important; padding: 0 !important; border: 0 !important; }
  .pm-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
  .pm-table td:nth-child(2) { grid-column: 2 / 4; }
  .pm-table td:nth-child(3) { grid-row: 2; grid-column: 2; }
  .pm-table td:nth-child(4) { grid-row: 2; grid-column: 3; }
  .pm-table td:nth-child(5) { grid-row: 2; grid-column: 1; }
  .fields { grid-template-columns: 1fr; }
  .fields > .field:not(.full-row) { grid-row: auto; display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tabs form, .tabs form .form-control { width: 100%; }
  .filter-bar > .filter-actions { flex: 1 1 100%; }
  .bulk-bar { flex-direction: column; align-items: stretch; }
  .bulk-bar label { flex-wrap: wrap; }
  .bulk-bar select { width: 100%; }
  .bulk-group { flex-direction: column; align-items: stretch; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dd { margin-bottom: 8px; }
  .card { overflow-x: auto; }
}
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: .25rem .45rem; }
.fields > .full-row { grid-column: 1 / -1; }
.grid-2-wide { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 991.98px) { .grid-2-wide { grid-template-columns: 1fr; } }
.flex-fill { flex: 1 1 auto; }

/* Pantallas sin sesión (ingresar, recuperar, contraseña temporal) */
body.guest { background: var(--canvas); min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 32px; }
.guest-box { width: 100%; max-width: 420px; }
.guest-brand { display: flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; font-size: 1.05rem; margin-bottom: 1.25rem; }
.guest .card { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04); }

/* Política de contraseña: se tilda en vivo */
.password-rules { list-style: none; padding: 0; margin: -.35rem 0 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .75rem; font-size: .8rem; color: var(--muted); }
.password-rules li::before { content: "○"; display: inline-block; width: 1.1em; }
.password-rules li.ok { color: #15803d; }
.password-rules li.ok::before { content: "✓"; }

/* Retenciones de un cobro: una fila por certificado */
.withholdings { border: 1px dashed var(--line); border-radius: var(--radius); padding: .75rem; margin-bottom: 1rem; background: var(--canvas); }
.withholding-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem .75rem; align-items: end; padding: .6rem 0; border-top: 1px solid var(--line-2); }
.withholding-row:first-child { border-top: 0; }
.withholding-row .field-wide { grid-column: span 2; }
.withholding-row .field-remove .btn { padding-inline: .5rem; }
.withholding-row [hidden] { display: none !important; }
.withholding-hint { grid-column: 1 / -1; }
/* En escritorio, columnas fijas: los datos quedan alineados entre filas aunque cambie el tipo. */
@media (min-width: 1200px) {
  .withholding-row { grid-template-columns: 1.35fr 1.25fr 1.45fr 1.1fr 1fr .7fr 1fr auto; }
  .withholding-row [data-jurisdiction][hidden] { display: block !important; visibility: hidden; }
  .withholding-row .field-wide { grid-column: 1 / span 3; }
}
@media (max-width: 600px) { .withholding-row .field-wide { grid-column: 1 / -1; } }
.withholding-balance { font-weight: 500; }
.withholding-balance.short { color: var(--warn); }
.withholding-balance.over { color: var(--brand-text); }
.withholding-balance.exact { color: var(--ok); }

/* Logo alternativo (Sistema → Logo): misma altura que el wordmark, nunca más ancho que el menú. */
.brand-logo { height: 40px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.guest-brand .brand-logo { margin: 0 auto; height: 48px; }
