* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2430;
  margin: 0;
  padding: 20px 14px 60px;
}
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 2px; }
.app-title-row { position:relative; display:flex; align-items:center; min-width:0; min-height:46px; }
.app-title-copy { display:flex; flex:0 0 auto; align-items:baseline; gap:7px; min-width:0; }
.app-title-row h1 { min-width:0; }
.app-header-version { color:#94a3b8; font-size:9px; font-weight:600; line-height:1.2; letter-spacing:.03em; }
.app-title-logo { position:absolute; top:50%; right:100px; width:190px; height:46px; margin-left:0; object-fit:contain; transform:translateY(-50%); }
.subtitle { color: #6b7280; font-size: 13px; margin: 0 0 16px; }
.warn {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  font-size: 12px; padding: 8px 12px; border-radius: 8px; margin-bottom: 16px;
}
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }

.tabbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabbar button, .tabbar a { background: #fff; border: 1px solid #e5e7eb; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: #4b5563; text-decoration:none; }
.tabbar button.active, .tabbar a.active { background: #1f2430; color: #fff; border-color: #1f2430; }
.tabbar .add-proj { border-style: dashed; color: #0200F9; }
.main-tabbar { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #e5e7eb; padding-bottom: 12px; justify-content: space-between; align-items: center; }
.main-tabbar button, .main-tabbar a { background: none; border: none; padding: 6px 4px; font-size: 14px; font-weight: 500; cursor: pointer; color: #6b7280; border-bottom: 2px solid transparent; text-decoration:none; white-space:nowrap; }
.main-tabbar button.active, .main-tabbar a.active { color: #1f2430; border-bottom-color: #0200F9; }
.database-backup-panel { display:flex; align-items:center; gap:16px; border-color:#cbd5e1; background:linear-gradient(135deg, #fff 0%, #f8fafc 100%); }
.database-backup-icon { display:grid; place-items:center; width:46px; height:46px; flex:0 0 46px; border-radius:12px; background:#1f2430; color:#fff; font-size:24px; font-weight:700; }
.database-backup-copy { flex:1; min-width:0; }
.database-backup-copy p { margin:3px 0; color:#475569; font-size:12px; line-height:1.45; }
.database-backup-copy .database-backup-note { color:#64748b; }
.database-backup-download { flex:0 0 auto; margin:0; }
.database-backup-download button { white-space:nowrap; }
.backup-status { display:inline-flex; margin-top:5px; padding:4px 8px; border-radius:999px; font-size:10px; font-weight:700; }
.backup-status-ok { background:#dcfce7; color:#166534; }
.backup-status-warning { background:#fef3c7; color:#92400e; }
.bulk-import-panel { margin-top:0; }
.backup-guidance-card { margin-top:14px; }
.backup-action-card { padding:20px; }
.backup-action-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.backup-action-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; align-items:end; margin-top:18px; }
.backup-action-grid .field { min-width:0; margin-bottom:0; }
.backup-action-grid label { color:#374151; font-weight:600; }
.backup-action-grid select, .backup-action-grid input { width:100%; height:38px; box-sizing:border-box; }
.backup-action-grid input[readonly] { background:#f8fafc; color:#1f2937; font-weight:600; text-overflow:ellipsis; }
.backup-restore-button, .backup-download-button { display:flex; align-items:center; justify-content:center; width:100%; height:38px; min-height:38px; box-sizing:border-box; line-height:1.25; white-space:normal; text-align:center; text-decoration:none; }
.backup-create-row { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin:12px 0 8px; }
.backup-create-row .section-title { margin-bottom:2px; }
.backup-create-actions { display:flex; align-items:center; gap:8px; }
.backup-create-actions form { margin:0; }
.backup-create-actions button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; white-space:nowrap; }
.backup-excel-icon { width:16px; height:16px; flex:0 0 16px; stroke:currentColor; stroke-width:1.55; stroke-linecap:round; stroke-linejoin:round; }
.backup-history-card { padding:12px 16px; }
.backup-history-table { width:100%; border-collapse:collapse; font-size:12px; }
.backup-history-table th { padding:10px 8px; background:#1f2937; color:#fff; text-align:left; }
.backup-history-table td { padding:10px 8px; border-bottom:1px solid #e5e7eb; vertical-align:middle; }
.backup-history-table tbody tr:last-child td { border-bottom:none; }
.backup-type, .backup-ready { display:inline-flex; padding:3px 7px; border-radius:999px; font-size:10px; font-weight:700; }
.backup-type { background:#e2e8f0; color:#334155; }
.backup-type-automatico { background:#dbeafe; color:#1d4ed8; }
.backup-type-emergencia { background:#fef3c7; color:#92400e; }
.backup-ready { background:#dcfce7; color:#166534; }
.backup-row-actions { white-space:nowrap; }
.backup-row-actions .del-link + .del-link { margin-left:10px; }
.report-monochrome-button, .report-pdf-link { display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid #1f2430; border-radius:8px; background:#1f2430; color:#fff; font-weight:600; text-decoration:none; white-space:nowrap; }
.report-monochrome-button { min-height:36px; padding:8px 14px; font-size:13px; cursor:pointer; }
.report-pdf-link { min-height:28px; padding:4px 9px; font-size:11px; }
.report-monochrome-button:hover, .report-pdf-link:hover { border-color:#000; background:#000; color:#fff; }
.report-monochrome-button:disabled { opacity:.5; cursor:not-allowed; }
.report-pdf-icon { width:14px; height:14px; flex:0 0 14px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.report-view-tabs { display:flex; gap:6px; margin-bottom:14px; padding:4px; border-radius:10px; background:#e9edf2; }
.report-view-tabs button { flex:1; min-height:36px; padding:7px 12px; border:0; border-radius:8px; background:transparent; color:#4b5563; font-size:13px; font-weight:600; cursor:pointer; }
.report-view-tabs button.active { background:#fff; color:#1f2430; box-shadow:0 1px 3px rgba(15,23,42,.12); }
.report-view-placeholder { padding:28px 18px; border:1px dashed #cbd5e1; border-radius:12px; background:#fff; color:#64748b; text-align:center; font-size:13px; }
.report-download-actions { margin-bottom:10px; }
.report-detail-intro { display:flex; flex-direction:column; gap:3px; margin-bottom:10px; }
.report-detail-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; }
.report-detail-heading .report-download-actions { flex:0 0 auto; flex-wrap:nowrap; margin-bottom:0; }
.report-detail-heading .report-download-actions button { min-height:34px; padding:7px 11px; }
.report-detail-intro strong { font-size:13px; }
.report-detail-intro span { color:#6b7280; font-size:10px; line-height:1.35; }
.report-concept-detail-table { min-width:980px; table-layout:fixed; }
.report-concept-detail-table th:nth-child(-n+2), .report-concept-detail-table td:nth-child(-n+2) { text-align:left; }
.report-concept-detail-table th:nth-child(2), .report-concept-detail-table td:nth-child(2) { padding-left:18px; }
.report-partida-name, .report-concept-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.report-concept-detail-table th:nth-child(n+3), .report-concept-detail-table td:nth-child(n+3) { text-align:right; white-space:nowrap; }
.report-negative { color:#dc2626 !important; font-weight:700; }
.report-destajo-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:10px 0 5px; }
.report-destajos-table th:last-child, .report-destajos-table td:last-child { width:58px; text-align:center; }
.backup-restore-modal { width:min(500px, calc(100vw - 30px)); }
.backup-restore-modal h3 { margin:0 30px 8px 0; }
.backup-restore-modal p { color:#475569; font-size:12px; line-height:1.5; }
.backup-restore-modal input { width:100%; margin-top:10px; }
.backup-restore-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
.primary.danger { background:#dc2626; border-color:#dc2626; }
.bulk-import-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.bulk-import-heading .ghost { flex:0 0 auto; text-decoration:none; }
.bulk-import-steps { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin:12px 0; }
.bulk-import-step { display:flex; align-items:flex-start; gap:8px; padding:10px; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; }
.bulk-import-step > span { display:grid; place-items:center; width:22px; height:22px; flex:0 0 22px; border-radius:50%; background:#1f2430; color:#fff; font-size:11px; font-weight:700; }
.bulk-import-step strong, .bulk-import-step small { display:block; }
.bulk-import-step strong { color:#1f2937; font-size:12px; }
.bulk-import-step small { margin-top:2px; color:#64748b; font-size:10px; line-height:1.35; }
.sql-restore-note { display:flex; flex-direction:column; gap:3px; margin-top:14px; padding:10px 12px; border-left:3px solid #64748b; border-radius:0 8px 8px 0; background:#f8fafc; color:#475569; font-size:11px; line-height:1.45; }
.import-format-notice { margin:0 0 12px; padding:9px 11px; border-left:3px solid #1f2430; border-radius:0 8px 8px 0; background:#f1f5f9; color:#475569; font-size:11px; line-height:1.45; }
.section-tabbar { display: flex; gap: 4px; margin-bottom: 16px; background: #eceef1; border-radius: 10px; padding: 4px; }
.section-tabbar button, .section-tabbar a { flex: 1; background: none; border: none; border-radius: 8px; padding: 7px 8px; font-size: 12px; font-weight: 500; cursor: pointer; color: #6b7280; text-decoration:none; text-align:center; }
.section-tabbar button.active, .section-tabbar a.active { background: #fff; color: #1f2430; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=file], textarea {
  padding: 9px 10px; border-radius: 8px; border: 1px solid #d1d5db; font-size: 13px; width: 100%;
}
.concept-observations-textarea {
  display:block; box-sizing:border-box; width:100%; height:96px; min-height:96px; max-height:96px;
  resize:none; overflow-y:auto;
}
select { padding: 9px 8px; border-radius: 8px; border: 1px solid #d1d5db; font-size: 13px; background: #fff; }
label { font-size: 12px; color: #6b7280; display: block; margin-bottom: 4px; }
.field { flex: 1; margin-bottom: 10px; }
.field-help { color:#9ca3af; font-size:11px; line-height:1.3; margin-top:4px; }

button.primary, a.primary {
  background: #0200F9; color: #fff; border: none; border-radius: 8px; padding: 9px 16px;
  font-size: 13px; font-weight: 500; cursor: pointer; display: inline-block;
}
button.primary:hover, a.primary:hover { background: #0000C4; }
button.primary:disabled, button.ghost:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost, a.ghost {
  background: none; border: 1px solid #d1d5db; border-radius: 8px; padding: 9px 14px;
  font-size: 13px; cursor: pointer; color: #4b5563; display: inline-block;
}
button.ghost:hover, a.ghost:hover { background:#f8fafc; border-color:#9ca3af; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline:3px solid rgba(2,0,249,.22); outline-offset:2px; }

.proj-summary { display: flex; gap: 10px; margin-bottom: 14px; }
.stat { flex: 1; background: #fff; border-radius: 10px; padding: 10px 12px; border: 1px solid #e5e7eb; }
.stat .num { font-size: 17px; font-weight: 600; }
.stat .label { font-size: 11px; color: #6b7280; }
.stat.over .num { color: #dc2626; }
.project-summary-stats { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; }
.project-summary-stats .stat { min-width:0; padding:9px 10px; }
.project-summary-stats .num { font-size:clamp(14px, 2.3vw, 17px); white-space:nowrap; }

.partida {
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #fafafa;
}
.expense-list { margin-top: 6px; }
.expense {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 5px 0; border-top: 1px solid #f1f2f4; gap: 8px;
}
.expense .desc { color: #374151; }
.expense .meta { color: #9ca3af; }
.expense .amount { font-weight: 500; white-space: nowrap; }
.retention-derived .desc { display:flex; flex-direction:column; min-width:0; }
.retention-derived .desc strong { color:#374151; font-size:12px; }
.retention-derived .desc small { color:#6b7280; font-size:10px; margin-top:2px; }

.saldo-movement-row {
  width:100%; border-right:0; border-bottom:0; border-left:0; background:transparent;
  color:inherit; font:inherit; text-align:left; cursor:pointer;
}
.saldo-movement-row:hover { background:#f8fafc; }
.floating-modal.saldo-detail-modal {
  top:50%; width:min(900px, calc(100vw - 32px)); max-height:calc(100vh - 32px);
  overflow-y:auto; transform:translate(-50%, -50%); animation:none;
}
.saldo-detail-close { position:absolute; top:10px; right:10px; font-size:18px; }
.saldo-detail-title { padding-right:30px; font-size:16px; font-weight:700; }
.saldo-detail-meta {
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:5px 18px;
  margin-top:8px; color:#6b7280; font-size:11px;
}
.saldo-selected-movement {
  display:flex; justify-content:space-between; gap:12px; margin-top:12px; padding:9px 10px;
  border:1px solid #dbeafe; border-radius:8px; background:#f8faff; font-size:12px;
}
table.saldo-detail-table { min-width:760px; }
table.saldo-detail-table th:nth-child(n),
table.saldo-detail-table td:nth-child(n) { text-align:left; }
table.saldo-detail-table th:nth-child(2),
table.saldo-detail-table th:nth-child(3),
table.saldo-detail-table th:nth-child(4),
table.saldo-detail-table td:nth-child(2),
table.saldo-detail-table td:nth-child(3),
table.saldo-detail-table td:nth-child(4) { text-align:right; }
.saldo-detail-totals {
  display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px 22px;
  margin-top:12px; font-size:12px;
}
.saldo-detail-done { display:block; margin:14px 0 0 auto; }

.section-title { font-size: 13px; font-weight: 600; margin: 16px 0 8px; color: #374151; }
.empty { text-align: center; color: #9ca3af; font-size: 13px; padding: 20px 0; }
.concepto-sub { font-size: 11px; color: #9ca3af; }

.catalog-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip {
  background: #f1f2f4; border-radius: 14px; padding: 4px 10px; font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}
.chip button { background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 11px; padding: 0; }
.catalog-block { margin-bottom: 14px; }
.catalog-block-title { font-size: 12px; font-weight: 600; color: #4b5563; margin-bottom: 4px; }
.catalog-import-panel {
  margin-top:14px; padding-top:13px; border-top:1px solid #e5e7eb;
}
.catalog-import-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px; margin-top:8px; }
.catalog-import-field { display:flex; flex-direction:column; min-width:0; margin-bottom:0; }
.catalog-import-field textarea { min-height:108px; resize:vertical; }
.catalog-import-file {
  min-height:108px; padding:10px; border:1px dashed #cbd5e1; border-radius:8px; background:#f8fafc;
}
.catalog-import-field button { align-self:flex-start; margin-top:auto; }

.table-wrap { overflow-x: auto; }
table.budget-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.budget-table th { background: #1f2430; color: #fff; padding: 8px 10px; text-align: left; white-space: nowrap; }
table.budget-table th:not(:first-child), table.budget-table td:not(:first-child) { text-align: right; }
table.budget-table td { padding: 7px 10px; border-bottom: 1px solid #f1f2f4; white-space: nowrap; }
table.budget-table tr.total-row td { font-weight: 700; border-top: 2px solid #1f2430; border-bottom: none; }
table.budget-table td.over { color: #dc2626; font-weight: 600; }
table.summary-comparison-table { table-layout:fixed; min-width:0; }
table.summary-comparison-table th,
table.summary-comparison-table td { overflow:hidden; text-overflow:ellipsis; }
.summary-name-cell { max-width:0; text-align:left !important; }
.summary-name-content { display:flex; align-items:center; min-width:0; gap:5px; }
.summary-name-content.is-detail { padding-left:6px; }
.summary-row-toggle { flex:0 0 auto; font-size:9px; }
.summary-row-name { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.summary-concept-drag-handle {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 20px; width:20px; height:24px;
  border:1px solid transparent; border-radius:5px; color:#64748b; cursor:grab; touch-action:none;
}
.summary-concept-drag-handle:hover,
.summary-concept-drag-handle:focus { border-color:#94a3b8; background:rgba(255,255,255,.9); color:#0200F9; outline:none; }
.summary-concept-drag-handle:active { cursor:grabbing; }
.summary-concept-drag-handle svg { width:10px; height:14px; fill:currentColor; pointer-events:none; }
.summary-partida-row.summary-partida-drop-target > td {
  background:#dbeafe !important; box-shadow:inset 0 0 0 2px #0200F9; color:#1e3a8a;
}
.summary-level-label {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
  min-height:18px; padding:1px 6px; border-radius:999px;
  font-size:8px; font-weight:700; line-height:1; letter-spacing:.02em; text-transform:uppercase;
}
.summary-level-label.is-concepto { border:1px solid #b8c2cf; background:rgba(255,255,255,.9); color:#52606f; }
.summary-partida-row > td {
  border-top:2px solid #1f2430 !important; border-bottom:2px solid #1f2430 !important;
  font-weight:700;
}
.summary-partida-row .summary-row-name { text-transform:uppercase; }
.summary-concept-row { cursor:pointer; }
.summary-concept-row > td { font-size:11px; }
.summary-concept-row > td:first-child { border-left:4px solid #7fcac7; }
.summary-concept-row.is-over > td:first-child { border-left-color:#dc2626; }
.summary-concept-row.is-unbudgeted-over > td:first-child { border-left-color:#f97316; }
.summary-concept-row:hover > td,
.summary-concept-row:focus > td { box-shadow:inset 0 0 0 1px rgba(2,0,249,.28); }
.summary-concept-row:focus { outline:none; }

table.presupuesto-table { width: 100%; border-collapse: collapse; font-size: 12px; }
table.presupuesto-table th { background: #f1f2f4; padding: 7px 8px; text-align: left; border-bottom: 2px solid #d1d5db; white-space: nowrap; }
table.presupuesto-table th:nth-child(2), table.presupuesto-table th:nth-child(3), table.presupuesto-table th:nth-child(4) { text-align: right; }
table.presupuesto-table td { padding: 6px 8px; border-bottom: 1px solid #f1f2f4; }
table.presupuesto-table td:nth-child(2), table.presupuesto-table td:nth-child(3), table.presupuesto-table td:nth-child(4) { text-align: right; white-space: nowrap; }
table.presupuesto-table tr.partida-header td { background: #dcfce7; color: #14532d; font-weight: 700; }
table.presupuesto-table tr.proyecto-total td { background: #1f2430; color: #fff; font-weight: 700; }
table.presupuesto-management-table { min-width:700px; }
table.presupuesto-management-table th:last-child,
table.presupuesto-management-table td.concepto-actions-cell { width:100px; min-width:100px; text-align:right; white-space:nowrap; }
table.presupuesto-management-table td.concepto-actions-cell .del-link { vertical-align:middle; }
.concept-comment-hover { position:relative; cursor:help; }
.concept-comment-hover::after {
  content:attr(data-concept-comment); position:absolute; z-index:300; left:8px; top:calc(100% + 4px);
  width:max-content; max-width:min(320px, calc(100vw - 40px)); padding:7px 9px; border-radius:7px;
  background:#1f2430; color:#fff; box-shadow:0 8px 20px rgba(15,23,42,.24); font-size:11px;
  font-weight:400; line-height:1.4; white-space:normal; text-align:left; pointer-events:none;
  opacity:0; visibility:hidden; transform:translateY(-3px); transition:opacity .14s ease, transform .14s ease;
}
.concept-comment-hover:hover::after { opacity:1; visibility:visible; transform:translateY(0); }
.concept-history-button { position:relative; display:inline-flex; align-items:center; justify-content:center; padding:2px 4px; margin-left:3px; overflow:visible; }
.concept-history-count { position:absolute; top:-7px; right:-6px; min-width:14px; height:14px; padding:0 3px; display:inline-flex; align-items:center; justify-content:center; border:2px solid #fff; border-radius:999px; background:#9ca3af; color:#fff; font-size:8px; font-weight:600; line-height:1; }

table.destajo-lines-table { width:100%; min-width:780px; table-layout:fixed; }
table.destajo-lines-table th,
table.destajo-lines-table td { padding-left:4px; padding-right:4px; }
table.destajo-lines-table .destajo-col-concepto { width:34%; min-width:0; text-align:left; }
table.destajo-lines-table .destajo-col-cantidad { width:13%; min-width:78px; }
table.destajo-lines-table .destajo-col-pu { width:14%; min-width:86px; }
table.destajo-lines-table .destajo-col-total { width:13%; min-width:92px; overflow:hidden; text-align:right; }
table.destajo-lines-table .destajo-col-lote { width:12%; min-width:76px; }
table.destajo-lines-table .destajo-col-observaciones { width:11%; min-width:88px; }
table.destajo-lines-table.has-retentions { min-width:920px; }
table.destajo-lines-table.has-retentions .destajo-col-concepto { width:26%; }
table.destajo-lines-table.has-retentions .destajo-col-cantidad { width:11%; }
table.destajo-lines-table.has-retentions .destajo-col-pu { width:11%; }
table.destajo-lines-table.has-retentions .destajo-col-total { width:9%; min-width:90px; padding-right:10px; }
table.destajo-lines-table.has-retentions .destajo-col-retencion { width:23%; min-width:215px; padding-left:5px; }
table.destajo-lines-table.has-retentions .destajo-col-lote { width:9%; }
table.destajo-lines-table.has-retentions .destajo-col-observaciones { width:8%; }
table.destajo-lines-table .retention-line-field { display:flex; align-items:center; gap:3px; flex-wrap:nowrap; white-space:nowrap; }
table.destajo-lines-table .retention-line-field.has-value { display:grid; grid-template-columns:100px 68px minmax(32px, 1fr); gap:3px; width:100%; }
table.destajo-lines-table .retention-line-field select,
table.destajo-lines-table .retention-line-field input { min-width:0; height:36px; box-sizing:border-box; padding:8px 5px; font-size:12px; }
table.destajo-lines-table .retention-line-field select { min-width:0; height:36px; box-sizing:border-box; font-size:12px; }
table.destajo-lines-table .retention-line-field.has-value select { flex:0 0 100px; width:100px; padding-left:6px; padding-right:5px; }
table.destajo-lines-table .retention-line-field.is-none select,
table.destajo-lines-table .retention-line-field select:only-child { flex:0 0 171px !important; width:171px !important; max-width:100%; min-width:0 !important; }
table.destajo-lines-table .retention-line-value { display:flex; align-items:center; gap:2px; flex:0 0 68px; }
table.destajo-lines-table .retention-line-field.has-value .retention-line-value { width:100%; }
table.destajo-lines-table .retention-line-value span { color:#6b7280; font-size:11px; }
table.destajo-lines-table .retention-line-value input { width:100%; appearance:textfield; -moz-appearance:textfield; }
table.destajo-lines-table .retention-line-value input::-webkit-inner-spin-button,
table.destajo-lines-table .retention-line-value input::-webkit-outer-spin-button { margin:0; appearance:none; -webkit-appearance:none; }
table.destajo-lines-table .retention-line-field output { flex:1 1 auto; min-width:28px; color:#374151; font-size:10px; font-weight:600; text-align:right; font-variant-numeric:tabular-nums; }
table.destajo-lines-table th:last-child,
table.destajo-lines-table td:last-child { width:3%; min-width:22px; padding-left:2px; padding-right:2px; text-align:center; }
table.destajo-lines-table .destajo-col-cantidad input,
table.destajo-lines-table .destajo-col-pu input { padding-left:6px; padding-right:6px; }
table.destajo-lines-table .destajo-col-total strong {
  display:block; max-width:100%; overflow:hidden; white-space:nowrap; text-align:right;
  font-variant-numeric:tabular-nums;
}
table.destajo-lines-table .budget-field { min-width:0; }
.destajo-list-card { padding-bottom:10px; }
.destajo-list-row,
.destajo-list-grand-total {
  display:grid; grid-template-columns:minmax(0, 1fr) minmax(70px, auto) minmax(70px, auto) minmax(145px, auto);
  align-items:center; column-gap:10px;
}
.destajo-list-row { padding:7px 0; }
.destajo-list-row > .desc { min-width:0; }
.destajo-list-money { display:flex; flex-direction:column; align-items:flex-end; min-width:66px; white-space:nowrap; }
.destajo-list-money > span { color:#9ca3af; font-size:9px; font-weight:500; }
.destajo-list-money > strong { color:#1f2430; font-size:12px; font-variant-numeric:tabular-nums; }
.destajo-list-money.is-negative > strong,
.destajo-list-grand-total .is-negative { color:#dc2626; }
.destajo-row-actions { display:flex; align-items:center; gap:5px; white-space:nowrap; }
.destajo-list-grand-total {
  margin-top:6px; padding-top:9px; border-top:2px solid #1f2430;
}
.destajo-list-total-label { color:#4b5563; font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.destajo-filter-card { margin-bottom:12px; padding:12px 14px; }
.destajo-filter-grid {
  display:grid; grid-template-columns:minmax(160px, 1.3fr) repeat(3, minmax(135px, 1fr)); gap:10px;
}
.destajo-filter-grid .field { min-width:0; margin-bottom:0; }
.destajo-filter-grid select { width:100%; }
.destajo-filter-actions { display:flex; justify-content:flex-end; align-items:center; gap:8px; margin-top:10px; }
.destajo-filter-actions .concepto-sub { margin-right:auto; }
.destajo-captured-toggle-button {
  display:inline-flex; width:auto; min-height:34px; margin:0 0 12px; padding:7px 12px;
  align-items:center; justify-content:center; border-radius:8px; background:#f8fafc;
}

.consulta-title { margin-bottom:3px; }
.consulta-filter-card { margin-top:12px; margin-bottom:14px; }
.consulta-filter-grid {
  display:grid; grid-template-columns:minmax(190px, 1.35fr) minmax(150px, 1fr) repeat(2, minmax(165px, 1fr)) auto;
  align-items:end; gap:10px;
}
.consulta-filter-grid .field { min-width:0; margin-bottom:0; }
.consulta-filter-grid select { width:100%; }
.consulta-project-select-control { position:relative; min-width:0; }
.consulta-project-select-control select {
  display:block; width:100%; padding-right:42px; appearance:none; -webkit-appearance:none; -moz-appearance:none;
}
.consulta-project-select-arrow {
  position:absolute; top:1px; right:1px; bottom:1px; display:flex; align-items:center; justify-content:center;
  width:32px; border-left:1px solid #e5e7eb; border-radius:0 7px 7px 0;
  background:#f8fafc; color:#374151; font-size:11px; pointer-events:none;
}
.consulta-clear-button { height:37px; }
.consulta-contractor-field { position:relative; }
.consulta-contractor-options {
  position:absolute; z-index:1200; top:100%; left:0; right:0; max-height:290px; overflow:auto;
  margin-top:5px; padding:5px; border:1px solid #d1d5db; border-radius:10px; background:#fff;
  box-shadow:0 12px 32px rgba(15,23,42,.22); color:#1f2430;
}
.consulta-contractor-options .concept-result-option { padding:9px 10px; }
.consulta-contractor-options .concept-result-name { font-weight:400; }
[x-cloak] { display:none !important; }
.consulta-prompt { margin-top:14px; border:1px dashed #d1d5db; border-radius:10px; background:#fff; }
.consulta-summary-bar { display:flex; align-items:stretch; gap:10px; margin-top:2px; margin-bottom:14px; }
.consulta-summary { flex:1; min-width:0; margin:0; }
.consulta-report-buttons { display:flex; align-items:stretch; gap:10px; }
.consulta-pdf-button { min-width:118px; padding:9px 12px; cursor:pointer; }
.consulta-pdf-button svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.consulta-project-card { margin-bottom:12px; }
.consulta-project-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; }
.consulta-project-heading > div { display:flex; align-items:baseline; gap:8px; min-width:0; }
.consulta-project-heading > strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
table.consulta-table { min-width:900px; }
table.consulta-table th:first-child, table.consulta-table td:first-child,
table.consulta-table th:nth-child(3), table.consulta-table td:nth-child(3),
table.consulta-table th:nth-child(4), table.consulta-table td:nth-child(4),
table.consulta-table th:nth-child(5), table.consulta-table td:nth-child(5),
table.consulta-table th:nth-child(6), table.consulta-table td:nth-child(6) { text-align:left; }
.consulta-status { display:inline-flex; padding:2px 7px; border-radius:999px; background:#f1f2f4; color:#4b5563; font-size:10px; font-weight:600; }
.consulta-status.is-authorized { background:#dcfce7; color:#15803d; }
.consulta-grand-total {
  display:grid; grid-template-columns:minmax(0, 1fr) minmax(120px, auto) minmax(120px, auto);
  align-items:center; gap:18px; border:2px solid #1f2430; background:#f8fafc;
}
.consulta-grand-total > div:first-child { display:flex; flex-direction:column; gap:3px; }
.consulta-grand-total > div:first-child span { color:#6b7280; font-size:10px; }
.consulta-grand-total > div:not(:first-child) { display:flex; flex-direction:column; align-items:flex-end; }
.consulta-grand-total > div:not(:first-child) span { color:#6b7280; font-size:10px; }
.consulta-grand-total > div:not(:first-child) strong { font-size:16px; font-variant-numeric:tabular-nums; }
.summary-comparison-header {
  justify-content:space-between; align-items:center; flex-wrap:nowrap; min-height:42px; margin-top:2px;
}
.summary-view-actions { display:flex; flex:0 0 auto; align-items:center; gap:8px; }
.summary-actions-caption {
  color:#6b7280; font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
}
.summary-export-group {
  display:inline-flex; align-items:stretch; overflow:hidden; border:1px solid #1f2430; border-radius:10px;
  background:#fff; box-shadow:0 2px 5px rgba(31,36,48,.10);
}
.summary-export-button {
  display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:72px; height:34px; padding:6px 11px;
  border:0; border-radius:0; background:#fff; color:#1f2430;
  font-family:inherit; font-size:10px; font-weight:700; line-height:16px;
  text-decoration:none; white-space:nowrap; cursor:pointer;
  transition:background .15s ease, color .15s ease, box-shadow .15s ease;
}
.summary-export-button + .summary-export-button { border-left:1px solid #1f2430; }
.summary-export-button.is-excel { background:#1f2430; color:#fff; }
.summary-export-button.is-excel:hover { background:#000; }
.summary-export-button.is-pdf { background:#fff; color:#1f2430; }
.summary-export-button.is-pdf:hover { background:#eef0f3; }
.summary-export-button:focus-visible {
  position:relative; z-index:1; outline:3px solid rgba(2,0,249,.24); outline-offset:-3px;
}
.summary-export-svg { width:16px; height:16px; flex:0 0 16px; stroke:currentColor; stroke-width:1.55; stroke-linecap:round; stroke-linejoin:round; }
.summary-inline-percent { color:#1f2430; font-variant-numeric:tabular-nums; text-align:right; white-space:nowrap; }
.summary-inline-percent.is-over { color:#dc2626; }
.summary-inline-percent.is-unbudgeted-over { color:#f97316; }
.summary-inline-percent.is-unbudgeted { color:#6b7280; font-size:9px; font-weight:500; }
.summary-graph-row {
  --advance-bar-color:#7fcac7;
  background-color:transparent;
  background-image:linear-gradient(to right, var(--advance-bar-color), var(--advance-bar-color)), linear-gradient(to right, #e9edf2, #e9edf2);
  background-position:left center;
  background-repeat:no-repeat;
  background-size:var(--advance-width) calc(100% - 6px), 100% calc(100% - 6px);
}
.summary-graph-row.is-over { --advance-bar-color:#dc2626; }
.summary-graph-row.is-over.is-unbudgeted-over { --advance-bar-color:#f97316; }
.summary-graph-row > td { position:relative; padding-top:9px; padding-bottom:9px; background:transparent; border-bottom:0; }
.summary-graph-row.is-over > td { color:#fff; font-weight:600; text-shadow:0 1px 1px rgba(0,0,0,.28); }
.summary-no-graph-row > td { padding-top:9px; padding-bottom:9px; background:#fff; }
.summary-no-graph-row.is-detail > td { background:#f8fafc; }
.summary-inline-legend { display:flex; justify-content:flex-end; gap:12px; padding:8px 10px 0; color:#6b7280; font-size:9px; border-top:1px solid #e5e7eb; }
.summary-inline-legend span { display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
.summary-chart-swatch { display:inline-block; width:9px; height:9px; border-radius:2px; }
.summary-chart-swatch.is-progress { background:#7fcac7; }
.summary-chart-swatch.is-over { background:#dc2626; }
.summary-chart-swatch.is-unbudgeted-over { background:#f97316; }
.floating-modal.saldo-detail-modal.summary-concept-modal {
  width:min(1400px, calc(100vw - 8px));
  max-width:calc(100vw - 8px);
}
.summary-concept-heading { margin-top:8px; padding-right:28px; font-size:14px; font-weight:700; line-height:1.35; }
.summary-concept-overview { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; margin-top:12px; }
.summary-concept-overview > span { display:flex; flex-direction:column; min-width:0; padding:9px 10px; border:1px solid #e5e7eb; border-radius:8px; background:#f8fafc; }
.summary-concept-overview small { color:#6b7280; font-size:9px; line-height:1.25; }
.summary-concept-overview strong { margin-top:2px; font-size:12px; font-variant-numeric:tabular-nums; }
.summary-concept-table-wrap { border:1px solid #e5e7eb; border-radius:8px; }
table.summary-concept-detail-table { width:100%; min-width:700px; table-layout:fixed; }
table.summary-concept-detail-table th:nth-child(1) { width:6%; }
table.summary-concept-detail-table th:nth-child(2) { width:15%; }
table.summary-concept-detail-table th:nth-child(3) { width:19%; }
table.summary-concept-detail-table th:nth-child(4) { width:10%; }
table.summary-concept-detail-table th:nth-child(5) { width:10%; }
table.summary-concept-detail-table th:nth-child(6) { width:11%; }
table.summary-concept-detail-table th:nth-child(7) { width:12%; }
table.summary-concept-detail-table th:nth-child(8) { width:17%; }
table.summary-concept-detail-table th:nth-child(1),
table.summary-concept-detail-table td:nth-child(1),
table.summary-concept-detail-table th:nth-child(4),
table.summary-concept-detail-table td:nth-child(4),
table.summary-concept-detail-table th:nth-child(5),
table.summary-concept-detail-table td:nth-child(5),
table.summary-concept-detail-table th:nth-child(6),
table.summary-concept-detail-table td:nth-child(6) { text-align:right; white-space:nowrap; }
table.summary-concept-detail-table th:nth-child(2),
table.summary-concept-detail-table td:nth-child(2),
table.summary-concept-detail-table th:nth-child(3),
table.summary-concept-detail-table td:nth-child(3),
table.summary-concept-detail-table th:nth-child(7),
table.summary-concept-detail-table td:nth-child(7),
table.summary-concept-detail-table th:nth-child(8),
table.summary-concept-detail-table td:nth-child(8) {
  text-align:left; white-space:normal; overflow-wrap:anywhere;
}
.catalog-usage-badge {
  display:inline-flex; align-items:center; min-height:22px; padding:2px 7px; margin-left:3px;
  border:1px solid #d8dee8; border-radius:999px; background:#f3f5f8; color:#667085;
  font-size:9px; font-weight:600; line-height:14px; white-space:nowrap;
}
.user-presence-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.user-presence-summary { color:#047857; font-size:10px; font-weight:600; }
.user-presence-description { display:flex; align-items:center; flex-wrap:wrap; gap:5px 10px; min-width:0; }
.user-presence-status { display:inline-flex; align-items:center; gap:5px; color:#6b7280; font-size:10px; font-weight:500; }
.user-presence-status small { color:#9ca3af; font-size:9px; }
.user-presence-status.is-online { color:#047857; }
.user-presence-dot { width:7px; height:7px; flex:0 0 7px; border-radius:50%; background:#9ca3af; }
.user-presence-status.is-online .user-presence-dot { background:#10b981; box-shadow:0 0 0 3px rgba(16,185,129,.13); }
.global-presence-panel {
  position:relative; z-index:80; width:calc(100% - 24px); max-width:1120px; margin:10px auto 0;
  padding:0; overflow:hidden; border:1px solid #d1d5db; border-radius:10px; background:#fff;
  box-shadow:0 4px 14px rgba(15,23,42,.10); color:#374151;
}
.global-presence-heading {
  display:flex; align-items:center; justify-content:space-between; gap:8px; padding:13px 15px;
  background:#1f2430; color:#fff; font-size:16px; font-weight:700;
}
.global-presence-total { color:#d1d5db; font-size:11px; font-weight:500; }
.global-presence-count {
  display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:24px; padding:0 7px;
  border:1px solid #d8dee8; border-radius:999px; background:#f3f5f8; color:#4b5563; font-size:11px;
}
.global-presence-sections {
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; padding:13px; background:#f5f6f8;
}
.global-presence-section { min-width:0; padding:11px; border:1px solid #e5e7eb; border-radius:9px; background:#fff; }
.global-presence-section-title {
  display:flex; align-items:center; justify-content:space-between; gap:8px; padding-bottom:8px;
  border-bottom:1px solid #e5e7eb; color:#1f2430; font-size:13px; font-weight:700;
}
.global-presence-section.is-online .global-presence-count { border-color:#bbf7d0; background:#d1fae5; color:#047857; }
.global-presence-list { display:flex; align-items:stretch; flex-direction:column; gap:0; }
.global-presence-user { display:flex; align-items:center; gap:10px; min-width:0; padding:10px 2px; border-top:1px solid #f1f2f4; font-size:13px; }
.global-presence-user:first-child { border-top:0; }
.global-presence-user .user-presence-dot { width:9px; height:9px; flex-basis:9px; background:#10b981; box-shadow:0 0 0 3px rgba(16,185,129,.13); }
.global-presence-user.is-offline .user-presence-dot { background:#9ca3af; box-shadow:none; }
.global-presence-user-copy { display:flex; flex:1; flex-direction:column; min-width:0; }
.global-presence-name { overflow:hidden; color:#1f2430; font-size:13px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.global-presence-user-copy small { margin-top:2px; overflow:hidden; color:#6b7280; font-size:10px; font-weight:400; text-overflow:ellipsis; white-space:nowrap; }
.global-presence-you {
  padding:2px 6px; border-radius:999px; background:#eef2ff; color:#0200F9;
  font-size:9px; font-weight:700; text-transform:uppercase;
}
.global-presence-empty { padding:12px 1px 4px; color:#9ca3af; font-size:12px; }
.floating-modal.settings-modal {
  top:6%; width:min(480px, calc(100vw - 24px)); max-width:calc(100vw - 24px); max-height:88vh;
  padding:16px; overflow:auto;
}
.settings-presence .global-presence-panel {
  position:relative; inset:auto; z-index:auto; width:100%; max-width:none; max-height:none; margin:0 0 14px;
  box-shadow:none;
}
.settings-presence .global-presence-heading { min-height:0; padding:8px 12px; font-size:14px; line-height:1.2; }
.settings-presence .global-presence-total { font-size:10px; }
.settings-presence .global-presence-sections { gap:10px; padding:12px; }
.settings-presence .global-presence-section { min-height:0; padding:10px; }
.settings-presence .global-presence-section-title { font-size:14px; }
.settings-presence .global-presence-user { padding:8px 2px; }
.settings-presence .global-presence-name { font-size:14px; }
.settings-presence .global-presence-user-copy small { font-size:11px; }
@media (min-width: 1800px) {
  .global-presence-panel {
    position:fixed; top:18px; right:18px; width:330px; max-width:330px; max-height:calc(100vh - 36px);
    margin:0; overflow:auto;
  }
  .global-presence-sections { grid-template-columns:1fr; }
  .settings-presence .global-presence-panel {
    position:relative; inset:auto; width:100%; max-width:none; max-height:none; margin:0 0 14px;
  }
  .settings-presence .global-presence-sections { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .floating-modal.settings-modal { width:calc(100vw - 12px); max-width:calc(100vw - 12px); padding:12px; }
  .settings-presence .global-presence-sections { grid-template-columns:1fr; padding:12px; }
  .settings-presence .global-presence-section { min-height:auto; }
}
.destajo-concepto-field {
  display:grid; grid-template-columns:minmax(0,1fr) 32px 30px;
  gap:4px; align-items:stretch; min-width:0;
}
.herramienta-entry-card { padding:18px; }
.herramienta-entry-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding-bottom:12px; margin-bottom:14px; border-bottom:1px solid #e5e7eb; }
.herramienta-entry-heading .section-title { margin:0 0 3px; }
.herramienta-form-grid { display:grid; grid-template-columns:minmax(0, 1.65fr) minmax(150px, .85fr); gap:12px 14px; }
.herramienta-form-grid .field { min-width:0; margin:0; }
.herramienta-form-grid input,
.herramienta-form-grid select,
.herramienta-form-grid textarea { width:100%; }
.herramienta-field-full { grid-column:1 / -1; }
.herramienta-field-full textarea { min-height:68px; resize:vertical; }
.herramienta-form-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-top:14px; }
.herramienta-form-actions .flash { flex:1; margin:0; }
.herramienta-form-actions .primary { min-width:180px; }
.floating-modal.herramienta-edit-modal { top:8%; width:min(480px, calc(100vw - 20px)); max-height:84vh; overflow:auto; }
.herramienta-edit-row > .field { flex:1; min-width:0; }
.herramienta-abonos-link { color:#1f2430; font-weight:600; text-decoration:underline; text-decoration-color:#cbd5e1; text-underline-offset:3px; white-space:nowrap; }
.herramienta-abonos-link:hover { color:#0200F9; text-decoration-color:#0200F9; }
.herramienta-sin-abonos { color:#64748b; white-space:nowrap; }
.herramienta-abonos-card { scroll-margin-top:16px; }
.herramienta-abonos-card .concepto-sub { margin-bottom:12px; }
.herramienta-abonos-table td { vertical-align:middle; }
.herramienta-abonos-table td > strong { color:#1f2430; white-space:nowrap; }
.herramienta-abonos-empty { padding:10px 0 2px; border-top:1px solid #e5e7eb; color:#7c879b; font-size:11px; }
.destajo-balance-note {
  margin-top:8px; padding:9px 11px; border:1px solid #e5e7eb; border-radius:6px;
  background:#f8fafc; color:#4b5563; font-size:12px; line-height:1.4;
}
.destajo-balance-note > strong:first-child { color:#1f2430; font-weight:600; }
@media (max-width: 460px) {
  .herramienta-entry-card { padding:14px; }
  .herramienta-form-grid { grid-template-columns:1fr; gap:10px; }
  .herramienta-field-full { grid-column:auto; }
  .herramienta-form-actions { align-items:stretch; flex-direction:column; }
  .herramienta-form-actions .primary { width:100%; min-width:0; }
}
.destajo-concepto-field input { width:100%; min-width:0; }
.destajo-concepto-field > button { width:100%; min-width:0; padding:8px 4px; }
.destajo-column-order-button { margin-bottom:8px; padding:5px 10px; font-size:11px; }
.required-field.is-missing { border-color:#dc2626; background:#fff7f7; box-shadow:0 0 0 2px rgba(220,38,38,.1); }
.required-warning { margin-top:4px; color:#dc2626; font-size:11px; font-weight:600; }
.concept-search-control { position:relative; min-width:0; }
.concept-search-control input { padding-right:34px; }
.concept-search-toggle {
  position:absolute; top:1px; right:1px; bottom:1px; width:32px; padding:0;
  border:0; border-left:1px solid #e5e7eb; border-radius:0 7px 7px 0;
  background:#f8fafc; color:#374151; cursor:pointer; font-size:14px;
}
.concept-search-toggle:hover { background:#eef2ff; color:#0200F9; }
.concept-results-popover {
  position:fixed; z-index:2500; display:none; max-height:290px; overflow:auto;
  padding:5px; border:1px solid #d1d5db; border-radius:10px; background:#fff;
  box-shadow:0 12px 32px rgba(15,23,42,.22); color:#1f2430;
}
.concept-results-popover.is-open { display:block; }
.concept-result-option {
  display:block; width:100%; padding:8px 10px; border:0; border-radius:7px;
  background:#fff; color:#1f2430; text-align:left; cursor:pointer;
}
.concept-result-option:hover, .concept-result-option.is-active { background:#eef2ff; }
.concept-result-name { display:block; font-size:12px; font-weight:650; line-height:1.25; }
.concept-result-price { display:block; margin-top:2px; color:#4b5563; font-size:10px; font-weight:600; line-height:1.2; }
.concept-results-empty { padding:14px 10px; color:#6b7280; font-size:12px; text-align:center; }

.lote-picker-modal { width:min(390px, calc(100vw - 24px)); }
.lote-picker-concepto { margin:3px 0 9px; }
.lote-picker-tabs {
  display:grid; grid-template-columns:1fr 1fr; gap:0; margin-bottom:8px;
  overflow:hidden; border:1px solid #1f2430; border-radius:10px;
}
.lote-picker-tabs button {
  display:flex; justify-content:center; align-items:center; gap:6px; padding:8px 6px;
  border:0; border-radius:0; background:#fff; color:#1f2430; font-size:11px;
}
.lote-picker-tabs button + button { border-left:1px solid #1f2430; }
.lote-picker-tabs button span {
  min-width:20px; padding:1px 6px; border-radius:999px; background:#eef0f3; font-size:9px; font-weight:700;
}
.lote-picker-tabs button.is-active { background:#1f2430; color:#fff; }
.lote-picker-tabs button.is-active span { background:#374151; color:#fff; }
.lote-picker-tabs button.ghost.is-active:hover { border-color:#1f2430; background:#1f2430; color:#fff; }
.lote-picker-select-visible { width:100%; margin-bottom:8px; padding:7px 5px; font-size:11px; }
.lote-picker-list { max-height:240px; overflow-y:auto; padding-right:3px; }
.lote-picker-empty { padding:18px 8px; text-align:center; }
.lote-picker-missing-concept { margin-top:10px; }
.lote-picker-item {
  display:grid; grid-template-columns:auto minmax(0, 1fr); align-items:center; gap:7px;
  margin-bottom:3px; padding:6px 7px; border:1px solid #e5e7eb; border-radius:7px;
  font-size:12px; cursor:pointer;
}
.lote-picker-item:hover { background:#f8fafc; }
.lote-picker-label { min-width:0; }

.floating-modal.budget-browser-modal {
  top:12%; width:min(620px, calc(100vw - 24px)); max-height:84vh; overflow:auto;
  transform:translateX(-50%);
  animation:slideUp .24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.budget-browser-partida {
  display:grid; grid-template-columns:minmax(0, 1fr) 90px; align-items:center; gap:12px;
  margin:10px 3px 5px; padding:6px 8px; border-radius:7px;
  background:#1f2430; color:#fff; font-size:10px; font-weight:700;
  letter-spacing:.04em; line-height:1.25; text-transform:uppercase;
}
.budget-browser-partida > strong { min-width:0; overflow:hidden; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
.budget-browser-partida > span:last-child { text-align:right; }
.budget-browser-item {
  display:flex; align-items:stretch; gap:5px; padding:3px; border-bottom:1px solid #f1f2f4;
}
.budget-browser-item:hover { background:#f8fafc; }
.budget-browser-choice {
  display:grid; grid-template-columns:minmax(0, 1fr) 90px; align-items:center; gap:12px;
  flex:1; min-width:0; padding:7px 8px; border:0; border-radius:7px; background:transparent;
  color:#1f2430; text-align:left; cursor:pointer;
}
.budget-browser-choice:hover { background:#eef2ff; }
.budget-browser-choice span { display:block; min-width:0; font-size:12px; font-weight:600; line-height:1.25; }
.budget-browser-choice small {
  display:block; margin:0; color:#4b5563;
  font-size:10px; font-weight:600; line-height:1.25; text-align:right; white-space:nowrap;
}
.del-link { background: none; border: none; color: #9ca3af; font-size: 12px; cursor: pointer; }
.del-link:hover { color: #ef4444; }
.del-link:disabled { opacity:.4; color:#9ca3af; cursor:not-allowed; }
.inline-confirm-dismiss-layer { position:fixed; z-index:850; inset:0; background:transparent; }
.inline-confirm-action { position:relative; z-index:851; }

.modal-backdrop { 
  position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.18);
  animation: fadeIn 0.18s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; background: rgba(0,0,0,0); }
  to { opacity: 1; background: rgba(0,0,0,0.18); }
}
.floating-modal {
  position: fixed; z-index: 1000; background: #fff; border: 1px solid #d1d5db; border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18); padding: 14px; width: 320px; max-width: calc(100vw - 20px);
  left: 50%; top: 20%; transform: translateX(-50%);
  animation: slideUp 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

input[type=text], input[type=number], input[type=date], input[type=password], input[type=file], textarea, select {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
input[type=text]:focus, input[type=number]:focus, input[type=date]:focus, input[type=password]:focus, input[type=file]:focus, textarea:focus, select:focus {
  border-color: #0200F9;
  box-shadow: 0 0 0 3px rgba(2,0,249,0.1);
}

button, a { transition: all 0.16s ease; }
button.primary:hover, a.primary:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(2,0,249,0.24); }
button.ghost:hover, a.ghost:hover { background: #f8fafc; border-color: #9ca3af; }
button.del-link:hover { color: #ef4444; }

.card, .tabbar, .chip, .expense { transition: all 0.16s ease; }
.expense:hover { background: rgba(0,0,0,0.02); }

.flash { animation: slideDown 0.24s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.tabbar button.active, .tabbar a.active, .section-tabbar button.active, .section-tabbar a.active, .main-tabbar button.active, .main-tabbar a.active {
  transition: all 0.2s ease;
}

.footer-brand { text-align: center; margin-top: 24px; padding-top: 14px; border-top: 1px solid #e5e7eb; opacity: 0.75; }
.footer-brand a { text-decoration: none; color: #6b7280; font-size: 11px; }
.footer-brand .app-version { margin-left:6px; color:#9ca3af; font-size:10px; font-weight:600; }
.error { color: #dc2626; font-size: 12px; }
.ok { color: #16a34a; font-size: 12px; }
.upload-ready {
  margin-top: 7px; padding: 7px 9px; border: 1px solid #bbf7d0; border-radius: 8px;
  background: #f0fdf4; color: #166534; font-size: 12px; overflow-wrap: anywhere;
}
.flash { background: #fee2e2; color: #991b1b; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 12px; }
.flash.ok { background: #dcfce7; color: #14532d; }
.over-field { background: #dc2626 !important; color: #fff !important; }
.budget-field { position:relative; min-width:78px; }
.budget-tooltip {
  display:none; position:absolute; z-index:30; left:50%; bottom:calc(100% + 7px); transform:translateX(-50%);
  padding:8px 12px; border-radius:8px; background:#1f2430; color:#fff; font-size:11px; font-weight:500;
  line-height:1; white-space:nowrap; box-shadow:0 5px 16px rgba(15,23,42,.28); pointer-events:none;
}
.budget-tooltip::after {
  content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-top-color:#1f2430;
}
.budget-tooltip span { color:#9ca3af; padding:0 4px; }
.budget-field:hover .budget-tooltip, .budget-field:focus-within .budget-tooltip { display:block; }
.budget-availability {
  display:none; position:fixed; z-index:2600; left:0; top:0;
  visibility:hidden;
  grid-template-columns:repeat(2,minmax(82px,1fr)); gap:4px;
  min-width:max-content; margin:0; padding:5px; border:1px solid #d1d5db; border-radius:9px;
  background:#fff; color:#374151; line-height:1.2; box-shadow:0 8px 22px rgba(15,23,42,.2);
  pointer-events:none;
}
.budget-field:focus-within .budget-availability { display:grid; }
.budget-field:focus-within .budget-availability.is-positioned { visibility:visible; }
.budget-availability::after {
  content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:6px solid transparent; border-top-color:#d1d5db;
}
.budget-availability.opens-below::after {
  top:auto; bottom:100%; border-top-color:transparent; border-bottom-color:#d1d5db;
}
.budget-availability-single { grid-template-columns:1fr; }
.budget-metric {
  display:flex; flex-direction:column; align-items:flex-start; gap:1px; min-width:0;
  padding:5px 6px; border:1px solid #e5e7eb; border-radius:6px; background:#f8fafc;
}
.budget-metric-label { color:#6b7280; font-size:9px; font-weight:600; white-space:nowrap; }
.budget-metric strong { color:#1f2430; font-size:12px; font-weight:700; }
.budget-metric.is-negative {
  border-color:#b91c1c; background:#dc2626;
}
.budget-metric.is-negative .budget-metric-label,
.budget-metric.is-negative strong { color:#fff; }
.stat-button { text-align:left; color:inherit; cursor:pointer; }
.stat-button.selected { box-shadow:0 0 0 2px #0200F9 inset; }
.check-row { display:flex; align-items:center; gap:7px; font-size:12px; color:#374151; margin:5px 0; }
.check-row input { width:auto; }
.permission-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px 12px; margin-top:8px; }
.permission-master {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin:10px 0; padding:10px 12px; border:1px solid #cbd5e1; border-radius:9px; background:#f8fafc;
}
.permission-master .check-row { margin:0; font-weight:700; color:#111827; }
.permission-master > span { color:#6b7280; font-size:11px; text-align:right; }
.permission-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:10px; }
.permission-section { min-width:0; padding:11px 12px; border:1px solid #e2e8f0; border-radius:10px; background:#fff; }
.permission-section-title { padding-bottom:7px; border-bottom:1px solid #eef2f7; color:#1f2937; font-size:12px; font-weight:700; }
.permission-section .permission-grid { grid-template-columns:1fr; margin-top:7px; }
.pagination { display:flex; gap:6px; align-items:center; justify-content:center; }
.history-pagination {
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  margin-top:10px; padding:10px 0 2px;
}
.history-pagination-summary { margin:0; color:#6b7280; font-size:12px; }
.history-pagination-controls { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.history-page-button {
  display:inline-flex; align-items:center; justify-content:center; min-width:34px; height:34px;
  padding:0 10px; border:1px solid #d1d5db; border-radius:8px; background:#fff;
  color:#374151; font:inherit; font-size:12px; cursor:pointer;
}
.history-page-button:hover:not(:disabled):not(.is-current) { border-color:#9ca3af; background:#f8fafc; }
.history-page-button.is-current { background:#1f2430; border-color:#1f2430; color:#fff; font-weight:600; }
.history-page-button:disabled { opacity:.45; cursor:not-allowed; }
.history-page-direction { gap:5px; }
.history-page-ellipsis { color:#9ca3af; padding:0 3px; }

.view-stage { position: relative; min-height: 90px; }
.view-transition-content {
  opacity: 1;
  transition: opacity .22s ease;
}
.view-transition-content.is-loading {
  opacity: .38;
  pointer-events: none;
}
.view-loader {
  position: absolute; z-index: 80; left: 50%; top: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid #dbe2ea; border-radius: 999px; background: rgba(255,255,255,.96);
  box-shadow: 0 6px 20px rgba(31,36,48,.14); color: #4b5563; font-size: 12px; font-weight: 600;
}
.view-loader-spinner {
  width: 14px; height: 14px; border: 2px solid #c7d2fe; border-top-color: #0200F9;
  border-radius: 50%; animation: viewSpin .65s linear infinite;
}
@keyframes viewSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .view-transition-content { transition-duration: .01ms; }
  .view-loader-spinner { animation-duration: 1.4s; }
}

@media (max-width: 920px) {
  .backup-action-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .backup-restore-button { grid-column:1; }
  .backup-download-button { grid-column:2; }
}

@media (max-width: 680px) {
  body { padding:14px 10px 40px; }
  .app-title-row { gap:12px; min-height:38px; }
  .app-title-logo { position:static; width:156px; height:38px; transform:none; }
  .database-backup-panel { align-items:flex-start; flex-wrap:wrap; }
  .database-backup-download { flex:1 0 100%; }
  .database-backup-download button { width:100%; }
  .bulk-import-heading { flex-direction:column; }
  .bulk-import-heading .ghost { width:100%; text-align:center; }
  .bulk-import-steps { grid-template-columns:1fr; }
  .backup-action-header, .backup-create-row { align-items:stretch; flex-direction:column; }
  .backup-action-grid { grid-template-columns:1fr; }
  .backup-restore-button, .backup-download-button { grid-column:1; }
  .backup-create-row button { width:100%; }
  .backup-create-actions { align-items:stretch; flex-direction:column; width:100%; }
  .backup-create-actions form { width:100%; }
  .backup-history-table { min-width:640px; }
  .catalog-import-grid { grid-template-columns:1fr; }
  .catalog-import-file { min-height:0; }
  .main-tabbar { align-items:flex-start; overflow-x:auto; }
  .main-tabbar > div { min-width:max-content; }
  .section-tabbar { overflow-x:auto; justify-content:flex-start; }
  .section-tabbar button, .section-tabbar a { min-width:max-content; }
  .catalog-tabs { flex-wrap:nowrap; }
  .proj-summary, .saldo-grid { display:grid; grid-template-columns:1fr; }
  .project-summary-stats { grid-template-columns:repeat(4, minmax(0, 1fr)); gap:6px; }
  .project-summary-stats .stat { padding:8px 7px; }
  .project-summary-stats .label { font-size:10px; }
  .row > .field { min-width:100%; }
  .expense { align-items:flex-start; flex-direction:column; }
  .expense > span:last-child { align-self:flex-end; }
  .destajo-list-row,
  .destajo-list-grand-total { grid-template-columns:minmax(0, 1fr) minmax(72px, auto) minmax(72px, auto); }
  .destajo-list-row > .desc { grid-column:1 / -1; }
  .destajo-list-row > .destajo-list-money:nth-of-type(2) { grid-column:2; }
  .destajo-list-row > .destajo-list-money:nth-of-type(3) { grid-column:3; }
  .destajo-row-actions { grid-column:1 / -1; justify-self:end; }
  .destajo-list-actions-spacer { display:none; }
  .destajo-filter-grid, .consulta-filter-grid { grid-template-columns:1fr; }
  .consulta-summary-bar { align-items:stretch; flex-direction:column; }
  .report-detail-heading { align-items:flex-start; }
  .report-detail-heading .report-download-actions { gap:5px; }
  .report-detail-heading .report-download-actions button { padding:6px 8px; font-size:11px; }
  .consulta-report-buttons { width:100%; }
  .consulta-report-buttons .consulta-pdf-button { flex:1; min-width:0; }
  .consulta-pdf-button { width:100%; min-height:38px; }
  .consulta-grand-total { grid-template-columns:1fr 1fr; }
  .consulta-grand-total > div:first-child { grid-column:1 / -1; }
  .destajo-filter-actions { align-items:stretch; flex-direction:column; }
  .destajo-filter-actions .concepto-sub { margin-right:0; }
  .destajo-filter-actions button, .consulta-clear-button { width:100%; }
  .destajo-captured-toggle-button { width:auto; }
  .permission-grid { grid-template-columns:1fr; }
  .permission-sections { grid-template-columns:1fr; }
  .permission-master { align-items:flex-start; flex-direction:column; }
  .permission-master > span { text-align:left; }
  .floating-modal { top:8%; max-height:84vh; overflow:auto; }
  .saldo-detail-modal { top:50%; max-height:calc(100vh - 20px); }
  .saldo-detail-meta { grid-template-columns:1fr; }
  .summary-concept-overview { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .saldo-selected-movement { align-items:flex-start; flex-direction:column; }
  .summary-actions-caption { display:none; }
  .summary-export-button { min-width:64px; padding:5px 8px; }
  .floating-modal.budget-browser-modal { top:4%; width:calc(100vw - 20px); max-height:92vh; }
  .history-pagination { justify-content:center; }
  .history-pagination-summary { width:100%; text-align:center; order:2; }
  .history-pagination-controls { justify-content:center; order:1; }
}

@media (max-width: 420px) {
  .project-summary-stats { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .app-title-row { align-items:center; flex-direction:row; gap:8px; }
  .app-title-row h1 { font-size:16px; }
  .app-title-copy { gap:5px; }
  .app-title-logo { width:90px; height:30px; }
  table.summary-comparison-table { min-width:510px; }
}
