/* Evorah v1.0.27 — global dark-mode contrast and component consistency audit */
html[data-theme="dark"]{
  --ev-bg:#09131d;--ev-surface:#111f2a;--ev-surface-2:#172934;--ev-surface-3:#20343e;
  --ev-text:#f3f7f8;--ev-text-soft:#c1cdd2;--ev-muted:#9eafb6;--ev-border:#40545d;
  --surface:var(--ev-surface);--surface-2:var(--ev-surface-2);--text:var(--ev-text);--muted:var(--ev-text-soft);--border:var(--ev-border);
}
html[data-theme="dark"] body,html[data-theme="dark"] main{background:var(--ev-bg)!important;color:var(--ev-text)!important}
html[data-theme="dark"] main :is(h1,h2,h3,h4,h5,h6,strong,label,legend,th,dt){color:var(--ev-text)!important}
html[data-theme="dark"] main :is(p,span,small,li,td,dd,.muted,.helptext,.hint,.subtext){color:var(--ev-text-soft)}
html[data-theme="dark"] main a:not(.button):not(.btn):not(.nav-link):not(.active-tab){color:#91e9e1}

html[data-theme="dark"] main :is(.panel,.card,.box,.section-card,.summary-card,.profile-card,.form-card,.detail-card,.content-card,.dashboard-card,.admin-card,.user-card,.record-card,.stat-card,.table-wrap,details){
  background-color:var(--ev-surface)!important;color:var(--ev-text)!important;border-color:var(--ev-border)!important;
}
html[data-theme="dark"] main :is(.panel,.card,.box,.section-card,.summary-card,.profile-card,.form-card,.detail-card,.content-card,.dashboard-card,.admin-card,.user-card,.record-card,.stat-card) :is(p,span,small,li,td,dd){color:var(--ev-text-soft)}

html[data-theme="dark"] main :is(input,textarea,select){
  background:var(--ev-surface-2)!important;color:var(--ev-text)!important;border-color:#58707a!important;caret-color:#6ee7dc!important;
}
html[data-theme="dark"] main :is(input,textarea)::placeholder{color:#9cafb6!important;opacity:1}
html[data-theme="dark"] main select option{background:#172934;color:#f3f7f8}
html[data-theme="dark"] main :is(input,textarea,select):disabled{background:#22333b!important;color:#aebdc3!important;opacity:.82}
html[data-theme="dark"] main :is(input,textarea,select):focus{outline:2px solid #54d8cf!important;outline-offset:1px;border-color:#54d8cf!important}

html[data-theme="dark"] main :is(table,thead,tbody,tr,th,td){border-color:var(--ev-border)!important}
html[data-theme="dark"] main thead,html[data-theme="dark"] main th{background:var(--ev-surface-2)!important}
html[data-theme="dark"] main tbody tr:nth-child(even){background:rgba(255,255,255,.025)}
html[data-theme="dark"] main tbody tr:hover{background:rgba(84,216,207,.08)}

html[data-theme="dark"] main :is(.badge,.pill,.chip,.tag,.status,.risk,.label-pill){border:1px solid #5b7078;color:var(--ev-text)!important;background:#2c4049}
html[data-theme="dark"] main :is(.badge-green,.status-active,.success,.positive){background:#173f32!important;color:#a6f0ca!important;border-color:#39745e!important}
html[data-theme="dark"] main :is(.badge-red,.status-danger,.danger,.negative){background:#4a252a!important;color:#ffb7bd!important;border-color:#7f454c!important}
html[data-theme="dark"] main :is(.badge-yellow,.warning,.status-warning){background:#493d1c!important;color:#ffe29a!important;border-color:#806d35!important}
html[data-theme="dark"] main :is(.badge-blue,.info,.status-info){background:#243f55!important;color:#bfe1ff!important;border-color:#4e7695!important}

html[data-theme="dark"] main :is(button,.button,.btn,input[type="submit"],input[type="button"]){border-color:#60757e}
html[data-theme="dark"] main :is(button,.button,.btn).secondary{background:var(--ev-surface-3)!important;color:var(--ev-text)!important}
html[data-theme="dark"] main :is(button,.button,.btn):disabled{background:#293940!important;color:#9dabb0!important;opacity:.78}

html[data-theme="dark"] main :is(.tabs,.clean-tabs,.tabs-panel,.filter-tabs,.access-tabs){background:var(--ev-surface)!important;border-color:var(--ev-border)!important}
html[data-theme="dark"] main :is(.tabs,.clean-tabs,.tabs-panel,.filter-tabs,.access-tabs) a{color:#c8d6da!important;border-color:#465b64!important;background:#1c303a!important}
html[data-theme="dark"] main :is(.tabs,.clean-tabs,.tabs-panel,.filter-tabs,.access-tabs) a:is(.active,.active-tab,[aria-current="page"]){background:#326f70!important;color:#fff!important;border-color:#6edfd6!important}

html[data-theme="dark"] main :is(.message,.alert,.notification-row,.empty-state){background:var(--ev-surface-2)!important;color:var(--ev-text)!important;border-color:var(--ev-border)!important}
html[data-theme="dark"] main hr{border-color:var(--ev-border)}
html[data-theme="dark"] main svg:not([fill="none"]){color:currentColor}
html[data-theme="dark"] main img{color-scheme:normal}

/* Native controls and autofill must not turn white in dark mode. */
html[data-theme="dark"] main input:-webkit-autofill,
html[data-theme="dark"] main input:-webkit-autofill:hover,
html[data-theme="dark"] main input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--ev-text)!important;-webkit-box-shadow:0 0 0 1000px var(--ev-surface-2) inset!important;transition:background-color 9999s ease-out 0s;
}
html[data-theme="dark"] main input[type="checkbox"],html[data-theme="dark"] main input[type="radio"]{accent-color:#55d9cf}

/* Avoid content jumping beneath sticky headers and tabs. */
main [id]{scroll-margin-top:96px}
.clean-tabs{overscroll-behavior-inline:contain;scrollbar-width:thin}
