/* Shared visual system for the app and service panels. */
:root{--green:#173f35;--green-2:#28634f;--cream:#f5f5f0;--ink:#21352d;--muted:#60746b;--line:#dfe6df;--mh-font:"Segoe UI",Arial,sans-serif;--mh-radius:12px;--mh-shadow:0 4px 16px #173f3505}
body{font-family:var(--mh-font);font-size:14px;line-height:1.5;background:var(--cream);color:var(--ink)}
button,input,select,textarea{font-family:inherit}
:where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #b89a52;outline-offset:3px}
button:disabled{cursor:not-allowed}
.app-shell{grid-template-columns:264px minmax(0,1fr)}
.app-shell .sidebar{padding:20px 14px 14px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#557568 #153c32;gap:0}
.sidebar .brand{padding:8px 8px 20px;border-radius:0;flex-shrink:0}
.sidebar .brand-logo-copy strong{font-size:18px;letter-spacing:1px}
.sidebar .brand-logo-copy small{font-size:10px}
.sidebar .field-card{padding:14px;margin-bottom:18px;flex-shrink:0}
.sidebar .field-card span{font-size:10px;letter-spacing:.8px}
.sidebar .field-card select{font-size:15px;min-height:30px}
.sidebar nav{overflow:visible;padding:0;gap:8px;flex-shrink:0}
.sidebar button{font-size:13px;line-height:1.4;min-height:40px;padding:10px 12px}
.sidebar button span{font-size:16px}
.sidebar .nav-home,.sidebar .nav-group-items>button{display:flex;align-items:center;gap:8px;width:100%;border:1px solid transparent}
.sidebar button.active{background:#2b5748;color:#fff;border-color:#69816a}
.sidebar .nav-home.active{box-shadow:inset 3px 0 #cfb56b}
.sidebar .nav-icon{flex:0 0 20px;width:20px;text-align:center;color:#b9ccb9}
.sidebar .nav-group{padding-top:4px}
.sidebar .nav-group-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;font-size:11px;font-weight:650;letter-spacing:.6px;color:#c0d0c6;padding:10px 12px}
.sidebar .nav-group-toggle .nav-group-label{width:auto;font-size:11px}
.sidebar .nav-group-toggle .nav-chevron{font-size:12px;width:14px;transition:transform .15s}
.sidebar .nav-group-toggle[aria-expanded="true"] .nav-chevron{transform:rotate(90deg)}
.sidebar .nav-group-toggle.is-current{color:#ead59d}
.sidebar .nav-group-items{display:flex;flex-direction:column;gap:3px;margin:3px 0 7px;padding-left:8px;border-left:1px solid #3c5f4f}
.sidebar .nav-group-items[hidden]{display:none}
.sidebar .sidebar-bottom{margin-top:18px;padding-top:14px;flex-shrink:0}
.sidebar .sidebar-bottom .user{margin-top:0;padding:12px 8px;min-height:54px}
.sidebar .user strong{font-size:12px;overflow-wrap:anywhere}
.sidebar .user small{font-size:11px}
.app-shell .topbar{min-height:72px;height:auto;padding:14px 28px;gap:16px;flex-wrap:wrap}
.app-shell .topbar .actions{gap:10px;flex-wrap:wrap}
.app-shell .sync{font-size:12px}
.app-shell .content{max-width:1320px;padding:32px 28px 56px}
.app-shell .welcome{gap:20px;align-items:flex-start;margin-bottom:28px}
.app-shell .welcome h1,.billing-dashboard .dashboard-heading h1,.wrap h1{font-family:var(--mh-font);font-size:30px;font-weight:650;line-height:1.2;letter-spacing:-.7px;margin:0 0 10px}
.app-shell .welcome p,.billing-dashboard .eyebrow{font-size:11px;letter-spacing:1px;line-height:1.5}
.app-shell .welcome>div>span{font-size:14px}
.app-shell :is(.panel-title h2,.module-actions h2,.modal h2,.notifications h3,.platform-quotes-head h3),.wrap h2,.billing-dashboard h2{font-family:var(--mh-font);font-size:19px;font-weight:650;line-height:1.35}
.app-shell :is(.panel,.stats article,.historical,.table-card),.wrap .card,.billing-board{border-color:var(--line);border-radius:var(--mh-radius);box-shadow:var(--mh-shadow)}
.app-shell .panel{padding:22px}
.app-shell .stats{gap:16px;margin-bottom:22px}
.app-shell .stats article{padding:20px}
.app-shell .stat-head small{font-size:11px;letter-spacing:.5px;color:var(--muted)}
.app-shell .stats article>strong{font-family:var(--mh-font);font-size:28px;font-weight:650;line-height:1.25;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.app-shell .stats article>p{font-size:12px}
.app-shell :is(.primary,.secondary,.form-actions button,.panel-title button),.wrap :is(button,.button),.billing-dashboard :is(button,.button){font-size:13px;font-weight:600;min-height:40px;border-radius:8px;line-height:1.4}
.app-shell .module{gap:22px}
.app-shell :is(.module-actions,.panel-title){gap:14px;flex-wrap:wrap}
.app-shell .module-actions>div{gap:10px;flex-wrap:wrap}
.app-shell .table-card{overflow-x:auto}
.app-shell .table-card :is(th,td){font-size:13px;line-height:1.5;padding-top:14px;padding-bottom:14px}
.app-shell .table-card th{font-size:11px;font-weight:650;letter-spacing:.3px}
.app-shell .table-card tbody tr:hover{background:#f5f8f4}
.app-shell .table-card td{font-variant-numeric:tabular-nums}
.app-shell .modal{border-radius:16px;padding:28px;max-height:calc(100dvh - 36px);overflow-y:auto}
.app-shell .modal>span{font-size:13px;line-height:1.6}
.app-shell .modal label{font-size:12px;line-height:1.5;gap:7px}
.app-shell .modal :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:14px;min-height:42px;border-color:#bacbc0;border-radius:8px}
.app-shell .form-actions{flex-wrap:wrap;gap:10px;padding-top:16px;margin-top:12px;border-top:1px solid var(--line)}
.app-shell :is(.auth-card h2,.auth-brand h1){font-family:var(--mh-font)}
.auth-card{font-family:var(--mh-font)}
.wrap{max-width:1080px;padding:32px 24px}
.wrap header{gap:16px;margin-bottom:28px}
.wrap .card{padding:24px;margin:20px 0}
.wrap p,.billing-dashboard p{line-height:1.65}
.wrap label,.billing-dashboard label{font-size:13px}
.wrap :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){min-height:42px;font-size:14px;border-color:#bacbc0}
.billing-dashboard :is(h1,h2,h3,strong),.billing-metrics strong{font-family:var(--mh-font)}
.billing-dashboard .billing-row{gap:18px;padding-top:20px;padding-bottom:20px}
.billing-dashboard .billing-row h3{font-size:15px;line-height:1.4}
.billing-dashboard .dashboard-status{font-size:13px}
.billing-dashboard .billing-metrics strong{font-weight:650;font-variant-numeric:tabular-nums}
.billing-dashboard .billing-dialog{border-radius:16px}
@media(max-width:1000px){.app-shell{grid-template-columns:230px minmax(0,1fr)}.app-shell .content{padding:28px 22px}.app-shell .topbar{padding:12px 22px}}
@media(max-width:900px){.app-shell{grid-template-columns:1fr}}
@media(max-width:760px){.app-shell{grid-template-columns:1fr}.app-shell .sidebar{width:min(290px,88vw);height:100dvh;padding-top:16px}.app-shell .topbar{padding:12px 16px;gap:10px}.app-shell .content{padding:24px 16px 40px}.app-shell .welcome{flex-wrap:wrap;gap:16px}.app-shell .welcome h1,.billing-dashboard .dashboard-heading h1,.wrap h1{font-size:26px}.app-shell .panel{padding:18px}.app-shell .module-actions{align-items:flex-start}.app-shell .module-actions>div{width:100%}.app-shell .modal{padding:24px 18px}.wrap{padding:24px 16px}.wrap .card{padding:20px}.workspace-context{order:3;width:100%}}
@media(prefers-reduced-motion:reduce){.sidebar .nav-chevron{transition:none}}
@media print{.sidebar,.topbar{display:none!important}.app-shell{display:block}.app-shell .content{max-width:none;padding:0}.app-shell :is(.panel,.table-card){box-shadow:none}}


.sidebar .nav-group-items>button{display:flex;align-items:center;gap:8px;width:100%;text-align:left}
.sidebar .nav-group-toggle span.nav-group-label{width:auto}.sidebar .nav-chevron{flex-shrink:0}
.app-shell .top-admin-button{font-size:13px;padding:10px 14px;min-height:40px;font-weight:600}
@media(max-width:600px){.app-shell .topbar .primary{font-size:12px}.app-shell .top-admin-button{font-size:12px}.app-shell .top-admin-button span{font-size:12px}.app-shell .topbar .sync{display:none}}
.app-shell :is(.finance-summary article,.report-grid article,.member-card,.invoice-task-list article,.compensation-columns>section){border-radius:12px;border-color:var(--line)}
.app-shell .finance-summary strong{font-family:var(--mh-font);font-size:26px;font-weight:650;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.app-shell :is(.finance-summary small,.finance-summary p,.stock-row small,.activity-row p,.activity-row small,.historical p,.alert-card p,.report-grid p){font-size:12px;line-height:1.6}
.app-shell :is(.stock-row strong,.activity-row strong,.report-grid h3,.member-card h3,.invoice-task-list h3){font-family:var(--mh-font);font-size:14px;font-weight:600;line-height:1.5}
.app-shell :is(.historical input,.filter-tabs button,.compensation-tabs button){font-size:13px;min-height:38px}
.app-shell .search{min-height:42px}.app-shell .search input{font-size:14px}
.app-shell .report-grid article{padding:22px}.app-shell .filter-tabs{display:flex;flex-wrap:wrap;gap:4px}
.app-shell :is(.invoice-task-list article,.compensation-choice){gap:14px}
.app-shell :is(.type-pill,.status-good,.status-pending,.status-bad){font-size:11px;line-height:1.5}
.app-shell .top-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
@media(max-width:900px){.app-shell .sidebar .nav-group-toggle{font-size:11px}.app-shell .sidebar .nav-group-label{width:auto}.app-shell .sidebar nav button{font-size:13px}.app-shell .sidebar nav .nav-group-toggle{font-size:11px}}
.app-shell :is(.settings-card,.permission-card,.member-grid article){border-radius:12px;border-color:var(--line);padding:22px}
.app-shell :is(.settings-card h2,.news-body h3,.installments h3){font-family:var(--mh-font);font-size:19px;font-weight:650;line-height:1.4}
.app-shell :is(.settings-card span,.permission-note p,.member-head small,.member-grid small,.task-list small,.price-note span,.module-copy,.news-body p){font-size:12px;line-height:1.6}
.app-shell :is(.settings-card b,.permission-options label,.field-editor label,.task-list b){font-size:13px;line-height:1.5}
.app-shell :is(.field-editor input,.settings-card input,.member-head select){font-size:14px;min-height:40px}
.app-shell .permission-options{gap:10px}.app-shell .task-list label{padding:16px;gap:12px}.app-shell .task-list span{min-width:0}
@media(max-width:760px){.app-shell :is(.settings-card,.permission-card,.member-grid article){padding:18px}.app-shell .finance-summary strong{font-size:23px}}

/* Mobile header and dashboard actions. Native WebViews must also apply Android window insets. */
.app-shell .alert-card{gap:12px;grid-template-columns:32px minmax(0,1fr) auto}
.app-shell .alert-card>div{min-width:0}
.app-shell .alert-card>button{justify-self:end;text-align:right;padding:10px 0 10px 12px;min-height:40px;white-space:nowrap;font-size:12px}
@media(max-width:900px){
 .app-shell .topbar{padding-top:max(24px,calc(12px + env(safe-area-inset-top,0px)));padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
 .app-shell .sidebar{padding-top:max(20px,env(safe-area-inset-top,0px));padding-bottom:max(16px,env(safe-area-inset-bottom,0px))}
 .app-shell .content{padding-bottom:calc(40px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:600px){
 .app-shell .top-admin-button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:42px;padding:0;font-size:0;gap:0}
 .app-shell .top-admin-button>span{display:inline-flex;align-items:center;justify-content:center;width:100%;font-size:18px;line-height:1;margin:0}
 .app-shell .alert-card{grid-template-columns:32px minmax(0,1fr);gap:10px 12px}
 .app-shell .alert-card>button{grid-column:2;justify-self:end;padding:6px 0 6px 12px}
}


/* Movement filters: one compact selector on phones; ordered tabs on desktop. */
.app-shell .movement-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
.app-shell .movement-toolbar>div:last-child{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.app-shell .movement-filter-tabs{display:flex;flex-wrap:wrap;gap:8px;padding:12px;background:#eef3ef;border-radius:12px}
.app-shell .movement-filter-tabs button{margin:0;padding:9px 14px;min-height:40px;white-space:nowrap;border-radius:8px;font-size:13px;flex:0 0 auto}
.app-shell .movement-filter-select{display:none}
@media(max-width:760px){
 .app-shell .movement-filter-tabs{display:none!important}
 .app-shell .movement-filter-select{display:grid;gap:7px;font-size:12px;font-weight:600;color:var(--muted)}
 .app-shell .movement-filter-select select{width:100%;min-height:44px;padding:10px 12px;border:1px solid #bacbc0;border-radius:8px;background:white;color:var(--ink);font:inherit;font-size:14px}
 .app-shell .movement-toolbar>div:last-child{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:10px}
 .app-shell .movement-toolbar>div:last-child button{width:100%;min-height:44px;margin:0}
}

.platform-home{max-width:1100px;margin:0 auto;padding:32px 20px}.platform-home header{display:flex;justify-content:space-between;align-items:center;gap:20px}.platform-home header img{width:150px}.platform-home .platform-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;margin:28px 0}.platform-home .platform-grid a{display:flex;flex-direction:column;gap:10px;padding:24px;background:white;border:1px solid #dce6df;border-radius:14px;text-decoration:none;color:#143f32}.platform-home .platform-grid small{color:#587369;line-height:1.5}
