:root {
    --brand-50: 239 246 255;
    --brand-100: 219 234 254;
    --brand-200: 191 219 254;
    --brand-500: 59 130 246;
    --brand-600: 37 99 235;
    --brand-700: 29 78 216;

    --surface: 255 255 255;
    --surface-soft: 248 250 252;
    --surface-strong: 241 245 249;
    --text: 15 23 42;
    --text-soft: 51 65 85;
    --muted: 100 116 139;
    --border: 226 232 240;
    --ring: 191 219 254;
    --success: 22 163 74;
    --warning: 217 119 6;
    --danger: 220 38 38;
    --info: 2 132 199;
    --chart-blue: 37 99 235;
    --chart-green: 22 163 74;
    --chart-orange: 234 88 12;
    --chart-red: 220 38 38;
    --chart-cyan: 8 145 178;
    --chart-purple: 124 58 237;
    --chart-grid: 226 232 240;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;

    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.1);
}

html,
body {
    color: rgb(var(--text));
    background: linear-gradient(180deg, rgb(248 250 252) 0%, rgb(241 245 249) 100%);
}

a {
    color: rgb(var(--brand-700));
    text-decoration: none;
}

a:hover {
    color: rgb(var(--brand-600));
    text-decoration: none;
}

a:focus,
a:active,
button:focus,
button:active,
.btn:focus,
.btn:active {
    text-decoration: none !important;
}

.ui-page-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem;
}

@media (min-width: 1024px) {
    .ui-page-shell {
        padding: 1.75rem 2rem;
    }
}

.home-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 992px) {
    .home-cards {
        grid-template-columns: 1fr 1fr;
    }
}

.ui-card {
    background: rgb(var(--surface));
    border: 1px solid rgb(var(--border));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.ui-card-header {
    border-bottom: 1px solid rgb(var(--border));
}

.ui-card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ui-card-hover:hover {
    transform: translateY(-2px);
    border-color: rgb(var(--brand-200));
    box-shadow: var(--shadow-md);
}

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1rem;
    padding: 0.625rem 0.9rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.ui-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgb(var(--ring));
}

.ui-btn-primary {
    color: #fff;
    background: rgb(var(--brand-600));
    border-color: rgb(var(--brand-600));
}

.ui-btn-primary:hover {
    background: rgb(var(--brand-700));
    border-color: rgb(var(--brand-700));
}

.ui-btn-outline {
    color: rgb(var(--brand-700));
    background: #fff;
    border-color: rgb(var(--brand-200));
}

.ui-btn-outline:hover {
    background: rgb(var(--brand-50));
    border-color: rgb(var(--brand-500));
}

.ui-btn-success {
    color: #fff;
    background: rgb(var(--success));
    border-color: rgb(var(--success));
}

.ui-btn-success:hover {
    filter: brightness(0.93);
}

.ui-btn-danger {
    color: #fff;
    background: rgb(var(--danger));
    border-color: rgb(var(--danger));
}

.ui-btn-danger:hover {
    filter: brightness(0.93);
}

.ui-btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2rem;
    border-radius: 9999px;
    border: 1px solid rgb(var(--brand-200));
    background: rgb(var(--brand-50));
    color: rgb(var(--brand-700));
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.36rem 0.7rem;
    text-decoration: none !important;
    transition: all .18s ease;
}

.ui-btn-table-action:hover {
    background: rgb(var(--brand-600));
    border-color: rgb(var(--brand-600));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.ui-btn-table-action:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgb(var(--ring));
}

.ui-acoes-tabela {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.ui-acao-icone {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgb(var(--border));
    border-radius: var(--radius-sm);
    background: rgb(var(--surface));
    color: rgb(var(--brand-600));
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

a.ui-acao-icone:hover {
    border-color: rgb(var(--brand-500));
    background: rgb(var(--brand-50));
    color: rgb(var(--brand-700));
    transform: translateY(-1px);
}

a.ui-acao-icone:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgb(var(--ring));
}

.ui-acao-icone--primaria {
    border-color: rgb(var(--brand-600));
    background: rgb(var(--brand-600));
    color: #fff;
}

a.ui-acao-icone--primaria:hover {
    border-color: rgb(var(--brand-700));
    background: rgb(var(--brand-700));
    color: #fff;
}

.ui-acao-icone--aviso {
    border-color: rgb(var(--warning) / 0.5);
    background: rgb(var(--warning) / 0.12);
    color: rgb(var(--warning));
}

a.ui-acao-icone--aviso:hover {
    border-color: rgb(var(--warning));
    background: rgb(var(--warning));
    color: #fff;
}

.ui-acao-icone.is-desabilitado {
    border-style: dashed;
    background: transparent;
    color: rgb(var(--muted));
    cursor: not-allowed;
}

.ui-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 240px;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    background: rgb(15 23 42);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 600;
    pointer-events: none;
    box-shadow: var(--shadow-md);
}

html[data-theme="dark"] a.ui-acao-icone { color: rgb(var(--brand-700)) !important; }
html[data-theme="dark"] a.ui-acao-icone--primaria { background: rgb(var(--brand-600)); color: #fff !important; }
html[data-theme="dark"] a.ui-acao-icone--aviso { color: rgb(var(--warning)) !important; }
html[data-theme="dark"] a.ui-acao-icone--aviso:hover { color: #fff !important; }
html[data-theme="dark"] .ui-tooltip { background: rgb(var(--surface-strong)); border: 1px solid rgb(var(--border)); }

.btn,
.btn-primary,
.btn-outline-primary,
.btn-success,
.btn-danger {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-primary {
    background: rgb(var(--brand-600));
    border-color: rgb(var(--brand-600));
}

.btn-primary:hover {
    background: rgb(var(--brand-700));
    border-color: rgb(var(--brand-700));
}

.btn-outline-primary {
    color: rgb(var(--brand-700));
    border-color: rgb(var(--brand-300, 147 197 253));
}

.btn-outline-primary:hover {
    background: rgb(var(--brand-50));
    border-color: rgb(var(--brand-500));
    color: rgb(var(--brand-700));
}

/* Botoes do Bootstrap alinhados ao design system */
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info,
.btn-light,
.btn-dark,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-success {
    background: rgb(var(--success));
    border-color: rgb(var(--success));
}

.btn-danger {
    background: rgb(var(--danger));
    border-color: rgb(var(--danger));
}

.btn-outline-danger {
    color: rgb(var(--danger));
    border-color: rgb(var(--danger) / 0.5);
}

.btn-outline-danger:hover {
    background: rgb(var(--danger));
    border-color: rgb(var(--danger));
    color: #fff;
}

.btn-outline-success {
    color: rgb(var(--success));
    border-color: rgb(var(--success) / 0.5);
}

.btn-outline-success:hover {
    background: rgb(var(--success));
    border-color: rgb(var(--success));
    color: #fff;
}

.btn-outline-secondary {
    color: rgb(var(--text-soft));
    border-color: rgb(var(--border));
}

.btn-outline-secondary:hover {
    background: rgb(var(--surface-strong));
    border-color: rgb(var(--border));
    color: rgb(var(--text));
}

/* Foco visivel e consistente em toda a aplicacao (acessibilidade) */
.btn:focus-visible,
.ui-btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid rgb(var(--brand-500));
    outline-offset: 2px;
}

/* Estado desabilitado */
.btn:disabled,
.btn.disabled,
.ui-btn:disabled,
.ui-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.form-control,
.form-select,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    border: 1px solid rgb(var(--border));
    background: #fff;
    color: rgb(var(--text));
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgb(var(--brand-500));
    box-shadow: 0 0 0 4px rgb(var(--ring));
    outline: 0;
}

.ui-alert,
.alert {
    border-radius: var(--radius-md);
    border: 1px solid rgb(var(--border));
    background: rgb(var(--surface));
    color: rgb(var(--text-soft));
}

.ui-alert-info,
.alert-info {
    border-color: rgb(186 230 253);
    background: rgb(240 249 255);
    color: rgb(12 74 110);
}

.ui-alert-success,
.alert-success {
    border-color: rgb(187 247 208);
    background: rgb(240 253 244);
    color: rgb(20 83 45);
}

.ui-alert-warning,
.alert-warning {
    border-color: rgb(254 215 170);
    background: rgb(255 247 237);
    color: rgb(124 45 18);
}

.ui-alert-danger,
.alert-danger {
    border-color: rgb(254 202 202);
    background: rgb(254 242 242);
    color: rgb(127 29 29);
}

.ui-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
}

.ui-badge-active {
    background: rgb(220 252 231);
    color: rgb(21 128 61);
    border-color: rgb(134 239 172);
}

.ui-badge-canceled {
    background: rgb(254 226 226);
    color: rgb(185 28 28);
    border-color: rgb(252 165 165);
}

.ui-badge-info {
    background: rgb(224 242 254);
    color: rgb(3 105 161);
    border-color: rgb(125 211 252);
}

.ui-badge-pending {
    background: rgb(254 243 199);
    color: rgb(146 64 14);
    border-color: rgb(252 211 77);
}

.ui-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.ui-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 980px;
}

.ui-table thead th {
    background: rgb(var(--surface-soft));
    color: rgb(var(--text-soft));
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgb(var(--border));
}

.ui-table th,
.ui-table td {
    white-space: nowrap;
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid rgb(var(--border));
}

.ui-table tbody tr {
    background: #fff;
    transition: background-color 0.2s ease;
}

.ui-table tbody tr:hover {
    background: rgb(var(--surface-soft));
}

.ui-table.ui-table-clientes {
    min-width: 0;
}

.ui-table-clientes th,
.ui-table-clientes td {
    white-space: normal;
    padding: 0.55rem 0.4rem;
}

.ui-table-clientes td:first-child,
.ui-table-clientes td:nth-child(n+6) {
    white-space: nowrap;
}

.ui-table-clientes td:nth-child(2) {
    max-width: 11rem;
}

.ui-table-particulares td:nth-child(n+3) {
    white-space: nowrap;
}

.ui-sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: inherit;
    box-shadow: 1px 0 0 rgb(var(--border));
}

#pagamentos-page.ui-page-shell,
#pagamentos-geral-page.ui-page-shell,
#comissoes-page.ui-page-shell,
#enotas-page.ui-page-shell,
#adesoes-page.ui-page-shell,
#checkin-page.ui-page-shell,
#config-page.ui-page-shell {
    max-width: 1680px;
}

#analytics-dashboard.ui-page-shell {
    max-width: 1880px;
}

.ui-filter-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgb(var(--border));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.ui-filter-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgb(var(--text-soft));
}

.ui-form-icon {
    position: relative;
}

.ui-form-icon i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(var(--muted));
    pointer-events: none;
    font-size: 0.95rem;
}

.ui-form-icon input,
.ui-form-icon select {
    padding-left: 2.2rem !important;
    min-height: 44px;
    border-radius: 12px;
}

.ui-summary-card {
    border-radius: 14px;
    border: 1px solid rgb(var(--border));
    padding: 0.55rem 0.7rem;
    text-align: center;
}

.ui-summary-card--receber {
    background: rgb(239 246 255);
    border-color: rgb(191 219 254);
}

.ui-summary-card--recebido {
    background: rgb(236 253 245);
    border-color: rgb(167 243 208);
}

.ui-summary-chip {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    min-height: 42px;
    min-width: 210px;
    padding: 0.42rem 0.7rem;
    border: 1px solid rgb(var(--border));
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.ui-summary-chip > div {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.ui-summary-chip p {
    margin: 0;
    line-height: 1.1;
}

.ui-summary-chip--receber {
    background: linear-gradient(180deg, #f8fbff 0%, #f0f7ff 100%);
    border-color: rgb(191 219 254);
}

.ui-summary-chip--recebido {
    background: linear-gradient(180deg, #f5fffa 0%, #ecfdf5 100%);
    border-color: rgb(167 243 208);
}

@media (max-width: 639px) {
    .ui-summary-chip {
        width: 100%;
        min-width: 0;
    }
}

.ui-table-compact {
    min-width: 930px;
}

.ui-table-compact thead th {
    font-size: 0.68rem;
    padding: 0.5rem 0.45rem;
}

.ui-table-compact th,
.ui-table-compact td {
    padding: 0.45rem 0.45rem;
}

.ui-table-compact .ui-badge,
.ui-table-compact .inline-flex.items-center.rounded-full {
    font-size: 0.64rem !important;
    line-height: 0.85rem !important;
    padding: 0.16rem 0.4rem !important;
}

.ui-pagination .ui-page-link,
.ui-pagination .ui-page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.3rem 0.65rem;
    border-radius: 9px;
    border: 1px solid rgb(var(--border));
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
}

.ui-pagination .ui-page-link {
    background: #fff;
    color: rgb(var(--brand-700));
}

.ui-pagination .ui-page-link:hover {
    background: rgb(var(--brand-50));
    border-color: rgb(var(--brand-200));
}

.ui-pagination .ui-page-current {
    background: rgb(var(--surface-soft));
    color: rgb(var(--text-soft));
}

/* Resumo de erros de formulario (includes/form_errors.html) */
.ui-form-errors {
    border: 1px solid rgb(var(--danger) / 0.35);
    background: rgb(var(--danger) / 0.08);
    color: rgb(var(--danger));
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    outline: none;
}

.ui-form-errors-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.ui-form-errors-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.ui-form-errors-list li + li {
    margin-top: 0.15rem;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --brand-50: 27 44 75;
    --brand-100: 33 54 92;
    --brand-200: 60 92 150;
    --brand-500: 92 143 228;
    --brand-600: 47 104 201;
    --brand-700: 143 181 240;

    --surface: 19 30 50;
    --surface-soft: 23 36 59;
    --surface-strong: 30 45 72;
    --text: 224 231 241;
    --text-soft: 189 201 221;
    --muted: 139 155 184;
    --border: 45 62 93;
    --ring: 47 104 201;
    --success: 72 187 124;
    --warning: 228 168 62;
    --danger: 229 101 101;
    --info: 86 168 222;
    --chart-blue: 125 173 242;
    --chart-green: 91 204 139;
    --chart-orange: 238 156 89;
    --chart-red: 239 116 116;
    --chart-cyan: 103 204 224;
    --chart-purple: 168 148 232;
    --chart-grid: 72 86 108;

    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] {
    color: rgb(var(--text));
    background: rgb(12 20 35) linear-gradient(180deg, rgb(14 23 40) 0%, rgb(11 19 33) 100%) fixed !important;
}

/* O fundo fica só no html: no body ele terminava junto com o conteúdo e deixava uma faixa. */
html[data-theme="dark"] body {
    min-height: 100vh;
    color: rgb(var(--text));
    background: transparent !important;
}

html[data-theme="dark"] .ui-btn-primary:hover {
    background: rgb(58 118 218);
    border-color: rgb(58 118 218);
}

html[data-theme="dark"] .ui-btn-danger {
    background: rgb(178 58 58);
    border-color: rgb(178 58 58);
}

html[data-theme="dark"] [class~="bg-blue-600"],
html[data-theme="dark"] [class~="bg-blue-700"] {
    background-color: rgb(var(--brand-600)) !important;
    border-color: rgb(var(--brand-600)) !important;
}

html[data-theme="dark"] [class~="hover:bg-blue-700"]:hover,
html[data-theme="dark"] [class~="bg-blue-700"]:hover {
    background-color: rgb(58 118 218) !important;
}

.app-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgb(var(--border));
    border-radius: 9999px;
    background: rgb(var(--surface));
    color: rgb(var(--text-soft));
    box-shadow: var(--shadow-sm);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-theme-toggle:hover {
    color: rgb(var(--brand-700));
    border-color: rgb(var(--brand-500));
    background: rgb(var(--surface-soft));
    transform: translateY(-1px);
}

.app-theme-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgb(var(--ring));
}

.app-theme-floating-toggle {
    position: fixed;
    right: 1rem;
    bottom: 5rem;
    z-index: 1095;
    width: 2.75rem;
    height: 2.75rem;
    backdrop-filter: blur(12px);
}

html[data-theme="dark"] .app-theme-floating-toggle {
    background: rgb(18 24 38 / 0.86);
    border-color: rgb(var(--border));
    color: rgb(var(--text));
}

@media (max-width: 767.98px) {
    .app-theme-floating-toggle {
        right: 0.8rem;
        bottom: 4.5rem;
        width: 2.55rem;
        height: 2.55rem;
    }
}

@media print {
    .app-theme-floating-toggle {
        display: none !important;
    }
}

.app-theme-toggle--mobile {
    width: 100%;
    min-height: 2.5rem;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 700;
}

html[data-theme="dark"] #app-header,
html[data-theme="dark"] header.navbar,
html[data-theme="dark"] .mobile-sidebar,
html[data-theme="dark"] #appSidebar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .content {
    background: rgb(var(--surface) / 0.94) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] #app-header,
html[data-theme="dark"] header.navbar {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="dark"] #appSidebarOverlay,
html[data-theme="dark"] .sidebar-overlay.show {
    background: rgb(2 6 23 / 0.66) !important;
}

html[data-theme="dark"] .ui-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .list-group-item {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
    box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .ui-card-header,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .accordion-header,
html[data-theme="dark"] .dropdown-header,
html[data-theme="dark"] .dropdown-divider,
html[data-theme="dark"] [class~="border-gray-100"],
html[data-theme="dark"] [class~="border-gray-200"],
html[data-theme="dark"] [class~="border-gray-300"],
html[data-theme="dark"] [class~="border-slate-100"],
html[data-theme="dark"] [class~="border-slate-200"] {
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .ui-filter-card,
html[data-theme="dark"] .ui-summary-chip,
html[data-theme="dark"] .ui-pagination .ui-page-link,
html[data-theme="dark"] .ui-pagination .ui-page-current,
html[data-theme="dark"] [class~="bg-white"],
html[data-theme="dark"] [class~="bg-white/90"],
html[data-theme="dark"] [class~="bg-gray-50"],
html[data-theme="dark"] [class~="bg-slate-50"] {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] [class~="bg-gray-100"],
html[data-theme="dark"] [class~="bg-slate-100"],
html[data-theme="dark"] .ui-table thead th,
html[data-theme="dark"] .table thead th {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] [class~="bg-blue-50"],
html[data-theme="dark"] [class~="bg-sky-50"],
html[data-theme="dark"] .ui-summary-card--receber,
html[data-theme="dark"] .ui-summary-chip--receber {
    background: rgb(30 64 175 / 0.22) !important;
    color: rgb(191 219 254) !important;
    border-color: rgb(59 130 246 / 0.48) !important;
}

html[data-theme="dark"] [class~="bg-green-50"],
html[data-theme="dark"] .ui-summary-card--recebido,
html[data-theme="dark"] .ui-summary-chip--recebido {
    background: rgb(20 83 45 / 0.28) !important;
    color: rgb(187 247 208) !important;
    border-color: rgb(34 197 94 / 0.45) !important;
}

html[data-theme="dark"] .ui-table tbody tr,
html[data-theme="dark"] .table,
html[data-theme="dark"] .table tbody,
html[data-theme="dark"] .table tbody tr,
html[data-theme="dark"] table.dataTable tbody tr {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .ui-table tbody tr:hover,
html[data-theme="dark"] .table-hover tbody tr:hover,
html[data-theme="dark"] [class~="hover:bg-gray-50"]:hover,
html[data-theme="dark"] [class~="hover:bg-gray-100"]:hover,
html[data-theme="dark"] [class~="hover:bg-slate-50"]:hover {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .ui-table th,
html[data-theme="dark"] .ui-table td,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td {
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] [class~="bg-gray-50"].form-control {
    background: rgb(13 22 38) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] {
    accent-color: rgb(var(--brand-600));
    border-color: rgb(var(--brand-200));
}

html[data-theme="dark"] input[type="checkbox"]:not(:checked),
html[data-theme="dark"] input[type="radio"]:not(:checked) {
    background-color: rgb(13 22 38);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: rgb(var(--muted)) !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: rgb(var(--brand-500)) !important;
    box-shadow: 0 0 0 4px rgb(var(--ring) / 0.55) !important;
}

html[data-theme="dark"] a,
html[data-theme="dark"] [class~="text-blue-600"],
html[data-theme="dark"] [class~="text-blue-700"],
html[data-theme="dark"] [class~="text-sky-600"],
html[data-theme="dark"] [class~="text-sky-700"] {
    color: rgb(var(--brand-700)) !important;
}

/* Botões sólidos feitos com <a> herdavam o azul-claro dos links e ficavam lavados. */
html[data-theme="dark"] a.ui-btn-primary,
html[data-theme="dark"] a.ui-btn-danger,
html[data-theme="dark"] a.btn-primary,
html[data-theme="dark"] a.cad-acao-primaria,
html[data-theme="dark"] a[class~="bg-blue-600"],
html[data-theme="dark"] a[class~="bg-blue-700"],
html[data-theme="dark"] a[class~="text-white"] {
    color: #fff !important;
}

html[data-theme="dark"] [class~="text-gray-500"],
html[data-theme="dark"] [class~="text-gray-600"],
html[data-theme="dark"] [class~="text-slate-500"],
html[data-theme="dark"] [class~="text-slate-600"],
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small {
    color: rgb(var(--muted)) !important;
}

html[data-theme="dark"] [class~="text-gray-700"],
html[data-theme="dark"] [class~="text-gray-800"],
html[data-theme="dark"] [class~="text-gray-900"],
html[data-theme="dark"] [class~="text-slate-700"],
html[data-theme="dark"] [class~="text-slate-800"],
html[data-theme="dark"] [class~="text-slate-900"],
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] label,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .accordion-button {
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .sidebar .nav-link:hover,
html[data-theme="dark"] .sidebar .nav-link.active,
html[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--brand-700)) !important;
}

html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .ui-btn-outline {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--brand-700)) !important;
    border-color: rgb(var(--brand-500) / 0.52) !important;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .ui-btn-outline:hover {
    background: rgb(30 64 175 / 0.26) !important;
    color: rgb(219 234 254) !important;
}

html[data-theme="dark"] .btn-outline-secondary {
    color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text)) !important;
}

/* Botoes claros do Bootstrap */
html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-secondary {
    background: rgb(var(--surface-strong)) !important;
    border-color: rgb(var(--border)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn-secondary:hover {
    background: rgb(var(--border)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .btn-outline-danger {
    color: rgb(var(--danger)) !important;
    border-color: rgb(var(--danger) / 0.5) !important;
}

html[data-theme="dark"] .btn-outline-danger:hover {
    background: rgb(var(--danger) / 0.18) !important;
    color: rgb(254 202 202) !important;
}

html[data-theme="dark"] .btn-outline-success {
    color: rgb(var(--success)) !important;
    border-color: rgb(var(--success) / 0.5) !important;
}

html[data-theme="dark"] .btn-outline-success:hover {
    background: rgb(var(--success) / 0.18) !important;
    color: rgb(187 247 208) !important;
}

/* No escuro, verde/vermelho dos tokens sao claros: texto precisa ser escuro */
html[data-theme="dark"] .btn-success,
html[data-theme="dark"] .btn-danger {
    color: rgb(15 23 42) !important;
}

html[data-theme="dark"] .ui-alert,
html[data-theme="dark"] .alert {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .ui-alert-info,
html[data-theme="dark"] .alert-info {
    background: rgb(12 74 110 / 0.34) !important;
    color: rgb(186 230 253) !important;
    border-color: rgb(14 165 233 / 0.45) !important;
}

html[data-theme="dark"] .ui-alert-success,
html[data-theme="dark"] .alert-success {
    background: rgb(20 83 45 / 0.34) !important;
    color: rgb(187 247 208) !important;
    border-color: rgb(34 197 94 / 0.45) !important;
}

html[data-theme="dark"] .ui-alert-warning,
html[data-theme="dark"] .alert-warning {
    background: rgb(113 63 18 / 0.34) !important;
    color: rgb(254 240 138) !important;
    border-color: rgb(245 158 11 / 0.45) !important;
}

html[data-theme="dark"] .ui-alert-danger,
html[data-theme="dark"] .alert-danger {
    background: rgb(127 29 29 / 0.34) !important;
    color: rgb(254 202 202) !important;
    border-color: rgb(248 113 113 / 0.45) !important;
}

html[data-theme="dark"] .ui-badge-active,
html[data-theme="dark"] .badge.bg-success {
    background: rgb(20 83 45 / 0.52) !important;
    color: rgb(187 247 208) !important;
    border-color: rgb(34 197 94 / 0.45) !important;
}

html[data-theme="dark"] .ui-badge-canceled,
html[data-theme="dark"] .badge.bg-danger {
    background: rgb(127 29 29 / 0.52) !important;
    color: rgb(254 202 202) !important;
    border-color: rgb(248 113 113 / 0.45) !important;
}

html[data-theme="dark"] .ui-badge-info,
html[data-theme="dark"] .badge.bg-info {
    background: rgb(12 74 110 / 0.52) !important;
    color: rgb(186 230 253) !important;
    border-color: rgb(14 165 233 / 0.45) !important;
}

html[data-theme="dark"] .ui-badge-pending {
    background: rgb(120 53 15 / 0.52) !important;
    color: rgb(253 230 138) !important;
    border-color: rgb(245 158 11 / 0.45) !important;
}

html[data-theme="dark"] .app-notify-toast {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
}

/* Cor semantica do toast no escuro */
html[data-theme="dark"] .app-notify-success {
    background: rgb(20 83 45 / 0.35) !important;
    border-color: rgb(34 197 94 / 0.45) !important;
    color: rgb(187 247 208) !important;
}

html[data-theme="dark"] .app-notify-error {
    background: rgb(127 29 29 / 0.35) !important;
    border-color: rgb(248 113 113 / 0.5) !important;
    color: rgb(254 202 202) !important;
}

html[data-theme="dark"] .app-notify-warning {
    background: rgb(120 53 15 / 0.35) !important;
    border-color: rgb(251 191 36 / 0.45) !important;
    color: rgb(253 230 138) !important;
}

html[data-theme="dark"] .app-notify-info {
    background: rgb(30 58 138 / 0.35) !important;
    border-color: rgb(96 165 250 / 0.45) !important;
    color: rgb(191 219 254) !important;
}

html[data-theme="dark"] .app-notify-close {
    color: rgb(var(--muted)) !important;
}

html[data-theme="dark"] .flatpickr-calendar {
    background: rgb(var(--surface)) !important;
    border-color: rgb(var(--border)) !important;
    box-shadow: var(--shadow-md) !important;
}

html[data-theme="dark"] .flatpickr-day,
html[data-theme="dark"] .flatpickr-months,
html[data-theme="dark"] .flatpickr-weekday,
html[data-theme="dark"] .flatpickr-current-month,
html[data-theme="dark"] .flatpickr-time input {
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] #header,
html[data-theme="dark"] #branding,
html[data-theme="dark"] #user-tools,
html[data-theme="dark"] .breadcrumbs {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] #header a,
html[data-theme="dark"] #user-tools a,
html[data-theme="dark"] #logout-form button {
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .section-header,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] [class~="bg-light"],
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table-light > th,
html[data-theme="dark"] .table-light > td {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .card-title,
html[data-theme="dark"] .modal-title {
    background: transparent !important;
}

html[data-theme="dark"] .card-body,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .tab-content,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .well,
html[data-theme="dark"] .form-group,
html[data-theme="dark"] .fieldBox {
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *,
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > *,
html[data-theme="dark"] table tbody tr:nth-child(odd),
html[data-theme="dark"] table tbody tr:nth-child(even) {
    background-color: rgb(var(--surface)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *,
html[data-theme="dark"] .ui-table tbody tr:nth-child(odd) {
    background-color: rgb(23 31 48 / 0.82) !important;
}

html[data-theme="dark"] .table-bordered,
html[data-theme="dark"] .table-bordered th,
html[data-theme="dark"] .table-bordered td {
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] input[readonly],
html[data-theme="dark"] input[disabled],
html[data-theme="dark"] select[disabled],
html[data-theme="dark"] textarea[readonly],
html[data-theme="dark"] textarea[disabled],
html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled {
    background: rgb(31 41 61 / 0.78) !important;
    color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
    opacity: 1 !important;
}

html[data-theme="dark"] option,
html[data-theme="dark"] optgroup {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] hr {
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .apexcharts-tooltip,
html[data-theme="dark"] .apexcharts-tooltip-title,
html[data-theme="dark"] .apexcharts-xaxistooltip,
html[data-theme="dark"] .apexcharts-yaxistooltip {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
    box-shadow: var(--shadow-sm) !important;
}

html[data-theme="dark"] .apexcharts-legend-text,
html[data-theme="dark"] .apexcharts-text,
html[data-theme="dark"] .apexcharts-datalabel,
html[data-theme="dark"] .apexcharts-xaxis-label,
html[data-theme="dark"] .apexcharts-yaxis-label {
    fill: rgb(var(--text-soft)) !important;
    color: rgb(var(--text-soft)) !important;
}

html[data-theme="dark"] .apexcharts-gridline,
html[data-theme="dark"] .apexcharts-xaxis-tick,
html[data-theme="dark"] .apexcharts-xaxis line,
html[data-theme="dark"] .apexcharts-yaxis line {
    stroke: rgb(var(--chart-grid)) !important;
}

html[data-theme="dark"] .apexcharts-point-annotation-label.chart-pct-badge {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text)) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] .auth-page-glow {
    opacity: 0.28 !important;
    filter: saturate(0.75);
}

html[data-theme="dark"] .checkin-shell .card,
html[data-theme="dark"] .checkin-shell .exam-box,
html[data-theme="dark"] .checkin-shell .exam-option {
    background: rgb(var(--surface)) !important;
    border-color: rgb(var(--border)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .checkin-shell .card-header,
html[data-theme="dark"] .checkin-shell .exam-box-header,
html[data-theme="dark"] .checkin-shell .list-group-item.active {
    background: rgb(var(--surface-strong)) !important;
    border-color: rgb(var(--border)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .checkin-shell .card-body,
html[data-theme="dark"] .checkin-shell .list-group-item {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .checkin-shell .js-plano:hover,
html[data-theme="dark"] .checkin-shell .plano-selecionado,
html[data-theme="dark"] .checkin-shell .exam-option:hover,
html[data-theme="dark"] .checkin-shell .exam-option.is-selected {
    background: rgb(30 64 175 / 0.22) !important;
    border-color: rgb(var(--brand-500) / 0.72) !important;
}

html[data-theme="dark"] .checkin-shell .exam-box-title {
    color: rgb(191 219 254) !important;
}

html[data-theme="dark"] .checkin-shell .exam-box-summary,
html[data-theme="dark"] .checkin-shell .exam-mobile-meta,
html[data-theme="dark"] .checkin-shell .exam-meta,
html[data-theme="dark"] .checkin-shell .exam-meta strong {
    color: rgb(var(--text-soft)) !important;
}

html[data-theme="dark"] .checkin-shell .exam-list::-webkit-scrollbar-thumb,
html[data-theme="dark"] #analytics-dashboard .rank-list::-webkit-scrollbar-thumb,
html[data-theme="dark"] #analytics-dashboard .chart-scroll-shell-active::-webkit-scrollbar-thumb {
    background: rgb(var(--border)) !important;
}

html[data-theme="dark"] #analytics-dashboard:fullscreen,
html[data-theme="dark"] #analytics-dashboard:-webkit-full-screen {
    background: rgb(var(--surface)) !important;
}

html[data-theme="dark"] #analytics-dashboard .analytics-helper-card,
html[data-theme="dark"] #analytics-dashboard .analytics-helper-item {
    background: rgb(var(--surface)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] #analytics-dashboard .analytics-helper-badge,
html[data-theme="dark"] #analytics-dashboard .analytics-refresh-status {
    background: rgb(30 64 175 / 0.22) !important;
    color: rgb(191 219 254) !important;
    border-color: rgb(59 130 246 / 0.42) !important;
}

html[data-theme="dark"] #analytics-dashboard .analytics-refresh-status.is-updating {
    background: rgb(113 63 18 / 0.28) !important;
    color: rgb(254 240 138) !important;
    border-color: rgb(245 158 11 / 0.44) !important;
}

html[data-theme="dark"] #analytics-dashboard .analytics-refresh-status.is-error {
    background: rgb(127 29 29 / 0.28) !important;
    color: rgb(254 202 202) !important;
    border-color: rgb(248 113 113 / 0.44) !important;
}

html[data-theme="dark"] #analytics-dashboard .analytics-csv-divider {
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] #analytics-dashboard .info-tip,
html[data-theme="dark"] #analytics-dashboard .analytics-helper-summary-icon {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table {
    color: rgb(var(--text-soft)) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table thead th {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table tbody tr:not(.details-row),
html[data-theme="dark"] #pagamentos-page #user-list-table tbody tr:not(.details-row) > td {
    background: rgb(var(--surface)) !important;
    color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table tbody tr.table-striped-odd:not(.details-row),
html[data-theme="dark"] #pagamentos-page #user-list-table tbody tr.table-striped-odd:not(.details-row) > td {
    background: rgb(var(--surface-soft)) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table tbody tr:hover:not(.details-row),
html[data-theme="dark"] #pagamentos-page #user-list-table tbody tr:hover:not(.details-row) > td {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table .details-row,
html[data-theme="dark"] #pagamentos-page #user-list-table .details-row > td {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table td span[title] {
    border-width: 1px !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="paid"] {
    background: rgb(20 83 45 / 0.52) !important;
    color: rgb(187 247 208) !important;
    border-color: rgb(34 197 94 / 0.45) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="canceled"],
html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="cancelByContract"] {
    background: rgb(51 65 85 / 0.72) !important;
    color: rgb(226 232 240) !important;
    border-color: rgb(100 116 139 / 0.5) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="authorized"],
html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="pendingBoleto"],
html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="pendingPix"],
html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="notSend"],
html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="pending"] {
    background: rgb(30 64 175 / 0.48) !important;
    color: rgb(191 219 254) !important;
    border-color: rgb(96 165 250 / 0.46) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="rejected"],
html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="denied"] {
    background: rgb(127 29 29 / 0.52) !important;
    color: rgb(254 202 202) !important;
    border-color: rgb(248 113 113 / 0.45) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="processError"] {
    background: rgb(124 45 18 / 0.54) !important;
    color: rgb(254 215 170) !important;
    border-color: rgb(251 146 60 / 0.46) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="reversed"],
html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="estornada"] {
    background: rgb(113 63 18 / 0.52) !important;
    color: rgb(254 240 138) !important;
    border-color: rgb(245 158 11 / 0.46) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-table td span[title="free"] {
    background: rgb(21 94 117 / 0.52) !important;
    color: rgb(165 243 252) !important;
    border-color: rgb(34 211 238 / 0.42) !important;
}

html[data-theme="dark"] #pagamentos-page .ui-btn-primary {
    background: rgb(var(--brand-600)) !important;
    border-color: rgb(var(--brand-600)) !important;
    color: #fff !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #pagamentos-page .ui-btn-primary:hover {
    background: rgb(58 118 218) !important;
    border-color: rgb(58 118 218) !important;
}

html[data-theme="dark"] #pagamentos-page .ui-btn-outline {
    background: rgb(var(--surface)) !important;
    border-color: rgb(var(--border)) !important;
    color: rgb(191 219 254) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #pagamentos-page .ui-btn-outline:hover {
    background: rgb(30 64 175 / 0.2) !important;
    border-color: rgb(96 165 250 / 0.58) !important;
    color: rgb(219 234 254) !important;
}

html[data-theme="dark"] #pagamentos-page .list-user-action a,
html[data-theme="dark"] #pagamentos-page .toggle-details {
    background: rgb(var(--surface-strong)) !important;
    border-color: rgb(var(--border)) !important;
    color: rgb(219 234 254) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] #pagamentos-page .list-user-action a:hover,
html[data-theme="dark"] #pagamentos-page .toggle-details:hover {
    background: rgb(45 58 82) !important;
    border-color: rgb(96 165 250 / 0.65) !important;
    color: #fff !important;
}

html[data-theme="dark"] #pagamentos-page .list-user-action a[class*="bg-amber-500"] {
    background: rgb(146 64 14 / 0.78) !important;
    border-color: rgb(251 191 36 / 0.5) !important;
    color: rgb(254 243 199) !important;
}

html[data-theme="dark"] #pagamentos-page .list-user-action a[class*="bg-rose-500"] {
    background: rgb(127 29 29 / 0.72) !important;
    border-color: rgb(248 113 113 / 0.48) !important;
    color: rgb(254 226 226) !important;
}

html[data-theme="dark"] #pagamentos-page .list-user-action a[class*="bg-slate-500"] {
    background: rgb(51 65 85 / 0.86) !important;
    border-color: rgb(148 163 184 / 0.42) !important;
    color: rgb(226 232 240) !important;
}

html[data-theme="dark"] #pagamentos-page #user-list-page-info,
html[data-theme="dark"] #pagamentos-page .pagination {
    color: rgb(var(--muted)) !important;
}

/* Tema escuro: paleta semantica das caixas de alerta (Tailwind) */

/* Aviso / atencao */
html[data-theme="dark"] [class~="bg-amber-50"],
html[data-theme="dark"] [class~="bg-yellow-50"],
html[data-theme="dark"] [class~="bg-orange-50"] {
    background-color: rgb(120 53 15 / 0.32) !important;
}

html[data-theme="dark"] [class~="border-amber-200"],
html[data-theme="dark"] [class~="border-yellow-200"],
html[data-theme="dark"] [class~="border-orange-200"] {
    border-color: rgb(251 191 36 / 0.42) !important;
}

html[data-theme="dark"] [class~="text-amber-700"],
html[data-theme="dark"] [class~="text-amber-800"],
html[data-theme="dark"] [class~="text-amber-900"],
html[data-theme="dark"] [class~="text-yellow-800"],
html[data-theme="dark"] [class~="text-orange-700"] {
    color: rgb(253 230 138) !important;
}

/* Erro / perigo */
html[data-theme="dark"] [class~="bg-red-50"],
html[data-theme="dark"] [class~="bg-red-100"],
html[data-theme="dark"] [class~="bg-rose-50"] {
    background-color: rgb(127 29 29 / 0.32) !important;
}

html[data-theme="dark"] [class~="border-red-200"],
html[data-theme="dark"] [class~="border-red-300"],
html[data-theme="dark"] [class~="border-rose-200"] {
    border-color: rgb(248 113 113 / 0.45) !important;
}

html[data-theme="dark"] [class~="text-red-700"],
html[data-theme="dark"] [class~="text-red-800"],
html[data-theme="dark"] [class~="text-red-900"],
html[data-theme="dark"] [class~="text-rose-700"] {
    color: rgb(254 202 202) !important;
}

/* Sucesso */
html[data-theme="dark"] [class~="bg-emerald-50"],
html[data-theme="dark"] [class~="bg-emerald-100"] {
    background-color: rgb(20 83 45 / 0.32) !important;
}

html[data-theme="dark"] [class~="border-emerald-200"],
html[data-theme="dark"] [class~="border-emerald-300"],
html[data-theme="dark"] [class~="border-green-200"] {
    border-color: rgb(34 197 94 / 0.42) !important;
}

html[data-theme="dark"] [class~="text-emerald-700"],
html[data-theme="dark"] [class~="text-emerald-900"],
html[data-theme="dark"] [class~="text-green-800"] {
    color: rgb(187 247 208) !important;
}

/* Informacao */
html[data-theme="dark"] [class~="bg-blue-100"] {
    background-color: rgb(30 58 138 / 0.32) !important;
}

html[data-theme="dark"] [class~="border-blue-200"],
html[data-theme="dark"] [class~="border-blue-100"] {
    border-color: rgb(96 165 250 / 0.42) !important;
}

html[data-theme="dark"] [class~="text-blue-800"] {
    color: rgb(191 219 254) !important;
}

/* Campos desabilitados / somente leitura no escuro */
html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled,
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] textarea:disabled,
html[data-theme="dark"] input[readonly],
html[data-theme="dark"] textarea[readonly] {
    color: rgb(var(--text-soft)) !important;
    -webkit-text-fill-color: rgb(var(--text-soft)) !important;
    opacity: 1 !important;
}

html[data-theme="dark"] select:disabled option,
html[data-theme="dark"] select option:disabled {
    color: rgb(var(--text-soft)) !important;
}

/* Texto do <select> no escuro */
html[data-theme="dark"] select,
html[data-theme="dark"] select.form-control,
html[data-theme="dark"] select.form-select,
html[data-theme="dark"] .select.form-control {
    color: rgb(var(--text)) !important;
    -webkit-text-fill-color: rgb(var(--text)) !important;
}

/* Desabilitado continua legivel, so com menos enfase que um campo ativo */
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] select[disabled],
html[data-theme="dark"] select.form-control:disabled {
    color: rgb(var(--text-soft)) !important;
    -webkit-text-fill-color: rgb(var(--text-soft)) !important;
}

/* Tema escuro: cadastro de cliente (#cliente-page) */
html[data-theme="dark"] #cliente-page select,
html[data-theme="dark"] #cliente-page .form-select {
    background-color: rgb(2 6 23 / 0.62) !important;
    border-color: rgb(var(--border)) !important;
    color: rgb(var(--text)) !important;
    -webkit-text-fill-color: rgb(var(--text)) !important;
    /* seta do dropdown em tom claro para aparecer no fundo escuro */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") !important;
}

html[data-theme="dark"] #cliente-page select:disabled,
html[data-theme="dark"] #cliente-page .form-select:disabled {
    background-color: rgb(31 41 61 / 0.78) !important;
    color: rgb(var(--text-soft)) !important;
    -webkit-text-fill-color: rgb(var(--text-soft)) !important;
}

html[data-theme="dark"] #cliente-page .form-control,
html[data-theme="dark"] #cliente-page input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] #cliente-page textarea {
    border-color: rgb(var(--border)) !important;
}

/* Tema escuro: componentes proprios do cadastro de cliente e afins */

/* Caixa "Responsavel financeiro" */
html[data-theme="dark"] #div_id_resposavelFinanceiro,
html[data-theme="dark"] #div_id_responsavelFinanceiro {
    background: rgb(30 58 138 / 0.22) !important;
    border-color: rgb(96 165 250 / 0.35) !important;
}

html[data-theme="dark"] #div_id_resposavelFinanceiro label,
html[data-theme="dark"] #div_id_responsavelFinanceiro label {
    color: rgb(191 219 254) !important;
}

/* Botoes de acao das tabelas (Adicional, Visualizar, Cancelar, Reativar) */
html[data-theme="dark"] #cliente-page .btn-adicionar {
    background: rgb(30 58 138 / 0.3) !important;
    border-color: rgb(96 165 250 / 0.4) !important;
    color: rgb(191 219 254) !important;
}

html[data-theme="dark"] #cliente-page .btn-visualizar {
    background: rgb(12 74 110 / 0.35) !important;
    border-color: rgb(56 189 248 / 0.4) !important;
    color: rgb(186 230 253) !important;
}

html[data-theme="dark"] #cliente-page .btn-exluir {
    background: rgb(127 29 29 / 0.32) !important;
    border-color: rgb(248 113 113 / 0.42) !important;
    color: rgb(254 202 202) !important;
}

html[data-theme="dark"] #cliente-page .ativarContrato,
html[data-theme="dark"] #cliente-page .reativarContrato {
    background: rgb(19 78 74 / 0.35) !important;
    border-color: rgb(45 212 191 / 0.4) !important;
    color: rgb(153 246 228) !important;
}

/* Cabecalho de card com gradiente claro */
html[data-theme="dark"] #cliente-page .card-header {
    background: rgb(var(--surface-soft)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] #cliente-page .modal-header,
html[data-theme="dark"] #cliente-page .modal-footer {
    background: rgb(var(--surface-soft)) !important;
}

/* Tabela de cartoes de cobranca */
html[data-theme="dark"] .billing-cards-wrap .table-responsive {
    background: rgb(var(--surface)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .billing-cards-wrap .table thead th {
    background: rgb(var(--surface-strong)) !important;
    border-bottom-color: rgb(var(--border)) !important;
    color: rgb(var(--text-soft)) !important;
}

/* Campos somente leitura: o inline usa !important, entao precisa de */
html[data-theme="dark"] input[readonly],
html[data-theme="dark"] textarea[readonly] {
    background-color: rgb(31 41 61 / 0.78) !important;
    color: rgb(var(--text-soft)) !important;
    -webkit-text-fill-color: rgb(var(--text-soft)) !important;
    border-color: rgb(var(--border)) !important;
}

/* Bloco DocuSign */
html[data-theme="dark"] .docusign-icon-btn,
html[data-theme="dark"] .docusign-ghost-btn {
    background: rgb(var(--surface-strong)) !important;
    border-color: rgb(var(--border)) !important;
    color: rgb(var(--text-soft)) !important;
}

html[data-theme="dark"] .docusign-icon-btn:hover,
html[data-theme="dark"] .docusign-ghost-btn:hover {
    background: rgb(var(--border)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .docusign-icon-btn.btn-download-contract {
    color: rgb(134 239 172) !important;
}

html[data-theme="dark"] .docusign-detail-cell {
    background: rgb(var(--surface-soft)) !important;
}

html[data-theme="dark"] .docusign-detail-card {
    background: rgb(var(--surface)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .docusign-chip.bg-danger {
    background: rgb(127 29 29 / 0.4) !important;
    color: rgb(254 202 202) !important;
}

/* Painel de processamento Galax */
html[data-theme="dark"] .galax-process-detail {
    background: rgb(127 29 29 / 0.3) !important;
    border-color: rgb(248 113 113 / 0.42) !important;
    color: rgb(254 202 202) !important;
}

html[data-theme="dark"] .galax-process-close,
html[data-theme="dark"] .galax-process-step-dot {
    background: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text-soft)) !important;
}

html[data-theme="dark"] .galax-process-close:hover,
html[data-theme="dark"] .galax-process-step.status-pending .galax-process-step-dot {
    background: rgb(var(--border)) !important;
}

html[data-theme="dark"] .galax-process-state-icon {
    background: rgb(30 58 138 / 0.3) !important;
    color: rgb(191 219 254) !important;
}

html[data-theme="dark"] .galax-process-state-icon.state-error,
html[data-theme="dark"] .galax-process-badge.state-error {
    background: rgb(127 29 29 / 0.35) !important;
    color: rgb(254 202 202) !important;
}

/* Seletor multiplo do admin e cartoes de plataforma */
html[data-theme="dark"] #cliente-page .admin-multiselect-box,
html[data-theme="dark"] #cliente-page .admin-multiselect-search {
    background: rgb(2 6 23 / 0.62) !important;
    border-color: rgb(var(--border)) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] #cliente-page .admin-multiselect-toolbar {
    background: rgb(var(--surface-strong)) !important;
}

html[data-theme="dark"] #cliente-page .admin-multiselect-item:hover {
    background: rgb(var(--border)) !important;
}

html[data-theme="dark"] .wrapper-info-modal,
html[data-theme="dark"] .platform-info-card .platform-info-item {
    background: rgb(var(--surface-soft)) !important;
    color: rgb(var(--text-soft)) !important;
}

/* Tema escuro: tabelas do Bootstrap 5 */
html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: rgb(var(--text));
    --bs-table-striped-bg: rgb(var(--surface-strong));
    --bs-table-striped-color: rgb(var(--text));
    --bs-table-hover-bg: rgb(var(--surface-strong));
    --bs-table-hover-color: rgb(var(--text));
    --bs-table-active-bg: rgb(var(--surface-strong));
    --bs-table-active-color: rgb(var(--text));
    --bs-table-border-color: rgb(var(--border));
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: var(--bs-table-bg) !important;
    color: rgb(var(--text)) !important;
}

html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table > thead > tr > th {
    background-color: rgb(var(--surface-strong)) !important;
    color: rgb(var(--text-soft)) !important;
}

/* Combobox com busca (ui-combo) */
.ui-combo {
    position: relative;
}

.ui-combo-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
    padding: 0;
    border: 0;
}

.ui-combo-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1200;
    max-height: 16rem;
    overflow: auto;
    overscroll-behavior: contain;
    background: rgb(var(--surface));
    border: 1px solid rgb(var(--border));
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 0.25rem;
}

.ui-combo-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: rgb(var(--text));
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.ui-combo-item:hover,
.ui-combo-item.is-active {
    background: rgb(var(--brand-50));
    color: rgb(var(--brand-700));
}

.ui-combo-item.is-current {
    font-weight: 700;
}

.ui-combo-empty {
    padding: 0.6rem 0.65rem;
    font-size: 0.8rem;
    color: rgb(var(--muted));
}

html[data-theme="dark"] .ui-combo-list {
    background: rgb(var(--surface)) !important;
    border-color: rgb(var(--border)) !important;
}

html[data-theme="dark"] .ui-combo-item:hover,
html[data-theme="dark"] .ui-combo-item.is-active {
    background: rgb(30 64 175 / 0.32) !important;
    color: rgb(219 234 254) !important;
}
