:root {
    --ink: #17211f;
    --muted: #6c7875;
    --line: #e3e8e5;
    --paper: #f5f6f3;
    --white: #fff;
    --forest: #173f37;
    --mint: #dff2e9;
    --coral: #e46f51;
    --shadow: 0 20px 60px rgba(29, 52, 47, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
textarea { font: inherit; }
button, summary, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 9vw; color: white; background: var(--forest); }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.login-brand::before { width: 520px; height: 520px; right: -260px; top: -120px; }
.login-brand::after { width: 360px; height: 360px; left: -230px; bottom: -180px; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; color: var(--forest); background: #bde8d6; font: 800 27px Georgia, serif; margin-bottom: 64px; }
.login-brand h1 { margin: 10px 0 24px; font: 500 clamp(48px, 5.6vw, 78px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.brand-copy { max-width: 510px; color: #c8d8d3; font-size: 18px; }
.brand-proof { display: grid; gap: 11px; margin-top: 50px; color: #d8e5e1; }
.login-panel { display: grid; place-items: center; padding: 48px 7vw; background: #f3f1eb; }
.login-card { width: min(440px, 100%); }
.login-card h2 { margin: 8px 0 6px; font: 500 38px/1.15 Georgia, serif; }
.mobile-brand { display: none; }
.eyebrow { margin: 0; color: #4e7c6f; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }
.stack-lg { display: grid; gap: 19px; margin-top: 34px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field span, .consorcio-selector label { color: #485450; font-size: 12px; font-weight: 750; }
.field input, .field select, .consorcio-selector select, .consorcio-selector input { width: 100%; min-height: 45px; padding: 10px 13px; border: 1px solid #d6dcd8; border-radius: 9px; outline: none; color: var(--ink); background: white; }
.localized-number { text-align: right; font-variant-numeric: tabular-nums; }
.field input:focus, .field select:focus, .consorcio-selector select:focus, .consorcio-selector input:focus { border-color: #5b8d7d; box-shadow: 0 0 0 3px rgba(91,141,125,.12); }
.check-field { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 17px; border: 0; border-radius: 9px; font-weight: 750; }
.button-primary { color: white; background: var(--forest); }
.button-dark { color: white; background: #202a28; }
.button-block { width: 100%; min-height: 49px; }
.demo-access { display: grid; gap: 2px; margin-top: 28px; padding: 16px 18px; border: 1px solid #dce2de; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 12px; }
.demo-access strong { color: var(--ink); }
.alert { margin: 18px 0; padding: 13px 16px; border-radius: 9px; }
.alert-error { color: #8b3326; background: #fbe8e3; }
.alert-success { color: #255c4d; background: var(--mint); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 20px 20px; color: #dbe6e2; background: #183d36; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin: 0 7px 42px; }
.sidebar-brand span:last-child { display: grid; }
.sidebar-brand small, .sidebar-footer small { color: #9eb8b0; font-size: 10px; }
.brand-mark-small { width: 38px; height: 38px; margin: 0; border-radius: 11px; font-size: 20px; }
.nav-list { display: grid; gap: 7px; }
.nav-list a { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-radius: 8px; color: #b8cbc5; }
.nav-list a:hover, .nav-list a.active { color: white; background: rgba(255,255,255,.1); }
.nav-list span { width: 18px; text-align: center; }
.nav-submenu { display: grid; margin: -4px 0 2px 22px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.2); }
.nav-list .nav-submenu a { padding: 8px 10px; color: #d9e8e3; font-size: 12px; background: rgba(255,255,255,.07); }
.nav-list .nav-submenu a span { width: 12px; color: #86b7a7; }
.sidebar-footer { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 11px; }
.sidebar-footer div:nth-child(2) { display: grid; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: #bde8d6; font-weight: 800; }
.icon-button { border: 0; color: #bdd0ca; background: none; font-size: 20px; }
.main-content { width: min(1420px, 100%); margin: auto; padding: 42px clamp(24px, 4vw, 66px) 72px; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.topbar h1 { margin: 4px 0; font: 500 clamp(30px, 4vw, 45px)/1.1 Georgia, serif; letter-spacing: -.025em; }
.consorcio-selector { min-width: 245px; display: grid; gap: 5px; }
.context-selector { display: grid; grid-template-columns: minmax(260px, 1.5fr) 170px; gap: 10px; align-items: end; }
.context-selector label { display: grid; gap: 5px; color: #485450; font-size: 12px; font-weight: 750; }
.context-selector select, .context-selector input { width: 100%; min-height: 45px; padding: 10px 13px; border: 1px solid #d6dcd8; border-radius: 9px; color: var(--ink); background: white; }
.context-heading h1 { font-size: clamp(38px, 4.5vw, 56px); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 34px 0 42px; }
.metric-card { display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 5px 20px rgba(29,52,47,.035); }
.metric-card > div { display: grid; }
.metric-card small { color: var(--muted); }
.metric-card strong { font: 600 23px Georgia, serif; }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; font-weight: 800; }
.metric-icon.coral { color: #a74630; background: #fde7df; }
.metric-icon.blue { color: #365e89; background: #e2ebf7; }
.metric-icon.green { color: #2f6858; background: #dff2e9; }
.metric-icon.amber { color: #875f22; background: #f6ebce; }
.module-section { scroll-margin-top: 25px; margin-top: 32px; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { margin: 4px 0; font: 500 clamp(34px, 4vw, 48px)/1.08 Georgia, serif; }
.filter-bar { display: grid; grid-template-columns: minmax(190px, 1.2fr) 150px 150px minmax(220px, 1.6fr) auto; gap: 12px; align-items: end; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.filter-bar .button { min-height: 42px; }
.quick-create { display: flex; gap: 9px; }
.quick-create input { padding: 10px 12px; border: 1px solid #d6dcd8; border-radius: 8px; }
.settings-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr); gap: 24px; }
.settings-card { margin-top: 0; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.settings-tabs { display: flex; gap: 4px; margin: -8px 0 28px; padding: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.settings-tabs a { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: max-content; padding: 11px 15px; border-radius: 8px; color: #65736f; font-size: 11px; font-weight: 750; }
.settings-tabs a.active { color: white; background: var(--forest); box-shadow: 0 5px 14px rgba(30, 68, 57, .16); }
.notification-summary { margin: -10px 0 24px; padding: 16px 18px; border: 1px solid #cfe2da; border-radius: 11px; background: #f2f8f5; }
.notification-summary > div { display: flex; align-items: center; gap: 12px; }
.notification-summary span:not(.notification-icon) { display: grid; }
.notification-summary small { color: var(--muted); }
.notification-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: #2f6858; background: #dff2e9; font-weight: 800; }
.consorcio-settings-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; padding: 24px; border: 1px solid #cfe0d9; border-radius: 13px; background: #f3f8f5; }
.consorcio-settings-card h2 { margin: 3px 0 5px; font: 500 26px Georgia, serif; }
.settings-search { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-bottom: 15px; }
.settings-search input { min-width: 0; padding: 10px 12px; border: 1px solid #d6dcd8; border-radius: 8px; }
.audit-access-card { border-color: #e2d8c5; background: #fbf8f1; }
.audit-filter { display: grid; grid-template-columns: minmax(260px, 520px) auto; gap: 10px; align-items: end; }
.audit-changes { min-width: 150px; white-space: normal; }
.audit-changes summary { cursor: pointer; color: var(--forest); font-weight: 750; }
.audit-changes pre { max-width: 480px; max-height: 240px; overflow: auto; padding: 10px; border-radius: 7px; background: #f4f6f5; font: 10px/1.45 monospace; }
.audit-creado { color: #285f51; background: #dff2e9; }
.audit-modificado { color: #73551e; background: #f5e9c9; }
.audit-eliminado { color: #8b4033; background: #f9e2dd; }
.parameters-access-card { border-color: #d5dbea; background: #f5f7fb; }
.parameter-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.parameter-groups a { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }
.parameter-groups a.active { border-color: #7ba293; background: #edf5f1; }
.parameter-groups small { color: var(--muted); }
.parameter-layout { grid-template-columns: minmax(280px, .65fr) minmax(520px, 1.35fr); }
.parameter-list { display: grid; gap: 8px; }
.parameter-row { display: grid; grid-template-columns: minmax(180px, 1fr) 75px 80px auto auto; gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.parameter-row > input { min-width: 0; padding: 9px; border: 1px solid #d6dcd8; border-radius: 7px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { margin: 3px 0 0; font: 500 26px Georgia, serif; }
.action-details { position: relative; }
.action-details summary { list-style: none; }
.action-details summary::-webkit-details-marker { display: none; }
.form-popover { position: absolute; z-index: 5; top: 51px; right: 0; width: min(520px, 86vw); padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
.modal-overlay { position: fixed; z-index: 40; inset: 0; visibility: hidden; opacity: 0; background: rgba(20,35,31,.58); backdrop-filter: blur(2px); transition: opacity .18s, visibility .18s; }
.modal-overlay.open { visibility: visible; opacity: 1; }
.center-modal { position: fixed; z-index: 41; top: 50%; left: 50%; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; visibility: hidden; opacity: 0; transform: translate(-50%, -47%) scale(.98); border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 24px 70px rgba(9,27,21,.3); transition: opacity .18s, transform .18s, visibility .18s; }
.center-modal.open { visibility: visible; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.center-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); background: #f6faf8; }
.center-modal-header h2 { margin: 3px 0 5px; color: var(--forest); font: 500 27px Georgia, serif; }
.center-modal-header p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.gasto-modal-form { padding: 22px 26px 26px; }
.center-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 5px; }
.expense-breakdown { padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafbf9; }
.expense-breakdown summary { cursor: pointer; color: var(--forest); font-weight: 800; }
.expense-breakdown[open] summary { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.table-card { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid #edf0ee; text-align: left; white-space: nowrap; }
th { color: #71807b; background: #fafbf9; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--forest); }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 99px; color: #50625d; background: #edf1ef; font-size: 10px; font-weight: 750; }
.badge-borrador { color: #73551e; background: #f5e9c9; }
.badge-emitida { color: #285f51; background: #dff2e9; }
.badge-cerrada { color: #384e64; background: #e1e8f0; }
.badge-anulada { color: #8b4033; background: #f9e2dd; }
.table-subtitle { display: block; margin-top: 3px; color: var(--muted); }
.liquidation-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.liquidation-header h1 { margin: 3px 0; font: 500 clamp(32px, 4vw, 46px)/1.08 Georgia, serif; }
.liquidation-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.liquidation-summary article { display: grid; gap: 7px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.liquidation-summary small { color: var(--muted); }
.liquidation-summary strong { font-size: 17px; }
.consortium-filter { grid-template-columns: minmax(280px, 1fr) 190px auto; margin-bottom: 22px; }
.table-subtitle { display: block; margin-top: 4px; color: var(--muted); }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.table-actions form { margin: 0; }
.status-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-activo { color: #205b48; background: #e5f3ed; }
.status-borrador { color: #725a22; background: #f7efd8; }
.status-archived { color: #626866; background: #e8ecea; }
.archived-row { color: #6b716f; background: #fafbfa; }
.workflow-card { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; align-items: end; padding: 23px; border: 1px solid #cfe0d9; border-radius: 13px; background: #f3f8f5; }
.workflow-card h2 { margin: 3px 0; font: 500 26px Georgia, serif; }
.emit-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.workflow-actions { display: flex; align-items: start; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.danger-action { position: relative; }
.danger-action > form { position: absolute; z-index: 4; right: 0; width: 330px; margin-top: 8px; padding: 16px; border: 1px solid #e6c9c2; border-radius: 10px; background: white; box-shadow: var(--shadow); }
.button-danger { color: white; background: #a84b39; }
.annulled-note { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; padding: 16px; border-left: 4px solid #a84b39; border-radius: 8px; background: #faece8; }
.closed-period-note { margin-bottom: 20px; padding: 16px; border-left: 4px solid #526b82; border-radius: 8px; color: #405466; background: #edf2f6; }
.text-button { border: 0; background: none; font-size: 11px; font-weight: 750; }
.text-button.edit { color: #276b59; }
.danger { color: #b44f39; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.locked-label { color: #8b6a62; font-size: 10px; font-weight: 750; }
.history-count { display: block; margin-top: 3px; color: #87918e; text-align: right; font-size: 9px; }
.delete-expense { position: relative; }
.delete-expense summary { cursor: pointer; list-style: none; }
.delete-expense summary::-webkit-details-marker { display: none; }
.delete-expense-popover { position: absolute; z-index: 8; top: 24px; right: 0; width: 340px; padding: 17px; border: 1px solid #e5cbc5; border-radius: 10px; text-align: left; background: white; box-shadow: var(--shadow); }
.delete-expense-popover p { margin: 7px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.delete-expense-popover form { display: grid; gap: 11px; }
.empty-state { padding: 28px !important; color: var(--muted); text-align: center; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two-column .module-section { padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.compact-list { display: grid; }
.compact-list article { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 13px 0; border-bottom: 1px solid #edf0ee; }
.compact-list article > div { display: flex; align-items: center; gap: 8px; }
.compact-list small { display: block; color: var(--muted); }
.mini-form { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.positive { color: #2f745f; }
.negative { color: #b04f3b; }
.account-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0 8px; }
.account-metrics article { display: grid; gap: 5px; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.account-metrics small, .account-metrics span { color: var(--muted); }
.account-metrics strong { font: 600 21px Georgia, serif; }
.account-metrics span { font-size: 10px; }
.movimiento-modal-form { padding: 22px 26px 26px; }
.account-summary-table tfoot th { border-top: 2px solid #dce5e1; background: #f2f7f4; color: var(--ink); }
.reserve-row td { background: #f5f8ed; font-weight: 700; }
.selector-actions { display: flex; align-items: end; gap: 10px; }
.consortium-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; margin: 20px 0 10px; }
.consortium-facts article { display: grid; gap: 5px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.consortium-facts small { color: var(--muted); }
.consortium-facts .reserve-fact { border-color: #cadfd5; background: #f4f9f6; }
.reserve-fact span { font-size: 10px; font-weight: 750; }
.table-search-right { display: grid; grid-template-columns: minmax(230px, 340px) auto; gap: 8px; margin-left: auto; }
.table-search-right input { min-width: 0; padding: 10px 12px; border: 1px solid #d6dcd8; border-radius: 8px; }
.table-pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 4px 0; color: var(--muted); font-size: 11px; }
.table-pagination > div { display: flex; align-items: center; gap: 14px; }
.table-pagination a { color: var(--forest); font-weight: 750; }
.table-pagination strong { color: var(--ink); font-size: 11px; }
.table-pagination .disabled { opacity: .45; }
.unit-summary td { vertical-align: top; }
.summary-note { min-width: 190px; max-width: 300px; white-space: normal; color: var(--muted); }
.saldo-deuda { color: #b04f3b; font-weight: 750; }
.saldo-favor { color: #2f745f; font-weight: 750; }
.financial-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.financial-card { padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.financial-card .section-heading { margin-bottom: 4px; }
.edit-consorcio-form { padding: clamp(24px, 4vw, 46px); }
.edit-section-heading { margin-top: 36px; }
.edit-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.hidden { display: none !important; }

.wizard-content { max-width: 1600px; }
.wizard-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.wizard-header h1 { margin: 4px 0; font: 500 clamp(34px, 4vw, 48px)/1.08 Georgia, serif; }
.back-link { display: inline-block; margin-bottom: 24px; color: #59736c; font-size: 12px; font-weight: 750; }
.draft-label { padding: 8px 12px; border: 1px solid #d8e4df; border-radius: 99px; color: #4e7369; background: #edf5f1; font-size: 11px; }
.wizard-layout { display: block; }
.wizard-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: white; list-style: none; }
.wizard-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: center; padding: 9px 12px; border-radius: 9px; color: #7b8783; }
.wizard-steps li > span { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #dce3df; border-radius: 50%; font-size: 11px; font-weight: 800; }
.wizard-steps li div { display: grid; }
.wizard-steps li strong { font-size: 12px; }
.wizard-steps li small { font-size: 10px; }
.wizard-steps li.active { color: var(--forest); background: #edf5f1; }
.wizard-steps li.active > span { color: white; border-color: var(--forest); background: var(--forest); }
.wizard-steps li.complete > span { color: #326454; border-color: #b9ddcf; background: #dff2e9; }
.wizard-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 12px 35px rgba(31, 56, 49, .055); }
.wizard-panel { display: none; min-height: 470px; padding: clamp(20px, 3vw, 36px); }
.wizard-panel.active { display: block; }
.panel-heading { display: flex; align-items: start; gap: 16px; margin-bottom: 32px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0 0 3px; font: 500 29px Georgia, serif; }
.panel-heading p { margin: 0; color: var(--muted); }
.panel-number { color: #7c9b91; font: 500 17px Georgia, serif; }
.form-grid-wide { gap: 20px; }
.switch-field { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.switch-field span { display: grid; }
.switch-field small { color: var(--muted); }
.wizard-actions { display: grid; grid-template-columns: 130px 1fr 150px; gap: 16px; align-items: center; padding: 17px 24px; border-top: 1px solid var(--line); background: #fafbf9; }
.wizard-actions > span { color: var(--muted); font-size: 11px; text-align: center; }
.button-soft { color: #3f554f; border: 1px solid #d9e0dc; background: white; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.percentage-status { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.percentage-status strong { color: var(--ink); }
.percentage-status progress { grid-column: 1 / -1; width: 100%; }
.percentage-status small { grid-column: 1 / -1; }
.percentage-error { color: #a84b39; }
.compact-units-table { overflow-x: auto; margin-bottom: 12px; }
.units-edit-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 10px; }
.units-edit-toolbar > div { display: grid; gap: 3px; }
.units-edit-toolbar small { color: var(--muted); }
.unit-inline-table { width: max-content; min-width: 100%; font-size: 11px; }
.unit-inline-table th, .unit-inline-table td { padding: 6px 5px; white-space: nowrap; vertical-align: top; transition: background-color .15s, box-shadow .15s; }
.unit-inline-table input:not([type="checkbox"]) { width: 112px; min-height: 31px; padding: 5px 6px; border: 1px solid #d9e0dc; border-radius: 6px; font-size: 11px; background: white; }
.unit-inline-table th:nth-child(1) input, .unit-inline-table td:nth-child(1) input,
.unit-inline-table th:nth-child(2) input, .unit-inline-table td:nth-child(2) input,
.unit-inline-table th:nth-child(3) input, .unit-inline-table td:nth-child(3) input,
.unit-inline-table th:nth-child(4) input, .unit-inline-table td:nth-child(4) input { width: 76px; }
.unit-inline-table td:nth-child(5) input,
.unit-inline-table td:nth-child(8) input { width: 145px; }
.unit-inline-table td:nth-child(6) input,
.unit-inline-table td:nth-child(9) input { width: 170px; }
.unit-inline-table td:nth-child(10) input { width: 190px; }
.unit-inline-table tr.unit-row-active > td { background: #eaf5f1; box-shadow: inset 0 2px #57937f, inset 0 -2px #57937f; }
.unit-inline-table tr.unit-row-active > td:first-child { box-shadow: inset 3px 0 #57937f, inset 0 2px #57937f, inset 0 -2px #57937f; }
.unit-inline-table tr.unit-row-active input { border-color: #75a998; }
.compact-percentage-input { width: 130px; text-align: right; }
.unit-edit-stack { min-width: 230px; }
.unit-edit-stack label { display: grid; gap: 4px; margin-bottom: 8px; }
.unit-edit-stack small { color: var(--muted); font-weight: 700; }
.unit-edit-stack input, .compact-unit-notes { width: 100%; min-height: 36px; padding: 8px 9px; border: 1px solid #d9e0dc; border-radius: 7px; background: white; }
.unit-deletion-warning { margin-bottom: 18px; }
.unit-delete-cell { min-width: 115px; vertical-align: top; }
.unit-delete-control { display: flex; align-items: center; gap: 8px; color: #9f2f2f; font-weight: 800; cursor: pointer; }
.unit-delete-control input { width: 17px; height: 17px; }
.unit-delete-reason { display: none; gap: 5px; margin-top: 12px; }
.unit-delete-reason.is-visible { display: grid; }
.unit-delete-reason small { color: #9f2f2f; font-weight: 800; }
.unit-delete-reason textarea { width: 100%; padding: 8px; border: 1px solid #d8a3a3; border-radius: 7px; }
.compact-units-table tr.unit-marked-for-deletion > td { background: #fff5f5; }
.compact-units-table tr.unit-marked-for-deletion input:not([type="checkbox"]),
.compact-units-table tr.unit-marked-for-deletion textarea:not([data-delete-reason]) { opacity: .55; }
.unit-location-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.compact-unit-notes { min-width: 210px; resize: vertical; }
.unit-setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.unit-setup-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf9; }
.unit-setup-card h3 { margin: 3px 0 5px; font-size: 16px; }
.unit-setup-card p, .unit-setup-card small { margin: 0; color: var(--muted); }
.unit-setup-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.unit-setup-controls .button { justify-self: start; width: auto; min-height: 36px; padding: 8px 12px; white-space: nowrap; font-size: 11px; }
.import-controls { grid-template-columns: auto 1fr auto; }
.configuration-heading { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.proration-explanation { padding: 12px 14px; border-left: 3px solid #6e998b; border-radius: 6px; color: #40544e; background: #eef5f2; font-size: 12px; }
.units-table input[readonly] { color: #53645f; border-color: #dce6e1; background: #f0f5f2; }
.percentage-track { grid-column: span 2; height: 6px; overflow: hidden; border-radius: 99px; background: #e8ecea; }
.percentage-track span { display: block; width: 0; height: 100%; background: #d17860; transition: width .2s; }
.percentage-track span.complete { background: #4b8b77; }
.units-table-wrap { overflow-x: auto; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; }
.units-table { width: 100%; table-layout: fixed; font-size: 10px; }
.units-table th, .units-table td { padding: 5px; }
.units-table input { width: 100%; min-width: 0; padding: 7px 6px; border: 1px solid #dbe1de; border-radius: 6px; font-size: 10px; }
.units-table th:nth-child(1) { width: 8%; }
.units-table th:nth-child(2), .units-table th:nth-child(3) { width: 7%; }
.units-table th:nth-child(4) { width: 10%; }
.units-table th:nth-child(5) { width: 16%; }
.units-table th:nth-child(6) { width: 18%; }
.units-table th:nth-child(7) { width: 14%; }
.units-table th:nth-child(8) { width: 16%; }
.units-table th:nth-child(9) { width: 4%; }
.units-table td:last-child { width: 42px; }
.remove-row { width: 27px; height: 27px; border: 0; border-radius: 7px; color: #ac4e3b; background: #f9e9e5; font-size: 18px; }
.form-hint { margin-top: 12px; color: var(--muted); font-size: 11px; }
.balance-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.balance-item { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.balance-item:last-child { border-bottom: 0; }
.balance-item > span { display: grid; }
.balance-item small { color: var(--muted); }
.balance-item input { width: 150px; padding: 9px 11px; border: 1px solid #dbe1de; border-radius: 7px; text-align: right; }
.balance-legend { display: flex; gap: 20px; margin: 12px 0 24px; color: var(--muted); font-size: 10px; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.dot.debt { background: #d17860; }
.dot.credit { background: #4b8b77; }
.activation-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.activation-choice label { display: flex; align-items: start; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.activation-choice span { display: grid; }
.activation-choice small { color: var(--muted); }

.drawer-overlay { position: fixed; z-index: 30; inset: 0; pointer-events: none; opacity: 0; background: rgba(11, 27, 23, .38); backdrop-filter: blur(2px); transition: opacity .2s; }
.drawer-overlay.open { pointer-events: auto; opacity: 1; }
.edit-drawer { position: fixed; z-index: 31; top: 0; right: 0; width: min(500px, 94vw); height: 100vh; overflow-y: auto; padding: 30px; transform: translateX(102%); background: #fff; box-shadow: -25px 0 70px rgba(20, 43, 37, .18); transition: transform .25s ease; }
.edit-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: start; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 3px 0 0; font: 500 31px Georgia, serif; }
.drawer-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: #56625f; background: white; font-size: 23px; }
.draft-warning { margin: 19px 0 0; padding: 13px 15px; border-left: 3px solid #c08b35; border-radius: 7px; color: #715825; background: #f8efd9; font-size: 12px; }
.drawer-form { display: grid; gap: 17px; padding-top: 23px; }
.field textarea { width: 100%; min-height: 105px; padding: 11px 13px; resize: vertical; border: 1px solid #d6dcd8; border-radius: 9px; outline: none; }
.field textarea:focus { border-color: #5b8d7d; box-shadow: 0 0 0 3px rgba(91,141,125,.12); }
.audit-note { margin: 0; padding: 12px; border-radius: 8px; color: #62706c; background: #f3f6f4; font-size: 10px; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 6px; }
.notes-filter { grid-template-columns: 1.2fr .8fr .8fr 1.4fr auto; }
.notes-layout { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 24px; align-items: start; }
.note-editor-card { position: sticky; top: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.note-editor-card form, .note-edit-form { display: grid; gap: 14px; }
.mini-editor { overflow: hidden; border: 1px solid #d6dcd8; border-radius: 9px; background: white; }
.editor-toolbar { display: flex; gap: 4px; padding: 7px; border-bottom: 1px solid var(--line); background: #f5f7f5; }
.editor-toolbar button { min-width: 30px; height: 29px; padding: 0 8px; border: 1px solid #d7dfdb; border-radius: 6px; color: #40544e; background: white; cursor: pointer; }
.editor-toolbar button:hover { border-color: #78978d; background: #edf4f1; }
.mini-editor textarea { width: 100%; min-height: 180px; padding: 14px; resize: vertical; border: 0; outline: 0; font: 13px/1.6 Consolas, monospace; }
.mini-editor small { display: block; padding: 0 14px 10px; color: var(--muted); font-size: 10px; }
.notes-list { display: grid; gap: 14px; }
.notes-list-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 2px; }
.notes-list-heading h2 { margin: 3px 0 0; font: 500 27px Georgia, serif; }
.notes-sort { display: flex; gap: 8px; }
.notes-sort a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: #50665f; background: white; font-size: 10px; }
.note-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.note-card.featured { border-left: 4px solid #c39843; }
.note-card > header, .note-card > footer { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.note-card h3 { margin: 3px 0 0; font: 500 22px Georgia, serif; }
.note-pin { padding: 5px 8px; border-radius: 99px; color: #70571f; background: #f6edcf; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.note-content { margin: 16px 0; color: #34443f; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.note-content > :first-child { margin-top: 0; }
.note-content > :last-child { margin-bottom: 0; }
.note-content a { color: #326c5c; text-decoration: underline; }
.note-card > footer { align-items: center; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); }
.note-actions { display: flex; align-items: center; gap: 10px; }
.note-actions form { margin: 0; }
.note-actions details { position: relative; }
.note-actions summary { cursor: pointer; list-style: none; }
.note-edit-form { position: absolute; z-index: 20; top: 28px; right: 0; width: min(520px, 76vw); padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 18px 45px rgba(20, 43, 37, .18); }
.note-edit-form .mini-editor textarea { min-height: 130px; }

@media (max-width: 1000px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .two-column { grid-template-columns: 1fr; }
    .financial-split { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .search-field { grid-column: span 2; }
    .settings-grid { grid-template-columns: 1fr; }
    .consortium-facts { grid-template-columns: 1fr 1fr; }
    .parameter-groups { grid-template-columns: 1fr; }
    .parameter-layout { grid-template-columns: 1fr; }
    .liquidation-summary { grid-template-columns: 1fr 1fr; }
    .account-metrics { grid-template-columns: 1fr 1fr; }
    .workflow-card { grid-template-columns: 1fr; }
    .unit-setup-grid { grid-template-columns: 1fr; }
    .unit-setup-controls, .import-controls { grid-template-columns: 1fr; }
    .notes-layout { grid-template-columns: 1fr; }
    .note-editor-card { position: static; }
    .notes-filter { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-panel { min-height: 100vh; padding: 30px 22px; }
    .mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 52px; font-weight: 800; }
    .mobile-brand .brand-mark { margin: 0; width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
    .app-shell { display: block; }
    .sidebar { position: static; width: 100%; height: auto; padding: 14px 18px; flex-direction: row; align-items: center; }
    .sidebar-brand { margin: 0 auto 0 0; }
    .wizard-steps li { grid-template-columns: 31px; justify-content: center; }
    .wizard-steps li div { display: none; }
    .units-table { min-width: 920px; }
    .notes-filter { grid-template-columns: 1fr; }
    .note-edit-form { position: fixed; inset: 5vh 4vw auto; width: auto; max-height: 90vh; overflow-y: auto; }
    .sidebar-brand small, .nav-list, .sidebar-footer > div { display: none; }
    .sidebar-footer { margin: 0; padding: 0; border: 0; display: block; }
    .main-content { padding: 28px 17px 60px; }
    .topbar { align-items: stretch; flex-direction: column; }
    .consorcio-selector { min-width: 0; }
    .context-selector { grid-template-columns: 1fr; }
    .selector-actions { align-items: stretch; flex-direction: column; }
    .consortium-facts { grid-template-columns: 1fr; }
    .table-search-right { width: 100%; grid-template-columns: 1fr auto; }
    .table-pagination { align-items: flex-start; flex-direction: column; }
    .filter-bar { grid-template-columns: 1fr; }
    .search-field { grid-column: auto; }
    .consorcio-settings-card { align-items: stretch; flex-direction: column; }
    .settings-tabs { justify-content: flex-start; }
    .parameter-row { grid-template-columns: 1fr 70px; }
    .liquidation-summary, .emit-form { grid-template-columns: 1fr; }
    .account-metrics { grid-template-columns: 1fr; }
    .workflow-actions { align-items: stretch; flex-direction: column; }
    .metric-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .form-popover { position: fixed; inset: 10% 14px auto; max-height: 80vh; overflow-y: auto; }
    .wizard-header { align-items: start; flex-direction: column; }
    .wizard-panel { min-height: 0; padding: 24px 17px; }
    .wizard-actions { grid-template-columns: 1fr 1fr; }
    .wizard-actions > span { display: none; }
    .activation-choice { grid-template-columns: 1fr; }
}
