/* ====================================================
   NOTCH DARK MODE
   Ativado via html[data-theme="dark"]
   Toggle + localStorage em layout.html
   ==================================================== */

/* ════════════════════════════════════════════════════
   1. VARIÁVEIS DO TEMA BASE (style.css overrides)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] {
    --main-color: #fafafa;
    --text-color: #a1a1aa;
    --text-color-strong: #d4d4d8;
    --text-color-light: #71717a;
    --template-border-color: #2e2e38;
    --header-background-color: #18181b;
    --header-logo-background: #18181b;
    --header-border-bottom: #27272a;
    --header-logo-border-right: #27272a;
    --header-logo-border-bottom: #27272a;
    --header-text-color: #a1a1aa;
    --header-logo-text-color: #a1a1aa;
    --menu-background-color: #18181b;
    --menu-master-color-strong: #a1a1aa;
    --menu-border-right: #27272a;
    --menu-background-check: var(--main-color);
    --menu-background-button-circle: transparent;
    --menu-color-button-circle: #a1a1aa;
    --submenu-background-color: #18181b;
    --submenu-border-right: #27272a;
    --submenu-text-color: #a1a1aa;
    --submenu-sub-text-color: #71717a;
    --submenu-background-check: #27272a;
    --submenu-check-color: var(--main-color);
    --live-background-color: #0f0f12;
    --content-background: #1c1c22;
    --content-border-color: #2e2e38;
    --field-background: #27272a;
    --field-color: #d4d4d8;
    --field-border-color: #3f3f46;
    --field-focus-border-color: #52525b;
    --field-placeholder-color: #71717a;
    --button-background: #27272a;
    --button-text-color: #d4d4d8;
    --button-text-color-hover: #e4e4e7;
    --button-border: #3f3f46;
    --panel-background: #1c1c22;
    --panel-header-background: #27272a;
    --panel-header-color: #d4d4d8;
    --panel-footer-background: #1c1c22;
    --panel-border-color: #2e2e38;
    --panel-box-shadow: none;
    --modal-background: #1c1c22;
    --modal-footer-background: #27272a;
    --modal-header-background: #27272a;
    --modal-header-color: #d4d4d8;
    --tr-hover-background: #27272a;
    --tr-hover-color: #d4d4d8;
    --tr-even-background: #1c1c22;
    --tr-odd-background: #202028;
    --table-body-color: #a1a1aa;
    --table-header-color: #71717a;
    --scrollbar-color: #3f3f46;
    --color-overlay: #000000cc;
    --login-background-color: #0f0f12;
    --login-panel-left-background-color: #18181b;
    --login-panel-right-background-color: #1c1c22;
    --login-border-color: #2e2e38;
    --login-title-color: #d4d4d8;
    --login-header-color: #a1a1aa;
    --menu-user-splash-background: #18181b;
    --field-disabled-background: #202028;
    --field-disabled-text-color: #52525b;
    --field-disabled-border: #2e2e38;
}

/* ════════════════════════════════════════════════════
   2. MAD UI DESIGN TOKENS
   ════════════════════════════════════════════════════ */

html[data-theme="dark"],
html[data-theme="dark"] .mad-ui {
    --mad-bg:             #1c1c22;
    --mad-bg-subtle:      #202028;
    --mad-bg-muted:       #27272a;
    --mad-border:         #3f3f46;
    --mad-border-strong:  #52525b;
    --mad-text:           #e4e4e7;
    --mad-text-muted:     #a1a1aa;
    --mad-text-subtle:    #71717a;
    --mad-primary:        #e4e4e7;
    --mad-primary-hover:  #fafafa;
    --mad-primary-fg:     #18181b;
    --mad-primary-subtle: #27272a;
    --mad-secondary:        #a1a1aa;
    --mad-secondary-hover:  #d4d4d8;
    --mad-secondary-fg:     #18181b;
    --mad-secondary-subtle: #27272a;
    --mad-accent-subtle:  color-mix(in srgb, var(--main-color, #fafafa) 10%, #1c1c22);
    --mad-accent-border:  color-mix(in srgb, var(--main-color, #fafafa) 20%, transparent);
    --mad-accent-ring:    color-mix(in srgb, var(--main-color, #fafafa) 14%, transparent);

    --mad-success-subtle: #052e16;
    --mad-warning-subtle: #451a03;
    --mad-danger-subtle:  #450a0a;
    --mad-info-subtle:    #172554;
    --mad-shadow-sm: 0 1px 2px 0 rgba(0,0,0,.4);
    --mad-shadow:    0 1px 3px 0 rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05);
    --mad-shadow-md: 0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.3);
    --mad-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.5), 0 4px 6px -4px rgba(0,0,0,.3);
    --mad-shadow-xl: 0 20px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05);
    --mad-ring:        rgba(255,255,255,.1);
    --mad-ring-danger: rgba(220,38,38,.25);

    /* Tooltip — bg claro suave sobre fundo dark, fg escuro legivel */
    --mad-tooltip-bg: #3f3f46;
    --mad-tooltip-fg: #fafafa;
}

/* ════════════════════════════════════════════════════
   3. NOTCH HEADER — pills, botões, perfil
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .notch-pill-outer {
    background: #27272a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05) !important;
}

html[data-theme="dark"] .notch-date {
    color: #a1a1aa !important;
}

html[data-theme="dark"] .notch-pill-dark {
    background: #0f0f12 !important;
}

html[data-theme="dark"] .notch-pill-white,
html[data-theme="dark"] .notch-pill-unit {
    background: #3f3f46 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05) !important;
}

html[data-theme="dark"] .notch-pill-unit .notch-unit-select {
    color: #e4e4e7 !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") !important;
}
html[data-theme="dark"] .notch-pill-unit .notch-unit-select:hover {
    background-color: rgba(255,255,255,.1) !important;
}
html[data-theme="dark"] .notch-pill-unit .notch-unit-select option {
    background: #27272a !important;
    color: #e4e4e7 !important;
}

html[data-theme="dark"] .notch-pill-white .button-circle,
html[data-theme="dark"] .notch-pill-white a.button-circle {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .notch-pill-white .button-circle:hover,
html[data-theme="dark"] .notch-pill-white a.button-circle:hover {
    color: #e4e4e7 !important;
    background: rgba(255,255,255,.1) !important;
}

html[data-theme="dark"] .notch-pill-icon-btn {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .notch-pill-icon-btn:hover {
    color: #e4e4e7 !important;
    background: rgba(255,255,255,.1) !important;
}

html[data-theme="dark"] .notch-header-icon-btn {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .notch-header-icon-btn:hover {
    background: rgba(255,255,255,.08) !important;
    color: #e4e4e7 !important;
}

html[data-theme="dark"] .notch-user-btn {
    background: #27272a !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05) !important;
}
html[data-theme="dark"] .notch-user-btn:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08) !important;
}

html[data-theme="dark"] .notch-user-avatar {
    background: #3f3f46 !important;
}

html[data-theme="dark"] .notch-user-name {
    color: #d4d4d8 !important;
}

/* ════════════════════════════════════════════════════
   4. NOTCH MEGA-MENU
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .notch-megamenu {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05) !important;
}

html[data-theme="dark"] .notch-mega-module-icon {
    background: #3f3f46 !important;
}

html[data-theme="dark"] .notch-mega-module-title {
    color: #d4d4d8 !important;
}

html[data-theme="dark"] a.notch-mega-item {
    color: #a1a1aa !important;
}
html[data-theme="dark"] a.notch-mega-item:hover {
    background: #27272a !important;
    color: #e4e4e7 !important;
}
html[data-theme="dark"] a.notch-mega-item:hover .notch-mega-item-icon i,
html[data-theme="dark"] a.notch-mega-item:hover .notch-mega-item-icon svg {
    color: #a1a1aa !important;
}

html[data-theme="dark"] .notch-mega-item-icon i,
html[data-theme="dark"] .notch-mega-item-icon svg {
    color: #71717a !important;
}

html[data-theme="dark"] .notch-mega-header {
    border-color: #2e2e38 !important;
}

html[data-theme="dark"] .notch-mega-search {
    background: #27272a !important;
}

html[data-theme="dark"] .notch-mega-search-icon {
    color: #71717a !important;
}

html[data-theme="dark"] .notch-mega-search-input {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .notch-mega-search-input::placeholder {
    color: #71717a !important;
}

/* ════════════════════════════════════════════════════
   5. ICON RAIL (sidebar esquerda)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .container-menu {
    background: #18181b !important;
}

html[data-theme="dark"] .notch-rail-pill {
    background: #27272a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05) !important;
}

html[data-theme="dark"] .notch-rail-modules {
    background: #0f0f12 !important;
}

html[data-theme="dark"] .notch-rail-modules a.button-circle.checked {
    background: #27272a !important;
    color: #e4e4e7 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05) !important;
}

html[data-theme="dark"] .notch-rail-light a.button-circle {
    color: #71717a !important;
}
html[data-theme="dark"] .notch-rail-light a.button-circle:hover {
    background: rgba(255,255,255,.08) !important;
    color: #a1a1aa !important;
}
html[data-theme="dark"] .notch-rail-light a.button-circle.checked {
    background: #27272a !important;
    color: #e4e4e7 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05) !important;
}

/* ════════════════════════════════════════════════════
   6. SUBMENU (painel de navegação)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .master-menu-content {
    background: #18181b !important;
}

html[data-theme="dark"] .container-submenu {
    background: #18181b !important;
    border-right-color: #27272a !important;
}

html[data-theme="dark"] .notch-module-title {
    color: #d4d4d8 !important;
}

html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > a {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > a > i {
    color: #71717a !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > a:hover {
    background: color-mix(in srgb, var(--main-color) 8%, #18181b) !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > a:hover > i {
    color: #a1a1aa !important;
}

/* Active item — leaf checked (sem submenu) */
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.checked > a:not(.sub) {
    background: color-mix(in srgb, var(--main-color) 18%, #18181b) !important;
    color: #fafafa !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.checked > a:not(.sub) > i {
    color: var(--main-color) !important;
}

/* Expandable open — header com submenu aberto */
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.open > a.sub,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > a.sub.open,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.open.checked > a.sub,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.checked > a.sub.open {
    background: color-mix(in srgb, var(--main-color) 18%, #18181b) !important;
    color: #fafafa !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.open > a.sub > i,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > a.sub.open > i,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.open.checked > a.sub > i,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.checked > a.sub.open > i {
    color: var(--main-color) !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.open > a.sub::after,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > a.sub.open::after,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.open.checked > a.sub::after,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li.checked > a.sub.open::after {
    color: #d4d4d8 !important;
}

/* Nested sub-items (level 3) */
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul {
    border-left-color: #2e2e38 !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul > li > a {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul > li > a:hover {
    color: #fafafa !important;
    background: #27272a !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul > li.checked > a {
    color: #fafafa !important;
    background: color-mix(in srgb, var(--main-color) 18%, #18181b) !important;
}

/* Level 3 expandable open (sub-header aberto) */
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul > li.open > a.sub,
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul > li > a.sub.open {
    color: #d4d4d8 !important;
    background: transparent !important;
}

/* Nested sub-items (level 4 — deep checked) */
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul > li > ul > li > a {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul > li > ul > li > a:hover {
    background: #27272a !important;
    color: #fafafa !important;
}
html[data-theme="dark"] .container-submenu > ul > [module-menu] > ul > li > ul > li > ul > li.checked > a {
    background: color-mix(in srgb, var(--main-color) 18%, #18181b) !important;
    color: #fafafa !important;
}

/* menu-tools */
html[data-theme="dark"] .menu-tools {
    border-top-color: #2e2e38 !important;
}
html[data-theme="dark"] .menu-tools a {
    color: #71717a !important;
}
html[data-theme="dark"] .menu-tools a:hover {
    background: #27272a !important;
    color: #a1a1aa !important;
}
html[data-theme="dark"] .menu-tools-info {
    border-bottom-color: #2e2e38 !important;
}
html[data-theme="dark"] .menu-tools-unit {
    background: #27272a !important;
    color: #a1a1aa !important;
}
html[data-theme="dark"] .submenu-separator {
    color: #52525b !important;
}
html[data-theme="dark"] .menu-tools-version {
    color: #3f3f46 !important;
}

/* ════════════════════════════════════════════════════
   7. MASTER CONTAINER / CONTENT AREA
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .master-container {
    background-color: #0f0f12 !important;
}

html[data-theme="dark"] .container-live {
    background: #0f0f12 !important;
}

/* ════════════════════════════════════════════════════
   8. DRAWER (right panel)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] #mad_aside.right-panel {
    border-left-color: #2e2e38 !important;
    box-shadow: -8px 0 32px rgba(0,0,0,.4) !important;
}

html[data-theme="dark"] #mad_aside .card.panel {
    background: #1c1c22 !important;
}

html[data-theme="dark"] #mad_aside .card-header.panel-heading {
    background: #1c1c22 !important;
    border-bottom-color: #2e2e38 !important;
}

html[data-theme="dark"] #mad_aside .panel-title.card-title {
    color: #e4e4e7 !important;
}

html[data-theme="dark"] #mad_aside .header-actions .btn {
    border-color: #3f3f46 !important;
    background: #27272a !important;
    color: #a1a1aa !important;
}
html[data-theme="dark"] #mad_aside .header-actions .btn i {
    color: #a1a1aa !important;
}
html[data-theme="dark"] #mad_aside .header-actions .btn:hover {
    background: #3f3f46 !important;
    border-color: #52525b !important;
}
html[data-theme="dark"] #mad_aside .header-actions .btn:hover i {
    color: #e4e4e7 !important;
}

html[data-theme="dark"] #mad_aside .panel-footer.card-footer {
    border-top-color: #2e2e38 !important;
    background: #1c1c22 !important;
}

html[data-theme="dark"] #mad_aside .panel-footer .btn-primary {
    background: #e4e4e7 !important;
    border-color: #e4e4e7 !important;
    color: #18181b !important;
}
html[data-theme="dark"] #mad_aside .panel-footer .btn-primary:hover {
    background: #fafafa !important;
    border-color: #fafafa !important;
}
html[data-theme="dark"] #mad_aside .panel-footer .btn-primary i {
    color: #18181b !important;
}

html[data-theme="dark"] #mad_aside .panel-footer .btn-default {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #a1a1aa !important;
}
html[data-theme="dark"] #mad_aside .panel-footer .btn-default:hover {
    background: #3f3f46 !important;
    border-color: #52525b !important;
}

/* ════════════════════════════════════════════════════
   9. PAGE WRAPPER & HEADER
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .bpage-header-wrapper {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.3) !important;
}

html[data-theme="dark"] .bph-inner {
    border-bottom-color: #2e2e38 !important;
}

html[data-theme="dark"] .bph-icon-circle {
    border-color: #3f3f46 !important;
    background: #27272a !important;
    color: #a1a1aa !important;
}

html[data-theme="dark"] .bph-vsep {
    background: #2e2e38 !important;
}

html[data-theme="dark"] .bph-title,
html[data-theme="dark"] .mad-page-title {
    color: #e4e4e7 !important;
}

html[data-theme="dark"] .bpage-header-subtitle,
html[data-theme="dark"] .bpage-header-subtitle .bpage-header-chevron {
    color: #71717a !important;
}

/* Search */
html[data-theme="dark"] .bph-search-icon {
    color: #71717a !important;
}

html[data-theme="dark"] .bpage-header-search input,
html[data-theme="dark"] .bpage-header-search .form-control {
    color: #d4d4d8 !important;
    background: #27272a !important;
    border-color: #3f3f46 !important;
    box-shadow: none !important;
}
html[data-theme="dark"] .bpage-header-search input:focus,
html[data-theme="dark"] .bpage-header-search .form-control:focus {
    border-color: #52525b !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}

/* Buttons */
html[data-theme="dark"] .bpage-header-button.btn-success,
html[data-theme="dark"] .bph-actions .btn-success {
    background: #e4e4e7 !important;
    border-color: #e4e4e7 !important;
    color: #18181b !important;
}
html[data-theme="dark"] .bpage-header-button.btn-success:hover,
html[data-theme="dark"] .bph-actions .btn-success:hover {
    background: #fafafa !important;
    border-color: #fafafa !important;
}

html[data-theme="dark"] .bpage-header-button.btn-default,
html[data-theme="dark"] .bph-actions .btn-default {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #a1a1aa !important;
    box-shadow: none !important;
}
html[data-theme="dark"] .bpage-header-button.btn-default:hover,
html[data-theme="dark"] .bph-actions .btn-default:hover {
    background: #3f3f46 !important;
    border-color: #52525b !important;
}

/* ════════════════════════════════════════════════════
   10. TABLES / DATAGRID
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .card-body.panel-body.table-responsive {
    border-color: #2e2e38 !important;
    background: #1c1c22 !important;
}

html[data-theme="dark"] .bpage-header-wrapper table,
html[data-theme="dark"] #mad_main .card.panel table {
    background: #1c1c22 !important;
}

/* Striped rows */
html[data-theme="dark"] .bpage-header-wrapper .table-striped > tbody > tr:nth-of-type(odd),
html[data-theme="dark"] .bpage-header-wrapper .table-striped > tbody > tr:nth-of-type(even),
html[data-theme="dark"] #mad_main .card.panel .table-striped > tbody > tr:nth-of-type(odd),
html[data-theme="dark"] #mad_main .card.panel .table-striped > tbody > tr:nth-of-type(even) {
    background-color: #1c1c22 !important;
}

/* Thead */
html[data-theme="dark"] .bpage-header-wrapper table thead,
html[data-theme="dark"] .bpage-header-wrapper table thead tr,
html[data-theme="dark"] .bpage-header-wrapper table thead th,
html[data-theme="dark"] #mad_main .card.panel table thead,
html[data-theme="dark"] #mad_main .card.panel table thead tr,
html[data-theme="dark"] #mad_main .card.panel table thead th {
    background: #202028 !important;
    color: #71717a !important;
    border-bottom-color: #2e2e38 !important;
}

/* Filter row */
html[data-theme="dark"] .bpage-header-wrapper table tbody tr#datagrid-header-filter-row td,
html[data-theme="dark"] #mad_main .card.panel table tbody tr#datagrid-header-filter-row td {
    background: #202028 !important;
    border-bottom-color: #2e2e38 !important;
}

html[data-theme="dark"] .bpage-header-wrapper table tbody tr#datagrid-header-filter-row td input.tfield,
html[data-theme="dark"] .bpage-header-wrapper table tbody tr#datagrid-header-filter-row td .form-control,
html[data-theme="dark"] #mad_main .card.panel table tbody tr#datagrid-header-filter-row td input.tfield,
html[data-theme="dark"] #mad_main .card.panel table tbody tr#datagrid-header-filter-row td .form-control {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
}

/* Data rows */
html[data-theme="dark"] .bpage-header-wrapper table tbody tr,
html[data-theme="dark"] #mad_main .card.panel table tbody tr {
    border-bottom-color: #2e2e38 !important;
    background: #1c1c22 !important;
}
html[data-theme="dark"] .bpage-header-wrapper table tbody tr:hover,
html[data-theme="dark"] #mad_main .card.panel table tbody tr:hover {
    background: #202028 !important;
}

html[data-theme="dark"] .bpage-header-wrapper table tbody td,
html[data-theme="dark"] #mad_main .card.panel table tbody td {
    color: #d4d4d8 !important;
}

/* Datagrid toolbar */
html[data-theme="dark"] .datagrid-header-actions {
    background: #1c1c22 !important;
}

/* ════════════════════════════════════════════════════
   11. PAGINATION
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .tpagenavigation_resume {
    color: #71717a !important;
}

html[data-theme="dark"] .bpage-header-wrapper .pagination li.page-item a.page-link,
html[data-theme="dark"] .bpage-header-wrapper .pagination li.page-item span.page-link,
html[data-theme="dark"] #mad_main .card.panel .pagination li a.page-link,
html[data-theme="dark"] #mad_main .card.panel .pagination li span.page-link {
    border-color: #3f3f46 !important;
    color: #a1a1aa !important;
    background: #27272a !important;
    box-shadow: none !important;
}
html[data-theme="dark"] .bpage-header-wrapper .pagination li.page-item a.page-link:hover,
html[data-theme="dark"] #mad_main .card.panel .pagination li a.page-link:hover {
    background: #3f3f46 !important;
    border-color: #52525b !important;
}
html[data-theme="dark"] .bpage-header-wrapper .pagination li.page-item.active a.page-link,
html[data-theme="dark"] .bpage-header-wrapper .pagination li.page-item.active span.page-link,
html[data-theme="dark"] #mad_main .card.panel .pagination li.active a.page-link,
html[data-theme="dark"] #mad_main .card.panel .pagination li.active span.page-link {
    background: #e4e4e7 !important;
    border-color: #e4e4e7 !important;
    color: #18181b !important;
}
html[data-theme="dark"] .bpage-header-wrapper .pagination li.page-item.off a.page-link,
html[data-theme="dark"] #mad_main .card.panel .pagination li.off a.page-link {
    color: #3f3f46 !important;
    border-color: #27272a !important;
}

/* ════════════════════════════════════════════════════
   12. STANDALONE PANEL
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] #mad_main .card.panel {
    border-color: #2e2e38 !important;
    background: #1c1c22 !important;
    color: #d4d4d8 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.03) !important;
}

html[data-theme="dark"] #mad_main .card.panel > .card-header.panel-heading {
    border-bottom-color: #2e2e38 !important;
}
html[data-theme="dark"] #mad_main .card.panel > .card-header.panel-heading .panel-title.card-title {
    color: #e4e4e7 !important;
}

/* ════════════════════════════════════════════════════
   13. TABS
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .card-body.panel-body .nav-tabs {
    background: #27272a !important;
}

html[data-theme="dark"] .card-body.panel-body .nav-tabs > li > a {
    color: #71717a !important;
}
html[data-theme="dark"] .card-body.panel-body .nav-tabs > li > a:hover {
    color: #d4d4d8 !important;
}

html[data-theme="dark"] .card-body.panel-body .nav-tabs > li > a.active,
html[data-theme="dark"] .card-body.panel-body .nav-tabs > li > a.nav-link.active,
html[data-theme="dark"] .card-body.panel-body .nav-tabs > li.notch-tab-active > a {
    background: #1c1c22 !important;
    color: #e4e4e7 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.05) !important;
}

/* ════════════════════════════════════════════════════
   14. FORM COMPONENTS
   ════════════════════════════════════════════════════ */

/* Labels */
html[data-theme="dark"] .card.panel label {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .card.panel label[style*="color: #ff0000"],
html[data-theme="dark"] .card.panel label[style*="color: #FF0000"],
html[data-theme="dark"] .card.panel label[style*="color: red"] {
    color: #f87171 !important;
}

/* Inputs */
html[data-theme="dark"] .card.panel input.form-control.tfield:not([type="hidden"]),
html[data-theme="dark"] .card.panel input.tfield:not([type="hidden"]) {
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
    background: #27272a !important;
}
html[data-theme="dark"] .card.panel input.form-control.tfield:not([type="hidden"]):focus,
html[data-theme="dark"] .card.panel input.tfield:not([type="hidden"]):focus {
    border-color: #52525b !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}
html[data-theme="dark"] .card.panel input.form-control.tfield.tfield_disabled,
html[data-theme="dark"] .card.panel input.form-control.tfield[readonly] {
    background: #202028 !important;
    color: #52525b !important;
}

/* Textarea */
html[data-theme="dark"] .card.panel textarea.form-control.tfield {
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
    background: #27272a !important;
}
html[data-theme="dark"] .card.panel textarea.form-control.tfield:focus {
    border-color: #52525b !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}

/* Select nativo */
html[data-theme="dark"] .card.panel select.form-control:not(.select2-hidden-accessible) {
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
    background: #27272a !important;
}
html[data-theme="dark"] .card.panel select.form-control:not(.select2-hidden-accessible):focus {
    border-color: #52525b !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}

/* Select2 */
html[data-theme="dark"] .card.panel .select2-container--default .select2-selection--single {
    border-color: #3f3f46 !important;
    background: #27272a !important;
}
html[data-theme="dark"] .card.panel .select2-container--default.select2-container--open .select2-selection--single,
html[data-theme="dark"] .card.panel .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #52525b !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}
html[data-theme="dark"] .card.panel .select2-selection--single .select2-selection__rendered {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .card.panel .select2-selection--single .select2-selection__placeholder {
    color: #71717a !important;
}

/* Select2 dropdown (global) */
html[data-theme="dark"] .select2-container--default .select2-dropdown {
    border-color: #3f3f46 !important;
    background: #1c1c22 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.4) !important;
}
html[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: #3f3f46 !important;
    background: #27272a !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .select2-container--default .select2-results__option {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted {
    background: #27272a !important;
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
    background: #3f3f46 !important;
    color: #e4e4e7 !important;
}

/* Date group addon */
html[data-theme="dark"] .card.panel .tdate-group-addon {
    border-color: #3f3f46 !important;
    background: #202028 !important;
    color: #71717a !important;
}
html[data-theme="dark"] .card.panel .tdate-group-addon:hover {
    background: #27272a !important;
}

/* Password button */
html[data-theme="dark"] .card.panel .tpassword > button[type="button"] {
    border-color: #3f3f46 !important;
    background: #202028 !important;
    color: #71717a !important;
}
html[data-theme="dark"] .card.panel .tpassword > button[type="button"]:hover {
    background: #27272a !important;
}

/* Checkboxes */
html[data-theme="dark"] .card.panel .tcheckgroup_label {
    color: #d4d4d8 !important;
}

/* Separator */
html[data-theme="dark"] .card.panel h4.tseparator {
    color: #71717a !important;
}
html[data-theme="dark"] .card.panel hr.tseparator-divisor {
    border-top-color: #2e2e38 !important;
}

/* TFieldList */
html[data-theme="dark"] .card.panel table.tfieldlist {
    border-color: #3f3f46 !important;
}
html[data-theme="dark"] .card.panel table.tfieldlist thead th {
    background: #202028 !important;
    border-bottom-color: #3f3f46 !important;
    color: #71717a !important;
}
html[data-theme="dark"] .card.panel table.tfieldlist tbody td {
    border-bottom-color: #2e2e38 !important;
}
html[data-theme="dark"] .card.panel table.tfieldlist tfoot td {
    background: #202028 !important;
    border-top-color: #3f3f46 !important;
}
html[data-theme="dark"] .card.panel table.tfieldlist input.tfield:not([type="hidden"]) {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .card.panel table.tfieldlist input.tfield:not([type="hidden"]):focus {
    border-color: #52525b !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,.05) !important;
}

/* ════════════════════════════════════════════════════
   15. BREADCRUMB
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] #mad_main nav.breadcrumb-nav,
html[data-theme="dark"] #mad_main ol.breadcrumb {
    color: #71717a !important;
}
html[data-theme="dark"] #mad_main ol.breadcrumb li,
html[data-theme="dark"] #mad_main ol.breadcrumb li a {
    color: #71717a !important;
}

/* ════════════════════════════════════════════════════
   16. MAD DIALOG
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] #mad-dialog-box {
    background: #1c1c22 !important;
    box-shadow: 0 8px 40px rgba(0,0,0,.5) !important;
}

html[data-theme="dark"] #mad-dialog-title {
    color: #e4e4e7 !important;
}

html[data-theme="dark"] #mad-dialog-body {
    color: #a1a1aa !important;
}

/* ════════════════════════════════════════════════════
   17. DROPDOWN MENUS (mad-dropdown)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-dropdown-menu {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
    box-shadow: 0 10px 25px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05) !important;
}

html[data-theme="dark"] .mad-dropdown-item {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .mad-dropdown-item:hover {
    background: #27272a !important;
    color: #e4e4e7 !important;
}

html[data-theme="dark"] .mad-dropdown-sep {
    background: #2e2e38 !important;
    border-color: #2e2e38 !important;
}

html[data-theme="dark"] .mad-dropdown-item-danger {
    color: #f87171 !important;
}

/* ════════════════════════════════════════════════════
   18. LOGIN FORM
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .tabpanel_form_login .login-avatar {
    background: #202028 !important;
    border-color: #3f3f46 !important;
    color: #71717a !important;
}

html[data-theme="dark"] .tabpanel_form_login .fb-field-container:focus-within {
    box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}

html[data-theme="dark"] .tabpanel_form_login .tpassword > button[type="button"] {
    border-color: #3f3f46 !important;
    background: #202028 !important;
    color: #71717a !important;
}
html[data-theme="dark"] .tabpanel_form_login .tpassword > button[type="button"]:hover {
    background: #27272a !important;
    color: #a1a1aa !important;
}

/* ════════════════════════════════════════════════════
   19. SCROLLBAR
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #18181b !important;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3f3f46 !important;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #52525b !important;
}

/* ════════════════════════════════════════════════════
   20. MISC OVERRIDES
   ════════════════════════════════════════════════════ */

/* SweetAlert2 (confirmações) */
html[data-theme="dark"] .swal2-popup {
    background: #1c1c22 !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .swal2-title {
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .swal2-html-container {
    color: #a1a1aa !important;
}

/* Bootstrap modal fallback */
html[data-theme="dark"] .modal-content {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .modal-header {
    border-bottom-color: #2e2e38 !important;
}
html[data-theme="dark"] .modal-footer {
    border-top-color: #2e2e38 !important;
    background: #1c1c22 !important;
}
html[data-theme="dark"] .modal-title {
    color: #e4e4e7 !important;
}

/* body */
html[data-theme="dark"] body {
    background: #0f0f12 !important;
    color: #d4d4d8 !important;
}

/* header-logo border */
html[data-theme="dark"] .header-logo {
    border-right-color: #27272a !important;
    border-bottom-color: var(--header-logo-background) !important;
}

/* header-track */
html[data-theme="dark"] .header-track {
    border-bottom-color: transparent !important;
}

html[data-theme="dark"] .mad-page-header {
    border-bottom: 1px solid var(--mad-border) !important;
}

/* ════════════════════════════════════════════════════
   21. FULLCALENDAR
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] {
    --fc-border-color: #2e2e38;
    --fc-page-bg-color: #1c1c22;
    --fc-neutral-bg-color: rgba(39, 39, 42, 0.5);
    --fc-today-bg-color: rgba(255, 220, 40, 0.06);
    --fc-non-business-color: rgba(15, 15, 18, 0.4);
    --fc-button-bg-color: #27272a;
    --fc-button-border-color: #3f3f46;
    --fc-button-text-color: #d4d4d8;
    --fc-button-hover-bg-color: #3f3f46;
    --fc-button-hover-border-color: #52525b;
    --fc-button-active-bg-color: #e4e4e7;
    --fc-button-active-border-color: #e4e4e7;
    --fc-highlight-color: rgba(39, 39, 42, 0.4);
}

html[data-theme="dark"] .tfullcalendar {
    background-color: #1c1c22 !important;
}

html[data-theme="dark"] .fc-unthemed th,
html[data-theme="dark"] .fc-unthemed td,
html[data-theme="dark"] .fc-unthemed thead,
html[data-theme="dark"] .fc-unthemed tbody,
html[data-theme="dark"] .fc-unthemed .fc-divider,
html[data-theme="dark"] .fc-unthemed .fc-row,
html[data-theme="dark"] .fc-unthemed .fc-content,
html[data-theme="dark"] .fc-unthemed .fc-popover,
html[data-theme="dark"] .fc-unthemed .fc-list-view,
html[data-theme="dark"] .fc-unthemed .fc-list-heading td {
    border-color: #2e2e38 !important;
}

html[data-theme="dark"] .fc-center h2,
html[data-theme="dark"] .fc-toolbar-title {
    color: #d4d4d8 !important;
}

html[data-theme="dark"] .fc-nonbusiness {
    background: #0f0f12 !important;
}

html[data-theme="dark"] .fc-unthemed td.fc-today {
    background: rgba(255, 220, 40, 0.06) !important;
}

html[data-theme="dark"] .fc-unthemed .fc-divider,
html[data-theme="dark"] .fc-unthemed .fc-popover .fc-header,
html[data-theme="dark"] .fc-unthemed .fc-list-heading td {
    background: #27272a !important;
}

html[data-theme="dark"] .fc-button-group button {
    background: #27272a !important;
    color: #d4d4d8 !important;
    border-color: #3f3f46 !important;
}
html[data-theme="dark"] .fc-button-group button:hover {
    background: #3f3f46 !important;
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .fc-button-group button.fc-state-active,
html[data-theme="dark"] .fc-button-group button.fc-button-active {
    background: #e4e4e7 !important;
    color: #18181b !important;
}

html[data-theme="dark"] .fc-today-button {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .fc-today-button:hover {
    color: var(--main-color) !important;
}

/* FullCalendar v5+ theme-standard */
html[data-theme="dark"] .fc-theme-standard td,
html[data-theme="dark"] .fc-theme-standard th {
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .fc-theme-standard .fc-scrollgrid {
    border-color: #2e2e38 !important;
}

html[data-theme="dark"] .fc .fc-col-header-cell-cushion {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .fc .fc-daygrid-day-number {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .fc .fc-timegrid-slot-label-cushion {
    color: #71717a !important;
}

html[data-theme="dark"] .fc-theme-standard .fc-popover {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .fc-theme-standard .fc-popover-header {
    background: #27272a !important;
    color: #d4d4d8 !important;
}

/* FullCalendar buttons (v5+) */
html[data-theme="dark"] .fc .fc-button-primary {
    background-color: #27272a !important;
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .fc .fc-button-primary:hover {
    background-color: #3f3f46 !important;
    border-color: #52525b !important;
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .fc .fc-button-primary:not(:disabled).fc-button-active,
html[data-theme="dark"] .fc .fc-button-primary:not(:disabled):active {
    background-color: #e4e4e7 !important;
    border-color: #e4e4e7 !important;
    color: #18181b !important;
}
html[data-theme="dark"] .fc .fc-button-primary:disabled {
    background-color: #202028 !important;
    border-color: #2e2e38 !important;
    color: #52525b !important;
}

/* ════════════════════════════════════════════════════
   22. MAD TABS (hover fix for dark)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-tab:hover {
    background: rgba(255,255,255,.08) !important;
}

/* ════════════════════════════════════════════════════
   23. MAD PAGE CONTAINER / CONTENT
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-page-container {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.3) !important;
}

html[data-theme="dark"] .container-header {
    background: transparent !important;
}

/* ════════════════════════════════════════════════════
   24. MAD STEPS (arrows variant)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-steps-arrows .mad-step-arrow {
    background: #27272a !important;
    color: #a1a1aa !important;
}
html[data-theme="dark"] .mad-steps-arrows .mad-step-arrow::after {
    border-left-color: #27272a !important;
}
html[data-theme="dark"] .mad-steps-arrows .mad-step-arrow.mad-step-pending {
    background: #27272a !important;
    color: #71717a !important;
}
html[data-theme="dark"] .mad-steps-arrows .mad-step-arrow.mad-step-pending::after {
    border-left-color: #27272a !important;
}

/* ════════════════════════════════════════════════════
   25. MAD TIMELINE
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-timeline-date-sep {
    background: #27272a !important;
    color: #a1a1aa !important;
}

html[data-theme="dark"] .mad-timeline-card {
    background: #27272a !important;
    border-color: #3f3f46 !important;
}
html[data-theme="dark"] .mad-timeline-card-title {
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .mad-timeline-card-body {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .mad-timeline-card-time {
    color: #71717a !important;
}

/* ════════════════════════════════════════════════════
   26. MAD DB METRIC CARD
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-metric-card {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
}

/* ════════════════════════════════════════════════════
   27. MAD FORM SECTION
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-form-section-title {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-form-section-divider {
    border-color: #2e2e38 !important;
}

/* ════════════════════════════════════════════════════
   28. MAD SEPARATOR
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-separator {
    border-color: #2e2e38 !important;
}

/* ════════════════════════════════════════════════════
   29. MAD ACCORDION
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-accordion-item {
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-accordion-trigger {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-accordion-trigger:hover {
    background: #27272a !important;
}

/* ════════════════════════════════════════════════════
   30. MAD ALERT / CALLOUT
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-alert {
    border-color: #2e2e38 !important;
}

html[data-theme="dark"] .mad-callout {
    border-color: #2e2e38 !important;
    background: #202028 !important;
}

/* ════════════════════════════════════════════════════
   31. MAD DRAWER / MODAL (components)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-drawer-panel {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-drawer-header {
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-drawer-title {
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .mad-drawer-close {
    color: #71717a !important;
}
html[data-theme="dark"] .mad-drawer-close:hover {
    color: #a1a1aa !important;
    background: #27272a !important;
}
html[data-theme="dark"] .mad-drawer-footer {
    border-color: #2e2e38 !important;
    background: #1c1c22 !important;
}

html[data-theme="dark"] .mad-modal-panel {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-modal-header {
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-modal-title {
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .mad-modal-close {
    color: #71717a !important;
}
html[data-theme="dark"] .mad-modal-close:hover {
    color: #a1a1aa !important;
    background: #27272a !important;
}
html[data-theme="dark"] .mad-modal-footer {
    border-color: #2e2e38 !important;
    background: #1c1c22 !important;
}

/* ════════════════════════════════════════════════════
   32. MAD FORM FIELDS (input, select, textarea, etc.)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-input,
html[data-theme="dark"] .mad-select,
html[data-theme="dark"] .mad-textarea {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-input:focus,
html[data-theme="dark"] .mad-select:focus,
html[data-theme="dark"] .mad-textarea:focus {
    border-color: #52525b !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}
html[data-theme="dark"] .mad-input::placeholder,
html[data-theme="dark"] .mad-textarea::placeholder {
    color: #71717a !important;
}
html[data-theme="dark"] .mad-input:disabled,
html[data-theme="dark"] .mad-select:disabled,
html[data-theme="dark"] .mad-textarea:disabled {
    background: #202028 !important;
    color: #52525b !important;
}

html[data-theme="dark"] .mad-field-label {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-field-hint {
    color: #71717a !important;
}
html[data-theme="dark"] .mad-field-error {
    color: #f87171 !important;
}

/* ════════════════════════════════════════════════════
   33. MAD FIELD LIST — sem regra própria, de propósito
   ════════════════════════════════════════════════════ */

/* Havia aqui um bloco mirando `.mad-field-list thead th / tbody td / tfoot td`,
   sobrevivente da época em que o field-list era <table>. Hoje o componente é
   div + CSS grid com classes `.mad-fl-*` (mad-ui.css, seção FIELD LIST) e não
   existe nem a classe `.mad-field-list` nem thead/tbody/tfoot no markup — o
   bloco não casava com nada desde a migração. O dark do field-list sai inteiro
   dos tokens `--mad-bg-muted` / `--mad-border` / `--mad-text-muted` rebaseados
   no topo deste arquivo, que `.mad-fl-*` consome via var(). Precisa ajustar
   dark aqui? Ajuste o token, ou escreva a regra em `.mad-fl-*`. */

/* ════════════════════════════════════════════════════
   34. MAD CHECKBOX / SWITCH / RADIO
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-checkbox-box {
    border-color: #52525b !important;
    background: #27272a !important;
}
html[data-theme="dark"] .mad-checkbox:checked + .mad-checkbox-box {
    background: var(--main-color) !important;
    border-color: var(--main-color) !important;
}

html[data-theme="dark"] .mad-switch-track {
    background: #3f3f46 !important;
}

html[data-theme="dark"] .mad-radio-outer {
    border-color: #52525b !important;
}

/* ════════════════════════════════════════════════════
   35. MAD DATAGRID (component)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-dg-wrapper {
    border-color: #2e2e38 !important;
    background: #1c1c22 !important;
}
html[data-theme="dark"] .mad-dg-toolbar {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-dg-search-input {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-dg-table thead th {
    background: #202028 !important;
    color: #71717a !important;
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-dg-table tbody tr {
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-dg-table tbody tr:hover {
    background: #202028 !important;
}
html[data-theme="dark"] .mad-dg-table tbody td {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-dg-footer {
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .mad-dg-col-filter-input {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
}

/* ════════════════════════════════════════════════════
   36. MAD TRANSPORTER
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-transporter-loading {
    color: #a1a1aa !important;
}

/* ════════════════════════════════════════════════════
   37. MAD SELECT (mad-dbcombo, mad-multi-search, etc)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .mad-sel-control {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-sel.is-open > .mad-sel-control,
html[data-theme="dark"] .mad-sel-control:focus-within {
    border-color: #52525b !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}
html[data-theme="dark"] .mad-sel-dropdown {
    background: #1c1c22 !important;
    border-color: #3f3f46 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.4) !important;
}
html[data-theme="dark"] .mad-sel-option {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-sel-option.is-active,
html[data-theme="dark"] .mad-sel-option.is-selected {
    background: #27272a !important;
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .mad-sel-input,
html[data-theme="dark"] .mad-sel-single,
html[data-theme="dark"] .mad-sel-summary {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .mad-sel-chip {
    background: #3f3f46 !important;
    color: #d4d4d8 !important;
    border-color: #52525b !important;
}

/* ════════════════════════════════════════════════════
   38. JQUERY UI DATEPICKER
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .ui-datepicker {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
}
html[data-theme="dark"] .ui-datepicker-header {
    background: #27272a !important;
    border-color: #2e2e38 !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .ui-datepicker-title {
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .ui-datepicker th {
    color: #71717a !important;
}
html[data-theme="dark"] .ui-datepicker td a,
html[data-theme="dark"] .ui-datepicker td span {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .ui-datepicker td a:hover {
    background: #27272a !important;
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .ui-datepicker td a.ui-state-active {
    background: var(--main-color) !important;
    color: #fff !important;
}
html[data-theme="dark"] .ui-datepicker td.ui-datepicker-today a {
    background: #3f3f46 !important;
    color: #e4e4e7 !important;
}
html[data-theme="dark"] .ui-datepicker .ui-datepicker-prev,
html[data-theme="dark"] .ui-datepicker .ui-datepicker-next {
    color: #a1a1aa !important;
}
html[data-theme="dark"] .ui-datepicker .ui-datepicker-prev:hover,
html[data-theme="dark"] .ui-datepicker .ui-datepicker-next:hover {
    background: #3f3f46 !important;
}
html[data-theme="dark"] .ui-datepicker select.ui-datepicker-month,
html[data-theme="dark"] .ui-datepicker select.ui-datepicker-year {
    background: #27272a !important;
    color: #d4d4d8 !important;
    border-color: #3f3f46 !important;
}

/* ════════════════════════════════════════════════════
   39. TABLE-BORDERED (generic)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .table-bordered {
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .table-bordered td,
html[data-theme="dark"] .table-bordered th {
    border-color: #2e2e38 !important;
}

/* ════════════════════════════════════════════════════
   40. INFO-BOX (legacy)
   ════════════════════════════════════════════════════ */

html[data-theme="dark"] .info-box {
    background: #1c1c22 !important;
    border-color: #2e2e38 !important;
}
html[data-theme="dark"] .info-box-content {
    color: #d4d4d8 !important;
}

/* ════════════════════════════════════════════════════
   41. GENERAL DARK FALLBACKS
   ════════════════════════════════════════════════════ */

/* Badge readability */
html[data-theme="dark"] .badge {
    border: none !important;
}

/* Links in dark mode */
html[data-theme="dark"] a {
    color: inherit;
}

/* Inline labels used in detail views */
html[data-theme="dark"] label[style*="font-weight:bold"],
html[data-theme="dark"] label[style*="font-weight: bold"] {
    color: #a1a1aa !important;
}

/* Toggle icon - transição suave */
#notch-dark-toggle {
    transition: transform 0.3s ease !important;
}
#notch-dark-toggle:active {
    transform: scale(0.85) !important;
}
