/* Unidad 4 · v1.8.1. Hoja ADICIONAL: no sustituye el sistema visual v1.7.9. */
body.u4-v164-budget { --v181-paper:#dce6ed;--v181-panel:#e8eef3;--v181-cell:#f1f5f8;--v181-row:#e2ebf1;--v181-line:#bccbd6;--v181-ink:#183548;--v181-muted:#647d91;--v181-accent:#247c88; }
html[data-u4-theme="dark"] body.u4-v164-budget { --v181-paper:#0d1c2b;--v181-panel:#162a3d;--v181-cell:#182f44;--v181-row:#1b344a;--v181-line:#304b61;--v181-ink:#e8f2f7;--v181-muted:#a4b9c8;--v181-accent:#5bc1c1; }
body.u4-v164-budget .workspace>main { gap:9px; }
body.u4-v164-budget .metrics {gap:9px;}
body.u4-v164-budget .metric {border-radius:9px;box-shadow:none;min-height:75px;padding:10px 12px;}
body.u4-v164-budget .metric strong {font-size:17px;letter-spacing:-.25px;line-height:1.3;}
body.u4-v164-budget .metric small {font-size:11px;}
body.u4-v164-budget .metric span {font-size:10px;}
body.u4-v164-budget .v176-budget-switch {margin:6px 0 8px;border-radius:10px;box-shadow:none;}
body.u4-v164-budget .v176-budget-switch h2 {font-size:14px;}
body.u4-v164-budget .v176-budget-section {min-height:0;}
body.u4-v164-budget .budget-toolbar {gap:6px;padding:8px;}
body.u4-v164-budget .budget-toolbar .action {padding:6px 8px;min-height:29px;white-space:nowrap;font-size:10.5px;}
body.u4-v164-budget .filters :is(input,select){height:30px;}
body.u4-v164-budget .data-table td {height:34px;padding:4px 6px;border-color:var(--v181-line);}
body.u4-v164-budget .data-table th {border-color:var(--v181-line);}
body.u4-v164-budget .data-table tr.group-row td {height:36px;}
body.u4-v164-budget .data-table td.item-name {white-space:normal;}
body.u4-v164-budget .data-table .item-name .indent .inline-cell {white-space:normal;line-height:1.25;}
body.u4-v164-budget .money-display {gap:2px;grid-template-columns:20px minmax(0,1fr);}
body.u4-v164-budget .money-display .money-figure {font-size:10.5px;}
body.u4-v164-budget .money-display .money-label {font-size:8px;}
body.u4-v164-budget .data-table .row-tools {padding:3px 5px;}
body.u4-v164-budget .row-menu-wrap {gap:3px;justify-content:flex-end;}
body.u4-v164-budget .movement-toggle {flex:0 0 auto;font-size:9px;font-weight:800;white-space:nowrap;border:1px solid var(--v181-line);color:var(--v181-ink);background:var(--v181-row);border-radius:5px;padding:4px 5px;cursor:pointer;}
body.u4-v164-budget .movement-toggle:hover {border-color:var(--v181-accent);}
body.u4-v164-budget .v181-movement-detail td {height:auto!important;padding:0 10px 7px!important;white-space:normal;background:var(--v181-panel)!important;border-bottom:1px solid var(--v181-line);}
body.u4-v164-budget .v181-movement-shell {margin:0 2px 2px 68px;padding:5px 11px;border-radius:7px;border-left:2px solid var(--v181-accent);background:var(--v181-cell);max-width:calc(100% - 70px);}
body.u4-v164-budget .v181-movement-line {display:grid;grid-template-columns:85px 96px minmax(110px,1fr) minmax(110px,1fr) 130px auto;align-items:center;gap:9px;padding:7px 4px;border-bottom:1px solid var(--v181-line);font-size:10px;}
body.u4-v164-budget .v181-movement-line:last-child {border-bottom:0;}
body.u4-v164-budget .v181-movement-line b {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--v181-ink);}
body.u4-v164-budget .v181-movement-line small,body.u4-v164-budget .v181-movement-line time {color:var(--v181-muted);font-size:10px;}
body.u4-v164-budget .v181-movement-line strong {font-size:11px;color:var(--v181-ink);text-align:right;white-space:nowrap;}
body.u4-v164-budget .v181-movement-type {font-weight:800;color:var(--v181-accent);}
body.u4-v164-budget .v181-movement-line em {font-style:normal;color:var(--v181-muted);font-size:9px;}
body.u4-v164-budget .v181-movement-line.is-reclassified {opacity:.68;}
/* Panel corregido: semántica limpia y campos alineados, sin cuadros decorativos excesivos. */
body.u4-v164-budget .money-drawer {width:min(500px,100vw);}
body.u4-v164-budget .money-drawer-head {padding:13px 17px 10px;}
body.u4-v164-budget .money-drawer-head h2 {font-size:16px;line-height:1.2;}
body.u4-v164-budget .money-drawer form {padding:12px 16px 14px;gap:10px;}
body.u4-v164-budget .currency-edit {padding:11px 12px;gap:7px;border-radius:8px;box-shadow:none;}
body.u4-v164-budget .currency-edit-title {padding-bottom:7px;}
body.u4-v164-budget .currency-edit-title b {font-size:13px;}
body.u4-v164-budget .currency-edit input,body.u4-v164-budget .currency-edit select {height:30px;padding:4px 8px;font-size:11px;}
body.u4-v164-budget .currency-conversion {padding-top:6px;}
body.u4-v164-budget .currency-conversion strong {font-size:13px;}
body.u4-v164-budget .control-totals {padding-top:10px;gap:8px;border-color:var(--v181-line);}
body.u4-v164-budget .v181-movements {display:flex;flex-direction:column;}
body.u4-v164-budget .movement-form-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 9px;min-width:0;}
body.u4-v164-budget .movement-form-grid label {display:flex;flex-direction:column;gap:4px;min-width:0;font-size:10px;font-weight:700;color:var(--v181-muted);}
body.u4-v164-budget .movement-form-grid label.movement-full {grid-column:1 / -1;}
body.u4-v164-budget .movement-form-grid :is(input,select) {height:31px;width:100%;min-width:0;padding:5px 8px;border:1px solid var(--v181-line);border-radius:6px;background:var(--v181-cell);color:var(--v181-ink);font-size:11px;}
body.u4-v164-budget .movement-form-grid :is(input,select):focus {border-color:var(--v181-accent);outline:none;}
body.u4-v164-budget .movement-add-line {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;background:var(--v181-cell);border:1px solid var(--v181-line);border-radius:7px;}
body.u4-v164-budget .movement-add-line span {display:flex;flex-direction:column;gap:3px;min-width:0;}
body.u4-v164-budget .movement-add-line small {font-size:10px;color:var(--v181-muted);}
body.u4-v164-budget .movement-add-line strong {font-size:13px;color:var(--v181-ink);}
body.u4-v164-budget .movement-add-line button {padding:7px 11px;flex:none;}
body.u4-v164-budget .movement-list-card {border:1px solid var(--v181-line);border-radius:8px;overflow:hidden;background:var(--v181-cell);}
body.u4-v164-budget .movement-list-head {display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;background:var(--v181-row);color:var(--v181-ink);}
body.u4-v164-budget .movement-list-head b,body.u4-v164-budget .movement-list-head span {font-size:11px;font-weight:800;}
body.u4-v164-budget .movement-list {display:flex;flex-direction:column;gap:0;max-height:130px;overflow-y:auto;}
body.u4-v164-budget .movement-chip-row {display:flex;justify-content:space-between;align-items:center;padding:8px 10px;gap:12px;border-top:1px solid var(--v181-line);min-width:0;}
body.u4-v164-budget .movement-chip-main {display:flex;flex-direction:column;gap:3px;min-width:0;}
body.u4-v164-budget .movement-chip-main b {font-size:10.5px;color:var(--v181-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
body.u4-v164-budget .movement-chip-main small {font-size:9px;color:var(--v181-muted);}
body.u4-v164-budget .movement-chip-end {display:flex;align-items:center;gap:6px;white-space:nowrap;flex:none;}
body.u4-v164-budget .movement-chip-end span {font-size:11px;font-weight:800;color:var(--v181-ink);}
body.u4-v164-budget .icon-mini {width:22px;height:22px;line-height:18px;border:1px solid var(--v181-line);border-radius:6px;background:var(--v181-row);color:var(--v181-ink);cursor:pointer;}
body.u4-v164-budget .movement-empty-list {padding:8px 10px;color:var(--v181-muted);font-size:10px;}
body.u4-v164-budget .money-foot {border-color:var(--v181-line);margin-top:3px;padding:10px 0 0;}
body.u4-v164-budget .v181-reclass-modal {max-width:520px;}
body.u4-v164-budget .v181-warning {font-size:11px;padding:9px 10px;border-left:3px solid var(--v181-accent);background:var(--v181-cell);color:var(--v181-ink);}
body.u4-v164-budget .v181-reclass-modal :is(input,textarea,select) {width:100%;background:var(--v181-cell);color:var(--v181-ink);}
/* Modo oscuro: contraste legible en paneles y menús; el modo claro conserva tono gris-azulado. */
html[data-u4-theme="dark"] body.u4-v164-budget :is(.money-drawer,.currency-edit,.control-totals,.movement-list-card,.v181-reclass-modal) {background:var(--v181-panel)!important;color:var(--v181-ink)!important;border-color:var(--v181-line)!important;}
html[data-u4-theme="dark"] body.u4-v164-budget :is(.money-drawer-head,.money-foot,.money-drawer form) {background:var(--v181-panel)!important;color:var(--v181-ink)!important;}
html[data-u4-theme="dark"] body.u4-v164-budget .money-drawer :is(input,select,textarea) {background:#112638!important;border-color:var(--v181-line)!important;color:var(--v181-ink)!important;}
html[data-u4-theme="dark"] body.u4-v164-budget .money-drawer :is(.currency-edit-title b,.currency-conversion strong,.movement-list-head b,.money-drawer-head h2) {color:var(--v181-ink)!important;}
html[data-u4-theme="dark"] body.u4-v164-budget .v181-movement-line {color:var(--v181-ink)!important;}
@media(max-width:850px){body.u4-v164-budget .v181-movement-line{grid-template-columns:60px 80px minmax(100px,1fr) 120px}body.u4-v164-budget .v181-movement-line small{display:none}body.u4-v164-budget .v181-movement-shell{margin-left:0;max-width:100%;}}

body.u4-v164-budget .v181-trash-list {max-height:300px;overflow:auto;display:flex;flex-direction:column;gap:5px;padding:4px 0;}
body.u4-v164-budget .v181-trash-item {display:flex;align-items:center;gap:9px;padding:9px 10px;background:var(--v181-cell);border:1px solid var(--v181-line);border-radius:7px;color:var(--v181-ink);font-size:11px;}
body.u4-v164-budget .v181-trash-item input {accent-color:var(--v181-accent);}
