:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f9faf8;
  --border: #e2e4de;
  --border-strong: #c9ccc4;
  --text: #1c1f1a;
  --muted: #6b7066;
  --accent: #0f2641;
  --accent-hover: #0a1b30;
  --accent-soft: #e7ecf4;
  --brand-red: #e3061b;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a5b00;
  --warn-soft: #fff4dc;
  --ok: #1f6f3a;
  --ok-soft: #e4f4e8;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 24, 18, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; margin-top: 8px; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.pad { padding: 14px 16px; margin: 0; }

/* ---------- Barra superior ---------- */
.topbar { background: #16201d; color: #e9ece6; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; height: 54px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-weight: 650; font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border-radius: 4px; background: linear-gradient(135deg, #3fb5a6 0 50%, #0f5e57 50% 100%); flex: none; }
.brand-lg { font-size: 18px; color: var(--text); justify-content: center; margin-bottom: 20px; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { color: #b9c1b8; padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }
.mainnav a.active { color: #fff; background: rgba(255, 255, 255, .1); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.bell { position: relative; color: #b9c1b8; display: flex; padding: 6px; border-radius: 6px; }
.bell:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.bell.has-alerts { color: #ffcf70; }
.bell-count { position: absolute; top: -2px; right: -4px; background: #e5484d; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; }
.usermenu { position: relative; }
.usermenu summary { cursor: pointer; list-style: none; color: #dfe4dd; padding: 6px 8px; border-radius: 6px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary::after { content: " ▾"; color: #8a938a; }
.usermenu-pop { position: absolute; right: 0; top: 38px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); min-width: 160px; padding: 6px; }
.usermenu-pop a, .usermenu-pop .linklike { display: block; width: 100%; text-align: left; padding: 8px 10px; color: var(--text); border-radius: 6px; font: inherit; }
.usermenu-pop a:hover, .usermenu-pop .linklike:hover { background: var(--surface-2); text-decoration: none; }
.linklike { background: none; border: 0; cursor: pointer; }
.nav-toggle { display: none; background: none; border: 0; color: #dfe4dd; font-size: 20px; cursor: pointer; }

/* ---------- Contenido ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 .muted { font-weight: 500; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { display: inline-block; font-size: 13px; margin-bottom: 4px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-flush > .card-head { margin: 0; border-bottom: 1px solid var(--border); }
.card > h2 { margin-bottom: 10px; }
.card ul { padding-left: 20px; }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card[open] > summary { margin-bottom: 12px; }

/* ---------- Mensajes ---------- */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: var(--ok-soft); border-color: #b9e0c3; color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: #f5c2bd; color: var(--danger); }
.flash-info { background: var(--accent-soft); border-color: #bcdcd7; color: var(--accent); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Formularios ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 38, 65, .22); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: 6px; background: var(--surface-2); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1 / -1; }
.readonly-value { padding: 7px 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 7px; font-family: var(--mono); font-weight: 600; }
.form-actions { display: flex; gap: 8px; align-items: center; }
.align-end { align-self: end; }
.checks { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { margin-top: 3px; }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.inline.wrap { flex-wrap: wrap; }
.inline > select, .inline > input:not([type=checkbox]):not([type=radio]) { width: auto; }
label.field .inline > select { flex: 1; width: 100%; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.w-xs { width: 72px; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table th.right { text-align: right; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot th { border-top: 1px solid var(--border-strong); border-bottom: 0; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 13px; }
.table td.right { font-variant-numeric: tabular-nums; }
.table-hover tbody tr:hover { background: var(--surface-2); }
.rowlink { cursor: pointer; }
tr.inactive td { color: var(--muted); }
tr.edit-row > td { background: var(--surface-2); padding: 16px; }
tr.row-warn td { background: var(--warn-soft); }
tr.row-header td { background: var(--accent-soft); font-weight: 600; }
.table-raw td { font-size: 12px; white-space: nowrap; }
.templates-table td { vertical-align: middle; }

/* ---------- Distintivos ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eceee9; color: #4a4f46; white-space: nowrap; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-planificacion { background: #eceee9; color: #4a4f46; }
.status-produccion { background: #efe9fb; color: #5b3aa6; }
.status-transito { background: #e4eefc; color: #1d4f9b; }
.status-aduana { background: var(--warn-soft); color: var(--warn); }
.status-nacionalizada { background: var(--accent-soft); color: var(--accent); }
.status-cerrada { background: var(--ok-soft); color: var(--ok); }
.status-cancelada { background: var(--danger-soft); color: var(--danger); }
select.status-select { width: auto; font-weight: 600; border-radius: 999px; padding: 6px 12px; }
.progress { display: inline-block; vertical-align: middle; width: 64px; height: 6px; border-radius: 3px; background: #e6e8e3; overflow: hidden; margin-right: 6px; }
.progress span { display: block; height: 100%; background: var(--accent); }

/* ---------- Tablero ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.kpi:hover { border-color: var(--border-strong); text-decoration: none; }
.kpi-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-danger .kpi-value { color: var(--danger); }
.kpi-warn .kpi-value { color: var(--warn); }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; }
.segmented a { padding: 6px 12px; color: var(--text); }
.segmented a.active { background: var(--accent); color: #fff; }
.segmented a:hover { text-decoration: none; }

/* ---------- Detalle de importación ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.summary-grid dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.summary-grid dd { margin: 2px 0 0; }
.notes { background: var(--surface-2); border-radius: 6px; padding: 10px 12px; margin: 14px 0 0; }
.summary .muted.small { margin: 12px 0 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-strong); margin: 22px 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-weight: 500; font-size: 12px; background: #eceee9; border-radius: 999px; padding: 1px 7px; margin-left: 4px; color: var(--muted); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-actions { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.push-right { margin-left: auto; }

.tasklist { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: 32px 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); align-items: start; }
.task:last-child { border-bottom: 0; }
.task-check button.checkbox { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--border-strong); background: var(--surface); cursor: pointer; margin-top: 1px; padding: 0; display: grid; place-items: center; }
.task-check button.checkbox:hover { border-color: var(--accent); }
.task-check button.checkbox.on { background: var(--accent); border-color: var(--accent); }
.task-check button.checkbox.on::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.task-title { font-weight: 550; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin-top: 2px; align-items: center; }
.task-edit { grid-column: 1 / -1; background: var(--surface-2); border-radius: 6px; padding: 14px; margin-top: 8px; }

.danger-zone { margin-top: 32px; color: var(--muted); }
.danger-zone summary { cursor: pointer; font-size: 13px; }
.danger-zone form { margin-top: 10px; padding: 14px; border: 1px solid #f5c2bd; border-radius: var(--radius); background: var(--danger-soft); color: var(--text); }

.empty { text-align: center; padding: 60px 20px; }
.empty p { color: var(--muted); }

/* ---------- Login / instalación ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 30% 20%, #e7ecf4, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; box-shadow: 0 10px 30px rgba(20, 24, 18, .08); }
.auth-card h1 { margin-bottom: 8px; }
.auth-card .lead { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3, .span-4 { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; margin-left: auto; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .mainnav { display: none; order: 3; flex-basis: 100%; flex-direction: column; }
  .mainnav.open { display: flex; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: 1 / -1; }
  .task { grid-template-columns: 28px 1fr; }
  .task-actions { grid-column: 2; }
  .push-right { margin-left: 0; }
}

/* ---------- Menú Maestros ---------- */
.navmenu { position: relative; }
.navmenu summary { list-style: none; cursor: pointer; color: #b9c1b8; padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.navmenu summary::-webkit-details-marker { display: none; }
.navmenu summary::after { content: " ▾"; color: #8a938a; }
.navmenu summary:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.navmenu summary.active { color: #fff; background: rgba(255, 255, 255, .1); }
.navmenu-pop { position: absolute; left: 0; top: 38px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); min-width: 220px; padding: 6px; z-index: 30; }
.navmenu-pop a { display: block; padding: 8px 10px; color: var(--text); border-radius: 6px; font-weight: 500; }
.navmenu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.navmenu-pop a.active { color: var(--accent); background: var(--accent-soft); }

/* ---------- Vista de precios USD / ARS ---------- */
.priceview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.priceview select { width: auto; }
.rate-note { font-size: 12.5px; color: var(--muted); }
.money-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-note { font-size: 12px; color: var(--muted); }
.pct-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pct-grid .pct { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; }
.pct-grid .pct b { display: block; font-size: 16px; }
.pct-grid .pct span { font-size: 12px; color: var(--muted); }
.status-create { background: var(--ok-soft); color: var(--ok); }
.status-update { background: #e4eefc; color: #1d4f9b; }
.status-skip { background: #eceee9; color: #4a4f46; }
.incomplete { color: var(--warn); font-weight: 600; }
@media (max-width: 760px) {
  .navmenu-pop { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 12px; }
  .navmenu-pop a { color: #b9c1b8; }
  .pct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.segmented button { padding: 6px 12px; border: 0; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--border-strong); }
.segmented button.active { background: var(--accent); color: #fff; }

/* El menú Maestros está dentro de .mainnav: sus opciones no deben heredar el hover blanco de la barra */
.mainnav .navmenu-pop a { color: var(--text); background: transparent; }
.mainnav .navmenu-pop a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.mainnav .navmenu-pop a.active,
.mainnav .navmenu-pop a.active:hover { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 760px) {
  .mainnav .navmenu-pop a { color: #b9c1b8; }
  .mainnav .navmenu-pop a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
  .mainnav .navmenu-pop a.active, .mainnav .navmenu-pop a.active:hover { color: #fff; background: rgba(255, 255, 255, .1); }
}


/* =========================================================
   Marca Nexus Comex: barra superior clara con el logo
   ========================================================= */
.topbar { background: #fff; color: var(--accent); border-bottom: 1px solid var(--border); box-shadow: 0 1px 3px rgba(15, 38, 65, .06); }
.brand { color: var(--accent); font-weight: 700; letter-spacing: -.01em; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-lg { flex-direction: column; gap: 8px; }
.brand-lg .brand-logo-full { width: 190px; height: auto; }
.mainnav a, .navmenu summary { color: #46506a; }
.mainnav a:hover, .navmenu summary:hover { color: var(--accent); background: #f1f3f7; }
.mainnav a.active, .navmenu summary.active { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--brand-red); }
.navmenu summary::after, .usermenu summary::after { color: #8a93a6; }
.bell { color: #46506a; }
.bell:hover { color: var(--accent); background: #f1f3f7; }
.bell.has-alerts { color: var(--brand-red); }
.bell-count { background: var(--brand-red); }
.usermenu summary { color: var(--accent); }
.usermenu summary:hover { background: #f1f3f7; }
.nav-toggle { color: var(--accent); }
@media (max-width: 760px) {
  .mainnav .navmenu-pop a { color: #46506a; }
  .mainnav .navmenu-pop a:hover { color: var(--accent); background: #f1f3f7; }
  .mainnav .navmenu-pop a.active, .mainnav .navmenu-pop a.active:hover { color: var(--accent); background: var(--accent-soft); }
  .brand-logo { height: 30px; }
}

/* ---------- Tipos de documento ---------- */
.doc-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.color-input { width: 44px; height: 36px; padding: 2px; cursor: pointer; }
.cost-toggle { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); white-space: nowrap; }
.cost-toggle.on { background: var(--ok-soft); border-color: #b9e0c3; color: var(--ok); }
.doc-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.doc-legend a { text-decoration: none; opacity: .55; }
.doc-legend a.on, .doc-legend a:hover { opacity: 1; }
.doc-legend .count { font-weight: 500; opacity: .85; margin-left: 2px; }
tr.doc-row td:first-child { border-left: 4px solid var(--row-color, transparent); }
.grow-input { flex: 1 1 280px; width: auto !important; }

/* ---------- Costeo ---------- */
.w-sm { width: 110px; }
.group-row td { background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; padding: 6px 12px; }
.mode-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.result-card { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; }
.result-card .big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-card .sub { color: var(--muted); font-size: 12.5px; }
.qline input, .qline select { padding: 4px 6px; font-size: 13px; }
.qline .w-num { width: 96px; }
.tax-col { color: #7c3aed; }
.table tr.subtotal td { font-weight: 700; background: var(--surface-2); }
@media (max-width: 760px) { .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.w-md { width: 220px; }
.segmented-radio label { padding: 6px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented-radio label + label { border-left: 1px solid var(--border-strong); }
.segmented-radio label.active { background: var(--accent); color: #fff; }
.segmented-radio input { display: none; }
.detail-matrix { margin-top: 14px; }
.detail-matrix summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.add-line { border-top: 1px solid var(--border); margin-top: 8px; }
.qline td { vertical-align: middle; }
.qline select { max-width: 190px; }
.cost-toggle.on-ext { background: #e4eefc; border-color: #b8cff3; color: #1d4f9b; }
.share-list { list-style: none; padding: 0; margin: 0 0 12px; }
.share-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border); }
.share-list li form { margin-left: auto; }
.ext-banner { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.checkbox.readonly { display: inline-grid; width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--border); place-items: center; }
.checkbox.readonly.on { background: var(--muted); border-color: var(--muted); }

/* Costo real e importes de documentos */
.alert { padding: 8px 12px; border-radius: var(--radius); margin: 8px 0; border: 1px solid; }
.alert-warn { background: var(--warn-soft); border-color: #f1d9a6; color: var(--warn); }
.alert-info { background: var(--accent-soft); border-color: #c9d4e4; color: var(--accent); }
.card-flush .alert { margin: 8px 16px; }
.neg { color: var(--danger); font-weight: 600; }
.pos { color: var(--ok); font-weight: 600; }
.warn-link { color: var(--warn); font-weight: 600; }
.span-all { grid-column: 1 / -1; margin: 0; }
.center { text-align: center; }
.total-row td { border-top: 2px solid var(--line, #d9dee5); }
.table-edit input, .table-edit select { min-width: 0; padding: 5px 7px; font-size: 13px; }
.table-edit td:first-child input { min-width: 180px; }
.table-edit input.num { text-align: right; width: 110px; }
.table-edit input.narrow { width: 80px; }
.row-ai td { background: #f6f3ff; }
.badge-ai { background: #ece6ff; color: #5b3fc4; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 10px 0; border-bottom: 1px solid var(--line, #e6e8ec); }
.news-list li:last-child { border-bottom: 0; }
.news-list li.unread { border-left: 3px solid var(--accent); padding-left: 10px; }
.w-check { width: 28px; }
.bulk-bar { border-bottom: 1px solid var(--line, #e6e8ec); gap: 8px; }
.bulk-bar select { width: auto; }
/* Certificados */
.cert-ok { background: var(--ok-soft); color: var(--ok); }
.cert-soon { background: var(--warn-soft); color: var(--warn); }
.cert-expired { background: var(--danger-soft); color: var(--danger); }
.cert-none, .cert-off { background: #eceee9; color: #4a4f46; }
.public-link { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.public-link-text { flex: 1 1 360px; min-width: 0; }
.public-link-text h2 { margin-top: 0; }
.copy-input { flex: 1 1 280px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.qr-box { width: 180px; text-align: center; }
.qr-box #qr svg { width: 160px; height: 160px; display: block; margin: 0 auto 8px; }
.inline.center { justify-content: center; }
.public-link .copy-input { width: 100%; max-width: 460px; min-width: 0; }
.trial-bar { background: var(--warn-soft); color: var(--warn); font-size: 13px; padding: 6px 0; border-bottom: 1px solid #f1d9a6; }
.trial-bar .muted { color: var(--warn); opacity: .8; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.status-anulada { background: #eceee9; color: #6b7066; text-decoration: line-through; }
.annulled-banner { background: #eceee9; border: 1px solid #d5d8d0; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
