:root {
    --nav: #101e34;
    --nav-text: #aab8cc;
    --page: #f3f6fa;
    --surface: #fff;
    --surface-alt: #f7f9fc;
    --line: #e3e9f0;
    --ink: #12223a;
    --muted: #53657d;
    --teal: #09796c;
    --teal-hover: #06685c;
    --teal-soft: #e1f5f1;
    --shadow: 0 3px 14px rgb(29 48 76 / 5%);
    --nav-width: 246px;
}
[data-bs-theme=dark] {
    color-scheme: dark;
    --nav: #101a2c;
    --nav-text: #aebed4;
    --page: #0e1829;
    --surface: #172439;
    --surface-alt: #1b2a41;
    --line: #2c3c55;
    --ink: #eff5ff;
    --muted: #aabbd2;
    --teal: #68dac7;
    --teal-hover: #9de7d8;
    --teal-soft: #1d3d41;
    --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 1rem/1.55 Inter, system-ui, sans-serif; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-hover); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid #16a997; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 750; letter-spacing: -.035em; }
h1 { font-size: clamp(1.75rem,3vw,2.15rem); margin-bottom: .3rem; }
h2 { font-size: 1.125rem; margin-bottom: .2rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.sidebar {
    width: var(--nav-width);
    background: var(--nav);
    color: var(--nav-text);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgb(255 255 255 / 8%);
}
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; padding: 1.35rem 1rem 1.3rem; }
.brand:hover { color: #fff; }
.brand strong { display: block; font-size: 1.18rem; line-height: 1.2; letter-spacing: .045em; }
.brand small { display: block; color: #b2c1d4; font-size: .75rem; }
.brand-icon {
    display: block;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.brand-logo-preview { display: block; object-fit: contain; margin: .75rem 0 1rem; }
.logo-reset { margin-top: .6rem; }
.navigation { display: flex; flex-direction: column; gap: 3px; padding: 0 .65rem .75rem; overflow-y: auto; scrollbar-width: none; }
.navigation::-webkit-scrollbar { display: none; }
.nav-label { color: #93a6bf; font-size: .67rem; letter-spacing: .12em; font-weight: 700; padding: .85rem .55rem .25rem; }
.navigation a { display: flex; gap: .62rem; align-items: center; color: var(--nav-text); padding: .55rem .62rem; border-radius: 8px; font-size: .805rem; font-weight: 550; }
.navigation a .bi { width: 1.1rem; font-size: 1rem; text-align: center; }
.navigation a:hover { background: #1c304b; color: #fff; }
.navigation a.selected { color: #c8fff4; background: #153f49; box-shadow: inset 3px 0 #39d8b9; }
.navigation em { margin-left: auto; font-size: .7rem; font-style: normal; color: #b6f9eb; }
.sidebar-footer { margin-top: auto; padding: .85rem 1rem; display: flex; align-items: center; gap: .65rem; border-top: 1px solid #28384e; font-size: .82rem; overflow-wrap: anywhere; }
.workspace { margin-left: var(--nav-width); min-width: 0; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .6rem clamp(1rem,3vw,2.2rem); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-start, .topbar-actions { display: flex; align-items: center; gap: .7rem; }
.topbar-start { font-weight: 700; }
.clock { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .82rem; white-space: nowrap; margin-right: .35rem; }
.icon-button { position: relative; display: grid; place-items: center; padding: 0; min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); cursor: pointer; }
.icon-button:hover { background: var(--surface-alt); color: var(--ink); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.alert-dot { position: absolute; right: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: #e87c64; }
.profile-menu { border-left: 1px solid var(--line); padding-left: .8rem; margin-left: .15rem; }
.profile-menu summary { display: flex; align-items: center; gap: .55rem; }
.avatar { display: grid; flex-shrink: 0; place-items: center; border-radius: 50%; width: 38px; height: 38px; object-fit: cover; color: var(--teal); background: var(--teal-soft); font-weight: 750; }
.user-label { display: grid; line-height: 1.25; font-size: .82rem; }
.user-label small, .profile-menu summary > i { font-size: .72rem; color: var(--muted); }
.dropdown-panel { position: absolute; z-index: 20; top: calc(100% + .65rem); right: 0; width: min(270px,78vw); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; background: var(--surface); box-shadow: 0 10px 30px rgb(10 28 48 / 15%); }
.dropdown-panel h3, .dropdown-panel p { margin: .4rem .5rem; }
.dropdown-panel a { display: block; padding: .55rem; border-radius: 6px; font-size: .875rem; }
.dropdown-panel a:hover { background: var(--surface-alt); }
.dropdown-panel small { display: block; color: var(--muted); }
.dropdown-panel form { margin-top: .35rem; }
.main-content { max-width: 1680px; padding: clamp(1rem,3vw,2.2rem); margin: 0 auto; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.45rem; }
.page-title p { color: var(--muted); margin: 0; font-size: .94rem; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .49rem; min-height: 39px; padding: .48rem .82rem; border: 1px solid transparent; border-radius: 9px; font-size: .85rem; font-weight: 650; line-height: 1.3; white-space: nowrap; cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.button-primary { background: #0b796b; color: white; box-shadow: 0 2px 5px rgb(7 86 76 / 18%); }
.button-primary:hover { background: #075d53; color: white; }
.button-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button-secondary:hover { background: var(--surface-alt); color: var(--teal); }
.button:disabled { cursor: wait; opacity: .7; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.panel-head { padding: 1.15rem 1.2rem .8rem; display: flex; justify-content: space-between; align-items: flex-start; gap: .65rem; }
.panel-head p { margin: 0; color: var(--muted); font-size: .82rem; }
.panel-head .button { min-height: 34px; font-size: .76rem; }
.padded { padding: 1.2rem; }
.padded form { max-width: 620px; }
.section-gap { margin-bottom: 1.1rem; }
.overview-grid { display: grid; grid-template-columns: minmax(260px, .86fr) minmax(0, 1.38fr); gap: 1rem; margin-bottom: 1rem; }
.balance-card { position: relative; isolation: isolate; overflow: hidden; display: flex; min-height: 234px; flex-direction: column; justify-content: center; gap: .78rem; border-radius: 16px; color: #fff; padding: 1.25rem; background: linear-gradient(133deg,#06534d 0%,#087267 58%,#087c6d 100%); box-shadow: 0 8px 20px rgb(6 84 76 / 13%); }
.balance-card::before { content: ""; position: absolute; z-index: -1; width: 245px; height: 245px; border: 1px solid rgb(190 255 226 / 21%); border-radius: 50%; right: -90px; top: -96px; box-shadow: 0 0 0 26px rgb(190 255 226 / 7%),0 0 0 52px rgb(190 255 226 / 6%),0 0 0 78px rgb(190 255 226 / 5%); }
.balance-caption { display: flex; align-items: center; gap: .6rem; color: #e2fff8; font-weight: 650; font-size: .9rem; }
.balance-caption > div { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid rgb(255 255 255 / 25%); border-radius: 10px; background: rgb(255 255 255 / 12%); }
.balance-card > strong { font-size: clamp(1.7rem,3.4vw,2.6rem); font-weight: 800; letter-spacing: -.06em; overflow-wrap: anywhere; }
.balance-footer { border-top: 1px solid rgb(255 255 255 / 26%); display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-top: .75rem; }
.balance-footer div { display: grid; gap: .12rem; min-width: 0; overflow-wrap: anywhere; }
.balance-footer small { font-size: .76rem; color: #dbfff7; }
.balance-footer b { font-size: 1rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.kpi { position: relative; display: flex; flex-direction: column; justify-content: center; padding: .75rem .8rem .7rem 3.65rem; }
.tile-icon { position: absolute; top: .85rem; left: .8rem; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-size: 1.02rem; }
.tile-icon.blue { background: #e8f0ff; color: #315bc2; }
.tile-icon.violet { background: #f0eaff; color: #674bb2; }
.tile-icon.amber { background: #fff1da; color: #90550d; }
.tile-icon.mint { background: #def4ed; color: #087967; }
.kpi p { color: var(--muted); font-size: .81rem; font-weight: 600; margin: 0; }
.kpi strong { font-size: 1.65rem; line-height: 1.3; letter-spacing: -.045em; }
.kpi small { color: var(--muted); font-size: .73rem; }
.chart-grid, .dashboard-bottom { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 1rem; margin-bottom: 1rem; }
.period { display: flex; align-items: center; gap: .45rem; color: var(--muted); background: var(--surface-alt); border: 1px solid var(--line); border-radius: 7px; padding: .32rem .55rem; font-size: .73rem; white-space: nowrap; }
.chart { position: relative; height: 216px; margin: .15rem 1.2rem 1.1rem; }
.donut-row { display: flex; gap: 1rem; align-items: center; padding: .25rem 1.1rem .8rem; }
.chart-doughnut { flex: 0 0 125px; height: 125px; margin: 0; }
.chart-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: .67rem; font-weight: 650; white-space: nowrap; color: var(--muted); pointer-events: none; }
.chart-legend { flex: 1; display: grid; gap: .42rem; font-size: .75rem; min-width: 0; }
.chart-legend div { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: .4rem; }
.chart-legend strong { overflow-wrap: anywhere; }
.chart-legend div > span:nth-child(2) { color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-0 { background: #0b897a; }.dot-1 { background: #61adf3; }.dot-2 { background: #f0ab4b; }.dot-3 { background: #9277d6; }
.recovery-note { display: flex; justify-content: space-between; margin: .35rem 1.1rem 1.1rem; padding: .65rem .75rem; background: var(--teal-soft); color: var(--teal); border-radius: 8px; font-size: .82rem; }
.empty { display: grid; justify-items: center; text-align: center; padding: 1.75rem .85rem; gap: .5rem; color: var(--muted); font-size: .87rem; }
.empty i { display: grid; place-items: center; height: 38px; width: 38px; border-radius: 11px; color: var(--muted); background: var(--surface-alt); font-size: 1.15rem; }
.empty p { margin: 0; }
.record-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .85rem; }
.record-table th, .record-table td { padding: .72rem .8rem; border-bottom: 1px solid var(--line); }
.record-table th:first-child, .record-table td:first-child { padding-left: 1.2rem; }
.record-table th { background: var(--surface-alt); color: var(--muted); text-transform: none; white-space: nowrap; font-size: .79rem; font-weight: 650; }
.record-table td { min-width: 54px; overflow-wrap: anywhere; }
.record-table tr:last-child td { border-bottom: 0; }
.record-table tbody tr:hover { background: var(--surface-alt); }
.status { display: inline-flex; border-radius: 999px; padding: .14rem .52rem; font-weight: 650; font-size: .73rem; }
.status-neutral { background: #e8effa; color: #365782; }
.status-success { background: #dcf5eb; color: #086850; }
.status-danger { background: #fce8e8; color: #9f353b; }
.status-warning { background: #fff1d8; color: #835209; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
.filters select { width: auto; max-width: 100%; }
.search-field { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem; color: var(--muted); }
.search-field input { background: transparent; border: 0; color: var(--ink); width: min(14rem,58vw); font-size: .86rem; }
.form-select,.form-control { border-color: var(--line); color: var(--ink); background-color: var(--surface); border-radius: 8px; font-size: .9rem; }
.form-control:focus,.form-select:focus { border-color: #2aaa97; box-shadow: 0 0 0 3px rgb(42 170 151 / 16%); color: var(--ink); background-color: var(--surface); }
.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.pagination-bar > div { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.field { display: grid; gap: .32rem; margin-bottom: .9rem; font-size: .88rem; font-weight: 550; min-width: 0; }
.field b { color: var(--teal); }
.field a { font-size: .79rem; }
.form-grid,.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 1rem; }
.form-grid .wide { grid-column: 1/-1; }
.detail-grid { grid-template-columns: repeat(3,minmax(0,1fr)); row-gap: 1rem; padding: .5rem 1.2rem 1.2rem; margin: 0; }
.detail-grid dt { color: var(--muted); font-size: .81rem; font-weight: 550; }
.detail-grid dd { margin: .2rem 0 0; overflow-wrap: anywhere; font-size: .95rem; }
.app-dialog { border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--surface); padding: 0; width: min(760px,calc(100% - 1.5rem)); max-height: calc(100% - 2rem); box-shadow: 0 20px 60px rgb(0 0 0 / 25%); }
.app-dialog::backdrop { background: rgb(10 22 39 / 64%); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; position: sticky; top: 0; z-index: 1; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-body { padding: 1.1rem; }
.dialog-footer { display: flex; justify-content: flex-end; padding-top: .7rem; }
.allocation { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: .65rem .75rem 0; margin-bottom: .7rem; }
.allocation legend { float: none; width: auto; font-size: .8rem; padding: 0 .4rem; font-weight: 650; }
.remove-allocation { position: absolute; right: .5rem; top: -.5rem; min-width: 28px; height: 28px; font-size: .75rem; }
.allocation:first-child .remove-allocation { display: none; }
.allocation-heading { margin: .6rem 0 .75rem; }
.message { display: flex; align-items: center; gap: .5rem; border-radius: 9px; margin-bottom: 1rem; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--line); }
.message.danger { color: #8d2c30; background: #fff0f0; border-color: #efc9ca; }
.message.success { color: var(--teal); background: var(--teal-soft); }
.timeline,.sequence { list-style: none; padding: .2rem 1.2rem 1rem; margin: 0; }
.timeline li { display: grid; grid-template-columns: 108px minmax(0,1fr) auto; align-items: center; gap: .5rem; border-top: 1px solid var(--line); padding: .6rem 0; font-size: .88rem; }
.timeline small { display: block; color: var(--muted); }
.sequence { display: flex; flex-wrap: wrap; gap: .5rem; }
.sequence li { display: inline-flex; gap: .4rem; align-items: center; color: var(--teal); background: var(--teal-soft); padding: .4rem .6rem; border-radius: 8px; font-size: .85rem; }
.sequence i { font-size: .5rem; }
.audit-detail { max-width: 36rem; white-space: pre-wrap; font-size: .75rem; }
.mobile-overlay,.mobile-toggle { display: none; }
@media (width > 960px) {
    .sidebar-collapsed { --nav-width: 68px; }
    .sidebar-collapsed .sidebar .brand,
    .sidebar-collapsed .sidebar-footer { justify-content: center; padding-inline: 0; }
    .sidebar-collapsed .sidebar .brand > span:not(.brand-icon),
    .sidebar-collapsed .sidebar-footer span,
    .sidebar-collapsed .nav-label,
    .sidebar-collapsed .navigation a > span,
    .sidebar-collapsed .navigation em { display: none; }
    .sidebar-collapsed .navigation a { justify-content: center; padding-inline: 0; }
}
@media (max-width:960px) { .desktop-toggle { display: none; } }
.auth { display: grid; grid-template-columns: minmax(300px,.9fr) 1.1fr; min-height: 100vh; }
.auth-aside { color: #fff; background: radial-gradient(circle at 85% 55%,#14685e 0,transparent 48%),linear-gradient(140deg,#0c1c34,#13413f); display: flex; flex-direction: column; min-height: 100%; }
.auth-aside .brand { padding: 1.75rem clamp(1.2rem,5vw,4rem); }
.auth-copy { margin: auto 0; max-width: 640px; padding: 2rem clamp(1.2rem,5vw,4rem) 4rem; }
.auth-copy h1 { font-size: clamp(2rem,5vw,4rem); line-height: 1.04; margin: 1rem 0; letter-spacing: -.065em; }
.auth-copy p { color: #d2e9e6; max-width: 30rem; }
.auth-emblem { display: grid; place-items: center; width: 65px; height: 65px; font-size: 1.7rem; border-radius: 18px; background: rgb(118 255 216 / 14%); border: 1px solid rgb(118 255 216 / 35%); }
.auth-main { display: grid; align-items: center; justify-items: center; padding: 1.5rem; }
.auth-form { width: min(100%,440px); padding: clamp(1rem,3vw,1.8rem); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.auth-form h2 { font-size: 1.5rem; }
.auth-form .button { width: 100%; }
.setup-note { font-size: .82rem; padding: .55rem; border-radius: 7px; background: var(--surface-alt); color: var(--muted); }
@media(max-width:1150px) {
    .donut-row { flex-wrap: wrap; }
    .chart-doughnut { flex-basis: 105px; height: 105px; }
}
@media(max-width:960px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .mobile-overlay { display: block; position: fixed; z-index: 29; inset: 0; border: 0; background: rgb(7 18 32 / 55%); }
    .workspace { margin-left: 0; }
    .mobile-toggle { display: grid; }
}
@media(max-width:680px) {
    .overview-grid,.chart-grid,.dashboard-bottom { grid-template-columns: minmax(0,1fr); }
    .balance-card { min-height: 205px; }
    .kpi { min-height: 92px; }
    .topbar-start > span,.clock,.user-label,.profile-menu summary > i { display: none; }
    .topbar { min-height: 58px; }
    .page-title { align-items: flex-start; flex-direction: column; }
    .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .auth { grid-template-columns: 1fr; }
    .auth-copy { padding: 0 1.2rem 1.2rem; }
    .auth-copy h1 { font-size: 1.8rem; }
    .auth-copy p { margin: 0; }
    .auth-emblem { display: none; }
}
@media(max-width:440px) {
    .form-grid { grid-template-columns: 1fr; }
    .kpi { padding-left: 3.15rem; }
    .tile-icon { width: 30px; height: 30px; }
    .timeline li { grid-template-columns: 1fr auto; }
    .timeline time { grid-column: 1/-1; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition: none !important; animation: none !important; } }
.executive-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; }
.executive-kpis .kpi { min-height: 98px; overflow-wrap: anywhere; }
.executive-filters { align-items: end; border-bottom: 0; }
.executive-filters label { display: grid; gap: .3rem; color: var(--muted); font-size: .86rem; }
.monthly-updates td { vertical-align: top; min-width: 155px; }
.monthly-updates td:nth-child(3), .monthly-updates td:nth-child(4), .monthly-updates td:nth-child(5) { min-width: 190px; }
.update-list { list-style: none; margin: 0; padding: 0; }
.update-list li + li { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
@media(max-width:1200px) {
    .executive-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:440px) {
    .executive-kpis { grid-template-columns: 1fr; }
}
