/* ── ADS PAGE VARS ── */
:root {
    --primary: #19253f;
    --accent: #19253f;
    --accent-light: #eef1ff;
    --bg: #F0F0F0;
    --card-bg: #ffffff;
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --kpi-bg-neutral: #f3f4f6;
    --kpi-icon-neutral: #374151;
    --shopee: #111827
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

.ads-content,
.ads-topbar,
.ads-table,
.ads-modal-box,
.ml-period-menu,
button,
input,
select {
    font-family: 'Montserrat', sans-serif;
}

#histList {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#histList>div {
    flex: 1;
    /* Isso diz: "estique para preencher o vazio" */
    display: flex;
    align-items: center;
    /* Mantém o texto e o ícone centralizados na linha */
    padding: 0 8px !important;
    margin: 0 !important;
    border-bottom: 1px solid #f0f2f5;
    /* Linha sutil para separar os itens */
}

/* 3. Tira a linha do último item para o acabamento ficar perfeito */
#histList>div:last-child {
    border-bottom: none;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    /* Mude de hidden para visible */
    min-width: 0;
}

/* ── TOPBAR ── */
.ads-topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

.ads-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ads-page-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff0ed;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.ads-page-title {
    font-size: 17px;
    font-weight: 800;
}

.ads-breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
}

.ads-breadcrumb span {
    color: var(--text);
    font-weight: 600;
}

.ads-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* loja selector */
.loja-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 12px;
}

.loja-selector label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.loja-selector select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    outline: none;
}

/* auto toggle */
.auto-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 14px;
}

.auto-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: #e2e8f0;
    transition: background .2s;
}

.toggle-switch input:checked+.toggle-track {
    background: var(--success);
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.toggle-switch input:checked~.toggle-knob {
    transform: translateX(18px);
}

.auto-status {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.auto-status.on {
    color: var(--success);
}

/* btn */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.btn .material-symbols-rounded {
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: #243460;
}

.btn-shopee {
    background: var(--shopee);
    color: #fff;
    border-color: var(--shopee);
}

.btn-shopee:hover {
    background: #d93d1f;
}

.btn-danger {
    color: var(--danger);
    border-color: #fecaca;
}

.btn-danger:hover {
    background: #fff5f5;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

/* ── CONTENT ── */
.ads-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* ── ALERT ── */
.ads-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid var(--warning);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 13px;
}

.ads-alert.hidden {
    display: none;
}

.ads-alert strong {
    color: var(--warning);
}

/* ── KPI STRIP ── */
.ads-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .ads-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ads-kpi {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color .2s, box-shadow .2s;
}

.ads-kpi:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 10px rgba(17, 24, 39, .05);
}

.ads-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--kpi-bg-neutral) !important;
    filter: grayscale(1) contrast(1.1);
    opacity: .85;
}

.ads-kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}

.ads-kpi-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.ads-kpi-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── GRID ── */
.ads-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

@media (max-width: 1100px) {
    .ads-grid {
        grid-template-columns: 1fr;
    }
}

/* ── CARD ── */
.ads-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.ads-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
}

.ads-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ads-card-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    flex-shrink: 0;
}

/* ── SCHEDULE TABLE ── */
table.ads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.ads-table thead {
    background: #f8fafc;
}

table.ads-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .7px;
    border-bottom: 1px solid var(--border);
}

table.ads-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}

table.ads-table tbody tr:hover {
    background: #fafbfd;
}

table.ads-table tbody tr:last-child {
    border-bottom: none;
}

table.ads-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.horario-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 7px;
    font-family: monospace;
}

.budget-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}

.budget-input {
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    width: 90px;
    background: #f8fafc;
    outline: none;
    transition: border-color .2s;
    display: none;
}

.budget-input:focus {
    border-color: var(--info);
}

/* próximo destaque */
table.ads-table tbody tr.next-row {
    background: #fffbeb;
}

table.ads-table tbody tr.next-row .horario-badge {
    background: var(--warning);
}

/* status pill */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.pill-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.pill-muted {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px solid var(--border);
}

.pill-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

/* inline edit row */
.edit-actions {
    display: flex;
    gap: 6px;
}

/* ── SIDE PANELS ── */
.ads-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* execução manual */
.manual-exec {
    padding: 20px;
}

.manual-exec label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    display: block;
    margin-bottom: 6px;
}

.manual-exec input[type=number] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    background: #f8fafc;
    outline: none;
    transition: border-color .2s;
    margin-bottom: 12px;
}

.manual-exec input:focus {
    border-color: var(--info);
}

.manual-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* historico mini */
.hist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}

.hist-item:last-child {
    border-bottom: none;
}

.hist-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.hist-info {
    flex: 1;
    min-width: 0;
}

.hist-hora {
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
}

.hist-budget {
    font-weight: 700;
    color: var(--primary);
}

.hist-time {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* add form */
.add-form {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: none;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.add-form.open {
    display: flex;
}

.add-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.add-form-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.add-form-field input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
    background: #f8fafc;
}

.add-form-field input:focus {
    border-color: var(--info);
}

/* toast */
.ads-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 600;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    transform: translateY(60px);
    opacity: 0;
    transition: all .25s;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ads-toast.show {
    transform: none;
    opacity: 1;
}

.ads-toast.success {
    border-left: 3px solid var(--success);
}

.ads-toast.error {
    border-left: 3px solid var(--danger);
}

/* modal */
.ads-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .35);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.ads-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.ads-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    transform: scale(.96);
    transition: transform .2s;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
}

.ads-overlay.open .ads-modal {
    transform: scale(1);
}

.ads-modal h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}

.ads-modal p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.ads-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 15px;
    transition: all .15s;
}

.ads-modal-close:hover {
    border-color: #94a3b8;
}

.ads-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state .ei {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: .4;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}


/* Tabela de produtos — altura máxima com scroll */
#prodTbody-wrap {
    max-height: 600px;
    overflow-y: auto;
}

/* Limita largura da tabela de produtos */
#prodTbody-wrap table {
    min-width: 600px;
    /* largura mínima para não quebrar */
}


#bulkActionsBar {
    /* Garante que a barra acompanhe exatamente a largura da tabela abaixo dela */
    position: relative;
    /* Importante para o z-index funcionar */
    z-index: 100;
    /* Garante que a barra fique acima do card debaixo */
    display: none;
    transition: all 0.3s ease;
    animation: slideDown 0.2s ease-out;
}


/* Cursor de mãozinha nos checkboxes e labels */
.shopee-checkbox,
.prod-checkbox,
#selectAllProd,
.toggle-switch,
.btn-bulk {
    cursor: pointer !important;
}

/* Garante que o checkbox mestre no topo também mude o cursor */
th input[type="checkbox"] {
    cursor: pointer;
}

/* Container do Menu */
.bulk-dropdown-content.shopee-style {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999 !important;
    /* Valor bem alto para ignorar tudo */
    background: #fff;
    border: 1px solid #dcdcdc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 4px 0;
    min-width: 150px;
}

/* Itens do Menu */
.shopee-style .dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    /* Padding generoso nas laterais */
    text-align: left;
    background: none;
    border: none;
    font-size: 14px;
    color: #333333;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    cursor: pointer;
    transition: background 0.2s;
}

/* Efeito ao passar o mouse */
.shopee-style .dropdown-item:hover:not(.disabled) {
    background-color: #f5f5f5;
}

/* Estado Desativado (O Resumir e Iniciar Agora da foto) */
.shopee-style .dropdown-item.disabled {
    color: #cccccc;
    cursor: not-allowed;
}

/* Remove qualquer borda azul ao clicar no botão */
.btn-bulk:focus {
    outline: none;
}

/* Pequena animação para ficar suave igual na Shopee */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-bulk {
    background: #fff;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-bulk:hover {
    border-color: #94a3b8;
    color: var(--primary);
}

/* Overlay que escurece o fundo */
.ads-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Caixa do Modal */
.ads-modal-box {
    background: white;
    width: 450px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.ads-modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 500;
    font-size: 16px;
}

.ads-modal-body {
    padding: 20px;
}

/* Radio Buttons Estilizados */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
}

.radio-item input:checked+.radio-mark {
    border-color: var(--primary);
}

.radio-item input:checked+.radio-mark::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
}

/* Input de Orçamento */
.shopee-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    margin-left: 28px;
    /* Alinha embaixo do texto do radio */
}

.currency-label {
    color: #999;
    border-right: 1px solid #eee;
    padding-right: 10px;
    margin-right: 10px;
}

#bulkBudgetInput {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

/* Footer e Botões */
.ads-modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fcfcfc;
    border-top: 1px solid #f0f0f0;
}

.btn-cancel {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 2px;
    cursor: pointer;
}

.btn-confirm {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 25px;
    border-radius: 2px;
    font-weight: bold;
    cursor: pointer;
}

.btn-confirm:hover {
    background: var(--primary-dark);
}

/* Botão fechar (X) estilo Shopee */
.close-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #666;
}

.close-btn .material-symbols-rounded {
    font-size: 20px;
}


.btn-acao-circ {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Esconder o input inicialmente se necessário */
.shopee-input-group {
    display: flex;
    /* Começa flex pois o 'Manual' está checked por padrão */
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 8px 12px;
    margin-left: 28px;
    transition: all 0.2s ease-in-out;
}

/* Efeito de foco no input igual da Shopee */
.shopee-input-group:focus-within {
    border-color: var(--primary);
}


/* Estilo das etiquetas (Badges) */
.shopee-badge-outline {
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
}

.shopee-badge-outline.blue {
    color: #2673dd;
    border-color: #2673dd;
    background-color: #f0f5ff;
}

.shopee-badge-outline.orange {
    color: #ee4d2d;
    border-color: #ee4d2d;
    background-color: #fff5f2;
}



/* Container da busca */
.log-search {
    display: flex;
    align-items: center;
    background-color: #f5f6f8;
    /* Fundo cinza bem moderno */
    border: 1px solid #e4e6eb;
    /* Borda sutil */
    border-radius: 6px;
    /* Cantos arredondados */
    padding: 6px 12px;
    width: 260px;
    /* Um pouco mais larga para caber o texto */
    transition: all 0.2s ease;
    /* Animação suave */
}

/* Efeito de foco: quando o usuário clica para digitar */
.log-search:focus-within {
    background-color: #ffffff;
    border-color: var(--primary);
    /* Laranja estilo Shopee */
    box-shadow: 0 0 0 3px rgba(238, 77, 45, 0.1);
    /* "Brilho" em volta */
}

/* Estilo do ícone da lupa */
.log-search .material-symbols-rounded {
    color: #888;
    font-size: 18px;
    margin-right: 8px;
}

/* Limpando o visual feio padrão do input */
.log-search input {
    border: none;
    background: transparent;
    outline: none;
    /* Tira a borda azul feia do navegador */
    width: 100%;
    font-size: 13px;
    color: #333;
}

/* Cor do texto de placeholder */
.log-search input::placeholder {
    color: #aeb0b5;
}


.metrica-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 0;
    cursor: pointer;
}

.metrica-check input {
    cursor: pointer;
}

/* ── PAGINATION ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* ← muda de space-between para flex-end */
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px 16px;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pagination-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    /* ← adiciona isso */
}

.page-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}


.page-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}


.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn span {
    font-size: 1rem;
}


#viewNosso .kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 16px;
}

#viewNosso .met-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    transition: border-color .15s, transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 118px;
}

#viewNosso .met-card:hover {
    border-color: #d1d5db;
    transform: translateY(-1px);
}

#viewNosso .met-card-blue {
    border-color: #3b82f6;
}

#viewNosso .met-card-yellow {
    border-color: #f59e0b;
}

#viewNosso .met-card-green {
    border-color: #10b981;
}

#viewNosso .met-card-red {
    border-color: #ef4444;
}

#viewNosso .met-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
    text-align: center;
}

#viewNosso .met-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    line-height: 1.2;
}

#viewNosso .met-value.green,
#viewNosso .met-value.orange,
#viewNosso .met-value.purple {
    color: var(--text);
}

/* ── Toggle botão ML ── */
.ads-kpi-ml-toggle {
    border: 1.5px dashed #d1d5db;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
}

.ads-kpi-ml-toggle:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 10px rgba(17, 24, 39, .06);
}

/* ── Vista estilo ML ── */
.ml-metricas-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

@media (max-width: 1200px) {
    .ml-metricas-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .ml-metricas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ml-met-card {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid transparent;
    border-radius: 12px;
    padding: 16px;
    transition: border-color .15s;
    min-width: 0;
}

.ml-met-card.ml-met-active {
    border-top-color: #9ca3af;
    background: #fafafa;
}

.ml-met-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ml-info-icon {
    font-size: 11px;
    color: #9ca3af;
    cursor: pointer;
    flex-shrink: 0;
}

.ml-tooltip-popup {
    position: fixed;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
    padding: 10px 12px;
    border-radius: 8px;
    max-width: 280px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
    pointer-events: none;
}

.ml-met-value {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
}

.ml-met-value.purple,
.ml-met-value.green,
.ml-met-value.orange {
    color: var(--text);
}

/* ── Dropdowns de período / comparar / métricas ── */
.ml-period-wrap {
    position: relative;
}

.ml-period-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: border-color .15s;
    white-space: nowrap;
}

.ml-period-btn:hover {
    border-color: #94a3b8;
}

.ml-period-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 999;
    min-width: 200px;
    padding: 6px 0;
}

.ml-period-menu.open {
    display: block;
}

.ml-period-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ml-period-item:hover {
    background: #f8fafc;
}

.ml-period-item-active {
    color: #3b82f6;
    font-weight: 600;
}

.ml-period-range {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.ml-metrics-menu {
    min-width: 200px;
    padding: 8px 0;
}

.ml-metric-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}

.ml-metric-check:hover {
    background: #f8fafc;
}

.ml-metric-check input {
    width: 15px;
    height: 15px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.ml-metric-disabled {
    opacity: .45;
    pointer-events: none;
}

.status-chip.ativo {
    background: var(--green-soft);
    color: var(--green);
}

.status-chip.ativo .status-dot {
    background: var(--green);
}

.status-chip.inativo {
    background: #fee2e2;
    color: var(--red);
}

.status-chip.inativo .status-dot {
    background: var(--red);
}

.status-chip.status-ativo {
    background: var(--green-soft);
    color: var(--green);
}

.status-chip.status-ativo .status-dot {
    background: var(--green);
}

.status-chip.status-inativo {
    background: #fee2e2;
    color: var(--red);
}

.status-chip.status-inativo .status-dot {
    background: var(--red);
}

/* Garante o distanciamento das linhas (verifique se a tag <table> superior já tem essas propriedades) */
table {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
}

/* Zera formatações antigas do TR */
tr.row-card {
    background-color: transparent !important;
    border: none !important;
}

/* 1. Fundo branco e bordas marcadas no topo/base de todas as células */
tr.row-card td {
    background-color: #ffffff;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    transition: background-color 0.2s ease;
}

/* 2. Arredonda e fecha a lateral esquerda do card */
tr.row-card td:first-child {
    border-left: 1px solid #cbd5e1;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

/* 3. Arredonda e fecha a lateral direita do card */
tr.row-card td:last-child {
    border-right: 1px solid #cbd5e1;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* 4. Cor de fundo especial para anúncios pausados (Substitui o '#fafafa' inline) */
tr.row-card.row-pausada td {
    background-color: #f8fafc;
    /* Um cinza muito suave para indicar inatividade */
}

/* Efeito Hover opcional para destacar a linha quando o mouse passa */
tr.row-card:hover td {
    background-color: #f1f5f9;
}


.sk {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    height: 14px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.sk-badge {
    width: 80px;
    height: 22px;
    border-radius: 20px;
}

.sk-text {
    width: 70%;
}

.sk-long {
    width: 90%;
}

.sk-btn {
    width: 60px;
    height: 28px;
    border-radius: 8px;
}

.skeleton-row td {
    padding: 12px 8px;
}