/*
 * Zcolab UI · componentes globais
 * Tudo dentro de body.zc-theme. Cores só por token (ver zc-tokens.css).
 * Os !important existem porque o tema anterior (zui-theme.css) e o Bootstrap
 * do Perfex também usam !important nas mesmas propriedades.
 */

/* ---------- Base ---------- */
body.zc-theme {
    background: var(--zc-bg) !important;
    color: var(--zc-text);
    font-family: var(--zc-font) !important;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body.zc-theme #wrapper,
body.zc-theme .content { background: var(--zc-bg) !important; }
body.zc-theme :where(input, button, select, textarea, optgroup) { font-family: inherit; }
body.zc-theme :where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) { color: var(--zc-text); font-family: inherit; }
body.zc-theme :where(h1, .h1) { font-size: 24px; font-weight: 600; }
body.zc-theme :where(h4, .h4) { font-size: 15px; font-weight: 600; }
body.zc-theme :where(p, li, dd, dt, td, th, label, span, small) { font-family: inherit; }
body.zc-theme a { color: var(--zc-primary); }
body.zc-theme a:hover, body.zc-theme a:focus { color: var(--zc-primary-hover); }
body.zc-theme hr { border-color: var(--zc-border) !important; }
body.zc-theme :where(.text-muted, .text-dark-grey, small.text-muted, .help-block) { color: var(--zc-text-3) !important; }
body.zc-theme :where(.text-dark, .bold, strong, b) { color: inherit; }
body.zc-theme .text-success { color: var(--zc-green) !important; }
body.zc-theme .text-danger { color: var(--zc-red) !important; }
body.zc-theme .text-warning { color: var(--zc-yellow) !important; }
body.zc-theme .text-info { color: var(--zc-primary) !important; }
body.zc-theme code, body.zc-theme kbd, body.zc-theme pre {
    background: var(--zc-surface-2); color: var(--zc-text); border: 1px solid var(--zc-border);
    border-radius: 6px; box-shadow: none;
}
body.zc-theme kbd { padding: 1px 6px; font-family: inherit; font-size: 12px; font-weight: 600; }
body.zc-theme ::selection { background: var(--zc-primary-soft); color: var(--zc-text); }
body.zc-theme * { scrollbar-color: var(--zc-border-strong) transparent; }

/* Foco visível em tudo que é clicável */
body.zc-theme :where(a, button, input, select, textarea, summary, [tabindex], [role="button"], .btn):focus-visible {
    outline: 2px solid var(--zc-focus) !important;
    outline-offset: 2px !important;
    box-shadow: none;
}

/* Utilitários do módulo */
body.zc-theme .zc-muted { color: var(--zc-text-3); font-weight: 400; }
body.zc-theme .zc-overline {
    display: block; color: var(--zc-text-3); font-size: 11px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
}
body.zc-theme .zc-text-green { color: var(--zc-green); }
body.zc-theme .zc-text-red { color: var(--zc-red); }
body.zc-theme .zc-text-blue { color: var(--zc-primary); }
body.zc-theme .zc-text-neutral { color: var(--zc-text-3); }
body.zc-theme .zc-bg-green { background: var(--zc-green-solid); }
body.zc-theme .zc-bg-yellow { background: var(--zc-yellow-solid); }
body.zc-theme .zc-bg-red { background: var(--zc-red-solid); }
body.zc-theme .zc-ico { flex: 0 0 auto; vertical-align: middle; }
body.zc-theme .zc-only-dark, body.zc-theme.zc-dark .zc-only-light { display: none; }
body.zc-theme.zc-dark .zc-only-dark { display: inline-flex; }
body.zc-theme .zc-only-light { display: inline-flex; }

/* ---------- Botões ---------- */
body.zc-theme .btn {
    min-height: 38px;
    padding: 0 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: var(--zc-radius) !important;
    border: 1px solid transparent;
    font-size: 14px; font-weight: 600; line-height: 1.2;
    box-shadow: none !important; text-shadow: none !important; background-image: none !important;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
body.zc-theme .btn-block { display: flex; }
body.zc-theme .btn.hide, body.zc-theme .btn.hidden { display: none !important; }
body.zc-theme .btn-sm, body.zc-theme .btn-group-sm > .btn { min-height: 32px; padding: 0 10px; font-size: 13px; }
body.zc-theme .btn-xs, body.zc-theme .btn-group-xs > .btn { min-height: 26px; padding: 0 8px; font-size: 12px; border-radius: 8px !important; }
body.zc-theme .btn-lg { min-height: 44px; padding: 0 18px; font-size: 15px; }
body.zc-theme .btn-icon { padding: 0 10px; }

body.zc-theme .btn-primary,
body.zc-theme .btn-info {
    background: var(--zc-primary) !important; border-color: var(--zc-primary) !important; color: var(--zc-on-primary) !important;
}
body.zc-theme .btn-primary:hover, body.zc-theme .btn-primary:focus, body.zc-theme .btn-primary:active,
body.zc-theme .btn-info:hover, body.zc-theme .btn-info:focus, body.zc-theme .btn-info:active {
    background: var(--zc-primary-hover) !important; border-color: var(--zc-primary-hover) !important; color: var(--zc-on-primary) !important;
}
body.zc-theme .btn-default,
body.zc-theme .btn-secondary {
    background: var(--zc-surface) !important; border-color: var(--zc-border) !important; color: var(--zc-text) !important;
}
body.zc-theme .btn-default:hover, body.zc-theme .btn-default:focus, body.zc-theme .btn-default:active,
body.zc-theme .btn-default.active, body.zc-theme .open > .btn-default.dropdown-toggle {
    background: var(--zc-hover) !important; border-color: var(--zc-border-strong) !important; color: var(--zc-text) !important;
}
body.zc-theme .btn-link { background: transparent !important; border-color: transparent !important; color: var(--zc-primary) !important; }
body.zc-theme .btn-link:hover { background: var(--zc-hover) !important; text-decoration: none; }
body.zc-theme .btn-success { background: var(--zc-green-solid) !important; border-color: var(--zc-green-solid) !important; color: var(--zc-on-primary) !important; }
body.zc-theme .btn-danger { background: var(--zc-red-solid) !important; border-color: var(--zc-red-solid) !important; color: var(--zc-on-primary) !important; }
body.zc-theme .btn-warning { background: var(--zc-yellow-bg) !important; border-color: transparent !important; color: var(--zc-yellow) !important; }
body.zc-theme .btn-success:hover, body.zc-theme .btn-danger:hover, body.zc-theme .btn-warning:hover { filter: brightness(.93); }
body.zc-theme .btn[disabled], body.zc-theme .btn.disabled, body.zc-theme fieldset[disabled] .btn { opacity: .55; cursor: not-allowed; }
body.zc-theme .btn-group > .btn:not(:first-child):not(:last-child) { border-radius: 0 !important; }
body.zc-theme .btn-group > .btn:first-child:not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
body.zc-theme .btn-group > .btn:last-child:not(:first-child),
body.zc-theme .btn-group > .dropdown-toggle:not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
body.zc-theme .btn .caret { margin: 0; }

/* Botão só com ícone (topo, cartões) */
body.zc-theme .zc-icon-btn {
    width: 38px; height: 38px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: var(--zc-radius);
    color: var(--zc-text-2); cursor: pointer;
}
body.zc-theme .zc-icon-btn:hover { background: var(--zc-hover); color: var(--zc-text); }

/* ---------- Campos ---------- */
body.zc-theme .form-control,
body.zc-theme .bootstrap-select > .dropdown-toggle,
body.zc-theme .select2-container--default .select2-selection--single,
body.zc-theme .select2-container--default .select2-selection--multiple,
body.zc-theme .dataTables_wrapper .dataTables_filter input,
body.zc-theme .dataTables_wrapper .dataTables_length select,
body.zc-theme .bootstrap-tagsinput,
body.zc-theme .tagit {
    min-height: 38px;
    background: var(--zc-surface) !important;
    border: 1px solid var(--zc-border) !important;
    border-radius: var(--zc-radius) !important;
    color: var(--zc-text) !important;
    font-size: 14px; font-weight: 400;
    box-shadow: none !important;
}
body.zc-theme textarea.form-control { min-height: 80px; }
body.zc-theme .form-control::placeholder { color: var(--zc-text-3) !important; opacity: 1; }
body.zc-theme .form-control:hover,
body.zc-theme .bootstrap-select > .dropdown-toggle:hover { border-color: var(--zc-border-strong) !important; }
body.zc-theme .form-control:focus,
body.zc-theme .bootstrap-select.open > .dropdown-toggle,
body.zc-theme .bootstrap-select > .dropdown-toggle:focus,
body.zc-theme .select2-container--default.select2-container--focus .select2-selection--single,
body.zc-theme .dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--zc-primary) !important;
    box-shadow: 0 0 0 3px var(--zc-primary-soft) !important;
    outline: 0 !important;
}
body.zc-theme .form-control[disabled], body.zc-theme .form-control[readonly],
body.zc-theme fieldset[disabled] .form-control {
    background: var(--zc-surface-2) !important; color: var(--zc-text-3) !important;
}
body.zc-theme .bootstrap-select > .dropdown-toggle { font-weight: 400 !important; padding: 0 12px; justify-content: space-between; }
body.zc-theme .bootstrap-select .filter-option { color: var(--zc-text); display: flex; align-items: center; }
body.zc-theme .bootstrap-select .dropdown-toggle.bs-placeholder .filter-option { color: var(--zc-text-3) !important; }
body.zc-theme .bootstrap-select .bs-searchbox .form-control { min-height: 34px; }
body.zc-theme .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--zc-text) !important; line-height: 36px; }
body.zc-theme .select2-dropdown { background: var(--zc-surface) !important; border-color: var(--zc-border) !important; color: var(--zc-text); }
body.zc-theme .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--zc-primary-soft) !important; color: var(--zc-text) !important; }
body.zc-theme label, body.zc-theme label.control-label, body.zc-theme .control-label {
    color: var(--zc-text-2) !important; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
body.zc-theme .input-group-addon, body.zc-theme .input-group-btn > .btn {
    background: var(--zc-surface-2) !important; border-color: var(--zc-border) !important; color: var(--zc-text-2) !important;
}
body.zc-theme .input-group .form-control:not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
body.zc-theme .input-group .form-control:not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
body.zc-theme .input-group-addon:first-child { border-radius: var(--zc-radius) 0 0 var(--zc-radius) !important; }
body.zc-theme .input-group-addon:last-child { border-radius: 0 var(--zc-radius) var(--zc-radius) 0 !important; }
body.zc-theme .has-error .form-control { border-color: var(--zc-red-solid) !important; }
body.zc-theme .has-error .help-block, body.zc-theme p.text-danger, body.zc-theme label.error { color: var(--zc-red) !important; }
body.zc-theme .req, body.zc-theme .text-danger.req { color: var(--zc-red) !important; }

/* Checkbox e rádio (padrão do Perfex: input + label com ::before/::after) */
body.zc-theme .checkbox label, body.zc-theme .radio label { color: var(--zc-text) !important; font-weight: 400; font-size: 14px; }
body.zc-theme .checkbox label::before {
    background: var(--zc-surface) !important; border: 1.5px solid var(--zc-text-3) !important; border-radius: 6px !important;
}
body.zc-theme .radio label::before { background: var(--zc-surface) !important; border: 1.5px solid var(--zc-text-3) !important; }
body.zc-theme .checkbox input[type="checkbox"]:checked + label::before,
body.zc-theme .checkbox-primary input[type="checkbox"]:checked + label::before,
body.zc-theme .checkbox-info input[type="checkbox"]:checked + label::before {
    background: var(--zc-primary) !important; border-color: var(--zc-primary) !important;
}
body.zc-theme .checkbox input[type="checkbox"]:checked + label::after { color: var(--zc-on-primary) !important; }
body.zc-theme .radio input[type="radio"]:checked + label::before { border-color: var(--zc-primary) !important; }
body.zc-theme .radio input[type="radio"] + label::after,
body.zc-theme .radio-primary input[type="radio"] + label::after { background: var(--zc-primary) !important; }
body.zc-theme .checkbox input:focus-visible + label::before,
body.zc-theme .radio input:focus-visible + label::before { outline: 2px solid var(--zc-focus) !important; outline-offset: 2px; }
body.zc-theme input[type="checkbox"], body.zc-theme input[type="radio"] { accent-color: var(--zc-primary); }
body.zc-theme .onoffswitch-label { background: var(--zc-border-strong) !important; border-color: transparent !important; }
body.zc-theme .onoffswitch-label::before { background: var(--zc-surface) !important; border-color: transparent !important; }
body.zc-theme .onoffswitch-checkbox:checked + .onoffswitch-label { background: var(--zc-primary) !important; }
body.zc-theme .onoffswitch-checkbox:checked + .onoffswitch-label::before { border-color: transparent !important; }

/* ---------- Cartões ---------- */
body.zc-theme .panel_s,
body.zc-theme .panel,
body.zc-theme .widget > .row .panel_s,
body.zc-theme .top_stats_wrapper,
body.zc-theme .well,
body.zc-theme .zc-card {
    background: var(--zc-surface) !important;
    border: 1px solid var(--zc-border) !important;
    border-radius: var(--zc-radius-card) !important;
    box-shadow: none !important;
    color: var(--zc-text);
}
body.zc-theme .panel_s > .panel-body,
body.zc-theme .panel > .panel-body {
    background: transparent !important; border: 0 !important; border-radius: var(--zc-radius-card) !important;
    box-shadow: none !important; color: var(--zc-text);
}
body.zc-theme .panel_s .panel_s, body.zc-theme .modal .panel_s { border-radius: 12px !important; }
body.zc-theme .panel-heading, body.zc-theme .panel_s .panel-heading {
    background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--zc-border) !important;
    border-radius: var(--zc-radius-card) var(--zc-radius-card) 0 0 !important;
    color: var(--zc-text) !important; font-size: 15px; font-weight: 600;
}
body.zc-theme .panel-footer {
    background: var(--zc-surface-2) !important; border-top: 1px solid var(--zc-border) !important;
    border-radius: 0 0 var(--zc-radius-card) var(--zc-radius-card) !important; color: var(--zc-text-2);
}
body.zc-theme .zc-card { padding: 20px; }
body.zc-theme .zc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
body.zc-theme .zc-card-title { margin: 0; color: var(--zc-text); font-size: 15px; font-weight: 600; line-height: 1.3; }
body.zc-theme .zc-empty { margin: 0; padding: 32px 12px; color: var(--zc-text-3); text-align: center; }
body.zc-theme .section-heading { color: var(--zc-text) !important; }

/* ---------- Abas ---------- */
body.zc-theme .nav-tabs { border-bottom: 1px solid var(--zc-border) !important; background: transparent !important; }
body.zc-theme .nav-tabs > li > a {
    margin: 0; padding: 10px 14px;
    background: transparent !important; border: 0 !important; border-bottom: 2px solid transparent !important;
    border-radius: 0 !important; color: var(--zc-text-2) !important; font-size: 14px; font-weight: 500;
}
body.zc-theme .nav-tabs > li > a:hover { color: var(--zc-text) !important; border-bottom-color: var(--zc-border-strong) !important; }
body.zc-theme .nav-tabs > li.active > a,
body.zc-theme .nav-tabs > li.active > a:hover,
body.zc-theme .nav-tabs > li.active > a:focus {
    color: var(--zc-primary) !important; border-bottom-color: var(--zc-primary) !important; font-weight: 600;
}
body.zc-theme .horizontal-scrollable-tabs .scroller { background: var(--zc-surface) !important; color: var(--zc-text-2) !important; }
body.zc-theme .nav-pills > li > a { border-radius: var(--zc-radius-pill); color: var(--zc-text-2); font-weight: 500; }
body.zc-theme .nav-pills > li > a:hover { background: var(--zc-hover); }
body.zc-theme .nav-pills > li.active > a, body.zc-theme .nav-pills > li.active > a:hover { background: var(--zc-primary) !important; color: var(--zc-on-primary) !important; }

/* ---------- Etiquetas (pílula com bolinha) ---------- */
body.zc-theme .label,
body.zc-theme .zc-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    background: var(--zc-t-bg, var(--zc-neutral-bg)) !important;
    border: 0 !important; border-radius: var(--zc-radius-pill) !important;
    color: var(--zc-t, var(--zc-neutral)) !important;
    font-size: 12.5px; font-weight: 600; line-height: 1.4; letter-spacing: 0 !important; text-transform: none !important; white-space: nowrap;
    box-shadow: none !important;
}
body.zc-theme .label::before,
body.zc-theme .zc-pill::before {
    content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor;
}
body.zc-theme .label:empty::before, body.zc-theme .label.zc-no-dot::before, body.zc-theme .zc-pill.zc-no-dot::before { display: none; }
body.zc-theme .label-success { --zc-t: var(--zc-green); --zc-t-bg: var(--zc-green-bg); }
body.zc-theme .label-danger { --zc-t: var(--zc-red); --zc-t-bg: var(--zc-red-bg); }
body.zc-theme .label-warning { --zc-t: var(--zc-yellow); --zc-t-bg: var(--zc-yellow-bg); }
body.zc-theme .label-info, body.zc-theme .label-primary { --zc-t: var(--zc-blue); --zc-t-bg: var(--zc-blue-bg); }
body.zc-theme .label-default { --zc-t: var(--zc-neutral); --zc-t-bg: var(--zc-neutral-bg); }
body.zc-theme .label a { color: inherit !important; }
body.zc-theme .badge {
    min-width: 22px; padding: 2px 7px;
    background: var(--zc-neutral-bg) !important; border: 0 !important; border-radius: var(--zc-radius-pill) !important;
    color: var(--zc-text-2) !important; font-size: 11.5px; font-weight: 700; line-height: 1.4; text-shadow: none;
}
body.zc-theme .badge.bg-info, body.zc-theme .badge.bg-primary { background: var(--zc-primary) !important; color: var(--zc-on-primary) !important; }
body.zc-theme .badge.bg-success, body.zc-theme .bg-success.tw-rounded-full { background: var(--zc-green-solid) !important; color: var(--zc-on-primary) !important; }
body.zc-theme .badge.bg-danger { background: var(--zc-red-solid) !important; color: var(--zc-on-primary) !important; }
body.zc-theme .badge.bg-warning, body.zc-theme .bg-warning.tw-rounded-full { background: var(--zc-yellow-bg) !important; color: var(--zc-yellow) !important; }

/* Prioridade: seta dentro de um círculo suave; ao lado do texto vira pílula */
body.zc-theme .zc-prio {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px;
    background: var(--zc-t-bg); border-radius: var(--zc-radius-pill);
    color: var(--zc-t); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
body.zc-theme .zc-prio svg { width: 20px; height: 20px; padding: 3px; }
body.zc-theme .zc-prio-critical { --zc-t: var(--zc-red); --zc-t-bg: var(--zc-red-bg); }
body.zc-theme .zc-prio-high { --zc-t: var(--zc-orange); --zc-t-bg: var(--zc-orange-bg); }
body.zc-theme .zc-prio-medium { --zc-t: var(--zc-yellow); --zc-t-bg: var(--zc-yellow-bg); }
body.zc-theme .zc-prio-low { --zc-t: var(--zc-blue); --zc-t-bg: var(--zc-blue-bg); }

/* Tipo: quadradinho de 24px */
body.zc-theme .zc-type {
    width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--zc-t-bg); border-radius: 8px; color: var(--zc-t);
}
/* Bloco de ícone de módulo */
body.zc-theme .zc-modicon {
    width: 40px; height: 40px; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--zc-t-bg); border-radius: var(--zc-radius-icon); color: var(--zc-t);
}

/* ---------- Tabelas (inclui DataTables) ---------- */
body.zc-theme .table, body.zc-theme table.table.dataTable {
    background: transparent !important; border: 0 !important; color: var(--zc-text); margin-bottom: 0;
}
body.zc-theme .table > thead > tr > th,
body.zc-theme table.table.dataTable thead th,
body.zc-theme .table > thead > tr > td {
    padding: 10px 12px !important;
    background: var(--zc-surface-2) !important;
    border: 0 !important; border-bottom: 1px solid var(--zc-border) !important;
    color: var(--zc-text-3) !important;
    font-size: 11px !important; font-weight: 700 !important; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
body.zc-theme .table > tbody > tr > td,
body.zc-theme table.table.dataTable tbody td,
body.zc-theme .table > tbody > tr > th,
body.zc-theme .table > tfoot > tr > td {
    padding: 12px !important;
    background: transparent !important;
    border: 0 !important; border-bottom: 1px solid var(--zc-border) !important;
    color: var(--zc-text) !important; font-size: 14px; vertical-align: middle;
}
body.zc-theme .table > tbody > tr:last-child > td, body.zc-theme table.table.dataTable tbody tr:last-child td { border-bottom: 0 !important; }
body.zc-theme .table > tbody > tr:hover > td, body.zc-theme table.table.dataTable tbody tr:hover td,
body.zc-theme .table-hover > tbody > tr:hover { background: var(--zc-hover) !important; }
body.zc-theme .table-striped > tbody > tr:nth-of-type(odd) { background: transparent !important; }
body.zc-theme .table > tbody > tr.selected > td, body.zc-theme .table > tbody > tr.active > td { background: var(--zc-primary-soft) !important; }
body.zc-theme .table td a { font-weight: 500; }
body.zc-theme .table .row-options { color: var(--zc-text-3); font-size: 12.5px; }
body.zc-theme .table .row-options a { color: var(--zc-text-2); font-weight: 500; }
body.zc-theme .table .row-options a:hover { color: var(--zc-primary); }
body.zc-theme .table .row-options .text-danger, body.zc-theme .table .row-options a.text-danger { color: var(--zc-red) !important; }
body.zc-theme table.dataTable thead .sorting::after, body.zc-theme table.dataTable thead .sorting_asc::after,
body.zc-theme table.dataTable thead .sorting_desc::after { color: var(--zc-text-3) !important; opacity: .9; }
body.zc-theme table.dataTable thead .sorting_asc, body.zc-theme table.dataTable thead .sorting_desc { color: var(--zc-text) !important; }
body.zc-theme .table-bordered, body.zc-theme .table-bordered > tbody > tr > td { border-color: var(--zc-border) !important; }
/* Tabela larga rola dentro do cartão, nunca a página */
body.zc-theme .table-responsive, body.zc-theme .dataTables_wrapper .table-responsive {
    border: 1px solid var(--zc-border) !important; border-radius: 12px; overflow-x: auto; background: var(--zc-surface);
}
body.zc-theme .panel-table-full .table-responsive { border-left: 0 !important; border-right: 0 !important; border-radius: 0; }
body.zc-theme .dataTables_wrapper { color: var(--zc-text-2); }
body.zc-theme .dataTables_wrapper .dataTables_length label, body.zc-theme .dataTables_wrapper .dataTables_filter label { color: var(--zc-text-3) !important; font-weight: 500; }
body.zc-theme .dataTables_info { color: var(--zc-text-3) !important; font-size: 13px; }
body.zc-theme .dataTables_processing, body.zc-theme .dt-loader {
    background: var(--zc-surface) !important; border: 1px solid var(--zc-border) !important; border-radius: 12px;
    box-shadow: var(--zc-shadow-pop) !important; color: var(--zc-text-2) !important;
}
body.zc-theme .dataTables_empty, body.zc-theme td.dataTables_empty { padding: 36px 12px !important; color: var(--zc-text-3) !important; text-align: center; }
body.zc-theme .dt-buttons .btn, body.zc-theme .dt-buttons .dt-button { min-height: 38px; }
body.zc-theme .table-loading { opacity: .6; }

/* ---------- Paginação ---------- */
body.zc-theme .pagination { margin: 12px 0; display: inline-flex; gap: 4px; }
body.zc-theme .pagination > li > a, body.zc-theme .pagination > li > span,
body.zc-theme .dataTables_paginate .paginate_button {
    min-width: 34px; height: 34px; padding: 0 10px; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent !important; border: 0 !important; border-radius: var(--zc-radius) !important;
    color: var(--zc-text-2) !important; font-size: 13.5px; font-weight: 500; float: none;
}
body.zc-theme .pagination > li > a:hover, body.zc-theme .dataTables_paginate .paginate_button:hover { background: var(--zc-hover) !important; color: var(--zc-text) !important; }
body.zc-theme .pagination > .active > a, body.zc-theme .pagination > .active > a:hover, body.zc-theme .pagination > .active > span,
body.zc-theme .dataTables_paginate .paginate_button.current, body.zc-theme .dataTables_paginate .paginate_button.current:hover {
    background: var(--zc-primary-soft) !important; color: var(--zc-primary) !important; font-weight: 700;
}
body.zc-theme .pagination > .disabled > a, body.zc-theme .pagination > .disabled > span { color: var(--zc-text-3) !important; opacity: .6; }

/* ---------- Menus suspensos ---------- */
body.zc-theme .dropdown-menu,
body.zc-theme .bootstrap-select .dropdown-menu,
body.zc-theme .popover,
body.zc-theme .ui-autocomplete,
body.zc-theme .datetimepicker, body.zc-theme .xdsoft_datetimepicker,
body.zc-theme .daterangepicker {
    background: var(--zc-surface) !important;
    border: 1px solid var(--zc-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--zc-shadow-pop) !important;
    color: var(--zc-text);
}
body.zc-theme .dropdown-menu { padding: 6px; }
body.zc-theme .dropdown-menu > li > a, body.zc-theme .bootstrap-select .dropdown-menu li a {
    padding: 8px 10px; border-radius: 8px; color: var(--zc-text) !important; font-size: 14px; font-weight: 400;
}
body.zc-theme .dropdown-menu > li > a:hover, body.zc-theme .dropdown-menu > li > a:focus,
body.zc-theme .bootstrap-select .dropdown-menu li a:hover {
    background: var(--zc-hover) !important; color: var(--zc-text) !important;
}
body.zc-theme .dropdown-menu > .active > a, body.zc-theme .dropdown-menu > .active > a:hover,
body.zc-theme .bootstrap-select .dropdown-menu li.selected a, body.zc-theme .dropdown-menu > li.zc-ap-on > a {
    background: var(--zc-primary-soft) !important; color: var(--zc-primary) !important; font-weight: 600;
}
body.zc-theme .dropdown-menu .divider { background: var(--zc-border) !important; margin: 6px 0; }
body.zc-theme .dropdown-header { padding: 8px 10px 4px; color: var(--zc-text-3) !important; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
body.zc-theme .dropdown-menu [class*="tw-text-neutral"] { color: inherit; }
body.zc-theme .popover-title { background: var(--zc-surface-2) !important; border-bottom: 1px solid var(--zc-border) !important; color: var(--zc-text); border-radius: 12px 12px 0 0; }
body.zc-theme .popover-content { color: var(--zc-text); }
body.zc-theme .popover > .arrow, body.zc-theme .popover > .arrow::after { border-color: transparent; display: none; }
body.zc-theme .xdsoft_datetimepicker .xdsoft_calendar td, body.zc-theme .xdsoft_datetimepicker .xdsoft_calendar th,
body.zc-theme .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box > div > div {
    background: var(--zc-surface) !important; border-color: var(--zc-border) !important; color: var(--zc-text) !important; box-shadow: none !important;
}
body.zc-theme .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
body.zc-theme .xdsoft_datetimepicker .xdsoft_calendar td:hover,
body.zc-theme .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box > div > div.xdsoft_current {
    background: var(--zc-primary) !important; color: var(--zc-on-primary) !important;
}
body.zc-theme .xdsoft_datetimepicker .xdsoft_label { background: var(--zc-surface) !important; color: var(--zc-text) !important; }
body.zc-theme .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select { background: var(--zc-surface) !important; border-color: var(--zc-border) !important; color: var(--zc-text) !important; }

/* ---------- Modais ---------- */
body.zc-theme .modal-backdrop { background: var(--zc-overlay) !important; opacity: 1 !important; }
body.zc-theme .modal-backdrop.fade { opacity: 0 !important; }
body.zc-theme .modal-backdrop.fade.in { opacity: 1 !important; }
body.zc-theme .modal-content {
    background: var(--zc-surface) !important; border: 1px solid var(--zc-border) !important;
    border-radius: var(--zc-radius-card) !important; box-shadow: var(--zc-shadow-pop) !important; color: var(--zc-text);
}
body.zc-theme .modal-header {
    padding: 16px 20px; background: transparent !important; border-bottom: 1px solid var(--zc-border) !important;
    border-radius: var(--zc-radius-card) var(--zc-radius-card) 0 0 !important;
}
body.zc-theme .modal-title { color: var(--zc-text) !important; font-size: 16px; font-weight: 600; }
body.zc-theme .modal-body { padding: 20px; background: transparent !important; color: var(--zc-text); }
body.zc-theme .modal-footer {
    padding: 14px 20px; background: var(--zc-surface-2) !important; border-top: 1px solid var(--zc-border) !important;
    border-radius: 0 0 var(--zc-radius-card) var(--zc-radius-card) !important;
}
body.zc-theme .modal-header .close, body.zc-theme .close { color: var(--zc-text-2) !important; opacity: 1; text-shadow: none; }
body.zc-theme .modal-header .close:hover { color: var(--zc-text) !important; }

/* ---------- Alertas, notificações, tooltips ---------- */
body.zc-theme .alert {
    padding: 12px 14px; border: 1px solid transparent !important; border-radius: 12px !important;
    background: var(--zc-t-bg, var(--zc-neutral-bg)) !important; color: var(--zc-t, var(--zc-text)) !important;
    font-weight: 500; box-shadow: none !important; text-shadow: none;
}
body.zc-theme .alert-success { --zc-t: var(--zc-green); --zc-t-bg: var(--zc-green-bg); }
body.zc-theme .alert-danger { --zc-t: var(--zc-red); --zc-t-bg: var(--zc-red-bg); }
body.zc-theme .alert-warning { --zc-t: var(--zc-yellow); --zc-t-bg: var(--zc-yellow-bg); }
body.zc-theme .alert-info { --zc-t: var(--zc-blue); --zc-t-bg: var(--zc-blue-bg); }
body.zc-theme .alert a, body.zc-theme .alert .alert-link { color: inherit !important; text-decoration: underline; }
body.zc-theme .alert .close { color: inherit !important; }
body.zc-theme [data-notify="container"].alert, body.zc-theme .alert.float-alert {
    background: var(--zc-surface) !important; border: 1px solid var(--zc-border) !important; border-left: 4px solid var(--zc-t, var(--zc-primary)) !important;
    box-shadow: var(--zc-shadow-pop) !important; color: var(--zc-text) !important;
}
body.zc-theme .tooltip { font-family: var(--zc-font); opacity: 1; }
body.zc-theme .tooltip-inner {
    padding: 6px 10px; background: var(--zc-tooltip-bg) !important; border-radius: 8px;
    color: var(--zc-tooltip-text) !important; font-size: 12.5px; font-weight: 500; box-shadow: none;
}
body.zc-theme .tooltip.top .tooltip-arrow { border-top-color: var(--zc-tooltip-bg) !important; }
body.zc-theme .tooltip.bottom .tooltip-arrow { border-bottom-color: var(--zc-tooltip-bg) !important; }
body.zc-theme .tooltip.left .tooltip-arrow { border-left-color: var(--zc-tooltip-bg) !important; }
body.zc-theme .tooltip.right .tooltip-arrow { border-right-color: var(--zc-tooltip-bg) !important; }

/* ---------- Progresso, listas, migalhas ---------- */
body.zc-theme .progress { height: 8px; background: var(--zc-hover) !important; border-radius: var(--zc-radius-pill) !important; box-shadow: none !important; }
body.zc-theme .progress-bar { background: var(--zc-primary) !important; box-shadow: none !important; color: transparent; font-size: 0; }
body.zc-theme .progress-bar-success { background: var(--zc-green-solid) !important; }
body.zc-theme .progress-bar-danger { background: var(--zc-red-solid) !important; }
body.zc-theme .progress-bar-warning { background: var(--zc-yellow-solid) !important; }
body.zc-theme .list-group-item {
    background: var(--zc-surface) !important; border-color: var(--zc-border) !important; color: var(--zc-text) !important;
}
body.zc-theme .list-group-item:first-child { border-radius: 12px 12px 0 0; }
body.zc-theme .list-group-item:last-child { border-radius: 0 0 12px 12px; }
body.zc-theme a.list-group-item:hover { background: var(--zc-hover) !important; }
body.zc-theme .list-group-item.active { background: var(--zc-primary-soft) !important; border-color: var(--zc-border) !important; color: var(--zc-primary) !important; }
body.zc-theme .breadcrumb { background: transparent !important; padding: 0; color: var(--zc-text-3); font-size: 13.5px; }
body.zc-theme .breadcrumb > li > a { color: var(--zc-text-2); }
body.zc-theme .breadcrumb > .active { color: var(--zc-text) !important; font-weight: 600; }
body.zc-theme .breadcrumb > li + li::before { color: var(--zc-text-3) !important; }
body.zc-theme blockquote { border-left-color: var(--zc-border-strong); color: var(--zc-text-2); }
body.zc-theme .staff-profile-image-small, body.zc-theme .client-profile-image-small { border: 0 !important; border-radius: 50%; }
body.zc-theme .img-thumbnail { background: var(--zc-surface); border-color: var(--zc-border); }

/* Editor de texto (TinyMCE): moldura segue o tema; a "folha" continua clara de propósito */
body.zc-theme .tox-tinymce, body.zc-theme .mce-tinymce { border: 1px solid var(--zc-border) !important; border-radius: var(--zc-radius) !important; box-shadow: none !important; }
body.zc-theme .tox .tox-toolbar, body.zc-theme .tox .tox-toolbar__primary, body.zc-theme .tox .tox-editor-header,
body.zc-theme .tox .tox-menubar, body.zc-theme .tox .tox-statusbar {
    background: var(--zc-surface-2) !important; border-color: var(--zc-border) !important; color: var(--zc-text-2) !important;
}
body.zc-theme .tox .tox-tbtn { color: var(--zc-text-2) !important; }
body.zc-theme .tox .tox-tbtn svg { fill: currentColor !important; }
body.zc-theme .tox .tox-tbtn:hover { background: var(--zc-hover) !important; }

/* Dropzone e anexos */
body.zc-theme .dropzone {
    background: var(--zc-surface-2) !important; border: 1.5px dashed var(--zc-border-strong) !important;
    border-radius: 12px !important; color: var(--zc-text-3) !important;
}

/* Estado carregando */
body.zc-theme .zc-skeleton {
    background: linear-gradient(90deg, var(--zc-hover) 25%, var(--zc-surface-2) 50%, var(--zc-hover) 75%);
    background-size: 200% 100%; border-radius: 8px; animation: zc-shimmer 1.4s linear infinite; color: transparent !important;
}
@keyframes zc-shimmer { to { background-position: -200% 0; } }

/* ---------- Utilitários Tailwind do Perfex: ligados aos tokens ---------- */
body.zc-theme :where(.tw-bg-white) { background-color: var(--zc-surface) !important; }
body.zc-theme :where(.tw-bg-neutral-50, .tw-bg-neutral-100, .bg-light, .tw-bg-neutral-50\/50) { background-color: var(--zc-surface-2) !important; }
body.zc-theme :where(.tw-bg-neutral-200, .tw-bg-neutral-300) { background-color: var(--zc-hover) !important; }
body.zc-theme :where([class~="tw-text-neutral-900"], [class~="tw-text-neutral-800"], [class~="tw-text-neutral-700"], .tw-text-black) { color: var(--zc-text) !important; }
body.zc-theme :where([class~="tw-text-neutral-600"], [class~="tw-text-neutral-500"]) { color: var(--zc-text-2) !important; }
body.zc-theme :where([class~="tw-text-neutral-400"], [class~="tw-text-neutral-300"]) { color: var(--zc-text-3) !important; }
body.zc-theme :where([class*="tw-border-neutral-"], .tw-border-solid, .tw-divide-neutral-200 > * + *) { border-color: var(--zc-border) !important; }
body.zc-theme :where(.tw-bg-primary-600, .tw-bg-primary-500, .tw-bg-primary-700) { background-color: var(--zc-primary) !important; color: var(--zc-on-primary) !important; }
body.zc-theme :where(.tw-text-primary-600, .tw-text-primary-500, .tw-text-primary-700) { color: var(--zc-primary) !important; }
body.zc-theme :where(.tw-text-success-600, .tw-text-success-500, .tw-text-success-700) { color: var(--zc-green) !important; }
body.zc-theme :where(.tw-text-danger-600, .tw-text-danger-500, .tw-text-danger-700) { color: var(--zc-red) !important; }
body.zc-theme :where(.tw-text-warning-600, .tw-text-warning-500, .tw-text-warning-700) { color: var(--zc-yellow) !important; }
body.zc-theme :where(.tw-shadow, .tw-shadow-sm, .tw-shadow-md) { box-shadow: none !important; }

/* Rede de segurança do modo escuro: fundos e textos claros fixos escritos inline em telas antigas */
body.zc-theme.zc-dark :where(
    [style*="background:#fff"], [style*="background: #fff"], [style*="background-color:#fff"], [style*="background-color: #fff"],
    [style*="background:white"], [style*="background: white"], [style*="background-color:white"], [style*="background-color: white"],
    [style*="background:#FFF"], [style*="background: #FFF"], [style*="background-color:#FFF"], [style*="background-color: #FFF"]
):not(.zc-keep) { background-color: var(--zc-surface) !important; }
body.zc-theme.zc-dark :where(
    [style*="background:#f1f5f9" i], [style*="background: #f1f5f9" i], [style*="background-color:#f1f5f9" i], [style*="background-color: #f1f5f9" i], [style*="background:#f8fafc" i], [style*="background: #f8fafc" i], [style*="background-color:#f8fafc" i], [style*="background-color: #f8fafc" i], [style*="background:#f9fafb" i], [style*="background: #f9fafb" i], [style*="background-color:#f9fafb" i], [style*="background-color: #f9fafb" i], [style*="background:#f3f4f6" i], [style*="background: #f3f4f6" i], [style*="background-color:#f3f4f6" i], [style*="background-color: #f3f4f6" i], [style*="background:#f5f5f5" i], [style*="background: #f5f5f5" i], [style*="background-color:#f5f5f5" i], [style*="background-color: #f5f5f5" i], [style*="background:#fafafa" i], [style*="background: #fafafa" i], [style*="background-color:#fafafa" i], [style*="background-color: #fafafa" i], [style*="background:#f0f0f0" i], [style*="background: #f0f0f0" i], [style*="background-color:#f0f0f0" i], [style*="background-color: #f0f0f0" i], [style*="background:#f9f9f9" i], [style*="background: #f9f9f9" i], [style*="background-color:#f9f9f9" i], [style*="background-color: #f9f9f9" i], [style*="background:#f4f4f4" i], [style*="background: #f4f4f4" i], [style*="background-color:#f4f4f4" i], [style*="background-color: #f4f4f4" i], [style*="background:#f7f7f7" i], [style*="background: #f7f7f7" i], [style*="background-color:#f7f7f7" i], [style*="background-color: #f7f7f7" i], [style*="background:#eee" i], [style*="background: #eee" i], [style*="background-color:#eee" i], [style*="background-color: #eee" i], [style*="background:#eeeeee" i], [style*="background: #eeeeee" i], [style*="background-color:#eeeeee" i], [style*="background-color: #eeeeee" i], [style*="background:#e5e7eb" i], [style*="background: #e5e7eb" i], [style*="background-color:#e5e7eb" i], [style*="background-color: #e5e7eb" i], [style*="background:#f8f9fa" i], [style*="background: #f8f9fa" i], [style*="background-color:#f8f9fa" i], [style*="background-color: #f8f9fa" i], [style*="background:#fbfcfe" i], [style*="background: #fbfcfe" i], [style*="background-color:#fbfcfe" i], [style*="background-color: #fbfcfe" i], [style*="background:#f6f8fb" i], [style*="background: #f6f8fb" i], [style*="background-color:#f6f8fb" i], [style*="background-color: #f6f8fb" i], [style*="background:#eff6ff" i], [style*="background: #eff6ff" i], [style*="background-color:#eff6ff" i], [style*="background-color: #eff6ff" i], [style*="background:#f5f7fa" i], [style*="background: #f5f7fa" i], [style*="background-color:#f5f7fa" i], [style*="background-color: #f5f7fa" i]
):not(.zc-keep):not(.label):not(.badge) { background-color: var(--zc-surface-2) !important; }
body.zc-theme.zc-dark :where(
    [style*="color:#000"], [style*="color: #000"], [style*="color:#111"], [style*="color: #111"], [style*="color:#222"], [style*="color: #222"],
    [style*="color:#333"], [style*="color: #333"], [style*="color:#0f172a"], [style*="color: #0f172a"], [style*="color:#1e293b"], [style*="color: #1e293b"],
    [style*="color:#334155"], [style*="color: #334155"], [style*="color:black"], [style*="color: black"]
):not([style*="background"]):not(.zc-keep) { color: var(--zc-text) !important; }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
    body.zc-theme *, body.zc-theme *::before, body.zc-theme *::after {
        animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; scroll-behavior: auto !important;
    }
}

/* pílulas coloridas escritas inline nas tabelas (status/prioridade de telas customizadas): o JS define o tom */
body.zc-theme td span.zc-pill[data-zc-tone] { background: var(--zc-t-bg) !important; border-color: transparent !important; color: var(--zc-t) !important; }

/* cores de texto utilitárias do Tailwind (telas customizadas) lendo os tokens */
body.zc-theme :where([class~="tw-text-red-500"], [class~="tw-text-red-600"], [class~="tw-text-red-700"], [class~="tw-text-red-800"], [class~="tw-text-red-900"]) { color: var(--zc-red) !important; }
body.zc-theme :where([class~="tw-text-rose-500"], [class~="tw-text-rose-600"], [class~="tw-text-rose-700"], [class~="tw-text-rose-800"], [class~="tw-text-rose-900"]) { color: var(--zc-red) !important; }
body.zc-theme :where([class~="tw-text-blue-500"], [class~="tw-text-blue-600"], [class~="tw-text-blue-700"], [class~="tw-text-blue-800"], [class~="tw-text-blue-900"]) { color: var(--zc-primary) !important; }
body.zc-theme :where([class~="tw-text-sky-500"], [class~="tw-text-sky-600"], [class~="tw-text-sky-700"], [class~="tw-text-sky-800"], [class~="tw-text-sky-900"]) { color: var(--zc-primary) !important; }
body.zc-theme :where([class~="tw-text-indigo-500"], [class~="tw-text-indigo-600"], [class~="tw-text-indigo-700"], [class~="tw-text-indigo-800"], [class~="tw-text-indigo-900"]) { color: var(--zc-purple) !important; }
body.zc-theme :where([class~="tw-text-violet-500"], [class~="tw-text-violet-600"], [class~="tw-text-violet-700"], [class~="tw-text-violet-800"], [class~="tw-text-violet-900"]) { color: var(--zc-purple) !important; }
body.zc-theme :where([class~="tw-text-purple-500"], [class~="tw-text-purple-600"], [class~="tw-text-purple-700"], [class~="tw-text-purple-800"], [class~="tw-text-purple-900"]) { color: var(--zc-purple) !important; }
body.zc-theme :where([class~="tw-text-green-500"], [class~="tw-text-green-600"], [class~="tw-text-green-700"], [class~="tw-text-green-800"], [class~="tw-text-green-900"]) { color: var(--zc-green) !important; }
body.zc-theme :where([class~="tw-text-emerald-500"], [class~="tw-text-emerald-600"], [class~="tw-text-emerald-700"], [class~="tw-text-emerald-800"], [class~="tw-text-emerald-900"]) { color: var(--zc-green) !important; }
body.zc-theme :where([class~="tw-text-teal-500"], [class~="tw-text-teal-600"], [class~="tw-text-teal-700"], [class~="tw-text-teal-800"], [class~="tw-text-teal-900"]) { color: var(--zc-teal) !important; }
body.zc-theme :where([class~="tw-text-cyan-500"], [class~="tw-text-cyan-600"], [class~="tw-text-cyan-700"], [class~="tw-text-cyan-800"], [class~="tw-text-cyan-900"]) { color: var(--zc-teal) !important; }
body.zc-theme :where([class~="tw-text-yellow-500"], [class~="tw-text-yellow-600"], [class~="tw-text-yellow-700"], [class~="tw-text-yellow-800"], [class~="tw-text-yellow-900"]) { color: var(--zc-yellow) !important; }
body.zc-theme :where([class~="tw-text-amber-500"], [class~="tw-text-amber-600"], [class~="tw-text-amber-700"], [class~="tw-text-amber-800"], [class~="tw-text-amber-900"]) { color: var(--zc-yellow) !important; }
body.zc-theme :where([class~="tw-text-orange-500"], [class~="tw-text-orange-600"], [class~="tw-text-orange-700"], [class~="tw-text-orange-800"], [class~="tw-text-orange-900"]) { color: var(--zc-orange) !important; }
body.zc-theme :where([class~="tw-text-gray-500"], [class~="tw-text-gray-600"], [class~="tw-text-gray-700"], [class~="tw-text-gray-800"], [class~="tw-text-gray-900"]) { color: var(--zc-text-2) !important; }
body.zc-theme :where([class~="tw-text-slate-500"], [class~="tw-text-slate-600"], [class~="tw-text-slate-700"], [class~="tw-text-slate-800"], [class~="tw-text-slate-900"]) { color: var(--zc-text-2) !important; }
/* modo escuro: textos escuros fixos escritos inline (sem fundo próprio) */
body.zc-theme.zc-dark :where([style*="color:#111827" i], [style*="color: #111827" i], [style*="color:#1f2937" i], [style*="color: #1f2937" i], [style*="color:#0f172a" i], [style*="color: #0f172a" i], [style*="color:#1e293b" i], [style*="color: #1e293b" i], [style*="color:#172b4d" i], [style*="color: #172b4d" i], [style*="color:#12172b" i], [style*="color: #12172b" i], [style*="color:#0b1220" i], [style*="color: #0b1220" i]):not([style*="background"]):not(.zc-keep) { color: var(--zc-text) !important; }
body.zc-theme.zc-dark :where([style*="color:#374151" i], [style*="color: #374151" i], [style*="color:#475569" i], [style*="color: #475569" i], [style*="color:#4b5563" i], [style*="color: #4b5563" i], [style*="color:#64748b" i], [style*="color: #64748b" i], [style*="color:#6b7280" i], [style*="color: #6b7280" i], [style*="color:#5b6475" i], [style*="color: #5b6475" i], [style*="color:#334155" i], [style*="color: #334155" i], [style*="color:#555" i], [style*="color: #555" i], [style*="color:#666" i], [style*="color: #666" i], [style*="color:#444" i], [style*="color: #444" i]):not([style*="background"]):not(.zc-keep) { color: var(--zc-text-2) !important; }
