/* ======================================================= */
/* TELA DE METAS E COMISSÕES (HIGH-DENSITY UI SAAS)        */
/* ======================================================= */

.comissoes-content {
    margin-left: 202px;
    margin-top: 60px;
    padding: 20px;
    height: calc(101vh - 50px);
    background: var(--body-color);
    transition: var(--tran-04);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#sidebar-container:has(.sidebar.collapsed)~.comissoes-content {
    margin-left: 60px !important;
}

/* ======================================================= */
/* CABEÇALHO PADRONIZADO DA TELA                           */
/* ======================================================= */

.cabecalho-comissoes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.consulta-title-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.consulta-title-group h1 {
    margin: 0;
    font-size: 2.2rem;
    color: var(--subtitle-color, #64748b);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1;
    transition: color 0.4s ease;
}

.consulta-title-group h1 i {
    color: var(--primary-color);
}

.consulta-title-group p {
    margin: 0;
    color: var(--subtitle-color, #94a3b8);
    font-size: 1.05rem;
    font-weight: 500;
    border-left: 2px solid var(--input-border, #cbd5e1);
    padding-left: 15px;
    line-height: 1.2;
    transition: color 0.4s ease, border-color 0.4s ease;
}

.botoes-header-container {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-nova-meta {
    padding: 0 20px !important;
    height: 34px !important;
    /* High Density */
    background: var(--primary-color) !important;
    color: white !important;
    border: none;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(96, 197, 163, 0.2);
}

.btn-nova-meta:hover {
    background: var(--primary-color-light) !important;
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

/* ======================================================= */
/* BARRA BÁSICA DE FILTROS                                 */
/* ======================================================= */

.filtro-pesquisa-basica {
    background: var(--card-bg, #ffffff);
    padding: 10px 15px !important;
    /* Compactado */
    border-radius: 6px !important;
    border: 1px solid var(--card-border, #e2e8f0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
}

.filtros-basicos-linha {
    display: flex;
    align-items: flex-end;
    gap: 12px !important;
    flex-wrap: wrap;
    flex: 1;
}

.filtros-basicos-linha .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.filtros-basicos-linha label {
    font-size: 0.75rem !important;
    font-weight: 700;
    color: var(--subtitle-color, #64748b);
    text-transform: uppercase;
}

.filtros-basicos-linha input[type="date"],
.filtros-basicos-linha select {
    padding: 0 10px !important;
    border: 1px solid var(--input-border, #cbd5e1) !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    color: var(--title-color, #334155) !important;
    outline: none;
    background-color: var(--input-bg, #f8fafc) !important;
    height: 34px !important;
    /* High Density */
    box-sizing: border-box;
    transition: 0.2s;
}

.filtros-basicos-linha input[type="date"]:focus,
.filtros-basicos-linha select:focus {
    border-color: var(--primary-color) !important;
}

.checkboxes-basicos {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    /* Alinha com os inputs */
}

.checkbox-moderno {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--subtitle-color, #475569);
    font-size: 0.75rem !important;
    font-weight: 700;
    text-transform: uppercase;
    user-select: none;
    margin: 0;
}

.checkbox-moderno input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.botoes-pesquisa-linha {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-pesquisar {
    padding: 0 20px !important;
    height: 34px !important;
    /* High Density */
    background: var(--primary-color) !important;
    color: white !important;
    border: none;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(96, 197, 163, 0.2);
}

.btn-pesquisar:hover {
    background: var(--primary-color-light) !important;
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

/* ======================================================= */
/* SUPER CARD UNIFICADO DA TABELA                          */
/* ======================================================= */

.painel-gestao-comissoes {
    background: var(--card-bg, #ffffff);
    padding: 0;
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--card-border, #e2e8f0);
    display: flex;
    flex-direction: column;
}

.tabela-wrapper {
    flex: 1;
    overflow-y: auto;
}

.tabela-excel {
    width: 100%;
    border-collapse: collapse;
}

.tabela-excel th {
    background: var(--table-header-bg, #f8fafc);
    color: var(--subtitle-color, #475569);
    font-size: 0.75rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 15px !important;
    border-bottom: 2px solid var(--card-border, #e2e8f0);
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.tabela-excel td {
    padding: 10px 15px !important;
    border-bottom: 1px solid var(--card-border, #f1f5f9);
    color: var(--title-color, #334155);
    font-size: 0.85rem !important;
    vertical-align: middle;
    transition: background-color 0.3s ease;
}

.tabela-excel tr:hover td {
    background-color: var(--table-header-bg, #f0fdf4);
}

.tabela-valor-texto {
    font-weight: 700;
    color: var(--subtitle-color, #475569);
}

/* ======================================================= */
/* COMPONENTES DE RESULTADO E PROGRESSO                    */
/* ======================================================= */

.barra-progresso-container {
    width: 100%;
    background-color: var(--card-border, #e2e8f0);
    border-radius: 6px;
    height: 8px !important;
    margin-top: 6px;
    overflow: hidden;
    position: relative;
}

.barra-progresso-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease-in-out, background-color 0.5s;
}

.barra-texto {
    font-size: 0.75rem !important;
    font-weight: 800;
    color: var(--subtitle-color, #475569);
}

.badge-meta-batida {
    background: #ecfdf5;
    color: #10b981;
    border: 1px solid #10b981;
    padding: 2px 6px;
    border-radius: 6px !important;
    font-size: 0.65rem !important;
    margin-left: 5px;
}

.status-ativo {
    color: #10b981;
    font-weight: 700;
    padding: 4px 10px;
    background: #ecfdf5;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    display: inline-block;
    text-transform: uppercase;
}

.status-expirada {
    color: #f59e0b;
    font-weight: 700;
    padding: 4px 10px;
    background: #fffbeb;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    display: inline-block;
    text-transform: uppercase;
}

.status-inativo {
    color: #ef4444;
    font-weight: 700;
    padding: 4px 10px;
    background: #fef2f2;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    display: inline-block;
    text-transform: uppercase;
}

/* ======================================================= */
/* BOTÕES DE AÇÃO NA GRID (DESIGN SYSTEM PADRÃO)           */
/* ======================================================= */

.acoes-meta {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-acao-ver,
.btn-acao-editar,
.btn-acao-excluir {
    width: 34px !important;
    /* High Density */
    height: 34px !important;
    border-radius: 6px !important;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--input-bg, #f8fafc);
    font-size: 1rem;
}

.btn-acao-ver {
    color: #3b82f6;
}

.btn-acao-ver:hover {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-2px);
}

.btn-acao-editar {
    color: #f59e0b;
}

.btn-acao-editar:hover {
    background-color: #fffbeb;
    border-color: #fde68a;
    transform: translateY(-2px);
}

.btn-acao-excluir {
    color: #ef4444;
}

.btn-acao-excluir:hover {
    background-color: #fef2f2;
    border-color: #fecaca;
    transform: translateY(-2px);
}

/* ======================================================= */
/* DRAWER DA LUPA (AUDITORIA DO VENDEDOR)                  */
/* ======================================================= */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    z-index: 10400;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
}

.drawer-extrato {
    position: fixed;
    top: 0;
    right: -500px;
    width: 350px !important;
    /* Reduzido de 450px */
    height: 100vh;
    background: var(--card-bg, #ffffff);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 10600;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer-extrato.open {
    right: 0;
}

.btn-fechar-drawer {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--subtitle-color, #94a3b8);
    cursor: pointer;
    transition: color 0.2s;
}

.btn-fechar-drawer:hover {
    color: #ef4444;
}

.btn-lupa {
    background: var(--input-bg, #f1f5f9);
    color: #3b82f6;
    border: 1px solid #bfdbfe;
    width: 34px !important;
    height: 34px !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-lupa:hover {
    background: #dbebff;
    transform: scale(1.05);
}

/* ======================================================= */
/* MODAIS GENÉRICOS E WIZARD (NOVO HIGH-DENSITY)           */
/* ======================================================= */

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 10500;
    backdrop-filter: blur(4px);
}

.popup-content-large {
    background: var(--body-color, #ffffff);
    border-radius: 6px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    width: 95%;
    max-height: 95vh;
}

.popup-meta-comissao {
    max-width: 1000px;
    border: 1px solid var(--card-border, #cbd5e1);
}

.modal-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px !important;
    background-color: var(--card-bg, #ffffff);
    border-bottom: 1px solid var(--card-border, #e2e8f0);
    flex-shrink: 0;
}

.modal-header-modern h2 {
    color: var(--title-color, #1e293b);
    font-size: 1.2rem !important;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
}

.btn-fechar-moderno {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1px solid #fecaca !important;
    border-radius: 6px !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.btn-fechar-moderno:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}

.modal-body-scroll {
    flex: 1;
    overflow-y: hidden;
    padding: 0 25px 15px 25px !important;
    display: flex;
    flex-direction: column;
}

/* ======================================================= */
/* UI/UX: TIMELINE (LINHA DO TEMPO) BLINDADA               */
/* ======================================================= */
.linha-do-tempo {
    display: flex;
    justify-content: center;
    gap: 120px;
    margin: 15px 0;
    position: relative;
    flex-shrink: 0;
}

.linha-do-tempo::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: var(--card-border, #e2e8f0);
    z-index: 1;
}

.linha-do-tempo .etapa {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--subtitle-color, #94a3b8);
    font-weight: 700;
    font-size: 0.75rem !important;
    text-transform: uppercase;
}

.linha-do-tempo .etapa span {
    width: 28px;
    height: 28px;
    border-radius: 6px !important;
    background: var(--input-bg, #ffffff);
    border: 2px solid var(--input-border, #cbd5e1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.linha-do-tempo .etapa.etapa-ativa span {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 10px rgba(105, 190, 157, 0.3);
}

.linha-do-tempo .etapa.etapa-ativa div {
    color: var(--primary-color);
}

/* ======================================================= */
/* UI/UX: FORMULÁRIOS E GRIDS COMPACTAS (34PX)             */
/* ======================================================= */
.form-grid-loja {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}

.col-span-5 {
    grid-column: span 5;
}

.col-span-6 {
    grid-column: span 6;
}

.col-span-7 {
    grid-column: span 7;
}

.col-span-8 {
    grid-column: span 8;
}

.col-span-12 {
    grid-column: span 12;
}

.section-title {
    font-size: 0.95rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color-light);
    padding-bottom: 4px;
    margin-bottom: 12px;
    margin-top: 5px;
    font-weight: 700;
}

.form-group label {
    font-size: 0.75rem !important;
    font-weight: 700;
    color: var(--subtitle-color, #475569);
    margin-bottom: 4px;
    display: block;
    text-transform: uppercase;
}

.form-group label .req {
    color: #ef4444;
}

/* TODOS OS INPUTS UNIFICADOS PARA 34PX (HIGH DENSITY) */
.form-group input,
.form-group select,
.input-tabela {
    width: 100%;
    height: 34px !important;
    /* Padrão High-Density */
    padding: 0 10px !important;
    border: 1px solid var(--input-border, #cbd5e1) !important;
    border-radius: 6px !important;
    color: var(--title-color, #334155) !important;
    font-size: 0.85rem !important;
    background: var(--input-bg, #fff) !important;
    box-sizing: border-box;
    outline: none;
    transition: border 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.input-tabela:focus {
    border-color: var(--primary-color) !important;
}

.input-meta-compacto,
.input-destaque,
.input-faixa-min,
.input-faixa-comissao,
.input-faixa-valor {
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
    border-color: #34d399 !important;
    text-align: right !important;
}

.input-destaque-lg {
    font-size: 1.25rem !important;
    /* Reduzido um pouco */
    height: 42px !important;
    /* Um pouco maior que o padrão para destaque */
    text-align: center !important;
    font-weight: 800 !important;
    border-radius: 6px !important;
    color: var(--primary-color) !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
    border-color: #34d399 !important;
}

.configuracao-base-box {
    background: var(--table-header-bg, #f8fafc);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 6px !important;
    padding: 12px;
    margin-bottom: 15px;
}

/* ======================================================= */
/* VENDEDORES: MICRO-SCROLL (EVITA SCROLL NO MODAL)        */
/* ======================================================= */
.vendedores-container-wrapper {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #cbd5e1);
    border-radius: 6px !important;
    display: flex;
    flex-direction: column;
}

.vendedores-toolbar {
    display: flex;
    gap: 10px;
    padding: 8px 10px !important;
    background: var(--table-header-bg, #f8fafc);
    border-bottom: 1px solid var(--card-border, #e2e8f0);
    align-items: center;
    justify-content: space-between;
}

.busca-vendedor-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg, #ffffff);
    border: 1px solid var(--input-border, #cbd5e1);
    border-radius: 6px !important;
    padding: 0 10px;
    flex: 1;
    height: 32px !important;
}

.busca-vendedor-wrapper input {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 8px !important;
    height: 100% !important;
    width: 100%;
    outline: none;
    color: var(--title-color, #334155);
    font-size: 0.85rem;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    height: 32px !important;
}

.vendedores-lista-scroll {
    height: 160px;
    overflow-y: auto;
}

.vendedor-linha-compacta {
    display: flex;
    align-items: center;
    padding: 6px 12px !important;
    border-bottom: 1px solid var(--table-border, #f1f5f9);
    cursor: pointer;
    transition: background 0.2s;
}

.vendedor-linha-compacta:last-child {
    border-bottom: none;
}

.vendedor-linha-compacta:hover {
    background: var(--table-header-bg, #f8fafc);
}

.vendedor-linha-compacta:has(input[type="checkbox"]:checked) {
    background: rgba(16, 185, 129, 0.05);
}

.vendedor-linha-compacta input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    margin-right: 12px;
    cursor: pointer;
}

.vendedor-avatar-sm {
    width: 24px;
    height: 24px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-right: 10px;
}

.vendedor-linha-compacta:has(input[type="checkbox"]:checked) .vendedor-avatar-sm {
    background: var(--primary-color);
    color: #ffffff;
}

.empty-state-vendedores {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ======================================================= */
/* CARDS DE MODELO DE REGRA E FAIXAS PROGRESSIVAS          */
/* ======================================================= */
.rule-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rule-card {
    cursor: pointer;
    margin: 0;
}

.rule-card input[type="radio"] {
    display: none;
}

.rule-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 6px !important;
    transition: all 0.2s ease;
    height: 100%;
    box-sizing: border-box;
}

.rule-card:hover .rule-card-content {
    border-color: #cbd5e1;
    background: var(--table-header-bg, #f8fafc);
}

.rule-card input[type="radio"]:checked+.rule-card-content {
    border-color: var(--primary-color);
    background: rgba(105, 190, 157, 0.05);
}

.rule-icon {
    width: 32px;
    height: 32px;
    background: var(--table-header-bg, #f1f5f9);
    color: var(--subtitle-color, #64748b);
    border-radius: 6px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.rule-card input[type="radio"]:checked+.rule-card-content .rule-icon {
    background: var(--primary-color);
    color: #ffffff;
}

.rule-card-content strong {
    display: block;
    font-size: 0.85rem;
    color: var(--title-color, #1e293b);
    margin-bottom: 2px;
}

.rule-card-content span {
    display: block;
    font-size: 0.7rem;
    color: var(--subtitle-color, #64748b);
    line-height: 1.2;
}

.box-regra-detalhe {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #cbd5e1);
    border-radius: 6px !important;
    padding: 15px;
}

.btn-remover-inline {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    border: none;
    cursor: pointer;
    background: #fee2e2;
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0 !important;
}

.btn-remover-inline:hover {
    background: #fecaca;
}

/* CAIXA DE FAIXAS COM SCROLL FIXO */
.box-faixas-scroll {
    height: 240px;
    overflow-y: auto;
    border: 1px solid var(--card-border, #cbd5e1);
    border-radius: 6px !important;
    background: var(--input-bg, #ffffff);
    width: 100%;
}

/* ======================================================= */
/* FOOTER FIXO PADRONIZADO DOS MODAIS                      */
/* ======================================================= */
.form-buttons-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px !important;
    background: var(--card-bg, #ffffff);
    border-top: 1px solid var(--card-border, #e2e8f0);
    flex-shrink: 0;
}

.btn-cancelar-outline {
    background: transparent !important;
    color: #ef4444 !important;
    /* Padrão Vermelho em Cancelar */
    border: 1px solid #fecaca !important;
    height: 34px !important;
    padding: 0 20px !important;
    border-radius: 6px !important;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-cancelar-outline:hover {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #ef4444 !important;
}

[data-theme="dark"] .btn-cancelar-outline:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.btn-avancar-primary {
    background: var(--primary-color) !important;
    color: white !important;
    border: none;
    height: 34px !important;
    padding: 0 20px !important;
    border-radius: 6px !important;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-avancar-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Exceção ao botão Limpar Filtros que fica cinza */
#btnLimparFiltrosDrawer {
    color: var(--subtitle-color, #64748b) !important;
    border-color: var(--input-border, #cbd5e1) !important;
    background: transparent !important;
}

#btnLimparFiltrosDrawer:hover {
    background: var(--table-header-bg, #f8fafc) !important;
    color: var(--title-color, #334155) !important;
    border-color: #94a3b8 !important;
}

/* ======================================================= */
/* TABELA DE ALTA DENSIDADE (MODAL DETALHES E REGRAS)      */
/* ======================================================= */
.tabela-grid-moderna {
    width: 100%;
    border-collapse: collapse;
}

.tabela-grid-moderna th {
    position: sticky;
    top: 0;
    background-color: var(--table-header-bg, #f8fafc);
    padding: 10px 15px !important;
    text-align: left;
    border-bottom: 2px solid var(--card-border, #e2e8f0);
    font-weight: 700;
    color: var(--subtitle-color, #475569);
    text-transform: uppercase;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px;
    z-index: 10;
    white-space: nowrap;
}

.tabela-grid-moderna td {
    padding: 10px 15px !important;
    border-bottom: 1px solid var(--table-border, #f1f5f9);
    color: var(--title-color, #334155);
    vertical-align: middle;
    font-size: 0.85rem !important;
    transition: background 0.2s;
}

.tabela-grid-moderna tbody tr:hover td {
    background-color: rgba(16, 185, 129, 0.05);
}

.tabela-grid-moderna.ultra-densa th,
.tabela-grid-moderna.ultra-densa td {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
}

.tabela-grid-moderna.ultra-densa input {
    padding: 0 6px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
}

[data-theme="dark"] .consulta-title-group p {
    border-color: var(--card-border) !important;
}

/* ======================================================= */
/* RESPONSIVIDADE MOBILE                                   */
/* ======================================================= */
@media (max-width: 1024px) {

    .comissoes-content,
    #sidebar-container:has(.sidebar.collapsed)~.comissoes-content,
    .sidebar.collapsed~.comissoes-content,
    .sidebar.collapsed+.top-header+.comissoes-content {
        margin-left: 0 !important;
        padding-top: 80px !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .comissoes-content {
        padding: 80px 10px 15px 10px !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    .cabecalho-comissoes {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .consulta-title-group {
        align-items: center !important;
        text-align: center !important;
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .consulta-title-group h1 {
        justify-content: center !important;
        width: 100%;
        font-size: 1.5rem !important;
    }

    .consulta-title-group p {
        text-align: center !important;
        border-left: none !important;
        padding-left: 0 !important;
        font-size: 0.95rem;
    }

    .botoes-header-container {
        width: 100%;
        flex-direction: column;
    }

    .btn-nova-meta {
        width: 100%;
        justify-content: center;
    }

    /* FILTROS BÁSICOS */
    .filtro-pesquisa-basica {
        flex-direction: column;
        align-items: stretch;
        padding: 15px !important;
        gap: 15px;
    }

    .filtros-basicos-linha {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .filtros-basicos-linha .form-group {
        width: 100% !important;
    }

    .checkboxes-basicos {
        margin-bottom: 0 !important;
    }

    .botoes-pesquisa-linha {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .btn-pesquisar {
        flex: 1;
        justify-content: center;
    }

    /* TABELA COM ROLAGEM HORIZONTAL */
    .painel-gestao-comissoes,
    .tabela-container {
        overflow-x: auto !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch !important;
        border: 1px solid var(--card-border) !important;
    }

    .tabela-excel {
        min-width: 900px !important;
    }

    .tabela-excel td {
        white-space: nowrap !important;
    }

    /* MODAIS PARA MOBILE */
    .popup-content-large {
        height: 95vh !important;
        padding: 0 !important;
        overflow-y: auto !important;
        display: block !important;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header-modern {
        padding: 15px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 20 !important;
    }

    .modal-header-modern h2 {
        font-size: 1.2rem !important;
        white-space: normal !important;
    }

    /* Wizard Steps: form-grid para column */
    .form-grid-loja {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    .box-regra-detalhe {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .box-regra-detalhe>div {
        width: 100% !important;
        flex: none !important;
    }

    .form-buttons-modern {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 15px !important;
    }

    .form-buttons-modern>div {
        flex-direction: column !important;
        width: 100% !important;
    }

    .form-buttons-modern button {
        width: 100% !important;
        justify-content: center !important;
    }
}