/* V5: a compact navy-and-gold workspace, built on existing modules. */
.select-search{position:relative;min-width:0;margin-bottom:5px}.select-search input{width:100%;box-sizing:border-box}.select-search-results{position:absolute;top:100%;left:0;right:0;z-index:90;max-height:260px;overflow:auto;background:white;border:1px solid #b9ccde;border-radius:6px;box-shadow:0 8px 22px #12345130}.select-search-results button{display:block;width:100%;text-align:left;background:white!important;color:#244663!important;border:0;border-radius:0!important;white-space:normal}.select-search-results button:hover,.select-search-results button.selected{background:#eaf3fb!important}.select-search-results span{display:block;padding:12px;color:#687c90}
.v5{--bg:#edf3f9;--line:#dce6ef;--accent:#133e65;--gold:#c89d39;background:var(--bg)}
.v5 #workspace.admin-layout>header{background:linear-gradient(110deg,#092a46 0%,#123e60 68%,#0a2942 100%);border-bottom:3px solid #c39b45;padding:15px 24px;min-height:98px;gap:16px}
.v5 .admin-layout>header .brand{grid-template-columns:165px minmax(0,1fr);gap:4px 20px}
.v5 .admin-layout>header .brand-logo{width:165px;border-radius:4px;margin:0}
.v5 .admin-layout>header .brand h1{font-size:1.15rem;letter-spacing:-.02em;font-weight:650}
.v5 .admin-layout>header .brand small{font-size:.8rem;color:#d8e6f2;opacity:1}
.v5 .admin-layout>header .account-bar{font-size:.8rem;color:#d8e6f2;margin:0}
.v5-header-date{color:#d7e6f3;font-size:.8rem;align-self:center;margin-right:10px}
.v5 .admin-layout>header #signout{background:#ffffff0d;color:#fff;border:1px solid #ffffff40;padding:8px 12px;font-size:.85rem}
.v5 .admin-layout .workspace-layout{grid-template-columns:218px minmax(0,1fr);align-items:stretch}
.v5 .admin-layout .workspace-layout.menu-collapsed{grid-template-columns:minmax(0,1fr)}
.v5 .admin-layout .workspace-layout>.tabs{background:linear-gradient(180deg,#0c2e4b,#153b59);border:0;border-radius:0;box-shadow:none;margin:0;padding:20px 10px 75px;top:0;max-height:100vh;height:calc(100vh - 98px);min-height:640px;gap:4px;backdrop-filter:none;align-self:start}
.v5 .admin-layout .tabs .tab{background:transparent;color:#dce8f2;font-size:.875rem;display:flex;gap:11px;align-items:center;min-height:43px;border:0;border-radius:6px;padding:10px;line-height:1.35;font-weight:500}
.v5 .admin-layout .tabs .tab.active,.v5 .admin-layout .tabs .tab[aria-pressed=true]{background:linear-gradient(100deg,#d6b04f,#bb8d2c);color:#132c42;box-shadow:0 3px 10px #03182740;font-weight:750}
.v5 .admin-layout .tabs .tab:not(.active):hover{background:#ffffff12;box-shadow:none}
.v5 .admin-layout .tab[data-tab=settings]{border-top:1px solid #ffffff26;margin-top:14px;padding-top:14px}
.v5-icon{width:19px;height:19px;flex:0 0 19px;vertical-align:middle}
.v5 .admin-layout .workspace-layout>.container{padding:23px 25px 84px;background:radial-gradient(ellipse at top right,#f9fcff 0%,#eff5fa 50%,#edf3f9 100%);min-height:calc(100vh - 98px)}
.v5-section-heading{display:none}.admin-layout .v5-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 4px}
.v5-section-heading h2{color:#173d60;font-size:1.55rem;margin:3px 0 0;font-weight:750;letter-spacing:-.035em}
.v5-eyebrow{font-size:.68rem;font-weight:700;letter-spacing:.13em;color:#72849a}
.v5-version{color:#84601d;background:#fff6df;border:1px solid #e9d49d;border-radius:5px;font-weight:750;font-size:.75rem;padding:3px 8px}
.v5 .statusline{font-size:.8rem;margin-bottom:15px;min-height:30px;color:#60768c}.v5 .statusline button{font-size:.8rem;padding:5px 10px;background:transparent}
.v5 #workspace .card,.v5 #workspace .stat{background:#fff;border:1px solid #dce6ef;border-radius:10px;box-shadow:0 2px 6px #173b6704;backdrop-filter:none;-webkit-backdrop-filter:none}
.v5 .card{padding:17px;margin-bottom:15px}.v5 .card h3{font-size:1rem;letter-spacing:-.015em;color:#193d5d;margin:0 0 13px}
.v5 .filters{gap:12px;margin:12px 0}.v5 #dashboardFilters{padding:12px 15px;margin:4px 0 15px;align-items:center}.v5 #dashboardFilters .field{flex:1;min-width:155px}.v5 #dashboardFilters .field:first-child{flex:2}.v5 #dashScope{font-size:.78rem;color:#64788c}
.v5 .field label,.v5 .fiscal-filters label,.v5 .workforce-fields label{font-size:.875rem;color:#4b6279;font-weight:600}
.v5 input,.v5 select,.v5 textarea{border-color:#d4dfeb;border-radius:6px;color:#243c52;background:#fff;min-height:36px;font-size:.875rem}
.v5 button,.v5 .btn{border-radius:6px;font-size:.875rem;font-weight:600;padding:9px 12px;line-height:1.35}
.v5 button.primary{background:linear-gradient(180deg,#d4ac43,#be912f);color:#172c3e;border:1px solid #b58b30;box-shadow:0 2px 4px #7a5c1414}
.v5 button.ghost{background:#eff5fb;color:#25557d;border:1px solid #dae5ef}
.v5 button.danger{background:#fff1f1;color:#a52732}
.v5 table{font-size:.875rem;line-height:1.45}.v5 th{background:#f1f6fb;color:#48617a;letter-spacing:.01em;font-size:.8rem;font-weight:700;border-bottom:1px solid #d8e4ef;padding:12px 10px;z-index:2}
.v5 td{padding:11px 10px;border-bottom:1px solid #eaf0f6;color:#314a60;vertical-align:middle}.v5 tbody tr:nth-child(even){background:#fbfdff}.v5 tbody tr:hover{background:#f0f6fc}
.v5 .tablewrap{border-color:#e1eaf2;border-radius:8px;max-height:65vh}.v5 td .mini{font-size:.8rem;padding:6px 9px}.v5 td b{color:#244663}
.v5 .badge{font-size:.8rem;font-weight:650;padding:3px 8px;border-radius:6px;margin:2px 0;line-height:1.4}
.v5 #workspace .b-ok{background:#e5f4eb;color:#1a6746;border-color:#b9dfc9}.v5 #workspace .b-danger{background:#fff0f1;color:#a12635;border-color:#f1c5cb}.v5 #workspace .b-warn{background:#fff5e4;color:#975b13;border-color:#ecd4a7}
.v5 .admin-layout #dashboard .stats{grid-template-columns:repeat(6,minmax(0,1fr));gap:11px;margin-bottom:16px;align-items:stretch}
.v5 #dashboard .stat{min-height:130px;padding:15px;position:relative;border-top:1px solid #dce6ef;display:flex;flex-direction:column;gap:6px;overflow:hidden}
.v5 #dashboard .stat>b{font-size:clamp(1.1rem,1.8vw,1.6rem);font-weight:750;line-height:1.2;letter-spacing:-.03em;color:#163d5a;overflow-wrap:anywhere;margin:0}
.v5 #dashboard .stat>span{font-size:.8rem;color:#5d7387;line-height:1.4}.v5-metric-icon{width:30px;height:30px;background:#eaf3fb;color:#2473a5;border-radius:8px;display:grid;place-items:center;margin-bottom:1px}
.v5 .v5-metric-1 .v5-metric-icon{background:#fff5df;color:#b98217}.v5 .v5-metric-2 .v5-metric-icon,.v5 .v5-metric-5 .v5-metric-icon{background:#fff0f1;color:#bb3946}.v5 .v5-metric-3 .v5-metric-icon{background:#e7f7ec;color:#258253}
.v5 #dashboard .stat-detail{height:auto;max-height:210px;font-size:.875rem;border-top:0;margin:0;line-height:1.55;overflow:auto}
.v5-dashboard-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;align-items:start}.v5-dashboard-grid>.card{margin:0;min-width:0;min-height:190px}
.v5-dashboard-grid>.card>div:not(.actions){max-height:250px;overflow:auto}.v5-dashboard-grid p{font-size:.875rem;margin:0;padding:9px 0;border-bottom:1px solid #edf2f7}.v5-dashboard-grid p:last-child{border-bottom:0}
.v5-dashboard-grid details{border-top:1px solid #e7edf4;margin-top:10px;padding-top:10px}.v5-dashboard-grid summary{font-size:.8rem;color:#416e93}.v5-portfolio #sClientDetail p{display:flex;justify-content:space-between;gap:10px;padding:12px 0}
.v5 #followup-dashboard{border-top:3px solid #9273b5;background:linear-gradient(145deg,#fff,#f7f4fc)}.v5 #followup-dashboard h3{color:#6f4a91}
.v5 #accountingDash{padding:15px 17px}.v5 #accountingDash>.debt-totals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.v5 #accountingDash .debt-totals>div{border:0;border-left:3px solid #cfac58;border-radius:0;background:#f7fafd;min-width:0;padding:9px 13px;font-size:.8rem}.v5 #accountingDash .debt-totals b{font-size:1.2rem;color:#1c5076;margin-top:4px}.v5 #accountingDash>p{font-size:.8rem;color:#5b7186;margin-bottom:0}
.v5 .dashboard-charts{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}.v5 .dashboard-chart{margin:0;min-width:0}.v5 .dashboard-chart .plot-wrap>svg{height:125px}.v5 .chart-legend{max-height:110px}.v5 .chart-legend li,.v5 .dashboard-chart>p{font-size:.8rem}
.v5-entry-card{padding:0!important}.v5-entry>summary{padding:15px 17px;font-size:.9rem;color:#1f567b;list-style:none}.v5-entry>summary::after{content:'Abrir';float:right;color:#7990a4;font-size:.78rem}.v5-entry[open]>summary::after{content:'Cerrar'}.v5-entry[open]>summary{border-bottom:1px solid #e0e9f1;margin-bottom:16px}.v5-entry>form,.v5-entry>.editor-label{margin:0 17px 17px}
.v5 .accounting-nav,.v5 #workforceHost [data-wf-view]{font-size:.875rem}.v5 #accountingHost .accounting-nav{margin-bottom:12px;padding-bottom:12px;gap:6px}.v5 .accounting-nav button{min-height:36px;padding:8px 12px;box-shadow:none}
.v5 .accounting-nav button.active,.v5 .accounting-nav button[aria-pressed=true]{background:#194a70;color:white;box-shadow:inset 0 -2px #d1ab54}.v5 #accountingHost .card>.grid{grid-template-columns:2fr 1fr 1fr;align-items:end}
.v5 .fiscal-months{gap:6px}.v5 .fiscal-months>div{border-top-width:2px;padding:10px;background:#f4f8fc}.v5 .payment-summary>div{border-top:2px solid #305c7b;background:#f9fbfe;padding:12px}.v5 .payment-summary strong{font-size:1.3rem}
.v5 .menu-toggle{font-size:.8rem;left:12px;bottom:12px;padding:10px 12px;border-radius:7px;background:#143d5e;color:#edf5ff;border-color:#5c7990}
.v5 .followup-button{background:#173e63;border:1px solid #68859f;border-radius:8px;font-size:.85rem;bottom:12px;right:16px}
.v5 .workforce-editor,.v5 .fiscal-dialog,.v5 .invoice-editor{box-shadow:0 22px 70px #09294040;border-radius:12px}.v5 .workforce-editor header{border-radius:8px}.v5 .daily-editor{width:min(1700px,98vw)}
.v5 :focus-visible{outline:3px solid #3e89bd;outline-offset:3px}
@media(min-width:1800px){.v5 .admin-layout .workspace-layout>.container{padding-left:32px;padding-right:32px}.v5-dashboard-grid>.card>div:not(.actions){max-height:300px}}
@media(max-width:1350px){.v5 .admin-layout #dashboard .stats{grid-template-columns:repeat(3,minmax(0,1fr))}.v5 #dashboard .stat{min-height:108px;display:grid;grid-template-columns:32px minmax(0,1fr);align-content:center;column-gap:10px}.v5-metric-icon{grid-row:1/3}.v5 #dashboard .stat>span{grid-column:2}.v5 .dashboard-charts{grid-template-columns:repeat(2,minmax(0,1fr))}.v5-dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:950px){.v5 .admin-layout .workspace-layout{grid-template-columns:185px minmax(0,1fr)}.v5 .admin-layout .workspace-layout>.container{padding:18px 15px 80px}.v5 .admin-layout>header .brand{grid-template-columns:130px minmax(0,1fr)}.v5 .admin-layout>header .brand-logo{width:130px}.v5-header-date{display:none}.v5 #accountingHost .card>.grid{grid-template-columns:1fr 1fr}.v5 #accountingDash>.debt-totals{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.v5 .admin-layout .workspace-layout{display:block}.v5 .admin-layout .workspace-layout>.tabs{position:relative;height:auto;min-height:0;max-height:220px;padding:8px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:auto}.v5 .admin-layout .tab[data-tab=settings]{margin:0;padding-top:10px;border-top:0}.v5 .admin-layout>header{padding:12px;min-height:0}.v5 .admin-layout>header .brand h1{font-size:1rem}.v5 .admin-layout #dashboard .stats{grid-template-columns:repeat(2,minmax(0,1fr))}.v5-dashboard-grid{grid-template-columns:1fr}.v5 .dashboard-charts{grid-template-columns:1fr}.v5 .v5-section-heading h2{font-size:1.35rem}.v5 #accountingHost .card>.grid{grid-template-columns:1fr}.v5 input,.v5 select,.v5 textarea{font-size:1rem}}
@media(prefers-reduced-motion:reduce){.v5 button{transition:none}.v5 button:active{transform:none}}
@media print{.v5 .workspace-layout>.tabs,.v5-section-heading,.v5 .statusline,.v5 .followup-button,.v5 .menu-toggle{display:none!important}.v5 .workspace-layout{display:block!important}}

.pdf-preview{width:95vw;max-width:1500px;padding:16px;border:1px solid #c9d8e5;border-radius:12px}.pdf-preview header{display:flex;align-items:center;gap:12px;background:white;color:#214664;padding:0 0 12px}.pdf-preview h2{flex:1;font-size:1rem;margin:0}.pdf-preview iframe{width:100%;height:78vh;border:0;background:#e8eef4}.pdf-preview::backdrop{background:#132d4a88}
.pdf-preview{max-height:94vh;box-sizing:border-box}.pdf-controls{display:flex;align-items:center;justify-content:center;gap:16px;padding:8px}.pdf-pages{height:72vh;overflow:auto;background:#e8eef4;padding:12px;text-align:center}.pdf-pages canvas{max-width:100%;height:auto;background:white;box-shadow:0 2px 12px #1234}.pdf-preview header{position:static;flex-wrap:wrap}.pdf-preview h2{min-width:200px}
.labor-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:14px 0}.labor-cards .card{padding:14px;margin:0}.labor-cards h3{margin:8px 0 0}
.shortcut-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px}.shortcut-card{border:1px solid #d0dfeb;border-radius:12px;padding:14px;background:white}.shortcut-card a{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;min-height:110px;text-decoration:none}.shortcut-card img{width:64px;height:64px;object-fit:contain}.shortcut-card button{margin:8px 4px 0;padding:5px 8px}
.amount-negative{color:#b42332!important;font-weight:650}.amount-favorable{color:#137347!important;font-weight:650}details[data-treasury-key="new"]>summary{font-weight:650;cursor:pointer;padding:8px 0}details[data-treasury-key="new"][open]>form{margin-top:16px}
.shortcut-editor{padding:12px 16px!important}.shortcut-editor>summary{cursor:pointer;font-weight:650}.shortcut-editor[open]>form{margin-top:14px}
.quick-day{width:min(940px,95vw)!important}.quick-worker{width:min(650px,92vw)!important}.quick-day .workforce-fields,.quick-worker .workforce-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.quick-common,.quick-person{padding:14px;border:1px solid #c7d7e5;border-radius:10px;background:white}.quick-day h3{margin:0 0 14px}.quick-day form>.actions,.quick-worker form>.actions{position:sticky;bottom:0;background:white;padding:14px;border-top:1px solid #d0deea;z-index:3}.quick-day label,.quick-worker label{color:#173b5c;font-size:.95rem}.quick-day input,.quick-day select,.quick-worker input{min-height:42px}.quick-day input:focus,.quick-day select:focus,.quick-worker input:focus{outline:3px solid #2f7bbb;outline-offset:2px}.wf-tools{padding:8px 12px;border:1px solid #cbdbea;border-radius:8px}.wf-tools>summary{cursor:pointer;font-weight:600}#wf-overview>p{font-size:.85rem}#workforceHost details>summary{padding:10px 0;cursor:pointer;color:#153e63;font-weight:650}#workforceHost .labor-cards{grid-template-columns:repeat(4,minmax(130px,1fr))}@media(max-width:700px){.quick-day .workforce-fields,.quick-worker .workforce-fields{grid-template-columns:1fr}#workforceHost .labor-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Higher contrast across the workspace. */
.v5{color:#142c43;font-size:15px;-webkit-font-smoothing:antialiased}.v5 #workspace.admin-layout>header{background:linear-gradient(110deg,#061c32,#123f67);border-bottom:3px solid #d8ae44}.v5 .admin-layout .workspace-layout>.tabs{background:#0b263f}.v5 .admin-layout .tabs .tab{color:#f2f6fc;font-size:.94rem;font-weight:600;padding:12px}.v5 .admin-layout .tabs .tab.active{background:#e3b74b;color:#102335;border-left:4px solid #fff1b8;box-shadow:0 3px 10px #0003}.v5 .admin-layout .tabs .tab:hover{background-color:#204a70}.v5 .v5-section-heading{border-bottom:1px solid #c0cedd;padding:10px 0 16px}.v5 #v5-section-title{font-size:1.6rem;color:#102c49}.v5 .statusline{margin:0 0 6px;padding:0 0 12px;border-bottom:1px solid #c6d4e2;color:#40566d}.v5 #workspace .card{border-color:#c7d6e5;box-shadow:0 3px 12px #142f4a0d}.v5 label,.v5 .field>label{color:#29445f;font-weight:600}.v5 input,.v5 select,.v5 textarea{border-color:#9cb2c8;color:#172e45}.v5 th{background:#e4edf6;color:#183b5c;border-bottom:2px solid #b3c7dc}.v5 td{color:#223b53}.v5 .stat b,.v5 .stat strong{color:#0e3458}.v5 .stat small,.v5 .dashboard-chart>p{color:#40566d}.v5 h3{color:#153754}.v5 .v5-metric-icon{background:#e0ecfa;color:#135da5}.v5 .dashboard-chart{border-top:4px solid #1a639e}.v5 .dashboard-chart h3{font-size:1.05rem}.v5 .chart-color-0{fill:#125da8;background:#125da8}.v5 .chart-color-1{fill:#078577;background:#078577}.v5 .chart-color-2{fill:#7045b0;background:#7045b0}.v5 .chart-color-3{fill:#b87313;background:#b87313}.v5 .chart-legend{max-height:none}.v5 .chart-legend li{font-size:.9rem;padding:6px 0;color:#263f57}.v5 .chart-total{font-weight:700;border-top:1px solid #c9d7e5;padding-top:12px;color:#153754}.general-controls{display:grid;grid-template-columns:2fr 2fr 1fr 1fr 1fr;gap:14px;margin:18px 0}.general-controls label{display:flex;flex-direction:column;gap:7px}.general-report-table{max-height:65vh;overflow:auto}.general-report-table table{min-width:2200px}.general-report-table th{position:sticky;top:0;z-index:1}.general-report-table td:first-child,.general-report-table th:first-child{position:sticky;left:0;background:#f1f6fb;min-width:210px}.general-report-table th:first-child{z-index:2}.general-report-table td{min-width:100px}.general-report-table td:nth-last-child(2),.general-report-table td:nth-last-child(3){min-width:190px}.v5 .negative-amount{color:#b21e32;font-weight:700}.report-method{font-size:.88rem;color:#41576b;line-height:1.6}#generalReport details{padding:12px 0;border-top:1px solid #d5e0eb}#generalReport summary{cursor:pointer;font-weight:600}@media(max-width:1000px){.general-controls{grid-template-columns:1fr 1fr}}@media(max-width:550px){.general-controls{grid-template-columns:1fr}.v5 .admin-layout .tabs .tab{font-size:.9rem}}
/* V5 workspace refinement: moderate gold, readable controls, responsive density. */
.v5{font-family:Inter,"Segoe UI",system-ui,-apple-system,sans-serif;color:#203b54}.v5 #workspace{max-width:none}.v5 .container{max-width:none;width:100%;box-sizing:border-box}.v5 .admin-layout>header .brand-logo{width:138px}.v5 #workspace.admin-layout>header{min-height:78px;padding:12px 22px}.v5 #workspace .card{box-shadow:0 4px 18px #14334d06}.v5 th{font-size:.875rem}.v5 input,.v5 select,.v5 textarea{min-height:42px}.v5 button{min-height:38px}.v5 .tablewrap{max-height:70vh}.v5 #followup-dashboard{border-top:3px solid #ba9232;background:#fff}.v5 #followup-dashboard h3{color:#193d5d}.v5 .v5-section-heading{margin-bottom:10px}.v5 .v5-eyebrow{font-size:.75rem}.v5-quick-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:0 0 18px}.v5-quick-actions>span{font-weight:650;color:#516b81;margin-right:12px}.v5-quick-actions button{background:#fff;border:1px solid #cfdae6;color:#193d5d;display:flex;align-items:center;gap:8px}.client-profile form>label{display:flex;flex-direction:column;gap:8px;margin:12px 0}.client-profile details,.version-history details{padding:14px 0;border-top:1px solid #d9e3ed}.profile-list{list-style:none;padding:0;margin:0}.profile-list li{padding:10px 0;border-bottom:1px solid #e5edf4}.simulation-dialog{width:min(1300px,96vw)}.simulation-dialog header{display:flex;justify-content:space-between}.simulation-dialog pre,.version-history pre{white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.6 ui-monospace,monospace;max-height:350px;overflow:auto}.simulation-dialog details{padding:14px 0}.simulation-dialog td input{width:100%;min-width:90px;box-sizing:border-box}.simulation-dialog td:first-child input{min-width:180px}.administrative-link{max-width:560px}.administrative-link button,.administrative-link a{margin:8px}.v5 #systemV5Host h2{margin-top:0}.v5 .client-profile{max-width:1000px}.v5 .v5-dashboard-grid>.card{min-height:160px}@media(min-width:1000px){.v5 .admin-layout .workspace-layout>.tabs{height:calc(100vh - 78px);min-height:0;overflow:auto}.v5 .admin-layout .workspace-layout>.container{padding-top:20px}}@media(max-width:1024px){.v5 #workspace.admin-layout>header{flex-wrap:wrap}.v5 .tablewrap{max-width:100%;overflow:auto}}@media(max-width:600px){.v5-quick-actions{display:grid;grid-template-columns:1fr 1fr}.v5-quick-actions>span{grid-column:1/-1}}
