/* =============================================================
   IntegraROI — estilos base (Bootstrap 5.3 + ajustes próprios)
   ============================================================= */

:root {
    --ir-sidebar-bg: #0b1220;
    --ir-sidebar-fg: #cbd5e1;
    --ir-sidebar-muted: #64748b;
    --ir-sidebar-active-bg: rgba(20, 184, 166, 0.14);
    --ir-sidebar-active-fg: #5eead4;
    --ir-sidebar-width: 260px;
    --ir-accent: #0f766e;
    --ir-page-bg: #f4f6f9;
    --ir-card-border: #e5e8ee;

    --bs-primary: #0f766e;
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: #0f766e;
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: #115e59;
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.btn-primary {
    --bs-btn-bg: #0f766e;
    --bs-btn-border-color: #0f766e;
    --bs-btn-hover-bg: #115e59;
    --bs-btn-hover-border-color: #115e59;
    --bs-btn-active-bg: #134e4a;
    --bs-btn-active-border-color: #134e4a;
    --bs-btn-disabled-bg: #0f766e;
    --bs-btn-disabled-border-color: #0f766e;
}

.btn-outline-primary {
    --bs-btn-color: #0f766e;
    --bs-btn-border-color: #0f766e;
    --bs-btn-hover-bg: #0f766e;
    --bs-btn-hover-border-color: #0f766e;
    --bs-btn-active-bg: #115e59;
    --bs-btn-active-border-color: #115e59;
}

.form-control:focus {
    border-color: #5eead4;
    box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .2);
}

body.app-body {
    background: var(--ir-page-bg);
    min-height: 100vh;
}

/* ---------------------------------------------------------- shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0; /* permite tabelas com scroll horizontal dentro do flex */
    display: flex;
    flex-direction: column;
}

.app-content {
    padding: 1.5rem;
    flex: 1 0 auto;
}

@media (max-width: 575.98px) {
    .app-content { padding: 1rem; }
}

/* ---------------------------------------------------------- sidebar */
.app-sidebar {
    background: var(--ir-sidebar-bg);
    color: var(--ir-sidebar-fg);
    --bs-offcanvas-width: var(--ir-sidebar-width);
    --bs-offcanvas-bg: var(--ir-sidebar-bg);
    --bs-offcanvas-color: var(--ir-sidebar-fg);
}

@media (min-width: 992px) {
    .app-sidebar-wrap {
        width: var(--ir-sidebar-width);
        flex: 0 0 var(--ir-sidebar-width);
        position: sticky;
        top: 0;
        height: 100vh;
        background: var(--ir-sidebar-bg);
        color: var(--ir-sidebar-fg);
    }
    .app-sidebar {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    .app-sidebar .offcanvas-body {
        overflow-y: auto;
    }
}

.app-sidebar__brand {
    padding: .9rem .75rem 1.25rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

/* Botão de recolher o menu (desktop) */
.app-sidebar__collapse {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--ir-sidebar-fg);
    font-size: 1.1rem;
}
.app-sidebar__collapse:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.app-sidebar__collapse:focus-visible { outline: 2px solid var(--ir-sidebar-active-fg); outline-offset: 2px; }

/* Menu recolhido: só ícones (desktop). O estado vem do cookie ir_sidebar, aplicado no <body> pelo servidor. */
@media (min-width: 992px) {
    .app-sidebar-wrap { transition: width .18s ease, flex-basis .18s ease; }
    .sidebar-collapsed { --ir-sidebar-width: 72px; }
    .sidebar-collapsed .app-sidebar-wrap { z-index: 1035; } /* painel dos submenus acima do conteúdo e do topo fixo */
    .sidebar-collapsed .app-sidebar__brand { justify-content: center; padding-left: 0; padding-right: 0; }
    .sidebar-collapsed .app-sidebar__brand .app-brand,
    .sidebar-collapsed .app-nav__label,
    .sidebar-collapsed .app-user__meta { display: none; }
    .sidebar-collapsed .app-sidebar__collapse .bi { transform: scaleX(-1); }
    .sidebar-collapsed .app-sidebar__body { padding-left: .5rem; padding-right: .5rem; }
    .sidebar-collapsed .app-sidebar .offcanvas-body { overflow: visible; }
    .sidebar-collapsed .app-nav .nav-link,
    .sidebar-collapsed .app-logout { justify-content: center; padding-left: 0; padding-right: 0; position: relative; }
    .sidebar-collapsed .app-nav .nav-link .bi,
    .sidebar-collapsed .app-logout .bi { font-size: 1.2rem; }
    .sidebar-collapsed .app-nav__badge { position: absolute; top: .1rem; right: .2rem; font-size: .6rem; padding: .2em .4em; }
    .sidebar-collapsed .app-user { justify-content: center; padding-left: 0; padding-right: 0; }

    /* Submenus viram um painel ao passar o mouse sobre o ícone */
    .sidebar-collapsed .app-nav > .nav-item { position: relative; }
    .sidebar-collapsed .app-nav__sub {
        display: none;
        position: absolute;
        top: 0;
        left: 100%;
        margin: 0 0 0 .4rem;
        min-width: 190px;
        padding: .4rem;
        background: var(--ir-sidebar-bg);
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: .5rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
        z-index: 1040;
    }
    .sidebar-collapsed .app-nav__sub::before { content: ""; position: absolute; top: 0; bottom: 0; left: -.5rem; width: .5rem; }
    .sidebar-collapsed .app-nav > .nav-item:hover > .app-nav__sub,
    .sidebar-collapsed .app-nav > .nav-item:focus-within > .app-nav__sub { display: block; }
    .sidebar-collapsed .app-nav__sub .nav-link { justify-content: flex-start; padding: .4rem .7rem; }
}

.app-sidebar__header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.app-sidebar__body {
    display: flex;
    flex-direction: column;
    padding: .75rem;
    flex: 1 1 auto;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.15rem;
    letter-spacing: .01em;
}
.app-brand:hover { color: #fff; }
.app-brand strong { color: var(--ir-sidebar-active-fg); font-weight: 700; }

.app-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--ir-sidebar-fg);
    border-radius: .5rem;
    padding: .55rem .75rem;
    font-size: .925rem;
}
.app-nav .nav-link .bi { font-size: 1.05rem; opacity: .85; }
.app-nav .nav-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.app-nav .nav-link.active {
    background: var(--ir-sidebar-active-bg);
    color: var(--ir-sidebar-active-fg);
    font-weight: 600;
}
.app-nav .nav-link.disabled { color: var(--ir-sidebar-muted); }

.app-nav__sub { margin: .1rem 0 .35rem 2.05rem; }
.app-nav__sub .nav-link { padding: .3rem .6rem; font-size: .85rem; color: #94a3b8; }
.app-nav__sub .nav-link.disabled { color: #475569; }

.app-badge-soon {
    font-size: .65rem;
    font-weight: 500;
    background: rgba(148, 163, 184, .12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, .2);
}

.app-sidebar__footer {
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding-top: .75rem;
    margin-top: .75rem;
}

.app-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .25rem .75rem .6rem;
    min-width: 0;
}
.app-user__avatar {
    flex: 0 0 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--ir-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: .9rem;
}
.app-user__meta { display: flex; flex-direction: column; min-width: 0; }
.app-user__name { color: #fff; font-size: .875rem; font-weight: 600; }
.app-user__email {
    color: var(--ir-sidebar-muted);
    font-size: .75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-logout {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    background: none;
    border: 0;
    color: var(--ir-sidebar-fg);
    border-radius: .5rem;
    padding: .55rem .75rem;
    font-size: .925rem;
    text-align: left;
}
.app-logout:hover { background: rgba(248, 113, 113, .1); color: #fca5a5; }

/* ---------------------------------------------------------- topbar */
.app-topbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--ir-card-border);
    position: sticky;
    top: 0;
    z-index: 1020;
}
.app-topbar__title { font-size: 1.2rem; font-weight: 600; margin: 0; }
.app-topbar__toggle { color: #0f172a; font-size: 1.5rem; padding: 0 .25rem; line-height: 1; }

@media (max-width: 575.98px) {
    .app-topbar { padding: .75rem 1rem; }
}

/* ---------------------------------------------------------- cards */
.card {
    border-color: var(--ir-card-border);
    border-radius: .75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.kpi-card__head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .75rem;
}
.kpi-card__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .6rem;
    display: grid;
    place-items: center;
    background: rgba(15, 118, 110, .09);
    color: var(--ir-accent);
    font-size: 1.1rem;
}
.kpi-card__label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #475569;
    margin: 0;
}
.kpi-card__value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 .25rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.kpi-card__hint { font-size: .78rem; color: #64748b; margin: 0; }

.app-empty-alert { border-radius: .75rem; background: #fff; }

.app-table thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    font-weight: 600;
    background: #f8fafc;
    white-space: nowrap;
}
.app-table td, .app-table th { padding: .65rem 1rem; }

/* ---------------------------------------------------------- integrações */
.integration-card__icon {
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    border-radius: .75rem;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    background: #f1f5f9;
    color: #334155;
}
.integration-card__icon--google { background: #e8f0fe; color: #1a73e8; }
.integration-card__icon--meta { background: #e7f0ff; color: #0866ff; }
.integration-card__icon--gam { background: #e6f4ea; color: #188038; }

.integration-status { font-weight: 500; padding: .45em .7em; }
.integration-status .bi { margin-right: .15rem; }

.integration-card__meta { margin: 0; }
.integration-card__meta > div {
    display: flex;
    justify-content: space-between;
    padding: .35rem 0;
    border-bottom: 1px dashed #e2e8f0;
}
.integration-card__meta dt { font-weight: 400; color: #64748b; }
.integration-card__meta dd { margin: 0; font-weight: 600; color: #0f172a; }

/* ---------------------------------------------------------- auth */
body.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(20, 184, 166, .18), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(15, 118, 110, .16), transparent 60%),
        #0b1220;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
.auth-brand strong { color: #5eead4; }

.auth-card {
    width: 100%;
    max-width: 400px;
    border: 0;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .35);
}
.auth-card .card-body { padding: 2rem; }

.auth-footnote { color: #64748b; font-size: .8rem; margin-top: 1.5rem; }

.app-error-detail { white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; }

/* ---------------------------------------------------------- relatórios */
.app-content .table-responsive { position: relative; } /* contém os .visually-hidden (absolutos) no recorte da rolagem */
.report-table td, .report-table th { vertical-align: top; }
.report-table .sub {
    font-size: .78rem;
    color: #64748b;
    margin-top: .15rem;
}
.report-source {
    flex: 0 0 1.75rem;
    height: 1.75rem;
    border-radius: .45rem;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #475569;
    font-size: .9rem;
}
.report-table.app-table td, .report-table.app-table th { padding: .55rem .6rem; }
.report-campaign { min-width: 280px; max-width: 380px; }
.report-campaign a { overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .report-campaign { min-width: 190px; } }
.min-w-0 { min-width: 0; }
.report-units > td { background: #f8fafc; padding: .5rem 1rem 1rem; }
.report-total th, .report-total td { --bs-table-bg: #e2e8f0; font-weight: 600; border-top: 2px solid #94a3b8; }

.roi-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .78rem;
    font-weight: 600;
    padding: .2rem .45rem;
    border-radius: .4rem;
    font-variant-numeric: tabular-nums;
}
.roi-badge--neg  { background: #e53935; color: #fff; }
.roi-badge--zero { background: #b0b8c4; color: #1f2937; }
.roi-badge--low  { background: #e6f000; color: #1f2937; }
.roi-badge--mid  { background: #6c5ce7; color: #fff; }
.roi-badge--good { background: #43c52b; color: #fff; }
.roi-badge--top  { background: linear-gradient(135deg, #f6d44a 0%, #e5b100 55%, #c99400 100%); color: #3b2a00; }
.roi-badge--na   { background: #e2e8f0; color: #475569; }

.settings-pct { max-width: 220px; }

/* Relatório: faixas alternadas, cabeçalho escuro, ROI colorido por célula */
.report-table thead th {
    background: #334155;
    color: #f8fafc;
    border-color: #334155;
}
.report-table thead th .fw-normal { color: #cbd5e1; }
.report-row--alt > td, .report-row--alt > th { --bs-table-bg: #eef2f7; }
.report-units > td { --bs-table-bg: #f8fafc; }
.report-units.report-row--alt > td { --bs-table-bg: #e6ebf2; }
.report-units .table thead th { background: transparent; color: #64748b; border-color: #e2e8f0; }
.report-table .sub {
    display: table;
    margin-left: auto;
    background: rgba(51, 65, 85, .07);
    border-radius: .25rem;
    padding: 0 .3rem;
}
.report-table .text-center .sub, .report-table .text-start .sub { margin-right: auto; }
.report-source--google { background: #e8f0fe; color: #1a73e8; }
.report-source--meta { background: #e7f0ff; color: #0866ff; }
.report-source--none { background: #f1f5f9; color: #94a3b8; }

.report-table .report-roi-head { width: 68px; }
.report-table td.roi-cell {
    width: 68px;
    min-width: 68px;
    padding-left: .3rem;
    padding-right: .3rem;
    font-size: .85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.roi-cell .bi { margin-right: .15rem; }
.roi-cell__net { font-size: .85rem; font-weight: 400; margin-top: .1rem; }
.roi-cell__label { font-size: .78rem; font-weight: 600; }
.report-table td.roi-cell--neg  { --bs-table-bg: #e53935; --bs-table-color: #fff; color: #fff; }
.report-table td.roi-cell--zero { --bs-table-bg: #b0b8c4; --bs-table-color: #1f2937; color: #1f2937; }
.report-table td.roi-cell--low  { --bs-table-bg: #e6f000; --bs-table-color: #1f2937; color: #1f2937; }
.report-table td.roi-cell--mid  { --bs-table-bg: #6c5ce7; --bs-table-color: #fff; color: #fff; }
.report-table td.roi-cell--good { --bs-table-bg: #43c52b; --bs-table-color: #fff; color: #fff; }
.report-table td.roi-cell--top  { --bs-table-bg: #e5b100; --bs-table-color: #3b2a00; color: #3b2a00;
    background-image: linear-gradient(135deg, #f6d44a 0%, #e5b100 55%, #c99400 100%); }
.report-table td.roi-cell--na   { --bs-table-bg: #e2e8f0; --bs-table-color: #475569; color: #475569; }
/* Poucos dados: mesma cor da faixa do ROI, só com a ampulheta no canto (listras removidas em 02/10/2026). */
.report-table td.roi-cell--small { position: relative; }
.report-table td.roi-cell--small .roi-cell__flag { position: absolute; top: 2px; right: 3px; font-size: .65rem; line-height: 1; opacity: .8; }

/* Meta de ROI: contorno escuro por dentro da célula + "▼ meta" (a cor da faixa continua a mesma) */
.report-table td.roi-cell--below { box-shadow: inset 0 0 0 3px rgba(15, 23, 42, .55); }
.roi-cell__goal { font-size: .68rem; font-weight: 600; margin-top: 2px; opacity: .9; }

/* Tendência de 7 dias (relatório de campanhas) */
.trend { display: inline-block; line-height: 1; color: #64748b; }
.trend svg { display: block; overflow: visible; }
.trend__zero { stroke: #cbd5e1; stroke-width: 1; stroke-dasharray: 2 2; }
.trend__line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.trend__dot { fill: currentColor; }
.trend__label { font-size: .72rem; margin-top: 2px; white-space: nowrap; }
.trend--up { color: #16803c; }
.trend--down { color: #c62828; }
.trend--flat { color: #64748b; }
.trend--none { color: #94a3b8; }
.trend--button { background: none; border: 0; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.trend--button:hover, .trend--button:focus-visible { background: rgba(15, 23, 42, .06); }
.trend-modal__chart { position: relative; height: 220px; }

/* ---------------------------------------------------------- dashboard */
.kpi-card--roi-neg  { border-top: 4px solid #e53935; }
.kpi-card--roi-zero { border-top: 4px solid #b0b8c4; }
.kpi-card--roi-low  { border-top: 4px solid #d4dc00; }
.kpi-card--roi-mid  { border-top: 4px solid #6c5ce7; }
.kpi-card--roi-good { border-top: 4px solid #43c52b; }
.kpi-card--roi-top  { border-top: 4px solid #e5b100; }
.kpi-change { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; font-weight: 600; margin-top: .5rem; }
.kpi-change__vs { font-weight: 400; color: #64748b; }
.kpi-change--good { color: #15803d; }
.kpi-change--bad { color: #b91c1c; }
.kpi-change--flat { color: #475569; }
.dash-chart { position: relative; width: 100%; }
.dash-chart--main { height: 320px; }
.dash-chart--roi { height: 170px; }
.dash-split__bar { height: .6rem; }
.dash-split__fill--google { background: #2a78d6; }
.dash-split__fill--meta { background: #0866ff; }
.dash-split__icon--google { color: #1a73e8; }
.dash-split__icon--meta { color: #0866ff; }
.sync-provider { font-size: 1.35rem; }
.sync-provider--google { color: #1a73e8; }
.sync-provider--meta { color: #0866ff; }
.sync-provider--gam { color: #188038; }
.sync-kpi--ok .bi { color: #198754; }
.sync-kpi--warning .bi { color: #b58105; }
.sync-kpi--danger .bi { color: #dc3545; }
.sync-issue { flex-basis: 16rem; }
.sync-result { min-width: 14rem; max-width: 34rem; }
.sync-result details summary { cursor: pointer; color: var(--bs-link-color); }
.report-shared { font-weight: 500; color: #475569; vertical-align: 1px; }
.report-source-cell { min-width: 15rem; max-width: 19rem; }
.report-share-head { min-width: 170px; }
.report-share__bar { height: .5rem; }
.report-share__fill { background: #0f766e; }
.dash-top-name { max-width: 0; width: 45%; }
.dash-top-name__link { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-roi-legend .roi-badge { font-size: .7rem; padding: .1rem .35rem; }
.w-0p { width: 0%; }
.w-5p { width: 5%; }
.w-10p { width: 10%; }
.w-15p { width: 15%; }
.w-20p { width: 20%; }
.w-25p { width: 25%; }
.w-30p { width: 30%; }
.w-35p { width: 35%; }
.w-40p { width: 40%; }
.w-45p { width: 45%; }
.w-50p { width: 50%; }
.w-55p { width: 55%; }
.w-60p { width: 60%; }
.w-65p { width: 65%; }
.w-70p { width: 70%; }
.w-75p { width: 75%; }
.w-80p { width: 80%; }
.w-85p { width: 85%; }
.w-90p { width: 90%; }
.w-95p { width: 95%; }
.w-100p { width: 100%; }
@media (max-width: 575.98px) { .dash-chart--main { height: 260px; } .dash-top-name { width: 34%; min-width: 88px; } .dash-top .report-table td, .dash-top .report-table th { padding-left: .4rem; padding-right: .4rem; } }

/* ---------------------------------------------------------- guia de configuração */
.guide-flow li { margin-bottom: .4rem; }
.guide-code-wrap { position: relative; }
.guide-code-wrap .guide-copy { position: absolute; top: .4rem; right: .4rem; background: #fff; }
.guide-code {
    background: #f1f5f9;
    border: 1px solid var(--ir-card-border);
    border-radius: .5rem;
    padding: .65rem .75rem;
    font-size: .8rem;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 0;
}
.guide-code-wrap .guide-code { padding-right: 6.5rem; }
.guide-code--block { word-break: normal; overflow-x: auto; white-space: pre; }
@media (min-width: 1200px) { .guide-sticky { position: sticky; top: 5rem; } }
.guide-gen-label { min-width: 0; }
.guide-copy { white-space: nowrap; flex: 0 0 auto; }

/* ---------------------------------------------------------- campanha: conjuntos e anúncios */
.campaign-tab-card { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }

/* Relatório: linha selecionada (clique) destaca os dados da plataforma de anúncio */
.report-table tbody tr.report-row { cursor: pointer; }
.report-table tbody tr.report-row.is-selected > td:not(.roi-cell) { --bs-table-bg: #e0f7fb; }
.report-table tr.report-row.is-selected .sub--platform {
    display: block;
    background: #2ec5e0;
    color: #fff;
    font-weight: 600;
    font-size: .82rem;
    margin: .35rem -.6rem -.55rem;
    padding: .35rem .6rem;
    border-radius: 0;
    text-align: right;
}
.report-table [data-tip] { cursor: help; }
.report-table tr.report-row [data-tip] { cursor: inherit; }

/* ---------------------------------------------------------- institucional (Sobre, Termos, Privacidade) */
.app-nav__heading { margin: .9rem .75rem .25rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ir-sidebar-muted); list-style: none; }
.sidebar-collapsed .app-nav__heading { margin: .6rem auto .2rem; width: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.legal-page { max-width: 820px; background: #fff; border: 1px solid var(--ir-card-border); border-radius: .75rem; padding: 2rem 2.25rem; line-height: 1.65; }
.legal-page h2 { font-size: 1.1rem; font-weight: 600; margin: 1.75rem 0 .6rem; }
.legal-page h3 { font-size: .95rem; font-weight: 600; margin: 1rem 0 .4rem; color: #334155; }
.legal-page section:first-of-type h2 { margin-top: .5rem; }
.legal-page ul, .legal-page ol { padding-left: 1.25rem; }
.legal-page li { margin-bottom: .35rem; }
.legal-lead { font-size: 1.05rem; color: #334155; }
.legal-meta { font-size: .85rem; color: #64748b; margin-bottom: 1rem; }
.legal-links { margin: 2rem 0 0; font-size: .9rem; }
@media (max-width: 575.98px) { .legal-page { padding: 1.25rem 1rem; } }
.public-body { background: var(--ir-page-bg); min-height: 100vh; display: flex; flex-direction: column; }
.public-container { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.public-header { background: var(--ir-sidebar-bg); padding: .8rem 0; }
.public-brand { font-size: 1.1rem; }
.public-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }
.public-nav a:not(.btn) { color: var(--ir-sidebar-fg); text-decoration: none; font-size: .9rem; }
.public-nav a:not(.btn):hover, .public-nav a.active { color: #fff; }
.public-nav a.active { font-weight: 600; }
.public-main { padding-top: 2rem; padding-bottom: 2rem; flex: 1 0 auto; }
.public-main .legal-page { margin: 0 auto; }
.public-footer { color: #64748b; font-size: .8rem; padding-bottom: 1.5rem; text-align: center; }
.auth-footnote--links { margin-top: .5rem; }
.auth-footnote--links a { color: inherit; }
.public-title { max-width: 820px; margin: 0 auto 1rem; font-size: 1.5rem; font-weight: 600; }

/* CPC de equilíbrio (abaixo do CPC): verde = há folga, vermelho = CPC acima do que a UTM paga */
.report-table .breakeven { display: block; font-size: .72rem; margin-top: .15rem; white-space: nowrap; }
.report-table .breakeven--ok { color: #15803d; }
.report-table .breakeven--over { color: #b91c1c; font-weight: 600; }

/* ROI por hora */
.hourly-chart { position: relative; height: 260px; }

/* Modal do botão Atualizar */
.refresh-modal__icon { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; border: 4px solid; }
.refresh-modal__icon--busy { border-color: transparent; color: #0f766e; }
.refresh-modal__icon--busy .spinner-border { width: 64px; height: 64px; border-width: 5px; }
.refresh-modal__icon--success { border-color: #c8ecd4; color: #16a34a; }
.refresh-modal__icon--warning { border-color: #fde7b0; color: #d97706; }
.refresh-modal__icon--error { border-color: #f8c9c9; color: #dc2626; }
.refresh-modal__list { max-height: 220px; overflow-y: auto; }
.refresh-modal__item { padding: 6px 10px; border-radius: 6px; background: #f1f5f9; margin-bottom: 6px; }
.refresh-modal__item--failed { background: #fdecec; }
.refresh-modal__item--partial, .refresh-modal__item--running { background: #fef6e4; }

/* Dados até (atraso de cada plataforma) */
.freshness { color: #475569; }
.freshness__item { white-space: nowrap; }
.freshness__item--ok { color: #15803d; }
.freshness__item--warn { color: #b45309; }
.freshness__item--late { color: #b91c1c; font-weight: 600; }

/* Histórico de sincronização recolhido (páginas das integrações) */
.sync-history-toggle { color: inherit; font-weight: 600; font-size: .95rem; }
.sync-history-toggle__icon { display: inline-block; transition: transform .15s ease; }
.sync-history-toggle:not(.collapsed) .sync-history-toggle__icon { transform: rotate(90deg); }

/* Sites: lista de blocos para marcar */
.unit-pick { max-height: 320px; overflow-y: auto; }
.unit-pick__item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; padding: .4rem .6rem; border-bottom: 1px solid #eef1f5; cursor: pointer; margin: 0; }
.unit-pick__item:hover { background: #f8fafc; }
.unit-pick__name { font-weight: 500; }
.unit-pick__meta { font-size: .78rem; color: #64748b; flex-basis: 100%; padding-left: 1.6rem; }
.unit-pick__item[hidden] { display: none; }
.site-suggest__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem 0; border-top: 1px solid #eef1f5; }
.site-suggest__row:first-child { border-top: 0; }

/* Relatório de campanhas: botão "?" das UTMs sem campanha (o texto abre ao clicar) */
.report-source--btn { border: 0; padding: 0; cursor: pointer; }
.report-source--btn:hover, .report-source--btn[aria-expanded="true"] { background: #e2e8f0; color: #475569; }


/* Grupos de UTM */
.report-source--group { background: #ecfdf5; color: #0f766e; }
.group-empty__text { max-width: 34rem; }
.utm-rule-badge { display: none; }
.unit-pick__item.is-rule { background: #f0fdf4; }
.unit-pick__item.is-rule .utm-rule-badge { display: inline-block; }

/* Detalhe por país */
.country-flag { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .12); vertical-align: -2px; object-fit: cover; }

/* Relatório de campanhas: nomes das campanhas da UTM numa linha só (lista completa na dica) */
.report-campaign__names { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
@media (max-width: 575.98px) { .report-campaign__names { max-width: 160px; } }

/* Dashboard: botão de fechar aviso */
.btn-close-sm { width: .6em; height: .6em; padding: .25em; }
