/* KONEVIX 1.44.2: one-pass semantic Theme Engine normalization.
   Loaded LAST. Business workspace card overrides & POS rendered previews are excluded.
   Light, sand, business-gray, dark, graphite, violet, midnight, ocean and custom. */
:root{
  --kv-form-surface:var(--color-surface-secondary,var(--panel2));
  --kv-form-color:var(--color-text-primary,var(--text));
  --kv-form-help:var(--color-text-secondary,var(--muted));
  --kv-form-line:var(--color-border-default,var(--border));
  --kv-form-padding-inline:14px;
}
/* Headers, nested legacy surfaces and modules: no literal dark fallback in Light. */
html :is(.admin-tool-section,.entity-manager-row,.entity-manager-detail .card,
  .entity-detail-grid .card,.object-designer-toolbar,.object-designer-palette,
  .records-journal-toolbar,.records-journal-filters,.records-journal-table-wrap,
  .records-module-settings,.records-sender-row,.resolution-card,.document-chain-item,
  .snapshot-card,.incoming-meta-grid>div,.outgoing-meta-grid>div,
  .module-object-binding-card,.survey-admin-page .card,
  .admin-hub .admin-tool-section){
  background:var(--color-surface-primary)!important;
  color:var(--color-text-primary)!important;
  border-color:var(--color-border-default)!important;
}
html :is(.admin-tool-card,.entity-manager-object-icon,.admin-tool-icon,
 .document-chain-item,.records-sender-row,.snapshot-card,
 .resolution-card,.outgoing-stage-line,.user-department-picker,
 .module-object-binding-list .check-line){
 background:var(--color-surface-secondary)!important;
 color:var(--color-text-primary)!important;
 border-color:var(--color-border-default)!important;
}
html :is(.entity-manager-row,.entity-field-row,.admin-tool-section,
 .records-sender-row,.records-hub-card,.snapshot-card,
 .records-journal-toolbar,.records-journal-filters,.module-object-binding-card){
 min-width:0;
}
html :is(.admin-tool-card,.entity-manager-row,.entity-field-row,.records-hub-tab,
 .records-journal-actions button,.module-object-binding-list .check-line){
 overflow-wrap:anywhere;
}
html :is(.admin-tool-card,.entity-manager-row,.records-hub-tab):hover{
 border-color:var(--color-accent)!important;
 background:var(--color-surface-hover)!important;
}
html :is(.entity-manager-tabs button,.records-hub-tab){
 color:var(--color-text-secondary)!important;
 padding:10px 13px;
 border-radius:9px;
}
html :is(.entity-manager-tabs button.active,.records-hub-tab.active,
  .entity-manager-tabs button[aria-selected="true"],.records-hub-tab[aria-selected="true"]){
 color:var(--color-text-primary)!important;
 border-color:var(--color-accent)!important;
 background:var(--color-surface-selected)!important;
}
html :is(.entity-manager-tabs button,.records-hub-tab):focus-visible{
 outline:2px solid var(--color-accent)!important;
 outline-offset:2px;
}
/* Form readability: labels, checkboxes and condition rows get real breathing room. */
html :is(.condition-builder,.user-admin-preferences,.workspace-template-block-row,
 .kv-field-rule-toggle,.module-object-binding-list .check-line,
 .survey-admin-page .check-line,.modal .check-line){
 color:var(--kv-form-color)!important;
 background:var(--kv-form-surface)!important;
 border:1px solid var(--kv-form-line)!important;
 padding:12px var(--kv-form-padding-inline)!important;
 min-width:0;
 line-height:1.45;
}
html :is(.condition-builder,.user-admin-preferences) :is(.condition-builder-head,label,legend,h3,h4,strong,b){
 color:var(--kv-form-color)!important;
 line-height:1.4;
}
html :is(.condition-builder,.user-admin-preferences,.workspace-template-block-row)
  :is(.muted,.small,small,.form-caption,.condition-builder-hint){color:var(--kv-form-help)!important}
html .condition-builder .condition-row{min-width:0;gap:9px;padding:2px 0}
html .condition-builder .condition-row>*{min-width:0}
html .condition-builder .condition-builder-head{gap:10px;min-width:0}
html .check-line:not(.pd-mock .check-line):not(.pd-preview .check-line){align-items:center!important;gap:11px!important}
html .check-line:not(.pd-mock .check-line):not(.pd-preview .check-line) input[type="checkbox"]{width:16px!important;height:16px!important;flex:0 0 16px}
html .check-line:not(.pd-mock .check-line):not(.pd-preview .check-line) span{min-width:0;line-height:1.45;color:var(--kv-form-color)!important}
html .check-line.compact:not(.pd-mock .check-line):not(.pd-preview .check-line){padding:5px 3px!important;border:0!important;background:transparent!important}
html :is(.modal,.content,.admin-center-page) :is(.check-line,.condition-builder,.user-admin-preferences) :is(label,span,strong,b){color:var(--kv-form-color)}
html :is(.modal,.admin-center-page,.content,.survey-admin-page) :is(input,textarea,select){min-width:0}
html :is(.modal,.admin-center-page,.survey-admin-page) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
 color:var(--color-text-primary)!important;background:var(--input-bg)!important;
 border-color:var(--input-border)!important;
}
/* Real Records Management journal. Old CSS gave every hovered CELL a dark background. */
html .records-journal-table{color:var(--color-text-primary);background:var(--color-surface-primary)}
html .records-journal-table thead th{
 background:var(--table-header-bg)!important;
 color:var(--color-text-primary)!important;
 border-color:var(--color-border-default)!important;
 padding:12px 14px!important;
}
html .records-journal-table tbody td{
 background:var(--color-surface-primary);
 color:var(--color-text-primary)!important;
 border-color:var(--color-border-soft)!important;
 padding:12px 14px!important;
 line-height:1.5;
}
html .records-journal-table tbody td :is(b,strong){color:var(--color-text-primary)!important}
html .records-journal-table tbody td small{color:var(--color-text-secondary)!important;line-height:1.4}
html .records-journal-table tbody tr.journal-final:not(:hover):not(.selected):not([aria-selected="true"])>td{
 background:color-mix(in srgb,var(--color-success) 6%,var(--color-surface-primary))!important;
}
html .records-journal-table tbody tr:hover>td,
html .records-journal-table tbody tr:focus-within>td{
 background:var(--table-row-hover)!important;
 color:var(--color-text-primary)!important;
}
html .records-journal-table tbody tr.selected>td,
html .records-journal-table tbody tr[aria-selected="true"]>td{
 background:var(--table-row-selected)!important;
 color:var(--color-text-primary)!important;
}
html .records-journal-table tbody tr.selected:hover>td,
html .records-journal-table tbody tr[aria-selected="true"]:hover>td{
 background:var(--color-surface-hover)!important;
}
html .records-journal-table .journal-due-over{color:color-mix(in srgb,var(--color-danger) 70%,var(--color-text-primary))!important}
html .records-journal-filters label{color:var(--color-text-secondary)!important;font-size:12px;line-height:1.35}
html .records-journal-table tbody tr:focus-within{outline:2px solid var(--color-accent);outline-offset:-2px}
/* Row metadata and statuses must never have "dark theme text" hard-coded. */
html .records-journal-table :is(.status.active,.status.terminated,.status.blocked),
html :is(.records-journal-table,.records-hub-card) .record-direction{
 border:1px solid var(--color-border-soft)!important;
}
html :is(.records-journal-table,.records-hub-card) .record-direction{
 background:var(--color-accent-soft)!important;color:var(--color-text-primary)!important;
 padding:5px 9px!important;
}
html :is(.records-journal-table,.records-hub-card) .record-direction.incoming,
html .status.active:not(.pd-mock .status):not(.pd-preview .status){background:var(--color-success-bg)!important;color:color-mix(in srgb,var(--color-success) 70%,var(--color-text-primary))!important}
html :is(.records-journal-table,.records-hub-card) .record-direction.outgoing,
html .status.blocked:not(.pd-mock .status):not(.pd-preview .status){background:var(--color-warning-bg)!important;color:color-mix(in srgb,var(--color-warning) 70%,var(--color-text-primary))!important}
html .status.terminated:not(.pd-mock .status):not(.pd-preview .status){background:var(--color-danger-bg)!important;color:color-mix(in srgb,var(--color-danger) 70%,var(--color-text-primary))!important}
html :is(.records-journal-actions,.records-journal-table,.entity-manager-detail) .mini{
 background:var(--color-surface-secondary);color:var(--color-text-primary);
 border-color:var(--color-border-default);
 min-height:30px;padding:7px 10px;
}
/* This is an intended independent theme preview, not a Theme Engine leak. */
:where(.pd-preview,.pd-mock,.pos-designer-preview,.theme-preview-ui,.k-preview-ui){color-scheme:normal}
/* Responsive polish - controls and labels must not touch card edges. */
@media(max-width:900px){
 html .records-journal-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
 html .records-journal-table th,html .records-journal-table td{padding:10px 12px!important}
 html .entity-manager-tabs{gap:5px}
}
@media(max-width:600px){
 html .records-journal-filters{grid-template-columns:minmax(0,1fr)}
 html .condition-builder .condition-row{grid-template-columns:minmax(0,1fr)!important}
 html :is(.condition-builder,.user-admin-preferences,.workspace-template-block-row){padding:12px!important}
 html .entity-manager-tabs button{min-height:38px}
}
@media(prefers-reduced-motion:reduce){
 html :is(.entity-manager-tabs button,.records-hub-tab,.records-journal-table tbody tr){transition:none!important}
}
