/* RCA 3.2.11 — common workspace, table grid and brand presentation. */
:root{--rule-blue:#3275df}
body.dark{--rule-blue:#6a9cf0}
.layout > .sidebar{display:flex;flex-direction:column;height:100dvh;overflow:hidden;padding-bottom:8px}
.layout.sidebar-collapsed > .sidebar{display:none}
.sidebar > .brand{flex:0 0 auto}
.sidebar > .nav{flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;margin-top:8px;margin-bottom:8px;padding:2px}
.sidebar > .nav button{flex-shrink:0}
.sidebar .user-box{flex:0 0 auto;display:block;margin:0;padding:8px 5px 0;border-top:1px solid var(--line)}
.user-identity{position:relative;padding-left:35px;min-height:37px;font-size:11px;overflow-wrap:anywhere;line-height:1.4}
.user-identity .user-avatar{top:2px;left:0}
.sidebar .user-box #logout{display:block;width:100%;margin-top:7px;padding:6px 10px;background:var(--panel);border:1px solid var(--line);color:var(--ink);font-size:12px}
.sidebar .user-box #logout:hover{color:var(--brand);border-color:var(--brand)}
.brand-logo,.topbar-logo{background:transparent!important;border:0;padding:0;border-radius:0}
.layout:not(.sidebar-collapsed) .topbar-logo{display:none}
.layout.sidebar-collapsed .topbar-logo{display:block}
/* Decorative orange accents become blue; operational badges retain their meaning. */
.table-wrap,.card,.metric{border-top-color:var(--rule-blue)}
.section-heading{border-bottom-color:var(--rule-blue)}
.book-section{border-left-color:var(--rule-blue);background:#3275df07}
.field-section legend,body.dark .field-section legend{color:var(--brand)}
.modal-head{background:linear-gradient(115deg,#3275df,#245abd);color:#fff}
.modal-head button,.modal-head button:hover{color:#fff;background:#ffffff18;border-color:#ffffff70}
/* One visual standard for main lists, settings, reports, and modal tables. */
.table-wrap{border-radius:12px;border-top:3px solid var(--rule-blue);background:var(--panel);max-height:calc(100dvh - 130px);scrollbar-width:thin}
.table-wrap table{width:100%;border-collapse:separate;border-spacing:0;color:var(--ink)}
.table-wrap table th,.table-wrap table td{border-right:1px solid var(--line);border-bottom:1px solid var(--line);text-align:center;white-space:nowrap!important;vertical-align:middle;padding:6px 9px;font-size:11px}
.table-wrap table th{background:var(--header-bg);font-size:10px;font-weight:700;text-transform:uppercase;position:sticky;top:0;z-index:2}
.table-wrap table td{height:34px}
.table-wrap table tbody tr:nth-child(odd){background:var(--panel)}
.table-wrap table tbody tr:nth-child(even){background:var(--zebra)}
.table-wrap table tbody tr:hover{background:var(--row-hover)}
.table-wrap table td button,.table-wrap table td .button-link{font-size:10px;padding:4px 7px}
/* Propagate the remaining viewport height through nested modules. */
#content.table-page{display:flex;flex-direction:column;gap:4px;min-height:0;overflow:hidden}
#content .table-layout{display:flex;flex-direction:column;gap:4px;min-height:0;overflow:hidden}
#content.table-page>.table-branch,#content .table-layout>.table-branch{flex:1 1 0;min-height:0;margin:0}
#content .table-layout>:not(.table-branch){flex:0 0 auto}
#content .workspace-primary-table,#content.table-page>.workspace-primary-table{flex:1 1 0;min-height:80px;max-height:none!important;overflow:auto;margin:0}
#content.table-page>.table-wrap:not(.workspace-primary-table){flex:0 1 auto;min-height:80px;max-height:25vh}
#content.table-page>.empty,#content .table-layout>.empty{padding:4px;margin:0;font-size:12px}
#content.table-page h2,#content .table-layout h2{margin:4px 0;font-size:15px}
#content.table-page>.tabs,#content .table-layout>.tabs{margin:0 0 4px;gap:4px}
#content.table-page>.kpi-grid,#content .table-layout>.kpi-grid{gap:6px;margin:0}
#content.table-page .kpi-grid .kpi,#content .table-layout .kpi-grid .kpi{padding:8px 12px;margin:0}
#content.table-page .kpi-grid strong,#content .table-layout .kpi-grid strong{font-size:23px}
#content.table-page>p,#content .table-layout>p{margin:3px 0}
.table-insights{border:1px solid var(--line);border-top:3px solid var(--rule-blue);border-radius:10px;background:var(--panel);margin:0}
.table-insights summary{padding:6px 10px;cursor:pointer;font-size:12px;font-weight:600;color:var(--brand)}
.table-insights>.dashboard-grid{max-height:26vh;overflow:auto;margin:0;padding:0 8px 8px;gap:8px}
.table-insights .card{margin:0;padding:10px}
#content .table-layout>#cr-upload{max-height:34vh;overflow:auto;padding:10px;margin:0}
#content .table-layout>#cr-preview:not(:empty){max-height:25vh;overflow:auto}
@media(max-height:650px){
 #content.table-page .toolbar,#content .table-layout>.toolbar{max-height:22vh;overflow:auto}
 #content.table-page .kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 #content.table-page .kpi-grid strong{font-size:18px}
 .table-insights>.dashboard-grid{max-height:20vh}
}
#content:has(>#leave-native-frame){display:flex;flex-direction:column;gap:4px;overflow:hidden}
#leave-native-frame{flex:1 1 0;height:100%;min-height:0}
#content.table-page>.table-insights,#content .table-layout>.table-insights{flex:0 1 auto;min-height:32px;overflow:auto}
body.dark .brand-logo,body.dark .topbar-logo{filter:drop-shadow(0 0 1px #ffffffaa)}
@media(max-height:650px){#content.table-page .toolbar,#content .table-layout>.toolbar{max-height:30vh}}
#content .table-layout>.workspace-primary-table{min-height:120px}
