/**
 * HEAD Dashboard — Media Desk refresh
 * Camada visual sobre app.css: hierarquia mais clara, brand HEAD, densão útil.
 */

:root {
    --ink-950: #161e2c;
    --ink-850: #222e43;
    --ink-700: #445466;
    --ink-500: #6b7f94;
    --ink-300: #a8b3c0;

    --brand-navy: #161e2c;
    --brand-slate: #222e43;
    --brand-steel: #6b819a;
    --brand-highlight: #b89b68;
    --brand-paper: #f7f8fa;
    --brand-wash: #eef1f5;
    --brand-line: #e2e7ee;
    --brand-muted: #6b7f94;
    --brand-ink: #222e43;

    --teal: #222e43;
    --teal-dark: #161e2c;
    --teal-soft: #e8edf3;

    --gold: #b89b68;
    --gold-soft: #f4eee3;
    --coral: #b16f70;
    --coral-soft: #f5e7e6;

    --mist-100: #e2e7ee;
    --mist-50: #eef1f5;
    --paper: #f7f8fa;

    --surface: #ffffff;
    --surface-sunken: #f1f4f8;
    --line-soft: #e2e7ee;

    /* Accent = navy HEAD (não azul SaaS) */
    --accent: #222e43;
    --accent-strong: #161e2c;
    --accent-soft: #e8edf3;
    --accent-warm: #b89b68;

    --channel-ads: #222e43;
    --channel-ads-soft: #6b819a;
    --channel-ig: #3f6b4d;
    --channel-ig-soft: #7a9e84;

    --series-1: #222e43;
    --series-2: #b89b68;
    --series-3: #6b819a;
    --series-4: #4f7a5b;

    --state-ok: #3f6b4d;
    --state-ok-soft: #e6f0ea;
    --state-warn: #a8843d;
    --state-warn-soft: #f4eee3;
    --state-bad: #b16f70;
    --state-bad-soft: #f5e7e6;
    --state-idle: #8a93a0;
    --state-idle-soft: #eef0f3;

    --shadow-card: 0 1px 0 rgba(22, 30, 44, 0.04), 0 10px 28px -16px rgba(22, 30, 44, 0.22);
    --shadow-lift: 0 2px 4px rgba(22, 30, 44, 0.06), 0 18px 36px -18px rgba(22, 30, 44, 0.28);
    --shadow-small: 0 4px 14px rgba(22, 30, 44, 0.06);
    --shadow: 0 16px 40px rgba(22, 30, 44, 0.08);

    --radius: 14px;
    --radius-small: 10px;
    --radius-lg: 16px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 24px;
    --s7: 32px;
    --s8: 40px;

    --sidebar-w: 248px;
}

/* ---- Shell ------------------------------------------------------------ */

html {
    background:
        radial-gradient(1200px 480px at 12% -8%, rgba(184, 155, 104, 0.09), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(107, 129, 154, 0.08), transparent 50%),
        var(--mist-50);
}

body {
    background: transparent;
    color: var(--ink-950);
}

.app-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
    padding: 22px 16px 18px;
    background:
        linear-gradient(165deg, rgba(184, 155, 104, 0.12) 0%, transparent 38%),
        linear-gradient(180deg, #1c2738 0%, #161e2c 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.brand {
    padding: 4px 10px 20px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    width: 108px;
}

.brand small,
.guest-brand small {
    margin-top: 2px;
    color: rgba(184, 155, 104, 0.85);
    font-size: 9px;
    letter-spacing: 0.16em;
}

.nav-label {
    margin: 18px 12px 6px;
    color: rgba(168, 179, 192, 0.75);
}

.main-nav {
    gap: 3px;
    padding-top: 14px;
}

.main-nav a {
    min-height: 42px;
    padding: 9px 12px;
    gap: 11px;
    border-radius: 11px;
    color: rgba(230, 233, 237, 0.72);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    transform: none;
}

.main-nav a[aria-current="page"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 3px 0 0 var(--gold);
}

.nav-glyph {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: inherit;
    opacity: 0.9;
}

.nav-glyph svg {
    width: 18px;
    height: 18px;
    display: block;
}

.sidebar-foot {
    margin-top: auto;
    padding: 14px 12px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(168, 179, 192, 0.8);
    font-size: 11.5px;
    gap: 9px;
}

.status-dot {
    background: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 155, 104, 0.18);
}

/* ---- Topbar ----------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    padding: 12px 2%;
    border-bottom: 1px solid rgba(226, 231, 238, 0.9);
    background: rgba(247, 248, 250, 0.82);
    backdrop-filter: blur(16px) saturate(1.1);
}

.page-heading {
    min-width: 0;
}

.page-heading h1 {
    margin: 3px 0 0;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.eyebrow,
.metric-label {
    color: var(--ink-500);
    font-size: 10px;
    letter-spacing: 0.12em;
}

.user-area {
    gap: 12px;
    padding: 6px 6px 6px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-small);
}

.avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(145deg, #2a384f, #161e2c);
    font-size: 14px;
}

.user-copy strong {
    font-size: 12.5px;
    letter-spacing: -0.01em;
}

.user-copy small {
    font-size: 10.5px;
}

.text-button {
    margin: 0 8px 0 0;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.text-button:hover,
.text-link:hover {
    color: var(--ink-950);
    background: var(--surface-sunken);
    text-decoration: none;
}

.page-content {
    width: 100%;
    max-width: none;
    padding: 22px 2% 64px;
}

/* ---- Alerts ----------------------------------------------------------- */

.alert {
    border-radius: 12px;
    border-width: 1px;
    box-shadow: none;
}

.alert-success {
    color: #2d4a36;
    border-color: #c5d8cb;
    background: var(--state-ok-soft);
}

.alert-warning {
    color: #6a4f1c;
    border-color: #e4d2a8;
    background: var(--gold-soft);
}

.alert-error {
    color: #7a3536;
    border-color: #e8c0c0;
    background: var(--coral-soft);
}

/* ---- Toolbar / período ----------------------------------------------- */

.desk-toolbar {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.preset-bar {
    margin-bottom: 0;
    padding: 5px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    box-shadow: none;
    width: 100%;
    max-width: none;
}

.preset {
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 0.82rem;
}

.preset.is-active {
    color: #fff;
    background: var(--ink-950);
    box-shadow: none;
}

.control-strip {
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 18px;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background: var(--surface);
    box-shadow: none;
    gap: 16px;
}

.control-strip > div > strong {
    font-size: 17px;
    letter-spacing: -0.03em;
}

.range-compare {
    display: block;
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 12px;
}

.filter-form {
    gap: 8px;
}

.filter-form label > span {
    color: var(--ink-500);
}

input,
select,
textarea {
    border-color: #d0d7e0;
    border-radius: 10px;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--ink-850);
    box-shadow: 0 0 0 3px rgba(34, 46, 67, 0.1);
}

.button {
    min-height: 40px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 650;
    transition: background 160ms var(--ease), border-color 160ms var(--ease),
        transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.button:hover {
    background: var(--surface-sunken);
    border-color: #c5cdd8;
}

.button-primary {
    color: #fff;
    background: var(--ink-950);
    border-color: var(--ink-950);
    box-shadow: none;
}

.button-primary:hover {
    color: #fff;
    background: #2a384f;
    border-color: #2a384f;
    transform: none;
    box-shadow: none;
}

.button-secondary {
    background: var(--gold-soft);
    border-color: #e0d1b4;
    color: #5c4720;
}

.button-secondary:hover {
    background: #efe4cf;
}

.button-large {
    min-height: 44px;
    padding: 0 18px;
}

/* ---- Headline metrics ------------------------------------------------- */

.headline {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 0;
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.headline::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--gold), var(--ink-850));
}

.headline-main {
    padding: 22px 24px 22px 28px;
}

.headline-main .metric-label {
    color: var(--ink-500);
}

.headline-number {
    display: block;
    margin: 6px 0 10px;
    font-family: var(--display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1;
    color: var(--ink-950);
    background: none;
    -webkit-text-fill-color: unset;
}

.headline-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    color: var(--ink-500);
    font-size: 13px;
}

.headline-side {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    margin: 0;
    background: var(--line-soft);
    border-left: 1px solid var(--line-soft);
}

.headline-side > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 14px 20px;
    background: var(--surface-sunken);
}

.headline-side dt {
    color: var(--ink-500);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.headline-side dd {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.fact-row {
    margin-bottom: 22px;
    border-radius: 14px;
    border-color: var(--line-soft);
    background: var(--line-soft);
}

.fact-row > div {
    padding: 14px 16px;
}

.fact-row dt {
    font-size: 0.66rem;
}

.fact-row dd {
    font-size: 1rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.panel {
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: none;
}

.page-content > .panel {
    margin-bottom: 18px;
}

.page-content > .panel.table-panel,
.page-content > .panel.instruction-panel {
    margin-top: 0;
}

.panel-header {
    padding: 16px 18px 14px;
}

.panel-header h2,
.form-section-heading h2,
.section-title {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 8px 0 14px;
    padding: 0;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-soft);
}

.section-title small {
    color: var(--ink-500);
    font-family: var(--body);
    font-size: 0.8rem;
    font-weight: 600;
}

.chart-panel {
    min-height: 0;
}

.chart-panel .panel-header {
    margin-bottom: 4px;
}

/* ---- Portfolio cards -------------------------------------------------- */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.portfolio-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 16px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    border-top: 3px solid var(--ink-850);
    background: var(--surface);
    box-shadow: none;
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease),
        transform 160ms var(--ease);
}

.portfolio-card:hover {
    border-color: #c9d2de;
    box-shadow: var(--shadow-lift);
    transform: translateY(-2px);
}

.portfolio-card.state-ok {
    border-top-color: var(--state-ok);
}

.portfolio-card.state-sem-dado {
    border-top-color: var(--ink-300);
    opacity: 0.92;
}

.portfolio-card.state-nunca {
    border-top-color: var(--state-warn);
}

.portfolio-card.state-com-erro {
    border-top-color: var(--state-bad);
}

.portfolio-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portfolio-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.portfolio-title a {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.portfolio-title small {
    display: block;
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 12px;
}

.portfolio-primary {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-sunken);
}

.portfolio-primary strong {
    display: block;
    margin-top: 2px;
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 720;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
}

.portfolio-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin: 0;
}

.portfolio-facts dt {
    font-size: 0.64rem;
}

.portfolio-facts dd {
    margin: 2px 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.portfolio-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    color: var(--ink-500);
    font-size: 11.5px;
    gap: 8px;
}

.portfolio-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
    padding-top: 0;
    border-top: 0;
}

.portfolio-actions .text-link,
.portfolio-actions .text-button {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 650;
}

.portfolio-actions .text-link {
    color: var(--ink-950);
    background: var(--accent-soft);
}

/* ---- Trends ----------------------------------------------------------- */

.trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.trend-up {
    color: #2d4a36;
    background: var(--state-ok-soft);
}

.trend-down {
    color: #7a3536;
    background: var(--state-bad-soft);
}

.trend-flat,
.trend-none {
    color: var(--ink-500);
    background: var(--state-idle-soft);
}

/* ---- Integrações / health --------------------------------------------- */

.health-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.health-banner.is-calm {
    background:
        linear-gradient(90deg, rgba(63, 107, 77, 0.08), transparent 42%),
        var(--surface);
}

.health-banner.is-alert {
    background:
        linear-gradient(90deg, rgba(168, 132, 61, 0.12), transparent 42%),
        var(--surface);
    border-color: #e4d2a8;
}

.health-copy {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.health-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--state-ok);
    box-shadow: 0 0 0 4px rgba(63, 107, 77, 0.15);
}

.health-banner.is-alert .health-dot {
    background: var(--state-warn);
    box-shadow: 0 0 0 4px rgba(168, 132, 61, 0.18);
}

.health-copy strong {
    display: block;
    font-family: var(--display);
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.health-copy small {
    color: var(--ink-500);
    font-size: 12.5px;
}

.connection-card {
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: none;
}

.connection-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px 18px;
}

.panel > .connection-facts {
    padding: 16px 18px 4px;
}

.connection-facts dt {
    color: var(--ink-500);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.connection-facts dd {
    margin: 6px 0 0;
    font-weight: 650;
    line-height: 1.35;
}

.panel > .page-intro {
    margin: 0;
    padding: 14px 18px 0;
    max-width: none;
}

.panel > .alert {
    margin: 14px 18px;
}

.panel > .cron-list,
.panel > .connection-list,
.panel > .import-list {
    padding: 16px 18px 18px;
}

.panel > .import-group {
    padding: 0 18px;
}

.panel > .import-group:first-of-type {
    padding-top: 16px;
}

.panel > .import-group:last-of-type {
    padding-bottom: 20px;
}

.panel > .import-group + .import-group {
    margin-top: 22px;
    padding-top: 4px;
}

.import-group-title {
    margin: 0 0 12px;
    letter-spacing: 0.08em;
}

.import-list {
    gap: 12px;
}

.import-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px 20px;
    padding: 16px 18px;
}

.import-identity strong {
    line-height: 1.3;
}

.import-identity small {
    margin-top: 5px;
    line-height: 1.4;
}

.import-form {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: center;
}

.import-form select {
    min-width: 200px;
}

.import-form.rename-inline input[type="text"] {
    min-width: 180px;
    max-width: 260px;
    padding: 9px 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-small);
    background: var(--surface);
}

.import-row.is-linked {
    opacity: 1;
    background: #f7faf8;
    border-color: #d5e3d9;
}

.page-content > .bulk-strip {
    margin-bottom: 18px;
}

@media (max-width: 720px) {
    .import-row {
        grid-template-columns: 1fr;
    }

    .import-form {
        flex-wrap: wrap;
        width: 100%;
    }

    .import-form select,
    .import-form.rename-inline input[type="text"] {
        min-width: 0;
        max-width: none;
        flex: 1 1 160px;
    }
}

.panel > .inline-empty {
    padding: 28px 24px 32px;
}

.panel > .inline-empty span {
    margin-top: 8px;
    max-width: 42rem;
    line-height: 1.5;
}

.cron-list {
    gap: 14px;
}

.page-content > .alert {
    margin-bottom: 18px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.status-success,
.status-active {
    color: #2d4a36;
    background: var(--state-ok-soft);
}

.status-error,
.status-expired,
.status-revoked {
    color: #7a3536;
    background: var(--state-bad-soft);
}

.status-expiring,
.status-never,
.status-warn {
    color: #6a4f1c;
    background: var(--gold-soft);
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: var(--surface-sunken);
    color: var(--ink-500);
    border-bottom: 1px solid var(--line-soft);
}

.data-table tbody tr:hover {
    background: rgba(34, 46, 67, 0.03);
}

.data-note {
    margin: 0;
    padding: 14px 18px 16px;
    color: var(--ink-500);
    font-size: 12.5px;
    line-height: 1.55;
}

.inline-empty {
    padding: 28px 20px;
    text-align: center;
}

.inline-empty strong {
    display: block;
    margin-bottom: 6px;
    font-family: var(--display);
    font-size: 1.1rem;
}

.onboarding {
    padding: 36px 28px;
    text-align: left;
    border: 1px solid var(--line-soft);
    background:
        linear-gradient(135deg, rgba(184, 155, 104, 0.1), transparent 40%),
        var(--surface);
    box-shadow: var(--shadow-card);
}

.onboarding h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.04em;
}

/* ---- Guest / login ---------------------------------------------------- */

.guest-body {
    min-height: 100vh;
    background: var(--ink-950);
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.guest-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(28px, 5vw, 56px);
    color: #e8edf3;
    background:
        radial-gradient(700px 420px at 20% 85%, rgba(184, 155, 104, 0.22), transparent 55%),
        radial-gradient(600px 380px at 90% 10%, rgba(107, 129, 154, 0.2), transparent 50%),
        linear-gradient(160deg, #1c2738 0%, #161e2c 55%, #121821 100%);
    overflow: hidden;
}

.guest-brand-panel::after {
    content: "";
    position: absolute;
    inset: auto -20% -30% 30%;
    height: 55%;
    background: radial-gradient(circle, rgba(184, 155, 104, 0.12), transparent 60%);
    pointer-events: none;
}

.guest-promise .eyebrow {
    color: rgba(184, 155, 104, 0.95);
}

.guest-promise h1 {
    margin: 12px 0 14px;
    font-family: var(--display);
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.guest-promise p {
    max-width: 28ch;
    color: rgba(232, 237, 243, 0.72);
    font-size: 1.05rem;
    line-height: 1.45;
}

.signal-art {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 72px;
    margin: 28px 0;
}

.signal-art span {
    flex: 1;
    max-width: 28px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, rgba(184, 155, 104, 0.85), rgba(107, 129, 154, 0.35));
    animation: signalRise 2.8s var(--ease) infinite;
}

.signal-art span:nth-child(1) { height: 28%; animation-delay: 0s; }
.signal-art span:nth-child(2) { height: 54%; animation-delay: 0.15s; }
.signal-art span:nth-child(3) { height: 78%; animation-delay: 0.3s; }
.signal-art span:nth-child(4) { height: 46%; animation-delay: 0.45s; }
.signal-art span:nth-child(5) { height: 92%; animation-delay: 0.6s; }

@keyframes signalRise {
    0%, 100% { transform: scaleY(0.85); opacity: 0.7; }
    50% { transform: scaleY(1); opacity: 1; }
}

.guest-form-panel {
    display: grid;
    place-items: center;
    padding: clamp(24px, 4vw, 48px);
    background:
        radial-gradient(500px 300px at 80% 0%, rgba(184, 155, 104, 0.08), transparent 55%),
        var(--paper);
}

.guest-form-wrap {
    width: min(100%, 400px);
    padding: 28px 28px 24px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.auth-heading h2 {
    margin: 6px 0 8px;
    font-family: var(--display);
    font-size: 1.75rem;
    letter-spacing: -0.04em;
}

.auth-heading p {
    margin: 0 0 22px;
    color: var(--ink-500);
    font-size: 0.95rem;
}

.stack-form .field {
    display: block;
    margin-bottom: 14px;
}

.stack-form .field > span:first-child {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.password-field {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid #d0d7e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.password-field input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.password-field input:focus {
    box-shadow: none;
}

.password-field button {
    padding: 0 14px;
    border: 0;
    border-left: 1px solid var(--line-soft);
    background: var(--surface-sunken);
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}

.password-field:focus-within {
    border-color: var(--ink-850);
    box-shadow: 0 0 0 3px rgba(34, 46, 67, 0.1);
}

.login-assurances {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.login-assurances li {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-sunken);
    color: var(--ink-700);
    font-size: 11.5px;
    font-weight: 600;
}

.form-footnote {
    margin-top: 16px;
    color: var(--ink-500);
    font-size: 12px;
}

/* ---- Desk reveal motion ----------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
    .page-content > .desk-toolbar,
    .page-content > .headline,
    .page-content > .chart-grid,
    .page-content > .fact-row,
    .page-content > .portfolio-grid,
    .page-content > .health-banner,
    .page-content > .panel,
    .page-content > .section-title {
        animation: deskIn 420ms var(--ease) both;
    }

    .page-content > .headline { animation-delay: 40ms; }
    .page-content > .chart-grid { animation-delay: 80ms; }
    .page-content > .fact-row { animation-delay: 110ms; }
    .page-content > .section-title { animation-delay: 130ms; }
    .page-content > .portfolio-grid { animation-delay: 150ms; }
}

@keyframes deskIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Responsive ------------------------------------------------------- */

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

    .headline-side {
        grid-template-columns: repeat(3, 1fr);
        border-left: 0;
        border-top: 1px solid var(--line-soft);
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .control-strip {
        align-items: stretch;
    }

    .filter-form {
        flex-wrap: wrap;
    }

    .filter-form input,
    .filter-form select {
        width: 100%;
    }

    .user-copy {
        display: none;
    }

    .guest-shell {
        grid-template-columns: 1fr;
    }

    .guest-brand-panel {
        min-height: 280px;
    }
}

@media (max-width: 640px) {
    .headline-side {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .preset-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .health-banner {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .signal-art span {
        animation: none;
    }

    .portfolio-card:hover {
        transform: none;
    }
}

/* ---- Hub de clientes -------------------------------------------------- */

.client-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.client-hub-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: inherit;
    text-decoration: none;
    transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.client-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
    color: inherit;
    text-decoration: none;
}

.client-hub-card.is-inactive {
    opacity: 0.72;
}

.client-hub-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-hub-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #fff;
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 700;
    flex: none;
}

.client-hub-title strong {
    display: block;
    font-family: var(--display);
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.client-hub-title small {
    color: var(--ink-500);
    font-size: 12px;
}

.client-hub-channels {
    display: grid;
    gap: 10px;
}

.client-channel-block {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: var(--surface-sunken);
}

.client-channel-block.channel-ads {
    background: linear-gradient(90deg, rgba(34, 46, 67, 0.06), transparent 55%), var(--surface-sunken);
}

.client-channel-block.channel-ig {
    background: linear-gradient(90deg, rgba(63, 107, 77, 0.08), transparent 55%), var(--surface-sunken);
}

.client-channel-block strong {
    display: block;
    margin-top: 8px;
    font-family: var(--display);
    font-size: 1.25rem;
    letter-spacing: -0.03em;
}

.client-hub-unit {
    font-family: var(--body);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-500);
}

.client-channel-block small {
    display: block;
    margin-top: 4px;
    color: var(--ink-500);
    font-size: 12px;
    line-height: 1.4;
}

.channel-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.channel-badge-ads {
    color: #fff;
    background: var(--channel-ads);
}

.channel-badge-ig {
    color: #fff;
    background: var(--channel-ig);
}

.client-hero-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-section {
    margin-bottom: 22px;
    padding: 20px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.channel-section-ads {
    border-top: 3px solid var(--channel-ads);
}

.channel-section-ig {
    border-top: 3px solid var(--channel-ig);
}

.channel-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.channel-section-head h2 {
    margin: 8px 0 0;
    font-family: var(--display);
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.channel-section .fact-row,
.channel-section .chart-grid {
    margin-bottom: 16px;
}

.channel-section .inline-empty {
    min-height: 160px;
}

.channel-section .inline-empty .button {
    margin-top: 14px;
}

.asset-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.asset-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface-sunken);
}

.asset-card.is-inactive {
    opacity: 0.65;
}

.asset-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.asset-card h3 {
    margin: 0;
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.asset-card h3 a {
    color: inherit;
    text-decoration: none;
}

.asset-card h3 a:hover {
    text-decoration: underline;
}

.asset-card > small {
    color: var(--ink-500);
    font-size: 12px;
}

.asset-card-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 6px 0 0;
}

.asset-card-facts dt {
    color: var(--ink-500);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.asset-card-facts dd {
    margin: 3px 0 0;
    font-weight: 650;
    font-size: 0.92rem;
}

.asset-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.asset-card-foot form {
    margin: 0;
}

.ig-avatar {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--mist-100);
}

.portfolio-head .ig-avatar,
.portfolio-head .portfolio-mark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.ig-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    padding: 16px 18px 18px;
}

.ig-post-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface-sunken);
}

.ig-post-thumb {
    aspect-ratio: 1;
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
    background: var(--mist-100);
}

.ig-post-thumb.is-empty {
    display: grid;
    place-items: center;
    color: var(--ink-500);
    font-size: 12px;
}

.ig-post-card strong {
    font-size: 0.9rem;
    line-height: 1.35;
}

.ig-post-card small {
    color: var(--ink-500);
    font-size: 12px;
}

.ig-post-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    margin: 0;
}

.ig-post-stats dt {
    color: var(--ink-500);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ig-post-stats dd {
    margin: 2px 0 0;
    font-weight: 650;
    font-size: 0.88rem;
}

@media (max-width: 720px) {
    .client-hub-grid,
    .asset-card-grid,
    .ig-post-grid {
        grid-template-columns: 1fr;
    }

    .channel-section {
        padding: 16px;
    }

    .asset-card-facts {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---- Visão consolidada da carteira ---------------------------------- */

.overview-command {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 12px;
}

.overview-intro {
    min-width: 260px;
}

.overview-intro > strong {
    display: block;
    margin-top: 3px;
    font-family: var(--display);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

.overview-intro p {
    margin: 3px 0 0;
    color: var(--ink-500);
    font-size: 12.5px;
}

.overview-command-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.range-picker {
    position: relative;
}

.range-picker > summary {
    min-width: 248px;
    min-height: 54px;
    padding: 8px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    cursor: pointer;
    border: 1px solid #d0d7e0;
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.range-picker > summary::-webkit-details-marker {
    display: none;
}

.range-picker > summary:hover,
.range-picker[open] > summary {
    border-color: var(--ink-850);
    box-shadow: 0 0 0 3px rgba(34, 46, 67, 0.08);
}

.range-picker > summary > svg {
    width: 20px;
    height: 20px;
    flex: none;
    color: var(--ink-500);
}

.range-picker > summary > span {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.range-picker > summary small {
    color: var(--ink-500);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.range-picker > summary strong {
    margin-top: 1px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.range-picker > summary > i {
    width: 7px;
    height: 7px;
    flex: none;
    border-right: 1.5px solid var(--ink-500);
    border-bottom: 1.5px solid var(--ink-500);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms var(--ease);
}

.range-picker[open] > summary > i {
    transform: rotate(225deg) translate(-2px, -1px);
}

.range-picker-form {
    position: absolute;
    z-index: 40;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lift);
}

.range-picker-form label span {
    display: block;
    margin: 0 0 4px 2px;
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 700;
}

.range-picker-form input {
    width: 100%;
    min-height: 40px;
    padding: 7px 9px;
    font-size: 12px;
}

.range-picker-form .button {
    grid-column: 1 / -1;
}

.overview-presets {
    min-height: 40px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.overview-preset {
    padding: 7px 11px;
    flex: none;
    border-radius: 8px;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 650;
    transition: color 150ms var(--ease), background 150ms var(--ease);
}

.overview-preset:hover {
    color: var(--ink-950);
    background: rgba(255, 255, 255, 0.7);
}

.overview-preset.is-active {
    color: #fff;
    background: var(--ink-950);
}

.overview-compare {
    margin-left: auto;
    padding-left: 16px;
    flex: none;
    color: var(--ink-500);
    font-size: 11px;
}

.overview-board {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.overview-board-toolbar {
    min-height: 64px;
    padding: 10px 14px 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line-soft);
}

.channel-tabs {
    display: flex;
    align-items: center;
    gap: 5px;
}

.channel-tab {
    min-height: 38px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 9px;
    color: var(--ink-500);
    background: transparent;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.channel-tab:hover {
    color: var(--ink-950);
    background: var(--surface-sunken);
}

.channel-tab.is-active {
    color: #fff;
    background: var(--ink-950);
}

.tab-signal {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.channel-tab:not(.is-active) .tab-signal-paid {
    color: var(--channel-ads);
}

.channel-tab:not(.is-active) .tab-signal-organic {
    color: var(--channel-ig);
}

.overview-search {
    width: min(240px, 30vw);
    min-width: 170px;
    position: relative;
}

.overview-search svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 17px;
    height: 17px;
    color: var(--ink-500);
    pointer-events: none;
    transform: translateY(-50%);
}

.overview-search input {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px 8px 37px;
    background: var(--surface-sunken);
    font-size: 12px;
}

.overview-summary {
    min-height: 70px;
    padding: 10px 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid var(--line-soft);
    background: #fbfcfd;
}

.overview-summary > div {
    min-width: 0;
    padding: 3px 16px;
    border-left: 1px solid var(--line-soft);
}

.overview-summary > div:first-child {
    padding-left: 0;
    border-left: 0;
}

.overview-summary span,
.overview-summary strong {
    display: block;
}

.overview-summary span {
    color: var(--ink-500);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overview-summary strong {
    margin-top: 2px;
    overflow: hidden;
    font-family: var(--display);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-summary > p {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-500);
    font-size: 11px;
    white-space: nowrap;
}

.overview-summary > p strong {
    display: inline;
    color: var(--ink-850);
    font-family: var(--body);
    font-size: inherit;
}

.overview-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #c5cdd8 transparent;
    scrollbar-width: thin;
}

.overview-table-scroll[data-drag-scroll] {
    cursor: grab;
}

.overview-table-scroll[data-drag-scroll].is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #c5cdd8 transparent;
    scrollbar-width: thin;
}

.overview-table {
    width: 100%;
    min-width: 100%;
    border-spacing: 0;
    border-collapse: separate;
    color: var(--ink-850);
    font-variant-numeric: tabular-nums;
}

.overview-table[data-view="paid"] {
    width: 100%;
    min-width: 100%;
}

.overview-table[data-view="organic"] {
    width: 100%;
    min-width: 100%;
}

.overview-table th,
.overview-table td {
    padding: 13px 14px;
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    background-clip: padding-box;
    text-align: right;
    white-space: nowrap;
}

.overview-table thead th {
    position: sticky;
    z-index: 4;
    color: var(--ink-500);
    background: #f8fafc;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.overview-table .channel-heading-row th {
    top: 0;
    height: 42px;
}

.overview-table .metric-heading-row th {
    top: 42px;
    height: 44px;
}

.overview-table .channel-heading {
    padding-top: 9px;
    padding-bottom: 9px;
    text-align: left;
    letter-spacing: 0.04em;
}

.overview-table .channel-heading small {
    margin-left: 5px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    opacity: 0.72;
}

.channel-heading-mark {
    width: 23px;
    height: 23px;
    margin-right: 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    font-family: var(--display);
    font-size: 11px;
    font-weight: 800;
}

.paid-heading {
    box-shadow: inset 0 3px var(--channel-ads);
}

.paid-heading .channel-heading-mark {
    background: var(--channel-ads);
}

.organic-heading {
    box-shadow: inset 0 3px var(--channel-ig);
}

.organic-heading .channel-heading-mark {
    background: var(--channel-ig);
}

.overview-table tr > [data-channel="paid"] + [data-channel="organic"] {
    border-left: 1px solid #d8e0e7;
}

.overview-table .client-column {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 18%;
    min-width: 18%;
    max-width: none;
    text-align: left;
    background: var(--surface);
    box-shadow: 10px 0 18px -20px rgba(22, 30, 44, 0.8);
}

.overview-table thead .client-column {
    z-index: 7;
    background: #f8fafc;
}

.overview-table .sync-column {
    width: 10%;
    min-width: 10%;
}

.overview-table tbody tr {
    height: 78px;
}

.overview-table tbody tr:not(.overview-no-results) {
    transition: background 140ms var(--ease);
}

.overview-table tbody tr:not(.overview-no-results):hover,
.overview-table tbody tr:not(.overview-no-results):hover > .client-column {
    background: #f8fafc;
}

.overview-table tbody tr.is-inactive {
    opacity: 0.6;
}

.account-identity {
    display: flex;
    align-items: center;
    gap: 11px;
}

.account-mark {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: none;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--account-color), #fff 65%);
    border-radius: 12px;
    color: var(--account-color);
    background: color-mix(in srgb, var(--account-color), #fff 88%);
    font-family: var(--display);
    font-size: 16px;
    font-weight: 800;
}

.account-mark::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--account-color);
    content: "";
}

.account-identity > span:last-child {
    min-width: 0;
}

.account-identity strong,
.account-identity small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-identity strong {
    color: var(--ink-950);
    font-family: var(--display);
    font-size: 14px;
    letter-spacing: -0.015em;
}

.account-identity small {
    max-width: 180px;
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 10px;
}

.metric-cell {
    width: 8%;
    min-width: 8%;
}

.metric-cell > strong {
    display: block;
    color: var(--ink-950);
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.metric-cell > small {
    display: block;
    margin-top: 4px;
    color: var(--ink-500);
    font-size: 9px;
}

.metric-cell.is-empty > strong,
.metric-cell.is-empty > small {
    color: var(--ink-300);
}

.metric-delta {
    width: max-content;
    min-width: 42px;
    margin: 5px 0 0 auto;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 999px;
    color: var(--ink-500);
    background: var(--state-idle-soft);
    font-size: 9px;
    font-weight: 750;
    line-height: 1.25;
}

.metric-delta i {
    font-size: 10px;
    font-style: normal;
}

.metric-delta.is-positive {
    color: #28613b;
    background: var(--state-ok-soft);
}

.metric-delta.is-negative {
    color: #934143;
    background: var(--state-bad-soft);
}

.metric-delta.is-flat,
.metric-delta.is-empty {
    color: var(--ink-500);
    background: var(--state-idle-soft);
}

.positive-number {
    color: #28613b !important;
}

.negative-number {
    color: #934143 !important;
}

.sync-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #356245;
    font-size: 10px;
    font-weight: 750;
}

.sync-state i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--state-ok);
}

.sync-state.is-waiting {
    color: #7b6641;
}

.sync-state.is-waiting i {
    background: var(--state-warn);
}

.sync-column > small {
    display: block;
    margin-top: 4px;
    color: var(--ink-500);
    font-size: 9px;
}

.overview-table tfoot th,
.overview-table tfoot td {
    height: 64px;
    border-bottom: 0;
    background: #f1f4f8;
}

.overview-table tfoot .client-column {
    z-index: 3;
    background: #f1f4f8;
}

.overview-table tfoot strong,
.overview-table tfoot small {
    display: block;
}

.overview-table tfoot strong {
    color: var(--ink-950);
    font-family: var(--display);
    font-size: 12px;
}

.overview-table tfoot small {
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 9px;
}

.overview-no-results td {
    height: 120px;
    color: var(--ink-500);
    text-align: center;
}

.overview-board.is-filtered tfoot {
    display: none;
}

.overview-table[data-view="paid"] [data-channel="organic"],
.overview-table[data-view="organic"] [data-channel="paid"] {
    display: none;
}

.overview-board-note {
    min-height: 44px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--ink-500);
    border-top: 1px solid var(--line-soft);
    background: #fbfcfd;
    font-size: 10px;
}

@media (prefers-reduced-motion: no-preference) {
    .overview-board {
        animation: media-ledger-in 420ms var(--ease) both;
    }

    @keyframes media-ledger-in {
        from {
            opacity: 0;
            transform: translateY(8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 65rem) {
    .overview-command {
        align-items: flex-start;
        flex-direction: column;
    }

    .overview-command-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .overview-command-actions .range-picker {
        margin-left: auto;
    }

    .overview-summary {
        grid-template-columns: repeat(4, minmax(130px, 1fr));
        overflow-x: auto;
    }

    .overview-summary > p {
        display: none;
    }
}

@media (max-width: 90rem) {
    .overview-table[data-view="all"] {
        width: 135%;
        min-width: 135%;
    }
}

@media (max-width: 65rem) {
    .overview-table[data-view="all"] {
        width: 175%;
        min-width: 175%;
    }
}

@media (max-width: 42.5rem) {
    .topbar,
    .page-content {
        padding-inline: 4%;
    }

    .overview-table[data-view="all"] {
        width: 235%;
        min-width: 235%;
    }

    .overview-intro p {
        max-width: 330px;
    }

    .overview-command-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .overview-command-actions > .button {
        width: 100%;
    }

    .overview-command-actions .range-picker {
        grid-column: 1 / -1;
        margin: 0;
    }

    .range-picker > summary {
        width: 100%;
    }

    .range-picker-form {
        position: static;
        width: 100%;
        margin-top: 7px;
        box-shadow: none;
    }

    .overview-compare {
        display: none;
    }

    .overview-board-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .channel-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .channel-tab {
        flex: 1 0 auto;
        justify-content: center;
    }

    .overview-search {
        width: 100%;
        min-width: 0;
    }

    .overview-summary {
        grid-template-columns: repeat(4, 140px);
        padding-inline: 14px;
    }

    .overview-board-note {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

@supports not (color: color-mix(in srgb, #000, #fff)) {
    .account-mark {
        border-color: var(--line-soft);
        background: var(--surface-sunken);
    }
}

/* --------------------------------------------------------------------------
   Plataformas separadas: Meta, Google Ads e Instagram
   -------------------------------------------------------------------------- */

:root {
    --channel-meta: #1877f2;
    --channel-meta-soft: #eaf3ff;
    --channel-google: #4285f4;
    --channel-google-soft: #edf4ff;
    --channel-organic: #3f6b4d;
    --channel-organic-soft: #edf5ef;
}

.nav-google-ads .nav-glyph {
    color: #74a6ff;
}

.platform-logo,
.google-ads-mark {
    width: 1.65em;
    height: 1.65em;
    display: inline-grid;
    place-items: center;
    flex: none;
    border-radius: 28%;
}

.platform-logo svg,
.google-ads-mark svg {
    width: 76%;
    height: 76%;
}

.platform-logo-meta {
    color: var(--channel-meta);
    background: var(--channel-meta-soft);
}

.platform-logo-google,
.google-ads-mark {
    background: #fff;
    box-shadow: inset 0 0 0 1px #dce5f1;
}

.platform-logo-instagram {
    color: var(--channel-organic);
    background: var(--channel-organic-soft);
}

.channel-tab .platform-logo {
    font-size: .84em;
}

.platform-summary-grid {
    width: 100%;
    margin-bottom: 1.4%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1%;
}

.platform-summary-card {
    min-width: 0;
    padding: 1.5%;
    display: flex;
    align-items: center;
    gap: 4%;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.platform-summary-card > .platform-logo {
    width: 11%;
    height: auto;
    aspect-ratio: 1;
}

.platform-summary-card > div {
    min-width: 0;
}

.platform-summary-card small,
.platform-summary-card strong,
.platform-summary-card span {
    display: block;
}

.platform-summary-card small {
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.platform-summary-card strong {
    margin-top: 1.5%;
    overflow: hidden;
    color: var(--ink-950);
    font-family: var(--display);
    font-size: clamp(17px, 1.55vw, 25px);
    letter-spacing: -.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-summary-card span {
    margin-top: 1.5%;
    color: var(--ink-500);
    font-size: 10px;
}

.platform-summary-meta { box-shadow: inset 0 3px var(--channel-meta), var(--shadow-card); }
.platform-summary-google { box-shadow: inset 0 3px var(--channel-google), var(--shadow-card); }
.platform-summary-instagram { box-shadow: inset 0 3px var(--channel-organic), var(--shadow-card); }

.overview-summary-platforms .summary-meta { box-shadow: inset 0 -2px var(--channel-meta); }
.overview-summary-platforms .summary-google { box-shadow: inset 0 -2px var(--channel-google); }
.overview-summary-platforms .summary-organic { box-shadow: inset 0 -2px var(--channel-organic); }

.platform-separated-table {
    width: 190%;
    min-width: 190%;
}

.platform-separated-table .client-column {
    width: 12%;
    min-width: 12%;
}

.platform-separated-table .metric-cell {
    width: 5.7%;
    min-width: 5.7%;
}

.platform-separated-table .sync-column {
    width: 8%;
    min-width: 8%;
}

.platform-separated-table .channel-heading {
    vertical-align: middle;
}

.platform-separated-table .channel-heading > .platform-logo {
    margin-right: 1%;
    vertical-align: middle;
}

.platform-separated-table .meta-heading { box-shadow: inset 0 3px var(--channel-meta); }
.platform-separated-table .google-heading { box-shadow: inset 0 3px var(--channel-google); }
.platform-separated-table .organic-heading { box-shadow: inset 0 3px var(--channel-organic); }

.platform-separated-table tr > [data-channel="meta"] + [data-channel="google"],
.platform-separated-table tr > [data-channel="google"] + [data-channel="organic"] {
    border-left: 2px solid #d7e0eb;
}

.platform-separated-table[data-view="meta"],
.platform-separated-table[data-view="google"],
.platform-separated-table[data-view="organic"] {
    width: 100%;
    min-width: 100%;
}

.platform-separated-table[data-view="meta"] [data-channel="google"],
.platform-separated-table[data-view="meta"] [data-channel="organic"],
.platform-separated-table[data-view="google"] [data-channel="meta"],
.platform-separated-table[data-view="google"] [data-channel="organic"],
.platform-separated-table[data-view="organic"] [data-channel="meta"],
.platform-separated-table[data-view="organic"] [data-channel="google"] {
    display: none;
}

.platform-page-head {
    width: 100%;
    margin-bottom: 1.4%;
    padding: 1.4% 1.6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3%;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: linear-gradient(105deg, #fff 0%, #f7faff 68%, #eef5ff 100%);
    box-shadow: var(--shadow-card);
}

.platform-title-lockup {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 3%;
}

.google-ads-mark.is-large {
    width: 12%;
    height: auto;
    aspect-ratio: 1;
    box-shadow: 0 8px 24px rgba(66, 133, 244, .14), inset 0 0 0 1px #dce5f1;
}

.platform-title-lockup > div { min-width: 0; }
.platform-title-lockup strong { display: block; font-family: var(--display); font-size: clamp(18px, 1.7vw, 28px); letter-spacing: -.035em; }
.platform-title-lockup p { margin: .6% 0 0; color: var(--ink-500); font-size: 12px; }

.platform-filter-strip { margin-bottom: 1.2%; }

.platform-metric-ribbon {
    width: 100%;
    margin-bottom: 1.4%;
    display: grid;
    grid-template-columns: 1.25fr repeat(5, 1fr);
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.platform-metric-ribbon > div {
    min-width: 0;
    padding: 9% 10%;
    border-left: 1px solid var(--line-soft);
}

.platform-metric-ribbon > div:first-child { border-left: 0; }
.platform-metric-ribbon small, .platform-metric-ribbon strong { display: block; }
.platform-metric-ribbon small { color: var(--ink-500); font-size: 9px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.platform-metric-ribbon strong { margin-top: 3%; overflow: hidden; font-family: var(--display); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.platform-ribbon-brand { display: flex; align-items: center; gap: 8%; box-shadow: inset 0 3px var(--channel-google); }
.platform-ribbon-brand .google-ads-mark { width: 22%; height: auto; aspect-ratio: 1; }

.platform-accounts-panel { overflow: hidden; }
.google-accounts-table { width: 150%; min-width: 150%; }
.google-accounts-table th, .google-accounts-table td { white-space: nowrap; }
.google-accounts-table th:first-child { width: 15%; }
.google-accounts-table th:nth-child(2) { width: 15%; }

.platform-account-cell {
    display: flex;
    align-items: center;
    gap: 5%;
}

.platform-account-cell .google-ads-mark { width: 15%; height: auto; aspect-ratio: 1; }
.platform-account-cell span:last-child { min-width: 0; }
.platform-account-cell strong, .platform-account-cell small { display: block; overflow: hidden; text-overflow: ellipsis; }
.platform-account-cell small, .table-subline { margin-top: 3%; color: var(--ink-500); font-size: 9px; }

.account-link-form { width: 100%; display: flex; align-items: center; gap: 4%; }
.account-link-form select { width: 82%; min-width: 0; }
.icon-action { width: 14%; min-width: 30px; aspect-ratio: 1; border: 0; border-radius: 25%; color: #fff; background: var(--channel-google); cursor: pointer; }
.account-link-form.is-meta .icon-action { background: var(--channel-meta); }
.account-link-form.is-instagram .icon-action { background: var(--channel-organic); }
.account-link-form.is-google .icon-action { background: var(--channel-google); }
.row-actions { display: flex; align-items: center; gap: 8%; }
.row-actions form { margin: 0; }
.text-button.is-danger { color: #a33f42; }
.sync-state.is-error { color: #934143; }
.sync-state.is-error i { background: var(--state-bad); }

@media (max-width: 90rem) {
    .overview-table.platform-separated-table[data-view="all"] { width: 210%; min-width: 210%; }
}

@media (max-width: 75rem) {
    .platform-summary-grid { grid-template-columns: 1fr; }
    .platform-summary-card { padding: 2%; }
    .platform-summary-card > .platform-logo { width: 5%; }
    .overview-table.platform-separated-table[data-view="all"] { width: 245%; min-width: 245%; }
    .google-accounts-table { width: 190%; min-width: 190%; }
    .platform-metric-ribbon { grid-template-columns: repeat(6, minmax(18%, 1fr)); overflow-x: auto; }
}

@media (max-width: 42.5rem) {
    .platform-page-head { padding: 4%; align-items: flex-start; flex-direction: column; }
    .platform-page-head > .strip-actions { width: 100%; }
    .platform-title-lockup { width: 100%; }
    .google-ads-mark.is-large { width: 15%; }
    .platform-summary-card { padding: 4%; }
    .platform-summary-card > .platform-logo { width: 11%; }
    .overview-table.platform-separated-table[data-view="all"] { width: 360%; min-width: 360%; }
    .platform-metric-ribbon { grid-template-columns: repeat(6, 42%); }
    .google-accounts-table { width: 320%; min-width: 320%; }
}

/* ---- Navegação e caixa de vínculos ----------------------------------- */

.overview-add-menu {
    position: relative;
}

.overview-add-menu > summary {
    list-style: none;
    cursor: pointer;
}

.overview-add-menu > summary::-webkit-details-marker {
    display: none;
}

.overview-add-menu > div {
    position: absolute;
    z-index: 30;
    top: calc(100% + 12%);
    right: 0;
    width: max(22vw, 100%);
    padding: 7%;
    display: grid;
    gap: 3%;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-lift);
}

.overview-add-menu:not([open]) > div {
    display: none;
}

.overview-add-menu > div > a {
    width: 100%;
    padding: 4%;
    display: flex;
    align-items: center;
    gap: 4%;
    color: var(--ink-850);
    border-radius: 9px;
}

.overview-add-menu > div > a:hover {
    background: var(--surface-sunken);
}

.overview-add-menu > div span,
.overview-add-menu > div strong,
.overview-add-menu > div small {
    display: block;
}

.overview-add-menu > div span {
    min-width: 0;
}

.overview-add-menu > div small {
    margin-top: 1%;
    color: var(--ink-500);
}

.link-attention-button {
    color: #775313;
    border-color: #e7c471;
    background: #fff9e9;
}

.overview-platform-nav {
    width: 100%;
    margin-bottom: 1.2%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1%;
}

.overview-platform-nav > a {
    min-width: 0;
    padding: 1.1% 1.3%;
    display: flex;
    align-items: center;
    gap: 3.5%;
    color: var(--ink-850);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, .74);
    transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.overview-platform-nav > a:hover {
    border-color: #b9c6d8;
    background: var(--surface);
}

.overview-platform-nav > a > span {
    min-width: 0;
    flex: 1;
}

.overview-platform-nav small,
.overview-platform-nav strong {
    display: block;
}

.overview-platform-nav small {
    color: var(--ink-500);
    font-size: .62rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.overview-platform-nav strong {
    margin-top: 1%;
    font-size: .83rem;
}

.overview-platform-nav b {
    padding: 1.8% 2.6%;
    color: var(--ink-500);
    border-radius: 999px;
    background: var(--surface-sunken);
    font-size: .72rem;
}

.link-inbox {
    width: 100%;
    margin-bottom: 1.4%;
    overflow: hidden;
    border: 1px solid #ead9ae;
    border-radius: 14px;
    background: linear-gradient(115deg, #fffdf7 0%, #fff 64%);
    box-shadow: var(--shadow-card);
    scroll-margin-top: 4vh;
}

.link-inbox > header {
    padding: 1.4% 1.6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3%;
    border-bottom: 1px solid #eee4c9;
}

.link-inbox h2 {
    margin: .3% 0 0;
    font-size: clamp(1rem, 1.25vw, 1.25rem);
}

.link-inbox p {
    margin: .4% 0 0;
    color: var(--ink-500);
    font-size: .74rem;
}

.link-inbox-count {
    width: 3.5%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    flex: none;
    color: #785619;
    border-radius: 50%;
    background: #f8e7b6;
    font-weight: 800;
}

.link-inbox-platforms {
    width: 100%;
    padding: .8%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8%;
}

.link-inbox-platforms > a {
    min-width: 0;
    padding: 3%;
    display: flex;
    align-items: center;
    gap: 3%;
    color: var(--ink-850);
    border-radius: 10px;
}

.link-inbox-platforms > a:hover {
    background: #fff8e7;
}

.link-inbox-platforms a > span {
    min-width: 0;
    flex: 1;
}

.link-inbox-platforms strong,
.link-inbox-platforms small {
    display: block;
}

.link-inbox-platforms small {
    margin-top: 1.5%;
    overflow: hidden;
    color: var(--ink-500);
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-inbox-platforms b {
    min-width: 8%;
    text-align: center;
}

.link-inbox-platforms a > i {
    color: var(--ink-500);
    font-style: normal;
}

.account-client-control {
    width: 100%;
    margin: 4% 0 1%;
    padding: 3% 0;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}

.link-state-unassigned {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    color: #86601c;
    font-size: .74rem;
    font-weight: 700;
}

.link-state-unassigned > i {
    width: .48em;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #d4a442;
}

@media (max-width: 75rem) {
    .overview-platform-nav,
    .link-inbox-platforms {
        display: flex;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .overview-platform-nav > a,
    .link-inbox-platforms > a {
        flex: 0 0 46%;
    }

    .link-inbox-count {
        width: 5%;
    }
}

@media (max-width: 42.5rem) {
    .overview-add-menu > div {
        position: fixed;
        top: 18%;
        right: 4%;
        left: 4%;
        width: 92%;
        padding: 4%;
    }

    .overview-platform-nav > a,
    .link-inbox-platforms > a {
        flex-basis: 78%;
        padding: 4%;
    }

    .link-inbox > header {
        padding: 4%;
    }

    .link-inbox-count {
        width: 12%;
    }

    .link-inbox-platforms {
        padding: 2%;
    }
}
