:root{--shell-sidebar:248px;--surface-soft:#f0f5f7;--line:var(--border)}
:root[data-theme=dark]{color-scheme:dark;--bg:#0b1118;--panel:#131c26;--text:#e6edf5;--muted:#a7b6c7;--border:#2c3b4d;--line:#2c3b4d;--surface-soft:#1b2938;--accent:#10877b;--accent-2:#16a293;--success:#86efac;--warning:#fcd34d;--danger:#fda4af;--info:#93c5fd;--shadow:0 10px 32px #0005}
html,body{min-width:320px}body #app{display:grid;grid-template-columns:var(--shell-sidebar) minmax(0,1fr)}body.sidebar-closed #app{grid-template-columns:0 minmax(0,1fr)}body .main{min-width:0}body #camelSidebar{width:var(--shell-sidebar);height:100dvh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain;flex-direction:column;flex-wrap:nowrap;align-items:stretch;box-sizing:border-box}body #camelSidebar .primary-nav{min-height:160px;overflow-y:auto;flex:1;display:flex!important;flex-direction:column;align-items:stretch}body #camelSidebar .nav-item{white-space:normal;text-align:left;min-height:44px;flex-shrink:0}body #camelSidebar .header-actions{flex-wrap:wrap;min-width:0;flex-shrink:0}body #sidebarToggle{width:44px;min-width:44px;height:44px;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;z-index:110}body .workspace-tools{gap:12px;align-items:center;flex-wrap:wrap}body .workspace-head{min-width:0}body .workspace-head>div{min-width:0}body .workspace-head p{overflow-wrap:anywhere}body.sidebar-preview.sidebar-closed #camelSidebar{top:0;height:100dvh;z-index:100}.shell-backdrop{position:fixed;inset:0;background:#0008;border:0;border-radius:0;z-index:90}.shell-backdrop[hidden]{display:none!important}
@media(max-width:1100px){body.shell-mobile #app{display:block;margin:0}body.shell-mobile .main{margin:0;width:100%}body.shell-mobile #camelSidebar{position:fixed;inset:0 auto 0 0;width:min(320px,88vw);height:100dvh;z-index:100;transform:translateX(-105%);display:flex!important;visibility:hidden;transition:transform .18s ease,visibility .18s}body.shell-mobile.sidebar-open #camelSidebar{transform:translateX(0);visibility:visible}body.shell-mobile.sidebar-open{overflow:hidden}body.shell-mobile #camelSidebar .primary-nav{order:initial;flex-basis:auto;overflow-x:hidden}body.shell-mobile #camelSidebar .nav-section-label,body.shell-mobile #camelSidebar .nav-icon{display:block}body.shell-mobile #camelSidebar .header-actions{margin-top:auto;flex-direction:column;align-items:stretch}body.shell-mobile #sidebarToggle{position:static!important}body.shell-mobile .workspace-tools{padding:10px 16px}body.shell-mobile .workspace-head{padding:16px!important;flex-wrap:wrap;gap:16px;position:static}body.shell-mobile .workspace-head .top-actions{flex-wrap:wrap}body.shell-mobile #camelSidebar .brand{margin-top:8px}body.shell-mobile #themeToggle{min-height:44px}}
@media(prefers-reduced-motion:reduce){body.shell-mobile #camelSidebar{transition:none}}
:root[data-theme=dark] body,:root[data-theme=dark] .main{background:var(--bg);color:var(--text)}
:root[data-theme=dark] :is(.panel,.card,.modal-card,.drawer,.audit-viewer,.dw-detail,.rc-dw,dialog,.workspace-tools,.workspace-head,.topbar,.detail-actions,.tabs,.tab-content,.stats,.stat,.kpi,.bank-day,.bank-case,.bank-candidate,.audit-billing-row,.audit-date-row,.upload-progress-panel,.assistant-panel,.system-chat-panel){background:var(--panel);color:var(--text);border-color:var(--border)}
:root[data-theme=dark] main :is(article,details,thead,th,td,.rc-page,.rc-panel,.rc-card,.dw-grid,.dw-kpis article,.dw-empty,.rc-bulk,.extratos-panel,.dw-collection-sources article,.audit-issue,.audit-viewer-context,.workflow-column,.workflow-card,.title-card,.audit-date-row.is-divergent){background:var(--panel);color:var(--text);border-color:var(--border)}
:root[data-theme=dark] :is(input,select,textarea){background:var(--surface-soft)!important;color:var(--text)!important;border-color:var(--border)!important;color-scheme:dark}
:root[data-theme=dark] :is(input,textarea)::placeholder{color:var(--muted)}
:root[data-theme=dark] main :is(.ghost,.secondary,button:not(.primary):not(.dw-event)){background:var(--surface-soft);color:var(--text);border-color:var(--border)}
:root[data-theme=dark] main :is(h1,h2,h3,h4,strong,label,summary,dt,dd){color:var(--text)}
:root[data-theme=dark] main :is(p,small,.muted,.dw-source-note,.eyebrow,.audit-billing-row dt){color:var(--muted)}
:root[data-theme=dark] :is(.table-wrap,.table-container,.dw-grid,.table,.rc-bulk table){border-color:var(--border)}
:root[data-theme=dark] :is(tr:nth-child(even),tbody tr:hover,.tab.active,.dw-questions button,.bank-evidence>div,.assistant-message,.system-chat-message,.rc-bulk pre){background:var(--surface-soft);color:var(--text)}
:root[data-theme=dark] :is(.modal,.drawer-backdrop,dialog::backdrop){background:#0009}
:root[data-theme=dark] svg text{fill:var(--text)}
.dw-audit-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:16px 0}.dw-audit-totals article{border:1px solid var(--border);border-radius:10px;padding:16px}.dw-audit-totals strong{font-size:1.65rem;display:block;margin-top:8px}.dw-audit-totals span{font-size:.88rem}.dw-event-inclusao{background:#dcfce7;color:#166534}.dw-audit-dark .dw-event-inclusao{background:#14532d;color:#bbf7d0}
:root[data-theme=dark] #app .main :is(.panel,.rc-dw,article,details,dialog,th,td,.workspace-head,.workspace-tools){background:var(--panel);color:var(--text);border-color:var(--border)}:root[data-theme=dark] #app .main :is(p,small,label,summary,h1,h2,h3,h4,dt,dd,strong){color:var(--text)}:root[data-theme=dark] #siengeDwPage .dw-collection-sources p{color:var(--muted)}:root[data-theme=dark] dialog::backdrop{background:#0009}
body #sidebarToggle{position:static!important}body .workspace-tools{position:sticky;top:0;z-index:80;background:var(--panel)}
#siengeDwPage [data-bulk-changes]{max-height:620px;overflow:auto;border:1px solid var(--border);border-radius:10px;margin-top:16px}#siengeDwPage [data-bulk-changes] th{position:sticky;top:0;z-index:1}.dw-audit-highlights{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.dw-audit-highlights article{padding:16px;border-left:4px solid #2563eb!important}.dw-audit-highlights .dw-highlight-inclusao{border-left-color:#16a34a!important}.dw-audit-highlights button{display:block;margin-top:12px}.dw-audit-highlights span{font-weight:600}
:root[data-theme=light] #camelSidebar{background:#fff;color:var(--text);border-right:1px solid var(--border)}:root[data-theme=light] #camelSidebar :is(.brand strong,.brand span,.nav-section-label,.server-status,.user-context,.user-context strong){color:var(--muted)}:root[data-theme=light] #camelSidebar .nav-item{color:#344256;background:transparent}:root[data-theme=light] #camelSidebar .nav-item.active{background:#e5f3f0;color:#075e5b}:root[data-theme=light] #camelSidebar :is(.ghost,.rc-sidebar-children summary){color:#344256;background:#f4f7f9;border-color:var(--border)}:root[data-theme=dark] .dw-audit-notice{background:#152f2c;color:#b7efe5;border-color:#28534c}:root[data-theme=dark] .dw-audit-notice.has-events{background:#332710;color:#fde68a;border-color:#805d17}
/* Contrast pairs stay together: pale text must not inherit a light card. */
:root[data-theme=dark] #stats .command-kpi{background:var(--panel);border-color:var(--border);color:var(--text)}
:root[data-theme=dark] .command-kpi small,:root[data-theme=dark] .command-kpi span{color:#b4c3d5}
:root[data-theme=dark] .badge.success{background:#14532d;color:#dcfce7}
:root[data-theme=dark] .badge.warning{background:#713f12;color:#fef3c7}
:root[data-theme=dark] .badge.danger{background:#7f1d1d;color:#fee2e2}
:root[data-theme=dark] .badge.info{background:#1e3a8a;color:#dbeafe}
:root[data-theme=dark] .badge.neutral,:root[data-theme=dark] .operational-badge{background:#334155;color:#e2e8f0}
:root[data-theme=dark] #sidebarToggle{background:var(--surface-soft);color:var(--text);border-color:var(--border)}
body .page,body .panel,body .table-wrap{min-width:0;max-width:100%}body .table-wrap{width:100%;overscroll-behavior-inline:contain}
.shell-card-table td{overflow-wrap:anywhere}.rc-sidebar-children>summary{min-height:44px;display:list-item;align-content:center}
@media(max-width:1100px){body .panel-head{flex-wrap:wrap;align-items:flex-start}body .search-wrap{width:100%;min-width:0}body .search-wrap input{width:100%;min-width:0}body .command-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}body .command-heading{flex-wrap:wrap;gap:12px}}
@media(max-width:1000px){body .shell-card-table{width:100%;min-width:0;table-layout:fixed}body .shell-card-table thead{display:none}body .shell-card-table tbody{display:block;padding:12px}body .shell-card-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:12px;padding:16px;border:1px solid var(--border);border-radius:10px;background:var(--panel)}body .shell-card-table td{display:block;min-width:0;padding:0;border:0;white-space:normal;line-height:1.5;background:transparent!important}body .shell-card-table td::before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;font-weight:600;margin-bottom:4px}body .shell-card-table td:first-child{grid-column:1/-1}body .shell-card-table .badge{white-space:normal;font-size:11px;line-height:1.4}body .financial-strip{grid-template-columns:repeat(3,minmax(0,1fr))}body .financial-strip>div{padding:14px;min-width:0}body .financial-strip strong{font-size:17px;overflow-wrap:anywhere}}
@media(max-width:520px){body .command-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}body .command-kpi{padding:14px;min-width:0}body .command-kpi strong{font-size:25px}body .shell-card-table tr{grid-template-columns:minmax(0,1fr)}body .financial-strip{grid-template-columns:minmax(0,1fr)}body .workspace-head h1{font-size:24px}}

:root[data-theme=dark] .priority-panel .panel-head{background:var(--panel);color:var(--text)}
@media(max-width:1000px){body .shell-card-table td[colspan]{grid-column:1/-1}body .shell-card-table td[colspan]::before{display:none}}

/* Migration and batch surfaces share the theme instead of fixed white fills. */
:root[data-theme=dark] #app .main :is(.migration-kpi,.migration-gate,.batch-mode-card,.batch-review,.batch-review-card,.batch-step,.batch-kpi,.assistant-sidecard,.assistant-composer,.responsible-options){background:var(--surface-soft);color:var(--text);border-color:var(--border)}
:root[data-theme=dark] #app .main :is(.batch-mode-card.is-selected,.batch-step.is-current){background:#153a37;border-color:#3eb2a4;box-shadow:0 0 0 1px #3eb2a4}
:root[data-theme=dark] .migration-progress{background:#334155}
:root[data-theme=dark] .migration-progress-bar{background:#2dd4bf}
:root[data-theme=dark] .batch-queue-notice{color:var(--muted)}
/* Glass surfaces use translucent fills, never opacity on text or controls. */
:root .camel-chat-launcher{background:rgba(7,88,82,.82);color:#fff;border:1px solid rgba(180,244,232,.45);backdrop-filter:blur(16px) saturate(140%);-webkit-backdrop-filter:blur(16px) saturate(140%);box-shadow:0 8px 30px #061e2b38,inset 0 1px 0 #ffffff30}
:root .camel-chat-launcher:hover{background:rgba(6,76,71,.94)}
@supports not (backdrop-filter:blur(1px)){:root .camel-chat-launcher{background:#075852}}

:root[data-theme=dark] #app .main :is(.summary-box,.decision-hero,.decision-hero-grid>div){background:var(--surface-soft);color:var(--text);border-color:var(--border)}
:root[data-theme=dark] #app .main .attention-box{background:#35291b;color:#f8e8d1;border-color:#87623a}
:root[data-theme=dark] #app .main .attention-box :is(p,li,strong){color:#f8e8d1}
:root[data-theme=dark] #app .main .rc-bulk [data-jobs-module] button{background:var(--surface-soft);color:var(--text);border-color:var(--border)}
:root .camel-chat-launcher{background:rgba(7,88,82,.38);border-color:rgba(180,244,232,.55);backdrop-filter:blur(18px) saturate(140%);-webkit-backdrop-filter:blur(18px) saturate(140%);text-shadow:0 1px 3px #001d1bcc}
:root .camel-chat-launcher:hover{background:rgba(7,88,82,.62)}

.dashboard-paging{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:14px 20px;color:var(--muted);font-size:12px}

/* Evidence surfaces include the viewer outside main and document list cards. */
:root[data-theme=dark] #app .main :is(.doc,.recon-evidence,.audit-evidence-hint,.finding-review-card,.review-finished,.kanban-pinned-summary){background:var(--surface-soft);color:var(--text);border-color:var(--border)}
:root[data-theme=dark] .audit-viewer :is(.audit-viewer-guide,.audit-viewer-context,.audit-search-results,.audit-search-suggestions button,.audit-viewer-body){background:var(--surface-soft);color:var(--text);border-color:var(--border)}
:root[data-theme=dark] .audit-viewer :is(button,.ghost,a.ghost){background:var(--surface-soft);color:var(--text);border-color:var(--border)}
:root[data-theme=dark] .audit-viewer :is(h3,strong,p,small,summary,label,output){color:var(--text)}
:root[data-theme=dark] .audit-viewer :is(.audit-viewer-guide summary span,.audit-image-tools span,.audit-viewer-tools){color:var(--muted)}
:root[data-theme=dark] .audit-viewer .audit-search-hit:is(:hover,[aria-pressed=true]){background:#16413a;color:#d4fff1;border-color:#42b8a6}
.doc>div{min-width:0}.doc small{overflow-wrap:anywhere}
@media(max-width:800px){.doc{flex-wrap:wrap}.doc>div:first-child{flex-basis:100%}.doc>div:last-child{flex-wrap:wrap}}

/* Comparison owns one main column; sidebar collapse must never create a zero-width title. */
body.audit-viewer-open #app{grid-template-columns:minmax(0,1fr);margin-right:var(--audit-viewer-effective-width);min-width:0}
body.audit-viewer-open #app .main{grid-column:1;min-width:0;width:100%}
body.audit-viewer-open #camelSidebar{display:none!important}
body.audit-viewer-open #sidebarToggle{display:none!important}
body.audit-viewer-open .audit-viewer{box-sizing:border-box;width:var(--audit-viewer-effective-width)}
@media(min-width:1101px){:root{--audit-viewer-effective-width:min(var(--audit-viewer-width),calc(100vw - 420px))}body.audit-viewer-open .workspace-head{flex-wrap:wrap;gap:12px}body.audit-viewer-open .workspace-head>div{min-width:0}body.audit-viewer-open .decision-hero{grid-template-columns:minmax(0,1fr)}}
@media(max-width:1100px){
 body.audit-viewer-open{overflow:hidden}
 body.audit-viewer-open #app{display:block;margin:0;height:45dvh;min-height:0;overflow:auto;overscroll-behavior:contain}
 body.audit-viewer-open .audit-viewer{position:fixed;inset:45dvh 0 0;width:100%;height:55dvh;border-left:0;border-top:2px solid var(--border)}
 body.audit-viewer-open #workflowDrawer .work-drawer-panel{top:0;bottom:auto;right:0;width:100vw!important;height:45dvh;max-height:45dvh}
 body.audit-viewer-open .audit-viewer-resize,body.audit-viewer-open .audit-size-label{display:none}
}
body.audit-viewer-full .audit-viewer{inset:0;width:100vw;height:100dvh}
