/* 996 theme compatibility layer. The approved Silkway visual system is the
 * reference; content, images, company identities and action semantics stay own. */
:root, html[data-sw-theme] {
    --bg: var(--sw-bg);
    --surface: var(--sw-surface);
    --text: var(--sw-text);
    --text-2: var(--sw-secondary);
    --text-3: var(--sw-muted);
    --border: var(--sw-line);
    --divider: var(--sw-line);
}

/* Native number/select controls otherwise retain the browser's light inset edge. */
.content input:not(.MuiInputBase-input):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.content select:not(.MuiNativeSelect-select),
.content textarea:not(.MuiInputBase-input) {
    border: 1px solid var(--sw-line);
    padding: 8px 10px;
}
/* Portalled MUI controls do not inherit .content rules. Preserve semantic
 * error/danger/success colors; only repair neutral text and disabled controls. */
html[data-sw-theme] .MuiFormHelperText-root:not(.Mui-error),
html[data-sw-theme] .MuiTablePagination-root,
html[data-sw-theme] .MuiSelect-icon,
html[data-sw-theme] .MuiAutocomplete-popupIndicator,
html[data-sw-theme] .MuiAutocomplete-clearIndicator,
html[data-sw-theme] .MuiAutocomplete-noOptions,
html[data-sw-theme] .MuiAutocomplete-loading,
html[data-sw-theme] .MuiTablePagination-actions .MuiIconButton-root,
html[data-sw-theme] .MuiFormLabel-root:not(.Mui-error) {
    color: var(--sw-secondary) !important;
}
html[data-sw-theme] .MuiFormControlLabel-label,
html[data-sw-theme] .MuiTableCell-root {
    color: var(--sw-text);
}
html[data-sw-theme] .MuiInputBase-input.Mui-disabled {
    -webkit-text-fill-color: var(--sw-muted);
    color: var(--sw-muted);
}
html[data-sw-theme] .MuiButton-root.Mui-disabled,
html[data-sw-theme] .MuiCheckbox-root.Mui-disabled {
    color: var(--sw-muted) !important;
}
html[data-sw-theme] .MuiButton-contained.Mui-disabled {
    background: var(--sw-soft) !important;
}
html[data-sw-theme] .MuiMenuItem-root.Mui-selected {
    background-color: var(--sw-accent-soft);
}
html[data-sw-theme] .MuiMenuItem-root:hover {
    background-color: var(--sw-soft);
}
html[data-sw-theme] .MuiInputBase-input::placeholder {
    color: var(--sw-muted) !important;
    opacity: 1 !important;
}
html[data-sw-theme] .MuiChip-colorDefault {
    background-color: var(--sw-soft);
    color: var(--sw-text);
    border-color: var(--sw-line);
}
html[data-sw-theme] .MuiChip-colorDefault .MuiChip-deleteIcon {
    color: var(--sw-secondary) !important;
}
