/* Módulo Gastos y cuentas por pagar (gastos.js). */
.gx-actions { flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.gx-date { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.gx-date input { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font: inherit; }
.gx-tabs { display: flex; gap: 6px; margin: 4px 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; width: max-content; max-width: 100%; overflow-x: auto; }
.gx-tab { padding: 8px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 13px/1.2 inherit; cursor: pointer; white-space: nowrap; }
.gx-tab.active { background: var(--blue-soft); color: var(--blue); }
.gx-loading { padding: 24px; color: var(--muted); }
.gx-metrics { margin-bottom: 16px; }
.gx-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.gx-grid-even { grid-template-columns: 1fr 1fr; }
.gx-side { display: grid; gap: 16px; }
.gx-card { padding-bottom: 12px; }
.gx-bars { display: grid; gap: 10px; padding: 4px 18px 8px; }
.gx-bar { display: grid; grid-template-columns: minmax(120px, 190px) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.gx-bar-label small { color: var(--muted); }
.gx-bar-track { height: 10px; border-radius: 99px; background: var(--blue-soft); overflow: hidden; }
.gx-bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #005aee, #01baef); }
.gx-bar b { font-variant-numeric: tabular-nums; }
.gx-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gx-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.gx-filters .field { min-width: 140px; margin: 0; }
.gx-search { flex: 1 1 220px; }
.gx-table tfoot td { border-top: 2px solid var(--line); background: #fafbfd; }
.gx-void { color: #a61b32; }
.gx-seg { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; }
.gx-seg button { padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 600 12.5px/1.2 inherit; cursor: pointer; }
.gx-seg button.active { background: var(--blue-soft); color: var(--blue); }
.gx-total { margin: 0 0 0 auto; color: var(--muted); }
.gx-inline { display: flex; gap: 8px; padding: 0 18px 12px; }
.gx-inline input { flex: 1; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.gx-small { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.gx-modal .modal-form { width: min(640px, calc(100vw - 32px)); }
.gx-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; align-items: start; }
.gx-form-grid .field { margin: 0; }
.gx-span { grid-column: 1 / -1; }
.gx-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.gx-check input { width: 16px; height: 16px; accent-color: var(--blue); }
.gx-pay-info { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--blue-soft); font-size: 13px; }
.gx-error { grid-column: 1 / -1; }
.pill.danger { background: #fff0f3; color: #a61b32; }
@media (max-width: 900px) {
  .gx-grid, .gx-grid-even { grid-template-columns: 1fr; }
  .gx-form-grid { grid-template-columns: 1fr; }
  .gx-bar { grid-template-columns: 1fr auto; }
  .gx-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .gx-actions .button { flex: 1 1 auto; }
}

/* v2: aprobación, cuentas por pagar agrupadas, caja, soportes, presupuestos */
.gx-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 99px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; }
.gx-alert { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; color: #78350f; font: inherit; text-align: left; cursor: pointer; }
.gx-hint { margin: 0 18px 12px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.gx-form-grid .gx-hint { margin: 0; }
.gx-bar.warn .gx-bar-track i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.gx-bar.over .gx-bar-track i { background: linear-gradient(90deg, #e11d48, #f43f5e); }
.gx-bar b small { color: var(--muted); font-weight: 500; }
.gx-clip { display: inline-flex; align-items: center; gap: 3px; min-width: 34px; height: 30px; padding: 0 8px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; }
.gx-clip.has { border-style: solid; border-color: #bfdbfe; background: var(--blue-soft); color: var(--blue); }
.gx-clip .icon { width: 15px; height: 15px; }
.gx-batch { color: var(--blue); }
.gx-subtotal td { background: #f8fafc; font-size: 12.5px; color: var(--muted); }
.gx-file input { padding: 8px 0; }
.gx-file small { color: var(--muted); }
.gx-supports { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.gx-supports li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.gx-supports a { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 600; text-decoration: none; }
.gx-supports small { color: var(--muted); }
.gx-pay-info ul { margin: 8px 0 0; padding-left: 18px; }
.gx-cash-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.gx-cash-bar .gx-hint { flex: 1 1 260px; margin: 0; }
.gx-cash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.gx-cash { display: grid; gap: 10px; padding: 16px; }
.gx-cash.closed { border-color: #bbf7d0; background: #f7fef9; }
.gx-cash header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gx-cash h3 { margin: 0; font-size: 15px; }
.gx-cash .pill .icon { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; }
.gx-cash dl { display: grid; gap: 6px; margin: 0; }
.gx-cash dl > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.gx-cash dt { color: var(--muted); }
.gx-cash dt small { font-size: 11px; }
.gx-cash dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.gx-cash .gx-cash-total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; }
.gx-cash .gx-cash-total dd { font-weight: 800; }
.gx-cash footer { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-cash-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.gx-in { color: #137a52; }
.gx-out { color: #a61b32; }
.gx-moves { display: grid; gap: 4px; max-height: 240px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.gx-moves li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; background: #f8fafc; font-size: 12.5px; }
.gx-diff { align-self: end; margin: 0; padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.gx-diff.ok { background: #ecfdf5; color: #137a52; }
.gx-diff.bad { background: #fff1f2; color: #a61b32; }
.gx-budget { display: flex; gap: 6px; }
.gx-budget input { width: 140px; min-height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.gx-threshold { margin-bottom: 16px; }
.gx-threshold .gx-inline input { max-width: 220px; }
.gx-form-grid > .gx-seg { width: max-content; max-width: 100%; }

/* v3: ventanas sin scroll, libro de movimientos (ingreso/egreso/saldo), fila rápida y edición en línea */
.modal.gx-modal { width: min(940px, calc(100vw - 32px)); max-height: 94vh; overflow-x: hidden; }
.gx-modal .modal-form { width: auto; }
.gx-modal .modal-body { gap: 12px 16px; padding: 18px 24px; }
.gx-modal .gx-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gx-modal .gx-c2 { grid-column: span 2; }
.gx-modal .field input, .gx-modal .field select { min-width: 0; width: 100%; }
.gx-modal .gx-file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.gx-modal .gx-file input { flex: 0 1 auto; padding: 0; }
.gx-pending { color: #b45309; font-weight: 600; }
.gx-ledger { min-width: 1180px; }
.gx-ledger td, .gx-ledger th { vertical-align: middle; }
.gx-ledger th:nth-child(8), .gx-ledger th:nth-child(9), .gx-ledger th:nth-child(10) { text-align: right; }
.gx-ledger .gx-in { color: #137a52; }
.gx-ledger .gx-out { color: #a61b32; }
.gx-ledger .gx-bal { color: var(--text); font-weight: 600; }
.gx-ledger tr.gx-abono td { background: #f6fdf9; }
.gx-ledger tr.gx-caja td { background: #f8fafc; }
.gx-ledger tr.gx-muted td { opacity: .6; }
.gx-ledger tr.gx-opening td { background: #eef4ff; }
.gx-ledger tr.gx-quick td { padding: 6px 6px; background: #fbfdff; border-bottom: 2px solid #dbe6f6; }
.gx-ledger tr.gx-quick input, .gx-ledger tr.gx-quick select { width: 100%; min-width: 0; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; }
.gx-ledger tr.gx-quick input[name="valor"] { text-align: right; font-weight: 600; }
.gx-ledger tr.gx-quick input:focus, .gx-ledger tr.gx-quick select:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 90, 238, .12); }
.gx-ledger tr.gx-editing td { background: #fffbeb; }
.gx-ledger tr.gx-editing input[name="nota"] { margin-top: 4px; }
.gx-ledger tfoot .gx-net td { background: #eef4ff; font-size: 14px; }
@media (max-width: 900px) {
  .gx-modal .gx-form-grid { grid-template-columns: 1fr; }
  .gx-modal .gx-c2 { grid-column: auto; }
}

/* v4: agrupación por día con fila de cierre */
.gx-ledger tr.gx-day-head td { padding-top: 14px; background: #fff; border-bottom: 1px solid #dbe6f6; color: var(--text); }
.gx-ledger tr.gx-day-head .icon { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; color: var(--blue); }
.gx-ledger tr.gx-day-head small { margin-left: 10px; color: var(--muted); }
.gx-ledger tr.gx-day-close td { background: #e8f0fe; border-top: 2px solid #005aee; border-bottom: 10px solid #fff; color: #0b2b5b; font-size: 13.5px; }
.gx-ledger tr.gx-day-close small { display: block; margin-top: 2px; color: #3b5a8c; font-size: 12px; }
/* v5: cifras siempre en una línea */
.gx-ledger { table-layout: auto; }
.gx-ledger td.gx-num, .gx-ledger th:nth-child(8), .gx-ledger th:nth-child(9), .gx-ledger th:nth-child(10) { white-space: nowrap !important; word-break: keep-all !important; overflow-wrap: normal !important; min-width: 108px; }
.gx-ledger td:nth-child(2) { min-width: 230px; }
.gx-ledger tr.gx-day-close td { overflow: visible; }
.gx-ledger tr.gx-day-close td.gx-num { font-size: 13px; padding-right: 10px; }
.gx-ledger td.gx-num, .gx-ledger tr.gx-day-close td.gx-num b { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.gx-ledger tr.gx-day-close td.gx-close-bal { text-align: left; }
.gx-ledger tr.gx-day-close td:last-child, .gx-ledger tr.gx-day-close td.gx-close-bal { background: #e8f0fe !important; }

/* v6: cierre diario en dos filas (como el total del período) y encabezados fijos al desplazarse */
.gx-ledger-wrap { max-height: calc(100vh - 150px); overflow: auto; border-top: 1px solid var(--line); }
.gx-ledger thead th { position: sticky; top: 0; z-index: 4; background: #f1f5fb; box-shadow: 0 1px 0 #d5dfee; }
.gx-ledger tfoot td { position: sticky; z-index: 3; }
.gx-ledger tfoot tr:first-child td { bottom: 41px; background: #f1f5fb; }
.gx-ledger tfoot tr.gx-net td { bottom: 0; background: #dbe6fb; }
.gx-ledger tr.gx-day-close td, .gx-ledger tr.gx-day-close td:last-child, .gx-ledger tr.gx-day-close td.gx-close-bal { background: #dce7fc !important; border-top: 2px solid #005aee; border-bottom: 0; color: #0b2b5b; }
.gx-ledger tr.gx-day-net td { background: #cddcf9 !important; border-bottom: 12px solid #fff; color: #0b2b5b; font-size: 13.5px; }
.gx-ledger tr.gx-day-net td.gx-num b { font-size: 14px; }

/* Fase 2 · Sprint A: proveedores, recibos, nombres editables */
.gx-link { border: 0; background: none; padding: 0 0 0 6px; color: var(--blue); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.gx-link:hover { opacity: .8; }
.gx-rename { gap: 6px; flex-wrap: nowrap; margin: 0; }
.gx-rename input { min-width: 0; flex: 1 1 140px; }
.gx-rename .gx-code { flex: 0 1 110px; }
.gx-filters .gx-seg + .gx-search { flex: 1 1 220px; }

/* Panel lateral de cotización aprobada */
.qd-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(520px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface, #fff); color: inherit; box-shadow: -12px 0 32px rgba(15, 23, 42, .18); display: flex; flex-direction: column; }
.qd-drawer:not([open]) { display: none; }
.qd-drawer::backdrop { background: rgba(15, 23, 42, .35); }
.qd-drawer[open] { animation: qd-in .18s ease-out; }
@keyframes qd-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.qd-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.qd-head h2 { margin: 2px 0; font-size: 18px; }
.qd-head p { margin: 0; color: var(--muted); }
.qd-head small { color: var(--muted); }
.qd-body { flex: 1; overflow: auto; padding: 16px 20px; display: grid; gap: 16px; align-content: start; }
.qd-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qd-kpis article { border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; }
.qd-kpis span, .qd-kpis small { display: block; color: var(--muted); font-size: 12px; }
.qd-kpis strong { display: block; font-size: 16px; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qd-progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: -8px; }
.qd-progress i { display: block; height: 100%; background: var(--green, #16a34a); }
.qd-body h3 { margin: 0 0 6px; font-size: 14px; }
.qd-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.qd-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); }
.qd-list li:first-child { border-top: 0; }
.qd-list li span { min-width: 0; }
.qd-list li small { display: block; color: var(--muted); font-size: 12px; }
.qd-list li b { white-space: nowrap; }
.qd-list .qd-cost { color: var(--muted); }
.qd-list .qd-total { background: var(--blue-soft); font-weight: 700; }
.qd-list .qd-empty { color: var(--muted); font-size: 13px; }
.qd-in { color: var(--green, #15803d); }
.qd-out { color: var(--red, #b91c1c); }
.qd-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .qd-kpis { grid-template-columns: 1fr; } .qd-foot .button { flex: 1 1 auto; } }
.gx-ledger .action-group { flex-wrap: nowrap; gap: 0; }
.gx-ledger .action-group .icon-button { width: 28px; height: 28px; }
.gx-ledger .action-group .icon { width: 16px; height: 16px; }

/* Fase 2 · Sprint B: catálogo, listas de precio, contratistas, impuestos */
.cx-editable { cursor: pointer; }
.cx-editable:hover { background: var(--blue-soft); }
.cx-inline { width: 120px; min-width: 0; padding: 6px 8px; text-align: right; }
.cx-since { display: grid; gap: 2px; margin-top: 4px; }
.cx-since input { padding: 4px 6px; width: 140px; }
.cx-type { margin-left: 6px; min-height: 20px; font-size: 11px; }
.cx-link { border: 0; background: none; padding: 0; color: var(--blue); cursor: pointer; text-align: left; font: inherit; }
.cx-selected { background: var(--blue-soft); }
.cx-changed td { background: #fffaf0; }
.cx-detail { margin-top: 16px; }
.cx-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 0 20px 14px; }
.cx-tools .gx-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cx-tools .gx-inline input, .cx-tools .gx-inline select { width: auto; min-width: 110px; padding: 6px 8px; }
.cx-tools label { display: grid; gap: 2px; }
.page-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#gx-saturday .table-wrap { max-height: 45vh; }
#gx-saturday input[data-gx-money] { width: 130px; }
#gx-contractor-detail h3 { margin: 14px 0 6px; }
.po-items { max-width: 340px; font-size: 13px; }
.po-unit { width: 90px; }
#po-dialog .table-wrap, #cs-dialog .cs-lines { max-height: 38vh; }
.cs-done { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 16px 0; }
.cs-done > .icon { width: 42px; height: 42px; color: var(--green); }

/* Fase 2 · Sprint C: tablero de gestión (paleta categórica validada, slots 1–4 en orden fijo) */
.viz-root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; }
.home-metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1280px) { .home-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .home-metric-grid { grid-template-columns: 1fr 1fr; } }
[data-view-panel="inicio"] .metric[data-home-card] { cursor: pointer; transition: box-shadow .15s, transform .15s; }
[data-view-panel="inicio"] .metric[data-home-card]:hover { box-shadow: 0 10px 28px rgba(20, 43, 83, .12); transform: translateY(-1px); }
.tb-detail { max-height: 60vh; }
.tb-root { margin-bottom: 18px; overflow: visible; }
.tb-head { flex-wrap: wrap; }
.tb-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.tb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 0 20px 14px; }
.tb-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tb-kpi span, .tb-kpi small { display: block; color: var(--muted); font-size: 12px; }
.tb-kpi strong { display: block; font-size: 20px; margin: 4px 0; letter-spacing: -.02em; }
.tb-root .gx-tabs { padding: 0 20px; }
.tb-body { padding: 14px 20px 20px; }
.tb-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tb-legend, .tb-options { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.tb-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.tb-check input { width: auto; }
.tb-check i, .tb-tip i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.tb-chart { position: relative; }
.tb-chart svg { width: 100%; height: auto; display: block; }
.tb-grid { stroke: var(--line); stroke-width: 1; }
.tb-axis { fill: var(--muted); font-size: 11px; }
.tb-axis-proj { font-style: italic; }
.tb-proj-band { fill: var(--blue-soft); opacity: .5; }
.tb-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tb-dashed { stroke-dasharray: 6 4; opacity: .7; }
.tb-dotted { stroke-dasharray: 2 4; }
.tb-end { stroke: var(--surface); stroke-width: 2; }
.tb-direct { fill: var(--text); font-size: 11px; font-weight: 600; }
.tb-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tb-hit { fill: transparent; cursor: crosshair; }
.tb-tip { position: absolute; top: 10px; min-width: 200px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(20, 43, 83, .14); font-size: 12px; pointer-events: none; }
.tb-tip div { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.tb-tip span { margin-left: auto; font-weight: 700; padding-left: 10px; }
.tb-proj-row td { font-style: italic; color: var(--muted); }
.tb-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tb-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tb-grid3 h3, .tb-grid2 h3 { margin: 0 0 8px; font-size: 14px; }
.tb-grid3 h3 small { color: var(--muted); font-weight: 500; }
.tb-bars { margin-bottom: 14px; }
.tb-inline-bar { margin: 0; }
.tb-sim { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tb-sim output { grid-column: 1 / -1; padding: 10px 12px; border-radius: 10px; background: var(--blue-soft); }
@media (max-width: 1100px) { .tb-grid3, .tb-grid2 { grid-template-columns: 1fr; } }

/* Fase 2 · Sprint D: chat del equipo */
.deko-bell.ch-trigger { position: relative; }
.deko-bell.ch-trigger.is-floating { margin-right: 54px; }
.ch-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 9px; font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.ch-badge[hidden] { display: none; }
.ch-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(400px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(15, 23, 42, .14); }
.ch-panel[hidden] { display: none; }
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.ch-head h2 { margin: 0; }
.ch-tabs { margin: 10px 18px 0; align-self: flex-start; }
.ch-list { flex: 1; overflow-y: auto; padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.ch-msg { max-width: 88%; align-self: flex-start; padding: 8px 12px; border-radius: 12px 12px 12px 4px; background: #f3f6fb; }
.ch-msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: var(--blue-soft); }
.ch-msg small { display: block; color: var(--muted); font-size: 11px; }
.ch-msg p { margin: 2px 0 0; color: var(--text); overflow-wrap: anywhere; }
.ch-removed p { font-style: italic; color: var(--muted); }
.ch-task { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--amber-soft, #fff5df); color: var(--amber, #a96508); font-size: 12px; font-weight: 600; }
.ch-task.done { background: var(--green-soft, #e9f8f0); color: var(--green); }
.ch-task .icon { width: 15px; height: 15px; }
.ch-link { border: 0; background: none; padding: 0; color: var(--muted); font-size: 11px; text-decoration: underline; cursor: pointer; }
.ch-form { padding: 10px 18px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ch-form textarea { resize: none; }
.ch-form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ch-form-row select { width: auto; flex: 1 1 140px; padding: 6px 8px; }
.ch-form-row .button { margin-left: auto; }
@media (min-width: 1100px) { body.ch-open .content { padding-right: 420px; } }
.gx-evo { margin: 16px 0; }
.gx-evo-chart { padding: 0 20px 14px; }
.gx-evo-zero { stroke: var(--muted); stroke-width: 1; }
.gx-evo h2 small { color: var(--muted); font-weight: 500; }
.tb-click { cursor: pointer; }
.tb-click:hover td { background: var(--blue-soft); }
.activity-kpis { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important; }
.config-hub { margin-bottom: 18px; }
.config-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 0 20px 20px; }
.config-hub-grid button { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; color: var(--muted); }
.config-hub-grid button:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.config-hub-grid b { display: block; color: var(--text); }
.config-hub-grid small { display: block; font-size: 12px; }
.gx-table td:first-child b { white-space: nowrap; }

/* Fase 2 · ajustes 19-oct: ventanas de detalle a todo el ancho; columnas numéricas alineadas */
.gx-modal .modal-body:not(.gx-form-grid) { grid-template-columns: minmax(0, 1fr); }
.gx-modal .modal-body:not(.gx-form-grid) > * { grid-column: 1 / -1; }
.gx-modal .table-wrap table { width: 100%; min-width: 0; }
.gx-table th.gx-num, .gx-table td.gx-num { text-align: right; white-space: nowrap; }
.gx-table td, .gx-table th { vertical-align: middle; }
/* Inicio: las tarjetas llenan siempre la fila (sin hueco a la derecha) */
.home-metric-grid { display: flex !important; flex-wrap: wrap; }
.home-metric-grid > .metric { flex: 1 1 210px; }
.gx-evo-area { fill: var(--viz-1); opacity: .12; }
.gx-evo-mark { fill: var(--surface); stroke: var(--viz-1); stroke-width: 2; }
.gx-evo-note { font-weight: 600; fill: var(--text); }
.gx-diff-tag { font-weight: 800; }
.cx-help { margin-bottom: 14px; padding: 0; }
.cx-help summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 700; color: var(--blue); list-style: none; }
.cx-help summary::-webkit-details-marker { display: none; }
.cx-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 20px; padding: 0 16px 14px; }
.cx-help-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.cx-help-grid b { color: var(--text); }
.gx-grid-even > article:has(.gx-account-form) { grid-column: 1 / -1; }
.gx-account-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 0; }
.gx-account-form label { display: grid; gap: 3px; }
.gx-account-form small { color: var(--muted); font-size: 11px; font-weight: 600; }
.gx-account-form input, .gx-account-form select { padding: 7px 9px; }
.gx-account-form .gx-code { width: 110px; }
.gx-account-form .gx-account-name { flex: 1 1 200px; }
.gx-account-form .gx-account-check { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; }
.gx-account-form .gx-account-check input { width: auto; }
.gx-account-form [name="tope_anual"] { width: 150px; }
.gx-account-form .pill { margin-bottom: 8px; }
.gx-caps-card { padding-bottom: 14px; }
.gx-caps { padding: 0 20px; }
.payment-rule-note{display:block;margin-top:4px;color:var(--amber,#a96508);font-weight:600}
.po-cat{display:inline-block;padding:0 6px;border-radius:6px;background:var(--blue-soft);color:var(--blue);font-size:11px;font-weight:700}
[data-gx-cat-other]{margin-top:4px}

/* Impuestos: calendario mensual y gráfico anual */
.tx-subbar { padding: 0 20px 12px; }
.tx-cal-head { display: flex; align-items: center; gap: 8px; padding: 0 20px 10px; }
.tx-cal-head h3 { margin: 0 8px; text-transform: capitalize; min-width: 170px; text-align: center; }
.tx-cal-head .tx-next .icon { transform: rotate(180deg); }
.cm-chart { --tx-late: #eda100; --tx-over: #d6334a; --tx-pend: #c5cedc; display: grid; gap: 18px; padding: 4px 18px 18px; }
.cm-debt { stroke: var(--tx-over); stroke-width: 2.2; }
.cm-debt-dot { fill: var(--surface); stroke: var(--tx-over); stroke-width: 2; }
.cm-debt-label { fill: var(--tx-over); }
.cm-key-debt { display: inline-block; width: 16px; height: 0 !important; background: none !important; border-top: 2px solid var(--tx-over); }
.cm-name { fill: var(--text); font-weight: 600; }
.tb-prod-controls { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.tb-prod-total { margin: 0 0 12px; }
.tb-prod-name { fill: var(--text); font-weight: 600; }
.cx-adjust-intro { margin: 0; }
.cx-rules td { vertical-align: middle; }
.cx-rules select, .cx-rules input { min-width: 0; }
.cx-pct { width: 90px; text-align: right; }
.cx-adjust-opts { margin-top: 4px; }
.cx-preview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 4px 0 8px; }
.cx-preview { max-height: 360px; overflow: auto; }
.po-linked { display: block; color: var(--green); font-size: 11px; font-weight: 700; }
.tx-calmode { margin-right: 6px; }
.tx-year { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 26px; padding: 6px 20px 8px; }
.tx-ym { display: grid; gap: 6px; align-content: start; }
.tx-ym-title { justify-self: start; padding: 2px 6px; margin-left: -6px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: 700 14px/1.3 inherit; text-transform: capitalize; cursor: pointer; }
.tx-ym-title:hover { background: var(--blue-soft); color: var(--blue); }
.tx-ym.is-current .tx-ym-title { color: var(--blue); }
.tx-ym-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; justify-items: center; }
.tx-ym-dow { color: var(--muted); font-size: 10.5px; font-weight: 700; padding-bottom: 2px; }
.tx-yd { position: relative; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text); font: 500 11.5px/1 inherit; }
button.tx-yd { cursor: pointer; font-weight: 800; }
.tx-yd.is-today { box-shadow: inset 0 0 0 2px var(--blue); }
.tx-yd.has.tone-draft { background: #dfe5ee; color: #34425a; }
.tx-yd.has.tone-review { background: #fbd68a; color: #6b3f00; }
.tx-yd.has.tone-danger { background: #d6334a; color: #fff; }
.tx-yd.has.tone-success { background: #1baf7a; color: #fff; }
button.tx-yd:hover { outline: 2px solid var(--blue); outline-offset: 1px; }
.tx-yd i { position: absolute; top: -4px; right: -5px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 99px; background: var(--text); color: var(--surface); font: 800 9px/14px inherit; font-style: normal; }
.tx-ym small { color: var(--muted); font-size: 11.5px; }
.tx-ylegend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 6px 20px 16px; color: var(--muted); font-size: 12px; }
.tx-ylegend span { display: inline-flex; align-items: center; gap: 6px; }
.tx-ylegend .tx-yd { width: 14px; height: 14px; }
.tx-ylegend-note { flex-basis: 100%; }
.tx-pop { position: absolute; z-index: 5; display: grid; gap: 6px; width: 260px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 40px rgba(15, 30, 60, .18); }
.tx-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tx-pop-head .icon-button { width: 28px; height: 28px; font-size: 18px; }
.tx-pop .text-button { justify-self: start; font-size: 12.5px; }
@media (max-width: 1200px) { .tx-year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .tx-year { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tx-year { grid-template-columns: 1fr; } .tx-cal-head { flex-wrap: wrap; } }
.tx-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; margin: 0 20px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tx-cal-dow { padding: 6px 8px; background: var(--canvas); color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.tx-cal-cell { min-height: 92px; padding: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.tx-cal-empty { background: var(--canvas); }
.tx-cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--blue); }
.tx-cal-day { font-size: 12px; font-weight: 700; color: var(--muted); }
.is-today .tx-cal-day { color: var(--blue); }
.tx-cal-item { display: grid; gap: 1px; width: 100%; padding: 4px 6px; border: 0; border-radius: 7px; text-align: left; cursor: pointer; font-size: 11px; line-height: 1.25; }
.tx-cal-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-cal-item.tone-draft { background: #edf1f7; color: #3c4a62; }
.tx-cal-item.tone-review { background: var(--amber-soft, #fff5df); color: var(--amber, #a96508); }
.tx-cal-item.tone-danger { background: #fdecec; color: #b42335; }
.tx-cal-item.tone-success { background: var(--green-soft, #e9f8f0); color: var(--green); }
.tx-legend { padding: 0 20px 6px; }
.tx-chart { --tx-ok: #1baf7a; --tx-late: #eda100; --tx-over: #d6334a; --tx-pend: #c5cedc; display: grid; gap: 18px; padding: 4px 18px 18px; }
.tx-kpis { margin-top: 6px; }
.tx-block h3 { margin: 0 0 6px; font-size: 14px; }
.tx-block h3 small { color: var(--muted); font-weight: 500; }
.tx-block .tx-legend { padding: 0 0 6px; }
.tx-val { fill: var(--muted); font-size: 10.5px; font-weight: 600; }
.tx-bar:hover rect:first-of-type { fill: var(--line); fill-opacity: .35; }
.tx-line-due { stroke: var(--muted); stroke-width: 2; }
.tx-line-paid { stroke: var(--viz-1); stroke-width: 2.5; }
.tx-line-prev { stroke: var(--viz-1); stroke-width: 1.6; stroke-dasharray: 5 4; opacity: .45; }
.tx-gap { fill: var(--tx-over); fill-opacity: .1; stroke: none; }
.tx-dot { fill: var(--surface); stroke: var(--viz-1); stroke-width: 2; }
.tx-today { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.tx-end { font-size: 11px; font-weight: 700; }
.tx-end-due { fill: var(--muted); } .tx-end-paid { fill: var(--viz-1); } .tx-end-prev { fill: var(--muted); font-weight: 500; }
.tx-key-due, .tx-key-paid, .tx-key-prev { display: inline-block; width: 16px; height: 0 !important; background: none !important; }
.tx-key-due { border-top: 2px solid var(--muted); } .tx-key-paid { border-top: 3px solid var(--viz-1); } .tx-key-prev { border-top: 2px dashed var(--viz-1); opacity: .6; }
.tx-key-gap { background: var(--tx-over) !important; opacity: .25; }
.tx-table summary { cursor: pointer; color: var(--blue); font-weight: 700; font-size: 13px; padding: 4px 0 8px; }
.tx-dash { display: inline-block; width: 16px; border-top: 2px dashed var(--text); height: 0 !important; background: none !important; }
.tx-settle > span:last-child { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; }
.tx-settle input { width: auto; }
@media (max-width: 720px) { .tx-cal-cell { min-height: 64px; } .tx-cal-item span { display: none; } }
.gx-works-card { margin-top: 16px; }
.gx-work-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-work-count { display: grid; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; color: var(--muted); }
.gx-work-count b { font-size: 16px; color: var(--text); }
.gx-collect b { color: var(--blue); }
.gx-work-select { width: auto; padding: 5px 8px; }
.qd-work .gx-seg { flex-wrap: wrap; }
.qd-collect { margin: 8px 0 0; color: var(--green); font-weight: 700; }
.tb-period{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;color:var(--muted)}.tb-period b{color:var(--text)}.tb-period small{flex-basis:100%;font-size:11px}
.gx-pct{width:62px}

/* Tablero · Finanzas */
.fin-group { margin-bottom: 18px; }
.fin-group h3 { margin: 0; font-size: 15px; }
.fin-group > p { margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.fin-card { display: grid; gap: 2px; align-content: start; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; background: var(--surface); }
.fin-card span { color: var(--muted); font-size: 12px; font-weight: 600; }
.fin-card strong { font-size: 19px; letter-spacing: -.02em; }
.fin-card em { font-style: normal; font-size: 12px; font-weight: 800; }
.fin-card small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.fin-good { border-left-color: var(--green); } .fin-good em { color: var(--green); }
.fin-warn { border-left-color: var(--amber, #a96508); } .fin-warn em { color: var(--amber, #a96508); }
.fin-bad { border-left-color: #c43349; } .fin-bad em { color: #c43349; }
.fin-bar { position: relative; grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--line); overflow: visible; }
.fin-bar span { display: block; height: 100%; border-radius: 99px; background: var(--viz-1, #2a78d6); }
.fin-bar i { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--text); }

/* ---- 20-oct: ítems editables en la tabla, descripción amplia ---- */
.item-line-product { display: grid; gap: 2px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.item-line-product small { color: var(--muted); }
.item-line-product u { color: var(--blue); text-decoration: none; font-weight: 700; }
.item-line-product:hover b { color: var(--blue); }
.item-line-input { width: 100%; min-width: 80px; min-height: 36px; padding: 6px 8px; text-align: right; }
.item-line-input[readonly] { background: var(--canvas); color: var(--muted); }
.item-inline-list { margin-top: 16px; }
.item-base-grid .item-description { grid-column: 1 / -1 !important; }
.item-base-grid .item-description textarea { min-height: 110px; resize: vertical; line-height: 1.45; }

/* ---- 20-oct: Tareas (Kanban) — color por tarea, columnas con acento y tarjetas vivas ---- */
.tk-toolbar { margin: -6px 0 14px; }
.tk-c-none { --tk-color: #94a3b8; } .tk-c-azul { --tk-color: #2563eb; } .tk-c-violeta { --tk-color: #7c3aed; } .tk-c-verde { --tk-color: #16a34a; }
.tk-c-ambar { --tk-color: #d97706; } .tk-c-rojo { --tk-color: #dc2626; } .tk-c-rosa { --tk-color: #db2777; } .tk-c-cian { --tk-color: #0891b2; } .tk-c-gris { --tk-color: #64748b; }
.tk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tk-stat { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.tk-stat b { font-size: 24px; letter-spacing: -.03em; line-height: 1.1; }
.tk-stat span { color: var(--muted); font-size: 12px; font-weight: 600; }
.tk-stat.is-open b { color: #d97706; } .tk-stat.is-mine b { color: #6366f1; } .tk-stat.is-late b { color: #dc2626; } .tk-stat.is-ok b, .tk-stat.is-done b { color: #10b981; }
.tk-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.tk-col { --tk-accent: #f59e0b; display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-top: 4px solid var(--tk-accent); border-radius: 18px; background: color-mix(in srgb, var(--tk-accent) 5%, var(--canvas)); min-height: 320px; transition: background .18s, box-shadow .18s; }
.tk-col-1 { --tk-accent: #6366f1; } .tk-col-2 { --tk-accent: #10b981; }
.tk-col.is-over { background: color-mix(in srgb, var(--tk-accent) 14%, var(--canvas)); box-shadow: inset 0 0 0 2px var(--tk-accent); }
.tk-col header { display: flex; align-items: center; gap: 10px; }
.tk-col-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--tk-accent); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--tk-accent) 35%, transparent); }
.tk-col-icon .icon { width: 18px; height: 18px; }
.tk-col header h3 { margin: 0; color: var(--text); font-size: 15px; }
.tk-col header small { color: var(--muted); font-size: 11.5px; }
.tk-count { margin-left: auto; min-width: 28px; padding: 3px 9px; border-radius: 99px; background: var(--tk-accent); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.tk-list { display: grid; gap: 10px; }
.tk-card { position: relative; display: grid; gap: 10px; padding: 13px 13px 11px 16px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tk-color) 9%, var(--surface)) 0%, var(--surface) 55%); box-shadow: 0 1px 2px rgba(15, 30, 60, .06); transition: transform .16s ease, box-shadow .16s ease; }
.tk-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--tk-color); }
.tk-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 30, 60, .12); }
.tk-card[draggable="true"] { cursor: grab; }
.tk-card.is-dragging { opacity: .45; transform: rotate(1.5deg); }
.tk-card.is-done { opacity: .82; }
.tk-card.is-done .tk-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.tk-card.is-late { box-shadow: 0 0 0 1px #fca5a5, 0 6px 16px rgba(220, 38, 38, .12); }
.tk-text { margin: 0; color: var(--text); font-weight: 650; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 9px; border: 0; border-radius: 99px; background: var(--canvas); color: var(--muted); font: 600 11.5px/1.4 inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-chip .icon { width: 13px; height: 13px; flex: 0 0 auto; }
.tk-chip-quote { background: color-mix(in srgb, #2563eb 12%, var(--surface)); color: #1d4ed8; cursor: pointer; }
.tk-chip-quote:hover { background: color-mix(in srgb, #2563eb 20%, var(--surface)); }
.tk-chip-work { background: color-mix(in srgb, #0891b2 12%, var(--surface)); color: #0e7490; }
.tk-due.is-late { background: #fde8e8; color: #b42335; font-weight: 800; }
.tk-due.is-today { background: var(--amber-soft); color: var(--amber); font-weight: 800; }
.tk-foot { display: flex; align-items: center; gap: 8px; }
.tk-avatar { --h: 220; display: inline-grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 35%); font: 800 11px/1 inherit; box-shadow: 0 0 0 2px var(--surface); }
.tk-avatar.is-empty { background: var(--canvas); color: var(--muted); }
.tk-foot small { min-width: 0; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.3; }
.tk-foot small span { color: var(--muted); font-weight: 500; font-size: 11px; }
.tk-actions { display: flex; gap: 2px; margin-left: auto; opacity: .55; transition: opacity .15s; }
.tk-card:hover .tk-actions, .tk-card:focus-within .tk-actions { opacity: 1; }
.tk-actions .icon-button { width: 30px; height: 30px; }
.tk-next .icon { transform: rotate(180deg); }
.tk-empty { margin: 4px; padding: 18px 12px; border: 1.5px dashed color-mix(in srgb, var(--tk-accent) 35%, var(--line)); border-radius: 12px; color: var(--muted); font-size: 12.5px; text-align: center; }
.tk-colors { margin: 0; padding: 0; border: 0; }
.tk-colors legend { padding: 0; margin-bottom: 7px; font-size: 13px; font-weight: 750; }
.tk-colors div { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-swatch { position: relative; cursor: pointer; }
.tk-swatch input { position: absolute; opacity: 0; }
.tk-swatch span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--tk-color); color: #fff; font-weight: 800; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: box-shadow .15s, transform .15s; }
.tk-swatch.tk-c-none span { background: var(--canvas); color: var(--muted); border: 1px dashed var(--line); }
.tk-swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tk-color); transform: scale(1.08); }
.tk-swatch input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 3px; }
.tk-edit-text { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--canvas); color: var(--text); white-space: pre-wrap; }
@media (max-width: 1000px) { .tk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .tk-board { grid-template-columns: 1fr; } .tk-col { min-height: 0; } }

/* 20-oct: con más secciones el menú no cabía. Cada sección toma una altura proporcional a la pantalla
   (18 renglones: 14 secciones + 4 de abajo) para que todo quepa sin desplazamiento; solo en pantallas muy
   bajas (< ~700 px) el bloque de secciones se desplaza y lo de abajo (salir) sigue visible. */
@media (min-width: 721px) {
  .sidebar { --nav-h: clamp(28px, calc((100vh - 200px) / 18), 44px); overflow: hidden; padding-top: 14px; padding-bottom: 12px; }
  .sidebar .brand { min-height: 44px; padding-bottom: 12px; }
  .sidebar .nav-list { flex: 1 1 auto; min-height: 0; gap: 2px; overflow-y: auto; align-content: start; scrollbar-width: thin; }
  .sidebar .nav-list .nav-link, .sidebar .sidebar-bottom .nav-link { min-height: 0; height: var(--nav-h); }
  .sidebar .sidebar-bottom { flex: 0 0 auto; gap: 2px; padding-top: 8px; }
}

/* 21-oct: el estado de la cotización vuelve a mostrar su NOMBRE (en pantallas medianas se había
   reducido a un círculo sin texto). Paleta moderna: fondo suave, texto del mismo tono y punto de color.
   Selector reforzado para imponerse a refinements.css y al modo oscuro generado. */
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger,
:root body .quote-grid-table .pill.draft.draft.draft,
:root body .quote-grid-table .pill.review.review.review,
:root body .quote-grid-table .pill.success.success.success,
:root body .quote-grid-table .pill.rejected.rejected.rejected,
:root body .quote-grid-table .pill.void.void.void {
  --st: #94a3b8; --st-bg: #f1f5f9; --st-ink: #475569;
  display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important;
  width: auto !important; min-width: 0 !important; max-width: none !important; height: 26px !important; min-height: 26px !important; max-height: none !important;
  padding: 0 10px 0 9px !important; border: 1px solid color-mix(in srgb, var(--st) 30%, transparent) !important; border-radius: 999px !important;
  background: var(--st-bg) !important; color: var(--st-ink) !important; font-size: 12px !important; font-weight: 700 !important; line-height: 1 !important;
  letter-spacing: .01em; white-space: nowrap !important; box-shadow: none !important; transition: transform .15s ease, box-shadow .15s ease;
}
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger::before,
:root body .quote-grid-table .pill.draft.draft.draft::before,
:root body .quote-grid-table .pill.review.review.review::before,
:root body .quote-grid-table .pill.success.success.success::before,
:root body .quote-grid-table .pill.rejected.rejected.rejected::before,
:root body .quote-grid-table .pill.void.void.void::before {
  content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st) 20%, transparent);
}
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger .icon { display: block !important; width: 12px !important; height: 12px !important; margin-left: -1px; opacity: .65; }
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px color-mix(in srgb, var(--st) 28%, transparent) !important; }
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger.draft, :root body .quote-grid-table .pill.draft.draft.draft { --st: #94a3b8; --st-bg: #f1f5f9; --st-ink: #475569; }
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger.review, :root body .quote-grid-table .pill.review.review.review { --st: #f59e0b; --st-bg: #fef6e0; --st-ink: #b45309; }
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger.success, :root body .quote-grid-table .pill.success.success.success { --st: #10b981; --st-bg: #e3f8ef; --st-ink: #047857; }
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger.rejected, :root body .quote-grid-table .pill.rejected.rejected.rejected { --st: #f43f5e; --st-bg: #ffe9ec; --st-ink: #be123c; }
:root body .quote-status-trigger.quote-status-trigger.quote-status-trigger.void, :root body .quote-grid-table .pill.void.void.void { --st: #8b5cf6; --st-bg: #f1ecfe; --st-ink: #6d28d9; }

/* 21-oct: archivo de tareas hechas */
.tk-archive-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 8px; border: 1.5px dashed color-mix(in srgb, var(--tk-accent) 45%, var(--line)); border-radius: 12px; background: transparent; color: var(--muted); font: 700 12.5px/1.2 inherit; cursor: pointer; }
.tk-archive-btn:hover { color: var(--text); background: color-mix(in srgb, var(--tk-accent) 8%, transparent); }
.tk-archive-btn .icon { width: 15px; height: 15px; }
.tk-archive-list { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.tk-archive-item { padding: 10px 12px 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--tk-color); border-radius: 10px; background: var(--surface); }
.tk-archive-item p { margin: 0 0 3px; color: var(--text); font-weight: 600; white-space: pre-wrap; }
.tk-archive-item small { color: var(--muted); }

/* 21-oct: la columna ESTADO medía 5,5 % (pensada para el círculo sin texto) y cortaba la etiqueta.
   Nuevo reparto (suma 100 %): N.º 7 · Cliente 12 · Proyecto 16 · Fecha 9 · Valor 8,5 · Saldo 8,5 · Asesor 8,5 · Estado 12,5 · Acciones 18. */
@media (min-width: 761px) {
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(1) { width: 7% !important; }
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(2) { width: 12% !important; }
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(3) { width: 16% !important; }
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(4) { width: 9% !important; }
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(5) { width: 8.5% !important; }
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(6) { width: 8.5% !important; }
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(7) { width: 8.5% !important; }
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(8) { width: 12.5% !important; }
  :root .quote-grid-table > colgroup[data-quote-grid-columns] > col:nth-child(9) { width: 18% !important; }
}
/* En pantallas medianas la etiqueta se compacta (sin flecha) para caber siempre completa. */
@media (max-width: 1280px) {
  :root body .quote-status-trigger.quote-status-trigger.quote-status-trigger { gap: 5px !important; padding: 0 8px !important; font-size: 11.5px !important; }
  :root body .quote-status-trigger.quote-status-trigger.quote-status-trigger .icon { display: none !important; }
}
/* Perfiles sin la columna «Asesor» (oculta con hidden): las celdas se corren una posición, así que el
   ESTADO usa la 7.ª columna y las acciones la 8.ª. Reparto: 7 · 13 · 20,5 · 9 · 9,5 · 9,5 · Estado 13,5 · Acciones 18 · 0. */
@media (min-width: 761px) {
  :root .quote-grid-table:has(thead th:nth-child(7)[hidden]) > colgroup[data-quote-grid-columns] > col:nth-child(2) { width: 13% !important; }
  :root .quote-grid-table:has(thead th:nth-child(7)[hidden]) > colgroup[data-quote-grid-columns] > col:nth-child(3) { width: 20.5% !important; }
  :root .quote-grid-table:has(thead th:nth-child(7)[hidden]) > colgroup[data-quote-grid-columns] > col:nth-child(5) { width: 9.5% !important; }
  :root .quote-grid-table:has(thead th:nth-child(7)[hidden]) > colgroup[data-quote-grid-columns] > col:nth-child(6) { width: 9.5% !important; }
  :root .quote-grid-table:has(thead th:nth-child(7)[hidden]) > colgroup[data-quote-grid-columns] > col:nth-child(7) { width: 13.5% !important; }
  :root .quote-grid-table:has(thead th:nth-child(7)[hidden]) > colgroup[data-quote-grid-columns] > col:nth-child(8) { width: 18% !important; }
  :root .quote-grid-table:has(thead th:nth-child(7)[hidden]) > colgroup[data-quote-grid-columns] > col:nth-child(9) { width: 0 !important; }
}

/* 30-oct: Pago total / Abono en una sola línea. */
.cs-pay-mode label { white-space: nowrap; }

/* 30-oct: pestaña Retenciones de Impuestos. */
.tx-retentions { display: grid; gap: 12px; padding: 4px 18px 18px; }
.tx-retentions h3 { margin: 8px 0 0; }
.tx-retentions .gx-total { text-align: right; }
.tx-retentions .action-group { justify-content: flex-end; }
