/* Supplier surfaces follow the existing theme toggle and shared DenteFácil tokens. */
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-page, .supplier-history, .lab-connection) {
    --supplier-accent: #a6caff;
    --supplier-success-bg: #173c32;
    --supplier-success-text: #94e4bb;
    --supplier-warning-bg: #3a3020;
    --supplier-warning-text: #f2d18b;
    color: var(--df-text);
    color-scheme: dark;
}

html.dentefacil-dark-mode :is(.supplier-metric, .supplier-total-help p, .supplier-more, .supplier-register-panel, .supplier-connection-action) {
    background: var(--df-surface) !important;
    border-color: var(--df-border) !important;
    color: var(--df-text) !important;
    box-shadow: none;
}
html.dentefacil-dark-mode :is(.supplier-tabs, .supplier-metric-icon, .supplier-workspace-nav, .supplier-register-summary div, .supplier-register-switch) {
    background: var(--df-surface-soft) !important;
    border-color: var(--df-border) !important;
    color: var(--supplier-accent) !important;
}
html.dentefacil-dark-mode :is(.supplier-workspace-hero, .supplier-register-hero) {
    background: linear-gradient(135deg, var(--df-surface-soft), var(--df-surface)) !important;
    border-color: var(--df-border) !important;
}
html.dentefacil-dark-mode :is(.supplier-tabs button, .supplier-overall span, .supplier-metric div > span, .supplier-refresh, .supplier-empty, .supplier-search > i, .supplier-workspace-eyebrow, .supplier-back-link, .supplier-connection-state, .supplier-register-summary span, .supplier-register-panel-header p, .supplier-register-hero p) {
    color: var(--df-muted) !important;
}
html.dentefacil-dark-mode :is(.supplier-overall strong, .supplier-metric strong, .supplier-empty strong, .supplier-register-summary strong, .supplier-register-switch strong) {
    color: var(--df-text-strong) !important;
}
html.dentefacil-dark-mode .supplier-tabs button.is-active {
    background: var(--df-surface-raised) !important;
    color: var(--supplier-accent) !important;
    box-shadow: 0 1px 5px #0003;
}
html.dentefacil-dark-mode :is(.supplier-tabs button:hover, .supplier-more:hover, .supplier-workspace-nav .btn:hover) {
    background: var(--df-surface-raised) !important;
    color: var(--supplier-accent) !important;
}
html.dentefacil-dark-mode .supplier-workspace-nav .btn { color: var(--df-muted); }
html.dentefacil-dark-mode .supplier-workspace-nav .btn.active { color: #fff !important; }
html.dentefacil-dark-mode .supplier-total-help summary { color: var(--supplier-accent); }
html.dentefacil-dark-mode .supplier-notice {
    background: var(--supplier-warning-bg) !important;
    border-color: #78613b !important;
    color: var(--supplier-warning-text) !important;
}
html.dentefacil-dark-mode .supplier-badge.is-connected {
    background: var(--supplier-success-bg);
    color: var(--supplier-success-text);
}
html.dentefacil-dark-mode .supplier-badge.is-warning {
    background: var(--supplier-warning-bg);
    color: var(--supplier-warning-text);
}
html.dentefacil-dark-mode .supplier-badge.is-neutral {
    background: var(--df-surface-raised);
    color: var(--df-muted);
}
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-history) .table {
    --bs-table-bg: var(--df-surface);
    --bs-table-hover-bg: var(--df-surface-raised);
    --bs-table-hover-color: var(--df-text-strong);
    border-color: var(--df-border);
}
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-history) .table thead th {
    background: var(--df-surface-soft) !important;
    color: var(--df-muted) !important;
}
html.dentefacil-dark-mode .supplier-directory .table tbody td { color: var(--df-text); }
html.dentefacil-dark-mode .supplier-directory .table tbody td:nth-child(2) { color: var(--df-text-strong); }
html.dentefacil-dark-mode .supplier-directory .table tbody tr:hover {
    --bs-table-accent-bg: var(--df-surface-raised);
    background: var(--df-surface-raised);
}
html.dentefacil-dark-mode .supplier-directory .table .text-danger { color: #ffaaaa !important; }
html.dentefacil-dark-mode .supplier-directory .table .text-success { color: var(--supplier-success-text) !important; }
html.dentefacil-dark-mode .supplier-directory .table-responsive + .row { color: var(--df-muted); }
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-page, .supplier-history) .btn-outline-primary {
    color: var(--supplier-accent) !important;
    border-color: #719bd5 !important;
}
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-page, .supplier-history) .btn-outline-primary:hover {
    background: #244d80 !important;
    color: #fff !important;
}
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-page, .supplier-history) .btn-outline-secondary {
    color: var(--df-muted) !important;
    border-color: #718198 !important;
}
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-page, .supplier-history) .dropdown-item.text-danger { color: #ffaaaa !important; }
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-page, .supplier-history) .alert-warning {
    background: var(--supplier-warning-bg) !important;
    border-color: #78613b !important;
    color: var(--supplier-warning-text) !important;
}
html.dentefacil-dark-mode .supplier-history .alert-info {
    background: #20364e !important;
    border-color: #476789 !important;
    color: #c2ddfa !important;
}
html.dentefacil-dark-mode .supplier-history .modal-content,
html.dentefacil-dark-mode #modal_conexao .modal-content,
html.dentefacil-dark-mode #modal_conexao .modal-header {
    background: var(--df-surface) !important;
    border-color: var(--df-border) !important;
    color: var(--df-text) !important;
}
html.dentefacil-dark-mode #modal_conexao .modal-title { color: var(--df-text-strong) !important; }
html.dentefacil-dark-mode :is(.supplier-history, #modal_conexao) .btn-close {
    filter: invert(1) grayscale(1) brightness(1.5);
    background-color: transparent;
}
html.dentefacil-dark-mode :is(.supplier-history, #modal_conexao) :is(.modal-header, .modal-footer, .lab-actions, .lab-supplier) {
    border-color: var(--df-border) !important;
}
html.dentefacil-dark-mode .lab-status {
    background: #20364e;
    border-color: #476789;
    color: #c2ddfa;
}
html.dentefacil-dark-mode .lab-status.connected {
    background: var(--supplier-success-bg);
    border-color: #366f55;
    color: var(--supplier-success-text);
}
html.dentefacil-dark-mode .lab-supplier > i { background: var(--df-surface-soft); color: var(--supplier-accent); }
html.dentefacil-dark-mode .lab-supplier strong { color: var(--df-text-strong); }
html.dentefacil-dark-mode .lab-connection .form-control:disabled {
    background: var(--df-surface-soft) !important;
    border-color: var(--df-border) !important;
    color: var(--df-muted) !important;
}
html.dentefacil-dark-mode .lab-actions .btn-outline-danger { color: #ffaaaa; border-color: #c57575; }
html.dentefacil-dark-mode .supplier-page #columns .card-content .title { color: var(--df-text-strong); }
html.dentefacil-dark-mode .supplier-register-panel-header { border-color: var(--df-border); }
html.dentefacil-dark-mode :is(.supplier-directory, .supplier-page, .supplier-history) :is(a, button):focus-visible {
    outline: 3px solid #a6caff;
    outline-offset: 3px;
}
