/* Revisión de uso intensivo: superficies, métricas y ventanas comparten tokens.
   No usar filtros invert() para oscurecer: alteran mapas, fotos y semántica. */
:root{--ui-bg:#f1f3f7;--ui-panel:#fff;--ui-soft:#f5f7fb;--ui-line:#d7dee8;--ui-ink:#243146;--ui-muted:#526278;--ui-blue:#1761c4;--ui-accent:#dfeaff;--ui-shadow:0 12px 35px #26374b12;--ex-muted:var(--ui-muted)}
:root[data-theme=dark]{color-scheme:dark;--ui-bg:#151b25;--ui-panel:#202938;--ui-soft:#273244;--ui-line:#435169;--ui-ink:#e8eef8;--ui-muted:#b7c4d7;--ui-blue:#245fbb;--ui-accent:#304a70;--ui-shadow:0 12px 35px #0003;--ex-ink:var(--ui-ink);--ex-muted:var(--ui-muted);--ex-line:var(--ui-line);--ex-panel:var(--ui-panel);--ex-wash:var(--ui-soft);--line:var(--ui-line)}
html[data-theme=light]{color-scheme:light}body:not(.is-access){background:var(--ui-bg)!important;color:var(--ui-ink)!important}button,.button{min-height:40px;padding:9px 15px;line-height:1.3}.smallbutton{min-height:36px;padding:8px 12px!important}label{line-height:1.55}.grid{column-gap:20px;row-gap:18px}.grid>label{margin:0;min-width:0}.grid input,.grid select,.grid textarea{margin-top:7px}.actions{gap:9px}.panel{padding:24px}.pagehead h2{line-height:1.25}.pagehead .actions{gap:10px}.listhead{gap:18px;flex-wrap:wrap;margin-bottom:20px}.tablewrap{scroll-padding-inline:14px}td,th{padding-inline:16px!important}td{line-height:1.65}td small{display:block;margin-top:5px}td .actions{min-width:150px}.list-workspace-ui2{padding:24px!important;margin:0 0 26px}.list-tools-ui2{display:flex;gap:20px;align-items:flex-end;flex-wrap:wrap;padding-bottom:22px;border-bottom:1px solid var(--ui-line);margin-bottom:24px}.list-tools-ui2 label{flex:1;min-width:180px;max-width:560px;margin:0}.list-tools-ui2 label:has(select){max-width:200px}.list-tools-ui2 input,.list-tools-ui2 select{display:block;width:100%;margin-top:7px}.list-tools-ui2 [role=status]{color:var(--ui-muted);font-size:12px;padding-bottom:12px}.fleet-heading-ui2{margin:34px 0 18px!important}.date-ui2{white-space:nowrap;font-variant-numeric:tabular-nums}.refined-table-ui2{box-shadow:none!important}.sort-ui2{display:flex;justify-content:space-between;align-items:center;gap:18px;width:100%;padding:4px 0!important;min-height:32px;background:transparent!important;border:0!important;color:inherit!important;text-align:left;font-size:12px;font-weight:650;white-space:nowrap}.sort-ui2 span{font-size:16px;color:var(--ui-muted)}[aria-sort=ascending] .sort-ui2,[aria-sort=descending] .sort-ui2{color:var(--ui-blue)!important}.theme-toggle-ui2{position:fixed;top:12px;right:20px;z-index:110;display:grid;place-items:center;width:43px;height:40px;min-height:40px;padding:9px!important;border:1px solid var(--ui-line)!important;border-radius:12px!important;background:var(--ui-panel)!important;color:var(--ui-ink)!important;box-shadow:0 2px 8px #0000000c!important}.theme-toggle-ui2 svg{width:21px;height:21px}.theme-toggle-ui2:hover{background:var(--ui-accent)!important}.topright{padding-right:85px!important}.is-access .theme-toggle-ui2{background:#f6f9ff!important;color:#253750!important;border-color:#ced8e6!important}
/* Cierre macOS: un botón real, con punto rojo y una cruz visible al interactuar.
   El área táctil es 36 px aunque el círculo visual mida 15 px. */
dialog .dialoghead .mac-close-ui2,dialog .custody-titlebar .mac-close-ui2{order:-1!important;flex:0 0 36px!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;border:0!important;background:transparent!important;border-radius:50%!important;padding:0!important;font-size:0!important;position:relative;color:#681813!important}
.mac-close-ui2:before{content:"";position:absolute;inset:10px;border-radius:50%;background:#ff6259;border:1px solid #d84a42}.mac-close-ui2:after{content:"×";position:absolute;inset:0;display:grid;place-items:center;font:600 14px Arial;color:#671710;opacity:0}.mac-close-ui2:hover:after,.mac-close-ui2:focus-visible:after{opacity:1}.dialoghead{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;padding:16px 22px!important;min-height:68px;flex-shrink:0}.dialoghead>div{flex:1;min-width:0}.dialoghead h2{margin:0!important}.dialoghead .eyebrow{margin:0 0 3px!important}.dialogfoot{background:var(--ui-soft)!important;backdrop-filter:none!important;opacity:1!important;margin:0!important;gap:10px;isolation:isolate;flex-shrink:0;padding:16px 22px!important;border-color:var(--ui-line)!important}.dialogfoot button{white-space:normal}.dialoghead,.dialogfoot{box-sizing:border-box}
@media screen{#editor[open]{display:flex!important;flex-direction:column;overflow:hidden!important;height:min(940px,94dvh);max-height:94dvh!important}#editor-form{display:flex!important;flex-direction:column;flex:1;min-height:0;overflow:hidden!important;padding:0!important;margin:0!important}.editor-scroll-ui2{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding-block:22px;padding:26px 28px 40px}#editor-fields{padding:0!important;overflow:visible!important}#editor-form>.dialogfoot{position:static!important;display:flex;flex-wrap:wrap;justify-content:flex-end}.editor-scroll-ui2>p:empty{display:none}}
.editor-tabs{margin:24px 0!important;padding:6px!important;gap:6px!important;overflow-x:auto;flex-wrap:wrap}.editor-tabs button{padding:10px 14px!important;min-height:40px!important}.rowcard{margin:18px 0!important;border-color:var(--ui-line)!important;border-radius:12px;padding:0 18px 20px!important;scroll-margin-block:24px}.rowcard>summary{padding:16px 0!important;line-height:1.55}.rowcard .grid{margin:10px 0 22px}.part-details-ui2{margin-top:20px}.compliance-config{padding:18px 20px;background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:12px;margin:18px 0 24px}.compliance-config>summary{font-weight:650;margin-bottom:15px}.compliance-check{display:flex;align-items:center;gap:10px;padding:16px 0;margin:10px 0}.compliance-roster{padding-top:28px;margin-top:32px;border-top:1px solid var(--ui-line)}.compliance-stage-ui2{font-size:15px!important;margin:24px 0 14px!important;letter-spacing:-.01em}.compliance-export-ui2{display:flex;gap:16px;align-items:center;flex-wrap:wrap;background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:12px;padding:20px;margin:24px 0 16px}.compliance-export-ui2 p{flex:1;min-width:180px;margin:0;font-size:12px;color:var(--ui-muted)}.compliance-export-ui2 button{flex-shrink:0;opacity:1!important}.workflow-progress{border-left:3px solid var(--ui-blue);padding:12px 16px;background:var(--ui-soft);border-radius:0 10px 10px 0;line-height:1.65}.fp-filters32{gap:20px 24px!important;padding:24px!important;margin:20px 0 28px!important;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-panel)}.fp-filters32 label{margin:0!important;line-height:1.7}.fp-filters32 input,.fp-filters32 select{display:block;width:100%;margin-top:7px}.fp-view32{padding-block:12px 20px!important;margin-bottom:16px!important}.fp-body32{padding:26px 30px!important}.fp-section32{margin-top:32px!important;padding-top:18px}.fp-detail-head32{gap:24px!important}.fp-item32{margin:18px 0!important;padding:16px!important}.fp-dates32{padding:22px!important;margin:20px 0 28px!important}.fp-body32 .grid{gap:20px}.fp-body32 h3{margin-bottom:16px}.fp-totals32{gap:18px!important;margin-bottom:26px!important}.fp-totals32>div{padding:22px!important}.custody-register{margin-top:8px}.custody-access{margin-bottom:18px}
/* Entrada limitada a una vez por nodo; interacción ligera, sin bucles permanentes. */
@keyframes data-reveal-ui2{from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
.data-card-ui2{animation:data-reveal-ui2 .42s cubic-bezier(.2,.75,.25,1) both;animation-delay:var(--card-delay-ui2,0ms);transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease!important;will-change:auto}
.data-card-ui2:hover{transform:translateY(-4px)!important;box-shadow:0 14px 28px #24334f20!important}.data-card-ui2:focus-visible{transform:translateY(-3px)!important}
/* Tarjetas métricas: texto y acción no heredan el azul de un botón primario. */
:is(.dash-card,.dash-item-card,.stat,.fp-totals32>div,.home-totals>div,.home-totals>button,.an-kpi,.an-stat){background:var(--ui-panel)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
:is(.dash-card,.dash-item-card,.stat,.fp-totals32>div,.home-totals>div,.home-totals>button,.an-kpi,.an-stat) :is(strong,b,.dash-card-label,.dash-card-detail,.dash-card-link,small,span:not(.dash-card-icon):not(.item-icon)){color:var(--ui-ink)!important}
.dash-card-icon,.item-icon{color:#295786!important;background:#e5edf9!important;border-radius:12px}.dash-card-icon svg,.item-icon svg{color:inherit!important}.dash-card{padding:24px!important;min-height:160px}.dash-card-copy{gap:9px!important}.dash-card strong{line-height:1.2}.dash-card-detail{line-height:1.65!important}.dash-highlights{gap:14px;padding:18px}.data-card-ui2 [class*=icon]{flex-shrink:0}
/* Capas heredadas usan colores literales: sustituir superficies y tinta de forma
   explícita, sin afectar fotografías, mapas, firmas ni el contenido exportado. */
:root[data-theme=dark] :is(.panel,.dash-panel,.an-panel,.custody-register,.mail-list33,.mail-reader33,.mail-workspace33,.fp-day32,.fp-totals32>div,.brigade-card30,dialog,.text-preview,.text-group,.rowcard,.custody-content,.custody-review>div,.an-kpi,.an-stat){background:var(--ui-panel)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] :is(h1,h2,h3,h4,h5,label,legend,summary,td,th,.pagehead p,.pagehead .eyebrow,.context-title p,.context-title>span,.brand strong,#who,#header-location,.dialoghead h2,.custody-step-heading,.fp-state352,.fp-stage352){color:var(--ui-ink)!important}
:root[data-theme=dark] :is(small,.muted,.fp-view32>span,.fp-totals32 span,.custody-review dt,.custody-private,.custody-step-description,.dialoghead .eyebrow,.pagination,.an-hint){color:var(--ui-muted)!important}
:root[data-theme=dark] :is(input:not([type=checkbox]):not([type=radio]),select,textarea){background:#192231!important;color:var(--ui-ink)!important;border-color:#5e708a!important}
:root[data-theme=dark] ::placeholder{color:#a5b5cc!important;opacity:1}
:root[data-theme=dark] :is(button.secondary,a.button.secondary,button.ghost,.tabbar button,.editor-tabs button){background:var(--ui-soft)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] :is(button.secondary,a.button.secondary):hover{background:#364761!important}
:root[data-theme=dark] :is(body>header,.dialoghead,.dialogfoot,.contextbar,.module-heading41,.editor-tabs,.tabbar,.fp-dates32,.compliance-config,.compliance-export-ui2,.workflow-progress,.custody-titlebar,.custody-footer,.custody-steps,.fp-weekday32,.fp-day32.outside){background:var(--ui-soft)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] aside.app-sidebar{background:#1b2432!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] .app-sidebar :is(nav button,nav .nav-group>p,.sidefoot,.sidebar-user31,.sidebar-user31 small){color:var(--ui-muted)!important}
:root[data-theme=dark] .app-sidebar nav button svg{color:#abc7ed!important}
:root[data-theme=dark] .app-sidebar nav button.active{background:#304463!important;color:#fff!important;border-color:#526e92!important}
:root[data-theme=dark] .app-sidebar nav button:hover{background:#2c3a50!important;color:#fff!important}
:root[data-theme=dark] :is(.sidefoot,.sidebar-user31){background:#253247!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] :is(thead th,.tablewrap){background:var(--ui-soft)!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] tbody tr{background:var(--ui-panel)!important}
:root[data-theme=dark] tbody tr:nth-child(even){background:#253044!important}
:root[data-theme=dark] tbody tr:hover{background:#31435e!important}
:root[data-theme=dark] tbody td{border-color:var(--ui-line)!important}
:root[data-theme=dark] .badge,:root[data-theme=dark] .fp-badge32{background:#35445b!important;color:#eef4ff!important;border-color:#526582!important}
:root[data-theme=dark] :is(.badge.warn,.fp-badge32.warning,.notice.warning){background:#493b20!important;color:#ffe2a0!important;border-color:#91733c!important}
:root[data-theme=dark] :is(.badge.ok,.fp-state352.completed){background:#214537!important;color:#b8f4d4!important;border-color:#467c62!important}
:root[data-theme=dark] :is(.badge.danger,.fp-badge32.urgent,.error){color:#ffb9b1!important}
:root[data-theme=dark] .notice{background:#243b56!important;color:#c9e6ff!important;border-color:#4e7197!important}
:root[data-theme=dark] a:not(.button){color:#a9ccff}
:root[data-theme=dark] :is(.dash-hero,.an-hero,.dash-filter,.an-filters,.dash-highlights,.dash-tabbar,.fp-dashboard-card32,.custody-access,.custody-entry){background:var(--ui-soft)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] :is(.dash-hero,.an-hero,.dash-highlights,.dash-tabbar,.fp-dashboard-card32,.custody-steps,.custody-access,.custody-entry) :is(p,h1,h2,h3,span,strong,b,small){color:var(--ui-ink)!important}
:root[data-theme=dark] :is(.dash-card-icon,.item-icon){color:#d6e8ff!important;background:#324b70!important}
:root[data-theme=dark] :is(.custody-steps button[aria-current=step],.tabbar button.active,.editor-tabs button.active){background:#3b5680!important;color:#fff!important}
:root[data-theme=dark] .access>.panel{background:#202c3ff5!important;border-color:#536c8e!important}
:root[data-theme=dark] .access .login-input31{background:#172334!important;border-color:#5e718c!important}
:root[data-theme=dark] .access :is(h2,label,.login-hint31,.access-foot31,#forgot-password-r6){color:var(--ui-ink)!important}
:root[data-theme=dark] .sort-ui2{color:var(--ui-ink)!important}
@media(max-width:760px){.theme-toggle-ui2{top:10px;right:12px;width:40px}.topright{padding-right:66px!important;gap:6px}.topright #who,.topright .tag{display:none}.topright #logout{font-size:11px;padding:7px;min-height:36px}.list-workspace-ui2{padding:16px!important}.list-tools-ui2{gap:16px}.list-tools-ui2 label{min-width:0;max-width:none;width:100%;flex-basis:100%}.list-tools-ui2 label:has(select){max-width:none}.panel{padding:18px}.editor-scroll-ui2{padding:20px 16px 32px}.grid,.grid.three{column-gap:16px;row-gap:18px}.dialoghead{padding:12px 14px!important}.dialogfoot{padding:14px!important}.dialogfoot button{flex:1;min-width:120px;min-height:42px}.fp-filters32{padding:18px!important;gap:18px!important}.fp-body32{padding:20px 16px!important}.fp-totals32{gap:12px!important}.fp-totals32>div{padding:18px!important}.dash-card{padding:18px!important}.compliance-export-ui2{padding:16px}.compliance-export-ui2 button{width:100%}.compliance-config{padding:16px}.mac-close-ui2:after{opacity:1}.data-card-ui2:hover{transform:none!important}}
@media(prefers-reduced-motion:reduce){.data-card-ui2{animation:none!important;transition:none!important}.data-card-ui2:hover,.data-card-ui2:focus-visible{transform:none!important}*{scroll-behavior:auto!important}}
@media print{.theme-toggle-ui2{display:none!important}:root[data-theme=dark] body,:root[data-theme=dark] dialog{background:#fff!important;color:#111!important}.data-card-ui2{animation:none!important}}

.parts-switch>button{background:var(--ui-soft)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important;padding:15px 18px!important}.parts-switch>button[aria-selected=true]{background:var(--ui-accent)!important;color:var(--ui-ink)!important;border-color:#7c9bca!important}.parts-switch small{color:var(--ui-muted)!important;font-size:11px!important;line-height:1.6}.parts-switch svg{color:inherit!important}
:root[data-theme=dark] :is(.classification-card,.dash-secondary,.an-metric){background:var(--ui-panel)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] :is(.classification-card,.dash-secondary,.an-metric) :is(span,strong,small,b){color:var(--ui-ink)!important}

:root[data-theme=light] .badge{color:#4d607a}

/* Auditoría visual: cubrir también la tinta y las superficies de los módulos
   heredados que no usan todavía tokens (encabezados, históricos y formularios). */
:root[data-theme=dark] :is(#editor-form,.editor-scroll-ui2,#editor-fields,#editor-fields>[data-editor-section],#review,#analytics-entry,.an-entry){background:var(--ui-panel)!important;color:var(--ui-ink)!important}
:root[data-theme=dark] :is(#page,dialog) :is(strong,b,p,summary,.custody-subtitle){color:var(--ui-ink)!important}
:root[data-theme=dark] body>header :is(strong,span,small,a,button){color:var(--ui-ink)!important}
:root[data-theme=dark] :is(.sidefoot,.sidebar-user31) :is(button,span,strong,small){color:var(--ui-ink)!important}
:root[data-theme=dark] .brand strong{color:var(--ui-ink)!important}
:root[data-theme=dark] #v-search353{background:#192231!important;border-color:#5e708a!important;color:var(--ui-ink)!important}
:root[data-theme=dark] #v-search353 input{background:transparent!important}
:root[data-theme=dark] :is(.dash-hero-actions button,.dash-tabbar button,.dash-presets button,.fp-dashboard-card32){background:var(--ui-soft)!important;color:var(--ui-ink)!important;border:1px solid var(--ui-line)!important}
:root[data-theme=dark] :is(.dash-tabbar button[aria-selected=true],.dash-presets button.active){background:#365580!important;color:#fff!important}
:root[data-theme=dark] .dash-hero-actions button :is(span,svg){color:inherit!important}
#page>.module-heading41{padding:18px 20px!important;border-radius:14px;margin-bottom:22px!important}
.custody-search{align-items:flex-end!important}.custody-search label{margin:0!important}.custody-search button{margin:0!important;min-height:40px}
@media(max-width:760px){#page>.module-heading41{padding:14px!important}.editor-scroll-ui2{scroll-padding-top:100px}}

:root[data-theme=light] #sync{color:#526278!important}
:root[data-theme=dark] :is(#logout,#connection,#sync){color:var(--ui-ink)!important}
:root[data-theme=dark] .live-totals{background:var(--ui-soft)!important;border-color:var(--ui-line)!important;color:var(--ui-ink)!important}
:root[data-theme=dark] .live-totals :is(span,strong,small,b){color:var(--ui-ink)!important}
body .v-avatar353{background:#365c7b!important;color:#fff!important}

.case-title-editable-ui2{cursor:text;border-radius:5px;display:inline-block;padding:4px 6px;margin:-4px -6px}.case-title-editable-ui2:hover{background:var(--ui-accent);outline:1px solid var(--ui-line)}.case-title-editable-ui2:focus-visible{outline:3px solid #4584de;outline-offset:3px}.title-form-ui2{padding:24px}.title-form-ui2>label{display:block}.title-form-ui2 textarea{display:block;width:100%;margin-top:10px}.title-form-ui2>p{line-height:1.7;margin:18px 0}.title-form-ui2 .dialogfoot{margin:20px -24px -24px!important}.title-form-ui2{background:var(--ui-panel)!important;color:var(--ui-ink)!important}

:root[data-theme=dark] :is(.case-subject,.case-agency,.preview-subject,.case-preview-empty p){color:var(--ui-ink)!important}
:root[data-theme=dark] :is(.case-preview,.case-results,.home-search,.case-preview-empty,.case-preview .preview-heading){background:var(--ui-panel)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] .case-preview :is(dd,dt){color:var(--ui-ink)!important}

:root[data-theme=dark] .v-brand353 strong{color:var(--ui-ink)!important}
:root[data-theme=dark] #map-status30{color:var(--ui-muted)!important}
:root[data-theme=dark] .v-command353{background:var(--ui-soft)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
:root[data-theme=dark] .v-command353 svg{color:var(--ui-muted)!important}
.dialogfoot{box-shadow:none!important}
