@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Cores primárias (identidade teal) */
    --primary: #039CB3;
    --primary-dark: #027A8C;
    --primary-light: #E0F7FA;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Aliases de compatibilidade */
    --accent: #039CB3;
    --accent-dark: #027A8C;
    --accent-muted: rgba(3, 156, 179, 0.1);

    /* Estrutura */
    --navy: #1e293b;
    --navy-dark: #0f172a;
    --navy-light: #334155;
    --text: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --muted: #64748b;
    --bg: #f8fafc;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --panel: #ffffff;
    --line: #e2e8f0;
    --border: #e2e8f0;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);

    /* Sidebar */
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-collapsed: 68px;
    --sidebar-expanded: 260px;
}

/* ─── Base ─────────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: .9375rem;
    line-height: 1.6;
    margin: 0;
}

/* ─── Layout ────────────────────────────────────────────────────────────────── */

.app-layout {
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */

.app-sidebar {
    background: var(--navy);
    border-right: 1px solid rgba(255, 255, 255, .06);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    inset: 0 auto 0 0;
    overflow: hidden;                    /* clipa tudo que ultrapassa a largura */
    padding: 20px 0 16px;
    position: fixed;
    width: var(--sidebar-collapsed);
    z-index: 1050;
    transition: width .22s ease, box-shadow .22s ease;
}

.app-layout.is-sidebar-open .app-sidebar {
    box-shadow: 4px 0 24px rgba(0, 0, 0, .25);
    width: var(--sidebar-expanded);
}

/* Nav — rola verticalmente quando o conteúdo excede a altura da sidebar */
.app-sidebar-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.app-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .2);
    border-radius: 999px;
}

.app-sidebar-actions {
    margin-top: auto;
    padding: 0 10px;
}

.app-sidebar-actions form {
    margin: 0;
}

/* Textos colapsáveis: visibilidade via opacity apenas.
   O overflow da sidebar já cuida da clipagem horizontal,
   eliminando a necessidade de max-width: 0 (que causava layout shift). */
.app-sidebar-logo-text,
.app-sidebar-section-title,
.app-sidebar-link span,
.app-sidebar-user-info {
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    white-space: nowrap;
}

.app-sidebar-logout {
    background: transparent;
    border: 0;
    width: 100%;
}

.app-layout.is-sidebar-open .app-sidebar-logo-text,
.app-layout.is-sidebar-open .app-sidebar-section-title,
.app-layout.is-sidebar-open .app-sidebar-link span,
.app-layout.is-sidebar-open .app-sidebar-user-info {
    opacity: 1;
    pointer-events: auto;
}

/* Compatibilidade com img de logo antiga */
.app-sidebar-body {
    display: none;
}

.app-sidebar-logo {
    display: none;
}

/* Links de navegação */
.app-sidebar-link {
    align-items: center;
    border-radius: 8px;
    color: #94a3b8;
    display: flex;
    font-size: .875rem;
    font-weight: 500;
    gap: .6rem;
    overflow: hidden;       /* impede que span vaze o link */
    padding: .65rem .85rem;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}

.app-sidebar-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #e2e8f0;
}

.app-sidebar-link.is-active {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(3, 156, 179, 0.3);
}

.app-sidebar-badge {
    background: var(--danger);
    border-radius: 999px;
    color: #fff;
    flex-shrink: 0;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
    margin-left: auto;
    padding: .2rem .45rem;
}

/* ─── Main ──────────────────────────────────────────────────────────────────── */

.app-main {
    margin-left: var(--sidebar-collapsed);
    min-height: 100vh;
    padding: 2rem 2.25rem;
    transition: margin-left .2s ease;
}

.app-layout.is-sidebar-open .app-main {
    margin-left: var(--sidebar-expanded);
}

/* ─── Topbar ────────────────────────────────────────────────────────────────── */

.topbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.page-title {
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin: 0;
}

/* ─── Panels / Cards ────────────────────────────────────────────────────────── */

.hero-card,
.panel,
.kpi-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
}

.hero-card {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-end;
    padding: 1.75rem;
}

.hero-card h2,
.panel h3 {
    margin-bottom: .4rem;
}

.hero-stats {
    display: flex;
    gap: 1.25rem;
}

.hero-stats div,
.kpi-card {
    min-width: 110px;
}

.eyebrow,
.kpi-card span,
.hero-stats span {
    color: var(--muted);
    display: block;
    font-size: .72rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.hero-stats strong,
.kpi-card strong {
    font-size: 1.35rem;
    font-weight: 700;
}

.panel {
    padding: 1.5rem;
}

.form-panel label {
    font-weight: 500;
    margin-bottom: .3rem;
}

.kpi-card {
    padding: .9rem 1rem;
}

.kpi-label {
    align-items: center;
    display: inline-flex;
    gap: .35rem;
}

.kpi-help {
    background: transparent;
    border: 0;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

/* ─── Buttons (Bootstrap override) ─────────────────────────────────────────── */

.btn {
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .01em;
    padding: .5rem 1rem;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

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

.btn-dark:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(3, 156, 179, 0.28);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-dark), #015E6B);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(3, 156, 179, 0.38);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: var(--line);
    color: var(--muted);
}

.btn-outline-secondary:hover {
    background: var(--bg);
    border-color: #cbd5e1;
    color: var(--text);
}

.btn-outline-dark {
    border-color: var(--navy);
    color: var(--navy);
}

.btn-outline-dark:hover {
    background: var(--navy);
    color: #fff;
}

/* ─── Forms (Bootstrap override) ───────────────────────────────────────────── */

.form-control,
.form-select {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: .9rem;
    padding: .5rem .75rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(3, 156, 179, .15);
    outline: none;
}

.form-label {
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .01em;
    margin-bottom: .35rem;
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(3, 156, 179, .18);
}

/* ─── Tables ────────────────────────────────────────────────────────────────── */

.table {
    --bs-table-bg: transparent;
    font-size: .875rem;
}

.table > :not(caption) > * > * {
    padding: .65rem .75rem;
}

.table thead th {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--line);
}

/* ─── Logo upload ────────────────────────────────────────────────────────────── */

.logo-upload-wrap {
    align-items: center;
    display: flex;
    gap: 1.25rem;
}

.logo-preview {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex: 0 0 96px;
    height: 96px;
    justify-content: center;
    overflow: hidden;
    width: 96px;
}

.logo-preview img {
    height: 100%;
    object-fit: contain;
    width: 100%;
    padding: .5rem;
}

.logo-preview-placeholder {
    color: #94a3b8;
}

.logo-preview-placeholder svg {
    height: 32px;
    width: 32px;
}

.logo-upload-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.logo-upload-hint {
    color: var(--muted);
    font-size: .8rem;
    margin: 0;
}

/* ─── Chart / empty state ───────────────────────────────────────────────────── */

.metric-slider-panel {
    overflow: hidden;
}

.chart-empty-state {
    align-items: center;
    background: var(--bg);
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    display: flex;
    justify-content: center;
    min-height: 220px;
    padding: 1.5rem;
    text-align: center;
}

/* ─── Dashboard tabs ─────────────────────────────────────────────────────────── */

.dashboard-primary-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.dashboard-primary-tab {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: .875rem;
    font-weight: 500;
    padding: .55rem .95rem;
    text-decoration: none;
    transition: all .15s ease;
}

.dashboard-primary-tab:hover {
    border-color: #cbd5e1;
    color: var(--text);
}

.dashboard-primary-tab.is-active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.metric-slider-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.metric-select {
    max-width: 240px;
}

/* ─── Competitor analysis ───────────────────────────────────────────────────── */

.competitor-analysis-header {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.competitor-analysis-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: .9rem;
    margin-bottom: .35rem;
}

.competitor-analysis-name {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
}

.competitor-analysis-actions {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    justify-content: flex-end;
    margin-left: auto;
    max-width: 320px;
    min-width: 280px;
}

.competitor-select-wrap {
    min-width: 100%;
}

.competitor-select-wrap label {
    font-weight: 600;
    margin-bottom: .3rem;
}

.competitor-evaluate-btn {
    min-width: 150px;
    width: 100%;
}

.comparison-period-label {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 400;
    margin-top: .2rem;
}

/* ─── Loading overlay ───────────────────────────────────────────────────────── */

.loading-overlay {
    align-items: center;
    background: rgba(15, 23, 42, .6);
    display: none;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 2000;
}

.loading-overlay.is-visible {
    display: flex;
}

.loading-modal-card {
    align-items: center;
    background: var(--navy);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
    color: #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    max-width: 340px;
    padding: 1.75rem 2rem;
    text-align: center;
}

.loading-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.loading-text {
    color: #94a3b8;
    font-size: .9rem;
}

/* ─── Upload config ──────────────────────────────────────────────────────────── */

.upload-config-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.upload-config-card {
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.upload-config-placeholder {
    align-items: center;
    background: var(--panel);
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    justify-content: center;
    min-height: 220px;
    padding: 1.5rem;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    width: 100%;
}

.upload-config-placeholder:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(233, 44, 67, .1);
    color: var(--accent-dark);
    transform: translateY(-2px);
}

@media (max-width: 991.98px) {
    .upload-config-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .upload-config-grid {
        grid-template-columns: 1fr;
    }
}

.upload-config-plus {
    align-items: center;
    background: var(--accent-muted);
    border-radius: 999px;
    color: var(--accent);
    display: inline-flex;
    font-size: 2.5rem;
    height: 76px;
    justify-content: center;
    line-height: 1;
    width: 76px;
}

.upload-config-label {
    font-size: .95rem;
    font-weight: 700;
}

.upload-config-locked-summary {
    display: grid;
    gap: .75rem;
}

.upload-config-locked-summary div,
.upload-manual-box,
.upload-api-box,
.upload-source-option {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.upload-config-locked-summary div {
    padding: .85rem 1rem;
}

.upload-config-locked-summary span,
.upload-source-option small {
    display: block;
    font-size: .75rem;
}

.upload-config-locked-summary span {
    color: var(--muted);
}

.upload-config-locked-summary strong {
    display: block;
    font-size: .98rem;
    margin-top: .15rem;
}

.upload-source-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.upload-source-option {
    align-items: center;
    background: #fff;
    border-color: #dbeafe;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
    color: var(--navy);
    cursor: pointer;
    display: flex;
    min-height: 92px;
    padding: 1rem;
    position: relative;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.upload-source-option input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.upload-source-option strong {
    display: block;
    font-size: .96rem;
    line-height: 1.25;
    margin-bottom: .25rem;
}

.upload-source-option small {
    color: #475569;
    line-height: 1.35;
}

.upload-source-option:hover {
    border-color: #93c5fd;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .12);
    transform: translateY(-1px);
}

.upload-source-option.is-active {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .16);
    color: #1d4ed8;
}

.upload-source-option.is-active small {
    color: #1e40af;
}

.upload-source-option.is-disabled {
    cursor: not-allowed;
    opacity: .58;
}

.upload-manual-box,
.upload-api-box {
    margin-top: 1rem;
    padding: 1rem;
}

.upload-manual-box {
    background: #fff7ed;
    border-color: #fed7aa;
}

.upload-api-box {
    background: #ecfeff;
    border-color: #a5f3fc;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.upload-config-columns {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(360px, .92fr) minmax(520px, 1.08fr);
    margin-bottom: 1rem;
}

.upload-config-columns--single {
    grid-template-columns: minmax(0, 1fr);
}

.marketing-shared-metrics,
.ms-config {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ms-config__toolbar {
    display: flex;
    justify-content: flex-end;
}

.ms-help-link {
    align-items: center;
    background: none;
    border: 0;
    color: #2563eb;
    display: inline-flex;
    font-size: .84rem;
    font-weight: 600;
    gap: .35rem;
    padding: 0;
    text-decoration: none;
}

.ms-help-link:hover,
.ms-help-link:focus {
    color: #1d4ed8;
    text-decoration: underline;
}

.ms-help-link::before {
    content: '?';
    align-items: center;
    background: #dbeafe;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 700;
    height: 1.25rem;
    justify-content: center;
    line-height: 1;
    width: 1.25rem;
}

.ms-flow-guide {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.1rem 1.15rem;
}

.ms-flow-guide--modal {
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
}

#msHowItWorksModal .modal-header {
    align-items: flex-start;
}

#msHowItWorksModal .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.ms-flow-guide__eyebrow {
    color: #64748b;
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    margin-bottom: .25rem;
    text-transform: uppercase;
}

.ms-flow-guide__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 .25rem;
}

.ms-flow-guide__lead {
    color: #64748b;
    font-size: .84rem;
    line-height: 1.45;
    margin: 0;
    max-width: 42rem;
}

.ms-flow-track {
    align-items: stretch;
    display: grid;
    gap: .5rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.ms-flow-track--result {
    border-top: 1px dashed #e2e8f0;
    padding-top: 1rem;
}

.ms-flow-node {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    min-width: 0;
    padding: .75rem .85rem;
}

.ms-flow-node--input {
    border-left: 3px solid #2563eb;
}

.ms-flow-node--auto {
    background: #f8fafc;
    border-left: 3px solid #64748b;
}

.ms-flow-node__badge {
    align-self: flex-start;
    background: #dbeafe;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .03em;
    padding: .18rem .5rem;
    text-transform: uppercase;
}

.ms-flow-node__badge--auto {
    background: #e2e8f0;
    color: #475569;
}

.ms-flow-node__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.ms-flow-chip {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #334155;
    font-size: .76rem;
    font-weight: 600;
    padding: .28rem .55rem;
}

.ms-flow-chip--gross {
    border-color: #99f6e4;
    color: #0f766e;
}

.ms-flow-chip--direct {
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.ms-flow-chip--digital {
    border-color: #ddd6fe;
    color: #6d28d9;
}

.ms-flow-chip--physical {
    border-color: #fed7aa;
    color: #c2410c;
}

.ms-flow-formula {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.ms-flow-formula__part {
    color: #475569;
    font-size: .78rem;
    font-weight: 600;
}

.ms-flow-formula__op {
    color: #94a3b8;
    font-size: .82rem;
    font-weight: 700;
}

.ms-flow-formula__result {
    background: #0f172a;
    border-radius: 999px;
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
    padding: .25rem .55rem;
}

.ms-flow-node__hint {
    color: #64748b;
    font-size: .72rem;
    line-height: 1.35;
    margin: 0;
}

.ms-flow-connector {
    align-items: center;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    justify-content: center;
    min-width: 1.75rem;
}

.ms-flow-connector__line {
    background: #cbd5e1;
    display: none;
    height: 1px;
    width: 100%;
}

.ms-flow-connector__symbol {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #64748b;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 700;
    height: 1.65rem;
    justify-content: center;
    width: 1.65rem;
}

@media (max-width: 820px) {
    .ms-flow-track {
        grid-template-columns: 1fr;
    }

    .ms-flow-connector {
        flex-direction: row;
        min-height: 1.5rem;
        width: 100%;
    }

    .ms-flow-connector__line {
        display: block;
        height: 1px;
        width: auto;
        flex: 1;
    }

    .ms-flow-connector__symbol {
        flex-shrink: 0;
    }
}

.ms-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    padding: 1rem;
}

.ms-section--direct {
    border-top: 3px solid #2563eb;
}

.ms-section--gross {
    border-top: 3px solid #0f766e;
}

.ms-section--digital {
    border-top: 3px solid #7c3aed;
}

.ms-section--physical {
    border-top: 3px solid #ea580c;
}

.ms-section--computed {
    background: #f8fafc;
    border-top: 3px solid #64748b;
}

.ms-display-panel {
    align-items: center;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    padding: .9rem 1rem;
}

.ms-display-panel__intro strong {
    display: block;
    font-size: .95rem;
    margin-bottom: .15rem;
}

.ms-display-panel__intro p {
    color: #64748b;
    font-size: .8rem;
    line-height: 1.4;
}

.ms-section__header {
    margin-bottom: 0;
}

.ms-section.is-expanded .ms-section__header {
    margin-bottom: .85rem;
}

.ms-section__toggle {
    align-items: flex-start;
    background: none;
    border: 0;
    color: inherit;
    display: flex;
    gap: .75rem;
    padding: 0;
    text-align: left;
    width: 100%;
}

.ms-section__toggle:hover .ms-section__chevron {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.ms-section__toggle-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
}

.ms-section__toggle-actions {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    gap: .45rem;
    margin-top: .1rem;
}

.ms-section__meta {
    background: #f1f5f9;
    border-radius: 999px;
    color: #64748b;
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .5rem;
    white-space: nowrap;
}

.ms-section__chevron {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    display: inline-flex;
    flex-shrink: 0;
    height: 2rem;
    justify-content: center;
    transition: background .15s ease, border-color .15s ease, transform .2s ease;
    width: 2rem;
}

.ms-section.is-expanded .ms-section__chevron {
    transform: rotate(180deg);
}

.ms-section__body {
    display: none;
}

.ms-section.is-expanded .ms-section__body {
    display: block;
}

.ms-section:not(.is-expanded) .ms-section__help,
.ms-section:not(.is-expanded) .ms-section__formula {
    display: none;
}

.ms-section__title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .35rem;
}

.ms-section__badge {
    background: #e2e8f0;
    border-radius: 999px;
    color: #334155;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .2rem .55rem;
    text-transform: uppercase;
}

.ms-section--direct .ms-section__badge {
    background: #dbeafe;
    color: #1d4ed8;
}

.ms-section--gross .ms-section__badge {
    background: #ccfbf1;
    color: #0f766e;
}

.ms-section--digital .ms-section__badge {
    background: #ede9fe;
    color: #6d28d9;
}

.ms-section--physical .ms-section__badge {
    background: #ffedd5;
    color: #c2410c;
}

.ms-section--computed .ms-section__badge {
    background: #e2e8f0;
    color: #475569;
}

.ms-section__title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.ms-section__help {
    display: block;
    color: #64748b;
    font-size: .84rem;
    line-height: 1.45;
    margin: 0;
    max-width: 52rem;
}

.ms-section__formula {
    display: block;
    color: #475569;
    font-size: .78rem;
    margin: .45rem 0 0;
}

.ms-section__formula span {
    background: #f1f5f9;
    border-radius: 999px;
    color: #334155;
    font-weight: 700;
    margin-right: .35rem;
    padding: .12rem .45rem;
}

.panel-display-toggles,
.ms-display-toggles {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.ms-display-toggles--compact {
    justify-content: flex-end;
}

.panel-display-toggle,
.ms-display-toggle,
.upload-metric-check {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    margin: 0;
    position: relative;
}

.panel-display-toggle input,
.ms-display-toggle input,
.upload-metric-check input {
    cursor: pointer;
    height: 100%;
    inset: 0;
    margin: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.panel-display-toggle span,
.ms-display-toggle span,
.upload-metric-check span {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569;
    display: inline-block;
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.2;
    padding: .32rem .7rem;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
    user-select: none;
}

.panel-display-toggle:hover input:not(:disabled):not(:checked) + span,
.ms-display-toggle:hover input:not(:disabled):not(:checked) + span,
.upload-metric-check:hover input:not(:disabled):not(:checked) + span {
    border-color: #86efac;
    color: #047857;
}

.panel-display-toggle input:checked + span,
.ms-display-toggle input:checked + span,
.upload-metric-check input:checked + span {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 1px 2px rgba(5, 150, 105, .24);
    color: #fff;
}

.panel-display-toggle input:focus-visible + span,
.ms-display-toggle input:focus-visible + span,
.upload-metric-check input:focus-visible + span {
    outline: 2px solid rgba(5, 150, 105, .35);
    outline-offset: 2px;
}

.panel-display-toggle input:disabled + span,
.upload-metric-check input:disabled + span {
    cursor: not-allowed;
    opacity: .45;
}

.ms-rows {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin-bottom: .75rem;
}

.ms-rows__empty {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    font-size: .84rem;
    margin: 0;
    padding: .85rem 1rem;
    text-align: center;
}

.ms-row-card {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: grid;
    gap: .65rem;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: .75rem .85rem;
}

.ms-row-card__fields {
    align-items: end;
    display: grid;
    gap: .55rem;
    min-width: 0;
}

.ms-row-card--direct .ms-row-card__fields {
    grid-template-columns: minmax(110px, .85fr) minmax(130px, 1fr) minmax(120px, .9fr) minmax(100px, .65fr) minmax(120px, .85fr);
}

.ms-row-card--gross .ms-row-card__fields {
    grid-template-columns: minmax(110px, .85fr) minmax(200px, 1fr);
}

.ms-row-card--rule .ms-row-card__fields {
    grid-template-columns: minmax(110px, .85fr) minmax(130px, 1.1fr) minmax(88px, .65fr) minmax(88px, .65fr) minmax(108px, .75fr);
}

.ms-panel-label {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    display: flex;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.25;
    min-height: 2rem;
    padding: .35rem .55rem;
    word-break: break-word;
}

.ms-row-card--panel-valor .ms-row-card__fields {
    grid-template-columns: minmax(150px, 1.35fr) minmax(110px, .75fr) minmax(132px, auto);
}

.ms-row-card--panel-identification .ms-row-card__fields {
    grid-template-columns: minmax(150px, 1.35fr) minmax(110px, .75fr) minmax(120px, .9fr) minmax(100px, .65fr) minmax(120px, .85fr);
}

.ms-field--display {
    gap: .3rem;
}

.ms-field--display .panel-display-toggles {
    min-height: 2rem;
}

.panel-metrics-config {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.panel-metrics-config .ms-rows {
    margin-bottom: 0;
}

.ms-row-card__remove {
    align-self: end;
    align-items: center;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    display: inline-flex;
    flex-shrink: 0;
    height: 2rem;
    justify-content: center;
    margin-bottom: 1px;
    padding: 0;
    width: 2rem;
}

.ms-row-card__remove:hover {
    background: #fef2f2;
}

.ms-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin: 0;
    min-width: 0;
}

.ms-field__label {
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.ms-field .form-select,
.ms-field .form-control {
    min-width: 0;
    width: 100%;
}

@media (max-width: 900px) {
    .ms-row-card__fields {
        overflow-x: auto;
        padding-bottom: .15rem;
        scrollbar-width: thin;
    }

    .ms-row-card--direct .ms-row-card__fields {
        grid-template-columns: minmax(110px, .85fr) minmax(130px, 1fr) minmax(120px, .9fr) minmax(100px, .65fr) minmax(120px, .85fr);
        min-width: 760px;
    }

    .ms-row-card--gross .ms-row-card__fields {
        grid-template-columns: minmax(110px, .85fr) minmax(220px, 1fr);
        min-width: 360px;
    }

    .ms-row-card--rule .ms-row-card__fields {
        grid-template-columns: minmax(110px, .85fr) minmax(140px, 1.1fr) minmax(96px, .65fr) minmax(96px, .65fr) minmax(120px, .75fr);
        min-width: 740px;
    }

    .ms-row-card--panel-valor .ms-row-card__fields {
        grid-template-columns: minmax(160px, 1.35fr) minmax(120px, .75fr) minmax(140px, auto);
        min-width: 460px;
    }

    .ms-row-card--panel-identification .ms-row-card__fields {
        grid-template-columns: minmax(150px, 1.35fr) minmax(110px, .75fr) minmax(120px, .9fr) minmax(100px, .65fr) minmax(120px, .85fr);
        min-width: 720px;
    }
}

.ms-add-btn {
    align-items: center;
    background: #fff;
    border: 1px dashed #94a3b8;
    border-radius: 10px;
    color: #0f172a;
    display: inline-flex;
    font-size: .84rem;
    font-weight: 600;
    gap: .35rem;
    padding: .55rem .85rem;
}

.ms-add-btn:hover {
    background: #f8fafc;
    border-color: #64748b;
}

.ms-add-btn span {
    font-size: 1rem;
    line-height: 1;
}

.ms-computed-grid {
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.ms-computed-card {
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: .85rem;
}

.ms-computed-card strong {
    display: block;
    font-size: .9rem;
    margin-bottom: .15rem;
}

.ms-computed-card p {
    color: #64748b;
    font-size: .78rem;
    line-height: 1.4;
}

@media (max-width: 760px) {
    .ms-section__header {
        flex-direction: column;
    }

    .ms-display-toggles--compact {
        justify-content: flex-start;
    }
}

.upload-metrics-builder,
.upload-source-builder {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 1rem;
}

.upload-metrics-builder h4,
.upload-source-builder h4 {
    font-size: 1rem;
    font-weight: 700;
}

.upload-metric-rows {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.upload-metric-row {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: .45rem;
    grid-template-areas: "metric type display base filter remove";
    grid-template-columns: minmax(135px, 1.2fr) minmax(112px, .75fr) minmax(132px, auto) minmax(120px, .8fr) minmax(190px, 1fr) 32px;
    padding: .65rem;
}

.upload-metric-row .form-select {
    min-width: 0;
    width: 100%;
}

.upload-metric-row > .metric-input-wrap {
    grid-area: metric;
}

.upload-metric-row > [data-metric-type] {
    grid-area: type;
}

.upload-metric-row > .upload-metric-display {
    grid-area: display;
}

.metric-breakdown-config,
.metric-breakdown-filter {
    min-width: 0;
}

.metric-breakdown-config {
    grid-area: base;
}

.metric-breakdown-filter {
    display: grid;
    gap: .35rem;
    grid-area: filter;
    grid-template-columns: minmax(92px, .55fr) minmax(150px, 1fr);
}

.metric-breakdown-filter .form-control {
    min-width: 0;
}

.upload-metric-remove {
    grid-area: remove;
    justify-self: end;
}

@media (max-width: 1180px) {
    .upload-metric-row {
        grid-template-areas:
            "metric metric type remove"
            "display base filter filter";
        grid-template-columns: minmax(0, 1fr) minmax(78px, auto) minmax(160px, .8fr) 34px;
    }
}

@media (max-width: 760px) {
    .upload-metric-row {
        grid-template-areas:
            "metric remove"
            "type type"
            "display display"
            "base base"
            "filter filter";
        grid-template-columns: minmax(0, 1fr) 34px;
    }
}

.metric-input-wrap {
    align-items: center;
    display: grid;
    gap: .45rem;
    grid-template-columns: 28px minmax(0, 1fr);
    min-width: 0;
}

.metric-input-icon {
    align-items: center;
    background: #E0F7FA;
    border: 1px solid #99E0EA;
    border-radius: 8px;
    color: #0E7490;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    line-height: 1;
    width: 28px;
}

.upload-config-actions {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

@media (max-width: 575.98px) {
    .upload-config-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}

.upload-metric-check {
    min-height: 0;
    min-width: 0;
    padding: 0;
}

.upload-metric-display {
    align-self: center;
}

.upload-metric-remove {
    height: 32px;
    line-height: 1;
    min-width: 32px;
    padding: 0;
    width: 32px;
}

@media (max-width: 575.98px) {
    .upload-source-options {
        grid-template-columns: 1fr;
    }

    .upload-config-columns {
        grid-template-columns: 1fr;
    }

    .upload-metric-row {
        grid-template-columns: 1fr;
    }

    .upload-metric-remove {
        width: 100%;
    }
}

@media (max-width: 991.98px) {
    .upload-config-columns {
        grid-template-columns: 1fr;
    }
}

/* ─── Company social chips ──────────────────────────────────────────────────── */

.company-social-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.company-social-chip {
    align-items: center;
    background: var(--accent-muted);
    border: 1px solid rgba(233, 44, 67, .2);
    border-radius: 999px;
    color: var(--accent-dark);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    transition: background .15s ease;
    width: 32px;
}

.company-social-chip:hover {
    background: rgba(233, 44, 67, .18);
    color: var(--accent-dark);
}

.company-social-chip svg {
    height: 15px;
    width: 15px;
}

/* ─── Social links builder ──────────────────────────────────────────────────── */

.social-link-placeholder {
    align-items: center;
    background: var(--panel);
    border: 1.5px dashed var(--line);
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    gap: .75rem;
    justify-content: center;
    min-height: 64px;
    padding: .85rem 1.2rem;
    transition: border-color .15s ease, color .15s ease;
    width: 100%;
}

.social-link-placeholder:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.social-link-placeholder-icon {
    align-items: center;
    background: var(--accent-muted);
    border-radius: 999px;
    color: var(--accent);
    display: inline-flex;
    font-size: 1.6rem;
    height: 38px;
    justify-content: center;
    line-height: 1;
    width: 38px;
}

/* ─── Company social cards (perfil da empresa) ────────────────────────────────── */

.company-social-cards {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.company-social-card {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    gap: .65rem;
    min-width: 220px;
    padding: .55rem .75rem;
    position: relative;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.company-social-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.company-social-card-icon {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    flex: none;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.company-social-card-body {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
    overflow: hidden;
}

.company-social-card-body strong {
    font-size: .85rem;
}

.company-social-card-body small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-social-card-badge {
    background: var(--accent-muted);
    border-radius: 999px;
    color: var(--accent);
    flex: none;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .03em;
    padding: .15rem .45rem;
    text-transform: uppercase;
}

.company-social-card-remove {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    flex: none;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.company-social-card-remove:hover {
    background: var(--accent-muted);
    color: var(--accent-dark);
}

.company-social-card.is-add {
    background: var(--bg);
    border: 1.5px dashed var(--line);
    color: var(--muted);
    justify-content: center;
}

.company-social-card.is-add:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.company-social-card-plus {
    align-items: center;
    background: var(--accent-muted);
    border-radius: 999px;
    color: var(--accent);
    display: inline-flex;
    flex: none;
    font-size: 1.3rem;
    height: 36px;
    justify-content: center;
    line-height: 1;
    width: 36px;
}

.company-social-card-icon.is-instagram {
    background: linear-gradient(135deg, #fdf497 0%, #fd5949 45%, #d6249f 70%, #285aeb 100%);
    color: #fff;
}

.company-social-card-icon.is-facebook {
    background: #1877f2;
    color: #fff;
}

.company-social-card-icon.is-tiktok {
    background: #000;
    color: #fff;
}

.company-social-card-icon.is-linkedin {
    background: #0a66c2;
    color: #fff;
}

.company-social-card-icon.is-youtube {
    background: #ff0000;
    color: #fff;
}

.company-social-card-icon.is-x-twitter {
    background: #000;
    color: #fff;
}

.company-social-card-icon.is-website {
    background: var(--accent-muted);
    color: var(--accent);
}

.company-social-card-icon.is-sm {
    height: 28px;
    width: 28px;
}

.company-social-card-icon.is-sm svg {
    height: 14px;
    width: 14px;
}

.concorrente-redes-icons {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.concorrente-rede-chip {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: inherit;
    display: inline-flex;
    gap: .25rem;
    padding: .1rem .4rem .1rem .1rem;
    text-decoration: none;
    transition: border-color .15s ease;
}

.concorrente-rede-chip:hover {
    border-color: var(--accent);
}

.concorrente-rede-followers {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.company-social-card-icon.is-outro {
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--muted);
}

/* ─── Modal ──────────────────────────────────────────────────────────────────── */

.modal-content {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .15);
}

/* ─── Mapping / config tables ───────────────────────────────────────────────── */

.upload-mapping-table th,
.upload-mapping-table td {
    vertical-align: middle;
}

.crm-traffic-map-row {
    align-items: flex-start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr);
}

.crm-traffic-map-select,
.crm-traffic-param-config {
    min-width: 0;
}

.upload-config-empty-state {
    align-items: center;
    background: var(--bg);
    border: 1.5px dashed var(--line);
    border-radius: 12px;
    display: flex;
    min-height: 160px;
    padding: 1.25rem;
}

/* ─── Data tabs ──────────────────────────────────────────────────────────────── */

.dashboard-data-tabs {
    border-bottom: 2px solid var(--line);
    gap: .25rem;
}

.dashboard-data-tabs .nav-link {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--muted);
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: -2px;
    padding: .65rem 1rem;
    transition: color .15s ease, border-color .15s ease;
}

.dashboard-data-tabs .nav-link:hover {
    color: var(--text);
}

.dashboard-data-tabs .nav-link.active {
    background: transparent;
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.dashboard-tab-header {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ─── Traffic block ──────────────────────────────────────────────────────────── */

.traffic-block-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.traffic-block-panel.is-results {
    border-color: #16a34a;
}

.traffic-summary-table th,
.traffic-summary-table td {
    font-size: .875rem;
    vertical-align: middle;
}

.traffic-summary-table thead th {
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.traffic-summary-table tbody tr:last-child td {
    border-bottom: 0;
}

.traffic-block-panel .table-responsive {
    flex: 1;
}

/* ─── Upload config page ─────────────────────────────────────────────────────── */

.upload-config-page {
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 1440px;
    overflow-x: hidden;
    width: 100%;
}

.upload-config-page .panel {
    box-sizing: border-box;
    max-width: 100%;
}

.upload-config-page .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

/* ─── Analysis config ────────────────────────────────────────────────────────── */

.analysis-config-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
}

.analysis-config-group {
    background: var(--bg);
    border-radius: 10px;
    box-sizing: border-box;
    min-width: 0;
    padding: .9rem 1rem;
}

.analysis-config-group .table {
    min-width: 0;
}

.analysis-filter-switch {
    align-items: center;
    display: inline-flex;
    gap: .5rem;
}

.crm-status-chart-wrap {
    margin-inline: auto;
    max-width: 520px;
}

/* ─── CRM filter dropdown ────────────────────────────────────────────────────── */

.crm-filter-dropdown {
    position: relative;
}

.crm-filter-dropdown [data-crm-filter-toggle] {
    align-items: center;
    display: inline-flex;
    gap: .5rem;
}

.crm-filter-count {
    align-items: center;
    background: var(--navy);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 700;
    justify-content: center;
    min-width: 1.5rem;
    padding: .1rem .4rem;
}

.crm-filter-dropdown-menu {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
    min-width: 280px;
    padding: .85rem;
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    z-index: 20;
}

.crm-filter-dropdown-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: .6rem;
}

.crm-filter-search-wrap {
    margin-bottom: .6rem;
}

.crm-filter-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    padding-right: .2rem;
}

.crm-filter-dropdown-list .form-check {
    border-radius: 8px;
    margin-bottom: 0;
    padding: .3rem .4rem .3rem 1.8rem;
}

.crm-filter-dropdown-list .form-check:hover {
    background: var(--accent-muted);
}

/* ─── Analysis config table ──────────────────────────────────────────────────── */

.analysis-config-table {
    table-layout: fixed;
    width: 100%;
}

.analysis-config-table th:first-child,
.analysis-config-table td:first-child {
    width: auto;
}

.analysis-config-table th:nth-child(2),
.analysis-config-table th:nth-child(3),
.analysis-config-table td:nth-child(2),
.analysis-config-table td:nth-child(3) {
    width: 120px;
}

@media (max-width: 1400px) {
    .analysis-config-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .crm-traffic-map-row {
        grid-template-columns: 1fr;
    }
}

/* ─── Company cards ──────────────────────────────────────────────────────────── */

.company-search-wrap {
    max-width: 360px;
    width: 100%;
}

.company-card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 240px;
    padding: 1.5rem;
    text-decoration: none;
    transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.company-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .09);
    color: inherit;
    transform: translateY(-2px);
}

.company-card-placeholder {
    align-items: center;
    border: 1.5px dashed var(--accent);
    justify-content: center;
    text-align: center;
}

.company-card-placeholder:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}

.company-card-plus {
    align-items: center;
    background: var(--accent-muted);
    border-radius: 999px;
    color: var(--accent);
    display: inline-flex;
    font-size: 2.4rem;
    height: 72px;
    justify-content: center;
    line-height: 1;
    margin-bottom: .85rem;
    width: 72px;
}

.company-card-head {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: .6rem;
}

.company-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.company-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

.company-overview-section {
    border-top: 1px solid var(--line);
    margin-top: .85rem;
    padding-top: .75rem;
}

.company-overview-section-title {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.company-overview-row {
    align-items: center;
    display: flex;
    gap: .6rem;
    justify-content: space-between;
    margin-top: .4rem;
}

.company-overview-cta {
    background: none;
    border: none;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
    padding: 0;
    text-decoration: underline;
}

.company-overview-cta:hover {
    color: var(--primary-dark, var(--primary));
}

.company-access-btn {
    align-items: center;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 700;
    gap: .35rem;
    height: 32px;
    padding: 0 .8rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.company-access-btn svg {
    height: 16px;
    width: 16px;
}

.company-access-btn:hover {
    background: var(--primary-dark);
    color: #fff;
}

.company-empty-state {
    background: var(--bg);
    border: 1.5px dashed var(--line);
    border-radius: 10px;
    padding: .9rem 1.1rem;
}

/* Company profile */

.company-profile-hero {
    align-items: stretch;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 1.5rem;
}

.company-profile-hero.is-simple {
    grid-template-columns: 1fr;
}

.company-profile-identity {
    align-items: center;
    display: flex;
    gap: 1rem;
    min-width: 0;
    width: 100%;
}

.company-profile-logo {
    align-items: center;
    background: var(--accent-muted);
    border: 1px solid rgba(3, 156, 179, .18);
    border-radius: 12px;
    color: var(--accent-dark);
    display: inline-flex;
    flex: 0 0 86px;
    font-size: 1.65rem;
    font-weight: 800;
    height: 86px;
    justify-content: center;
    overflow: hidden;
    width: 86px;
}

.company-profile-logo img {
    height: 100%;
    object-fit: contain;
    padding: .65rem;
    width: 100%;
}

.company-profile-logo.is-users svg {
    height: 34px;
    width: 34px;
}

.company-profile-heading {
    flex: 1;
    min-width: 0;
}

.company-profile-heading h2 {
    font-size: clamp(1.45rem, 2vw, 2.1rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.15;
    margin: .15rem 0 .35rem;
}

.company-profile-heading p {
    color: var(--muted);
    margin: 0;
    max-width: 760px;
}

.company-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .85rem;
}

.company-profile-facts {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1rem 0 0;
    max-width: 760px;
}

.company-profile-facts div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    min-width: 0;
    padding: .7rem .8rem;
}

.company-profile-facts dt {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.company-profile-facts dd {
    margin: .2rem 0 0;
    overflow-wrap: anywhere;
}

.company-profile-tags span,
.company-social-chip {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--navy-light);
    display: inline-flex;
    font-size: .82rem;
    font-weight: 700;
    height: auto;
    justify-content: flex-start;
    max-width: 100%;
    overflow-wrap: break-word;
    padding: .4rem .7rem;
    text-align: left;
    width: auto;
}

.company-action-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.company-action-card {
    align-items: flex-start;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
    color: var(--text);
    display: grid;
    gap: .55rem;
    min-height: 150px;
    padding: 1.25rem;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.company-action-card:hover {
    border-color: #99E0EA;
    box-shadow: var(--shadow-md);
    color: var(--text);
    transform: translateY(-2px);
}

.company-action-icon {
    align-items: center;
    background: rgba(3, 156, 179, .1);
    border-radius: 12px;
    color: var(--primary);
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.company-action-icon svg {
    height: 21px;
    width: 21px;
}

.company-action-card strong {
    font-size: 1rem;
}

.company-action-card small {
    color: var(--muted);
    line-height: 1.45;
}

a.company-social-chip {
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

a.company-social-chip:hover {
    background: var(--accent-muted);
    border-color: rgba(3, 156, 179, .28);
    color: var(--accent-dark);
}

.company-status-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    padding: .38rem .7rem;
}

.company-status-pill.is-active {
    background: #dcfce7;
    color: #166534;
}

.company-status-pill.is-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.company-profile-summary {
    align-content: stretch;
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    min-width: 260px;
}

.company-profile-summary div {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .85rem 1rem;
}

.company-profile-summary span,
.company-digital-primary span,
.company-info-list dt {
    color: var(--muted);
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.company-profile-summary strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1.2;
    margin-top: .25rem;
}

.company-metric-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.company-metric-card {
    min-height: 112px;
}

.company-metric-card strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1.2;
    margin-top: .5rem;
    overflow-wrap: anywhere;
}

.company-profile-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.company-info-panel {
    min-height: 100%;
}

.company-section-header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.company-info-list {
    display: grid;
    gap: .85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.company-info-list div {
    border-bottom: 1px solid var(--line);
    padding-bottom: .75rem;
}

.company-info-list dd {
    margin: .25rem 0 0;
    overflow-wrap: anywhere;
}

.company-digital-primary {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
}

.company-digital-primary a,
.company-panel-footer a:not(.btn) {
    color: var(--accent-dark);
    font-weight: 800;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.company-digital-primary a:hover,
.company-panel-footer a:not(.btn):hover {
    text-decoration: underline;
}

.company-social-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    min-width: 0;
}

.profile-edit-panel {
    max-width: 1180px;
}

.profile-edit-panel .row {
    align-items: start;
}

.profile-edit-panel .form-control,
.profile-edit-panel .form-select {
    min-height: 42px;
}

.logo-upload-wrap {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.logo-preview {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: inline-flex;
    flex: 0 0 82px;
    height: 82px;
    justify-content: center;
    overflow: hidden;
    width: 82px;
}

.logo-preview img {
    height: 100%;
    object-fit: contain;
    padding: .5rem;
    width: 100%;
}

.logo-preview-placeholder svg {
    color: var(--muted);
    height: 28px;
    width: 28px;
}

.logo-upload-actions {
    display: grid;
    gap: .35rem;
}

.logo-upload-hint {
    color: var(--muted);
    font-size: .82rem;
    margin: 0;
}

.tag-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.tag-select-tags:not(:empty) {
    margin-top: .6rem;
}

.tag-chip {
    align-items: center;
    background: var(--accent-muted);
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent-dark);
    display: inline-flex;
    font-size: .85rem;
    font-weight: 600;
    gap: .4rem;
    padding: .35rem .7rem;
}

.tag-chip-remove {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.tag-chip-remove:hover {
    color: var(--danger);
}

.tag-select-custom {
    align-items: center;
    display: flex;
    gap: .5rem;
    margin-top: .6rem;
}

.tag-select-custom-input {
    flex: 1 1 auto;
}

.users-panel {
    max-width: 980px;
}

.users-table th {
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.company-panel-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.company-panel-card {
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.company-panel-card h4 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: .35rem 0 .4rem;
}

.company-panel-card p {
    color: var(--muted);
    font-size: .88rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.company-panel-footer {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-top: auto;
    padding-top: 1rem;
}

@media (max-width: 1199.98px) {
    .company-panel-grid,
    .company-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .company-profile-hero,
    .company-profile-layout {
        grid-template-columns: 1fr;
    }

    .company-profile-summary {
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .company-profile-identity {
        align-items: flex-start;
        flex-direction: column;
    }

    .logo-upload-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .company-profile-summary,
    .company-action-grid,
    .company-profile-facts,
    .company-metric-grid,
    .company-info-list,
    .company-panel-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Activity pills ─────────────────────────────────────────────────────────── */

.activity-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.activity-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    padding: .45rem .75rem;
}

.activity-pill.is-high    { background: #fee2e2; color: #b91c1c; }
.activity-pill.is-medium  { background: #fef3c7; color: #b45309; }
.activity-pill.is-warm    { background: #ffedd5; color: #c2410c; }
.activity-pill.is-low     { background: #dbeafe; color: #1d4ed8; }
.activity-pill.is-fresh   { background: #dcfce7; color: #15803d; }
.activity-pill.is-none    { background: #f1f5f9; color: var(--muted); }

/* ─── Login page ─────────────────────────────────────────────────────────────── */

.auth-page-wrap {
    align-items: center;
    background: var(--navy-dark);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-logo-wrap {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-logo {
    height: auto;
    max-height: 52px;
    max-width: 180px;
    object-fit: contain;
}

.auth-logo-fallback {
    align-items: center;
    background: var(--navy);
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    font-size: 1.3rem;
    font-weight: 800;
    height: 52px;
    justify-content: center;
    letter-spacing: -.03em;
    min-width: 52px;
    padding: 0 1rem;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: .3rem;
}

.auth-subtitle {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 991px) {
    .app-layout {
        min-height: auto;
    }

    .app-sidebar {
        inset: auto;
        overflow: visible;
        padding: 1rem;
        position: static;
        width: 100%;
    }

    .app-layout.is-sidebar-open .app-sidebar {
        box-shadow: none;
        padding-inline: 1rem;
        width: 100%;
    }

    /* No mobile, todos os textos ficam visíveis */
    .app-sidebar-logo-text,
    .app-sidebar-section-title,
    .app-sidebar-link span,
    .app-sidebar-user-info {
        opacity: 1;
        pointer-events: auto;
    }

    .app-main,
    .app-layout.is-sidebar-open .app-main {
        margin-left: 0;
    }

    .company-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar,
    .hero-card,
    .competitor-analysis-header,
    .competitor-analysis-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .competitor-select-wrap {
        min-width: 100%;
    }

    .competitor-analysis-actions {
        margin-left: 0;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .company-card-grid {
        grid-template-columns: 1fr;
    }

    .app-main {
        padding: 1.25rem 1rem;
    }
}

/* ─── Misc ───────────────────────────────────────────────────────────────────── */

.company-switcher {
    align-items: center;
    display: flex;
    gap: .5rem;
}

.report-export table,
.table {
    --bs-table-bg: transparent;
}

.text-muted {
    color: var(--muted) !important;
}

.badge.bg-secondary {
    background: var(--bg) !important;
    color: var(--muted) !important;
    border: 1px solid var(--line);
}

.badge.bg-dark {
    background: var(--navy) !important;
}

/* Scrollbar (Webkit) */
::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ─── Sidebar — nova identidade ──────────────────────────────────────────────── */

/* Cabeçalho com logo */
.app-sidebar-head {
    align-items: center;
    border-bottom: 1px solid #334155;
    display: flex;
    margin-bottom: 12px;
    padding: 0 14px 18px;
}

.app-sidebar-brand {
    align-items: center;
    color: #fff;
    display: flex;
    gap: 10px;
    overflow: hidden;
}

/* Ícone do logo — sempre visível */
.app-sidebar-logo-link {
    align-items: center;
    border-radius: 10px;
    display: flex;
    flex-shrink: 0;
    height: 40px;
    justify-content: center;
    overflow: hidden;
    width: 40px;
}

.app-sidebar-logo-img {
    border-radius: 10px;
    height: 40px;
    object-fit: cover;
    width: 40px;
}

/* Texto do logo — faz parte do grupo de textos colapsáveis */
.app-sidebar-logo-text {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
}

.app-sidebar-logo-text a {
    color: inherit;
    text-decoration: none;
}

.app-sidebar-logo-text a:hover {
    text-decoration: underline;
}

.app-sidebar-logo-text small {
    color: #94a3b8;
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 2px;
    white-space: nowrap;
}

/* Seção de navegação */
.app-sidebar-section {
    margin-bottom: 16px;
}

.app-sidebar-section-title {
    color: #64748b;
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    overflow: hidden;
    padding: 0 12px 6px;
    text-transform: uppercase;
}

/* Ícones nos itens de nav — sempre visíveis, nunca encolhem */
.app-sidebar-link svg {
    flex-shrink: 0;
    height: 18px;
    min-width: 18px;
    width: 18px;
}

/* Rodapé com avatar de usuário */
.app-sidebar-footer {
    align-items: center;
    border-top: 1px solid #334155;
    color: #cbd5e1;
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow: hidden;
    padding: 14px 14px 0;
    text-decoration: none;
    transition: color .15s ease;
}

.app-sidebar-footer:hover,
.app-sidebar-footer.is-active {
    color: #fff;
}

.app-sidebar-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--success), var(--info));
    border-radius: 50%;
    color: #fff;
    display: flex;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.app-sidebar-user-info {
    overflow: hidden;
}

.app-sidebar-user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar-user-role {
    color: #94a3b8;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile: sidebar horizontal no topo, tudo visível */
@media (max-width: 991px) {
    .app-sidebar-logo-text,
    .app-sidebar-section-title,
    .app-sidebar-link span,
    .app-sidebar-user-info {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* ─── Topbar aprimorada ──────────────────────────────────────────────────────── */

.page-subtitle {
    color: var(--muted);
    font-size: .875rem;
    margin-bottom: 0;
    margin-top: .2rem;
}

/* ─── KPI cards modernos ─────────────────────────────────────────────────────── */

.kpi-card-m {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: 22px;
    position: relative;
    transition: box-shadow .2s ease, transform .2s ease;
}

.kpi-card-m::before {
    background: var(--kpi-accent, var(--primary));
    content: '';
    height: 3px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.kpi-card-m:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.kpi-card-m .kpi-m-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.kpi-m-icon {
    align-items: center;
    background: var(--kpi-icon-bg, rgba(3, 156, 179, 0.1));
    border-radius: 12px;
    display: flex;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.kpi-m-icon svg {
    color: var(--kpi-accent, var(--primary));
    height: 22px;
    width: 22px;
}

.kpi-m-trend {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    gap: 3px;
    padding: 4px 8px;
}

.kpi-m-trend.is-up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.kpi-m-trend.is-down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.kpi-m-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.kpi-m-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.1;
}

.kpi-m-footer {
    color: var(--text-light);
    font-size: 12px;
    margin-top: 6px;
}

.kpi-m-sub-rows {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
    padding-top: 7px;
}

.kpi-m-sub-row {
    color: var(--muted);
    display: flex;
    font-size: 12px;
    font-weight: 500;
    justify-content: space-between;
}

.kpi-m-sub-row span:last-child {
    color: var(--text);
    font-weight: 600;
}

.kpi-m-breakdown-groups {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-top: 7px;
}

.kpi-m-breakdown-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-m-breakdown-toggle {
    align-items: center;
    background: rgba(15, 23, 42, 0.03);
    border: 0;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: 600;
    gap: 8px;
    padding: 6px 8px;
    text-align: left;
    width: 100%;
}

.kpi-m-breakdown-toggle__label {
    flex: 1;
}

.kpi-m-breakdown-toggle__meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.kpi-m-breakdown-toggle__icon::before {
    content: '▾';
    display: inline-block;
    transition: transform .15s ease;
}

.kpi-m-breakdown-toggle[aria-expanded='false'] .kpi-m-breakdown-toggle__icon::before {
    transform: rotate(-90deg);
}

.kpi-m-sub-rows.is-collapsed {
    display: none;
}

.kpi-m-breakdown-group .kpi-m-sub-rows {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.crm-chart-dimension-filter {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.crm-chart-dimension-filter__label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.crm-chart-dimension-filter .form-select {
    min-width: 190px;
}

.perf-chart-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ─── Toggle "Destaque" (estrela) nos cards de KPI ──────────────────────────── */

.kpi-featured-form {
    margin: 0;
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 1;
}

.kpi-featured-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    padding: 0;
    transition: background .15s ease, color .15s ease;
    width: 28px;
}

.kpi-featured-toggle svg {
    height: 18px;
    width: 18px;
}

.kpi-featured-toggle:hover {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.kpi-featured-toggle.is-active {
    color: var(--warning);
}

/* ─── Visão Geral — Overview page ───────────────────────────────────────────── */

.overview-section-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.overview-section-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

/* KPI grid */
.overview-kpi-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1199px) {
    .overview-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .overview-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Performance grid */
.overview-performance-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.overview-perf-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.overview-perf-metrics {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}

.overview-perf-metric + .overview-perf-metric {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 14px;
}

.overview-perf-metric-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.4px;
    line-height: 1.15;
}

.overview-perf-metric-label {
    color: var(--text-light);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    margin-top: 4px;
}

.overview-perf-card.is-empty {
    border-style: dashed;
}

.overview-perf-card-cta {
    margin-top: 6px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--accent);
}

/* Marketing grid */
.overview-marketing-grid {
    display: grid;
    gap: 1rem;
}

.overview-destaque-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--ws-color, var(--accent));
    border-radius: 12px;
    padding: 1.25rem;
    display: block;
    text-decoration: none;
    color: inherit;
}

.overview-destaque-card:hover {
    box-shadow: var(--shadow-md);
}

.overview-destaque-card.is-empty {
    align-items: center;
    border-style: dashed;
    border-left-style: dashed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.overview-destaque-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
}

.overview-destaque-badge {
    font-size: .75rem;
    font-weight: 700;
    color: var(--ws-color, var(--accent));
    text-transform: uppercase;
}

.overview-destaque-title {
    margin: 0 0 .75rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.overview-destaque-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .75rem;
    margin-top: .75rem;
}

.overview-destaque-stat {
    display: flex;
    flex-direction: column;
}

.overview-destaque-stat strong {
    font-size: 1.1rem;
    font-weight: 800;
}

.overview-destaque-stat span {
    font-size: .75rem;
    color: var(--muted);
}

.overview-destaque-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1rem;
}

.overview-destaque-pagination {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: center;
    margin-top: 1rem;
}

.overview-destaque-pagination-btn {
    align-items: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-secondary);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    width: 32px;
}

.overview-destaque-pagination-btn svg {
    height: 16px;
    width: 16px;
}

.overview-destaque-pagination-btn:hover {
    background-color: var(--primary-light, #E0F7FA);
    border-color: var(--primary);
    color: var(--primary);
}

.overview-destaque-pagination-btn.is-disabled {
    cursor: default;
    opacity: .4;
    pointer-events: none;
}

.overview-destaque-pagination-info {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
}

/* Botão de notificações no topbar */
.overview-notif-trigger {
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    display: inline-flex;
    height: 40px;
    justify-content: center;
    position: relative;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
    width: 40px;
}

.overview-notif-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.overview-notif-trigger svg {
    height: 20px;
    width: 20px;
}

.overview-notif-trigger-badge {
    background: var(--danger);
    border-radius: 999px;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    padding: .15rem .35rem;
    position: absolute;
    right: -6px;
    text-align: center;
    top: -6px;
}

/* Top row: Projetos em destaque (2/3) + Notificações (1/3) */
.overview-top-grid {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: 2fr 1fr;
}

@media (max-width: 991px) {
    .overview-top-grid {
        grid-template-columns: 1fr;
    }
}

.overview-top-main,
.overview-top-side {
    display: flex;
    flex-direction: column;
}

.overview-top-main .overview-destaque-card {
    flex: 1;
}

/* Notificações summary card */
.overview-notif-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem;
}

.overview-notif-count {
    background: var(--accent-muted);
    border-radius: 999px;
    color: var(--primary);
    flex-shrink: 0;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
    padding: .2rem .55rem;
}

.overview-notif-empty-state {
    align-items: center;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .6rem;
    justify-content: center;
    padding: 1.5rem 0;
    text-align: center;
}

.overview-notif-empty-icon {
    align-items: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 999px;
    color: var(--success);
    display: flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.overview-notif-empty-icon svg {
    height: 20px;
    width: 20px;
}

.overview-notif-empty {
    color: var(--muted);
    font-size: .85rem;
    margin: 0;
}

.overview-notif-link {
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
    margin-top: auto;
    padding-top: .75rem;
    text-decoration: none;
}

.overview-notif-link:hover {
    text-decoration: underline;
}

/* Notificações — abas Novas / Lidas */
.notif-tabs {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.notif-tab {
    align-items: center;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font-size: .88rem;
    font-weight: 700;
    gap: .4rem;
    padding: .8rem 1rem;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.notif-tab:hover {
    background: #f8fafc;
    color: var(--text);
}

.notif-tab.is-active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.notif-tab-count {
    background: var(--accent-muted);
    border-radius: 999px;
    color: var(--primary);
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    padding: .15rem .5rem;
}

.notif-tab.is-active .notif-tab-count {
    background: var(--primary);
    color: #fff;
}

/* Notificações — lista de itens */
.notif-section .overview-section-label {
    margin-bottom: 10px;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.notif-item {
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 10px;
    display: flex;
    gap: .5rem;
    padding: .75rem .9rem;
    transition: box-shadow .15s ease, opacity .15s ease;
}

.notif-item:hover {
    box-shadow: var(--shadow-sm);
}

.notif-item.is-lida {
    opacity: .6;
}

.notif-item-link {
    align-items: flex-start;
    color: inherit;
    display: flex;
    flex: 1;
    gap: .75rem;
    min-width: 0;
    text-decoration: none;
}

.notif-item-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: .25rem;
}

.notif-item-actions form {
    display: flex;
    margin: 0;
}

.notif-item-action {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    height: 28px;
    justify-content: center;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    width: 28px;
}

.notif-item-action svg {
    height: 14px;
    width: 14px;
}

.notif-item-action:hover {
    background: var(--bg);
    border-color: var(--line);
    color: var(--text);
}

.notif-item-action.is-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.notif-item.is-danger,
.notif-compact-item.is-danger {
    border-left-color: var(--danger);
}

.notif-item.is-warning,
.notif-compact-item.is-warning {
    border-left-color: var(--warning);
}

.notif-item.is-info,
.notif-compact-item.is-info {
    border-left-color: var(--info);
}

.notif-item-icon {
    align-items: center;
    border-radius: 8px;
    display: flex;
    flex-shrink: 0;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.notif-item-icon svg {
    height: 16px;
    width: 16px;
}

.notif-item.is-danger .notif-item-icon,
.notif-compact-item.is-danger .notif-item-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.notif-item.is-warning .notif-item-icon,
.notif-compact-item.is-warning .notif-item-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.notif-item.is-info .notif-item-icon,
.notif-compact-item.is-info .notif-item-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.notif-item-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.notif-item-title {
    color: var(--text);
    font-size: .85rem;
    font-weight: 700;
}

.notif-item-desc {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.4;
}

.notif-item-date {
    color: var(--muted);
    flex-shrink: 0;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Notificações — item compacto (resumo da Visão Geral) */
.notif-compact-item {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.notif-compact-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: .6rem;
    list-style: none;
    padding: .6rem .75rem;
}

.notif-compact-summary::-webkit-details-marker {
    display: none;
}

.notif-compact-summary:hover {
    background: var(--bg);
}

.notif-compact-title {
    color: var(--text);
    flex: 1;
    font-size: .82rem;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-compact-toggle {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-shrink: 0;
    transition: transform .15s ease;
}

.notif-compact-toggle svg {
    height: 14px;
    width: 14px;
}

.notif-compact-item[open] .notif-compact-toggle {
    transform: rotate(180deg);
}

.notif-compact-details {
    border-top: 1px solid var(--line);
    padding: .6rem .75rem;
}

.notif-compact-details .notif-item-desc {
    margin: 0 0 .5rem;
}

.notif-compact-link {
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}

.notif-compact-link:hover {
    text-decoration: underline;
}

/* Setup banner (sem empresa) */
.overview-setup-banner {
    align-items: center;
    background: linear-gradient(135deg, rgba(3,156,179,0.06), rgba(139,92,246,0.04));
    border: 1px solid rgba(3,156,179,0.2);
    border-radius: 14px;
    display: flex;
    gap: 20px;
    margin-bottom: 2rem;
    padding: 24px 28px;
}

.setup-banner-icon {
    align-items: center;
    background: var(--accent-muted);
    border-radius: 12px;
    color: var(--primary);
    display: flex;
    flex-shrink: 0;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.setup-banner-icon svg {
    height: 26px;
    width: 26px;
}

.setup-banner-body {
    flex: 1;
}

.setup-banner-body h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.setup-banner-body p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

@media (max-width: 575px) {
    .overview-setup-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* ─── Performance views ──────────────────────────────────────────────────────── */

/* Sub-navegação horizontal entre as 4 views */
.perf-subnav {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 1.5rem;
    padding: 6px;
}

.perf-subnav-item {
    align-items: center;
    border-radius: 8px;
    color: var(--muted);
    display: inline-flex;
    font-size: .875rem;
    font-weight: 600;
    gap: 6px;
    padding: 8px 14px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.perf-subnav-item svg {
    flex-shrink: 0;
    height: 15px;
    width: 15px;
}

.perf-subnav-item:hover {
    background: var(--bg);
    color: var(--text);
}

.perf-subnav-item.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 3px 10px rgba(3,156,179,.28);
}

/* Cabeçalho da seção de painéis */
.perf-panels-header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.perf-panels-tabs {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.perf-panel-tab {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 600;
    padding: 6px 14px;
    text-decoration: none;
    transition: all .15s ease;
}

.perf-panel-tab:hover {
    border-color: #99E0EA;
    color: var(--primary);
}

.perf-panel-tab.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(3,156,179,.25);
}

.perf-view-tabs {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
    padding-bottom: .55rem;
}

.period-filter {
    position: relative;
}

.period-filter-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    color: var(--navy);
    display: inline-flex;
    gap: .7rem;
    min-width: 260px;
    padding: .55rem .8rem;
    text-align: left;
}

.period-filter-trigger:hover {
    border-color: #99E0EA;
}

.period-filter-icon {
    align-items: center;
    background: #E0F7FA;
    border-radius: 10px;
    color: var(--primary);
    display: inline-flex;
    font-size: 1rem;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.period-filter-trigger small {
    color: var(--muted);
    display: block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.period-filter-trigger strong {
    display: block;
    font-size: .92rem;
}

.period-filter-popover {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    display: none;
    gap: .95rem;
    left: 0;
    min-width: min(620px, calc(100vw - 2rem));
    padding: 1rem;
    position: absolute;
    top: calc(100% + .55rem);
    z-index: 30;
}

.period-filter-popover.is-open {
    display: grid;
    grid-template-columns: 180px minmax(260px, 1fr);
}

.period-filter-shortcuts {
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding-right: 1rem;
}

.period-filter-shortcuts button {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    color: var(--navy);
    font-size: .86rem;
    font-weight: 700;
    padding: .55rem .7rem;
    text-align: left;
}

.period-filter-shortcuts button:hover {
    background: #E0F7FA;
    border-color: #99E0EA;
    color: var(--primary);
}

.period-filter-calendar {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.period-filter-main {
    display: grid;
    gap: .85rem;
    min-width: 0;
}

.period-filter-controls {
    border-top: 1px solid var(--line);
    padding-top: .85rem;
}

.period-filter-calendar .flatpickr-calendar.inline {
    box-shadow: none;
    margin-top: 0;
    width: 100%;
}

.period-filter-calendar .flatpickr-rContainer,
.period-filter-calendar .flatpickr-days,
.period-filter-calendar .dayContainer {
    max-width: 100%;
    width: 100%;
}

.period-filter-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: .85rem;
}

@media (max-width: 767px) {
    .period-filter,
    .period-filter-trigger {
        width: 100%;
    }

    .period-filter-popover {
        min-width: 100%;
        position: static;
    }

    .period-filter-popover.is-open {
        grid-template-columns: 1fr;
    }

    .period-filter-shortcuts {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 0 1rem;
    }

}

.perf-view-tab {
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 700;
    padding: .8rem 1rem;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.perf-view-tab:hover {
    background: #f8fafc;
    color: var(--text);
}

.perf-view-tab.is-active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.perf-view-tab.is-config {
    align-items: center;
    background: #E0F7FA;
    border: 1px solid #99E0EA;
    border-radius: 10px;
    color: #027A8C;
    display: inline-flex;
    gap: .4rem;
    margin-left: auto;
    padding: .55rem .85rem;
}

.perf-view-tab.is-config:hover {
    background: #CCEEF2;
    border-color: #4DD0E1;
    color: #015E6B;
}

.perf-view-tab.is-config.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(3,156,179,.22);
}

.perf-general-heading {
    align-items: flex-start;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border: 1px solid #dbeafe;
    border-radius: 14px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
}

.perf-config-stack {
    display: grid;
    gap: 1.25rem;
}

@media (max-width: 767.98px) {
    .perf-view-tab.is-config {
        margin-left: 0;
    }
}

/* Estado vazio */
.perf-empty-state {
    align-items: center;
    background: var(--bg);
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.5rem;
    min-height: 260px;
    justify-content: center;
    padding: 2.5rem;
    text-align: center;
}

.perf-empty-state svg {
    color: var(--text-light);
    height: 40px;
    margin-bottom: 6px;
    opacity: .4;
    width: 40px;
}

.perf-empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.perf-empty-state p {
    color: var(--muted);
    font-size: .9rem;
    margin: 0;
    max-width: 420px;
}

/* Configuração compartilhada (collapsible) */
.perf-shared-config {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    overflow: hidden;
}

.perf-config-head {
    padding: 1.1rem 1.25rem 0;
}

.perf-shared-config-toggle {
    align-items: center;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: .875rem;
    font-weight: 600;
    gap: 8px;
    padding: 14px 18px;
    text-align: left;
    transition: background .15s ease;
    width: 100%;
}

.perf-shared-config-toggle:hover {
    background: #f8fafc;
}

.perf-config-chevron {
    margin-left: auto;
    transition: transform .2s ease;
}

[aria-expanded="true"] .perf-config-chevron {
    transform: rotate(180deg);
}

.perf-shared-config-form {
    border-top: 1px solid var(--line);
    padding: 18px;
}

.perf-config-field {
    margin-bottom: 12px;
}

.perf-config-help {
    color: var(--muted);
    display: block;
    font-size: .8rem;
    font-weight: 400;
    margin-top: 4px;
}

.integration-status-card {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 14px 16px;
}

.integration-status-card.is-connected {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.24);
}

.integration-status-pill {
    background: #e2e8f0;
    border-radius: 999px;
    color: #475569;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
}

.integration-status-card.is-connected .integration-status-pill {
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
}

.perf-platforms-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

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

.perf-platform-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 116px;
    padding: 14px;
}

.perf-platform-card.is-connected {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.24);
}

.perf-platform-card-compact {
    align-items: center;
    flex-direction: row;
    gap: .75rem;
    min-height: auto;
    padding: .75rem 1rem;
}

.perf-platform-card-compact .perf-platform-top {
    align-items: center;
    flex: 1;
    min-width: 0;
}

.perf-platform-card-compact .perf-platform-main {
    align-items: center;
}

.perf-platform-card-compact .perf-platform-main p {
    display: none;
}

.perf-platform-card-compact .perf-platform-logo {
    flex: 0 0 36px;
    height: 36px;
    width: 36px;
}

.perf-platform-card-compact .perf-platform-main h4 {
    font-size: .85rem;
}

.perf-platform-card-compact .perf-platform-actions {
    flex: 0 0 auto;
    width: auto;
}

.perf-platform-card-compact .perf-platform-actions .btn {
    width: auto;
}

@media (max-width: 575.98px) {
    .perf-platform-card-compact {
        align-items: stretch;
        flex-direction: column;
    }

    .perf-platform-card-compact .perf-platform-top {
        flex-direction: row;
    }
}

.perf-platform-top {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
}

.perf-platform-main {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.perf-platform-logo {
    align-items: center;
    background: color-mix(in srgb, var(--platform-accent) 12%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--platform-accent) 28%, #ffffff);
    border-radius: 12px;
    color: var(--platform-accent);
    display: flex;
    flex: 0 0 42px;
    font-size: 15px;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.perf-platform-logo img {
    display: block;
    max-height: 26px;
    max-width: 28px;
    object-fit: contain;
}

.perf-platform-main h4 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
}

.perf-platform-main p {
    color: var(--muted);
    font-size: 12px;
    margin: 2px 0 0;
}

.perf-platform-main small {
    color: #047857;
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.perf-platform-actions {
    align-items: stretch;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.perf-platform-actions .btn {
    width: 100%;
}

@media (max-width: 575.98px) {
    .perf-platform-top {
        flex-direction: column;
    }
}

.panel-name-logo,
.tab-logo {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.panel-name-logo img,
.tab-logo img {
    display: block;
    max-height: 16px;
    max-width: 18px;
    object-fit: contain;
}

.panel-name-logo.is-large {
    height: 34px;
    width: 34px;
}

.panel-name-logo.is-large img {
    max-height: 21px;
    max-width: 24px;
}

.upload-panel-title,
.perf-panel-card-name,
.perf-view-tab {
    align-items: center;
    display: flex;
    gap: 8px;
}

.upload-panel-heading {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.upload-panel-heading__name {
    font-size: inherit;
    font-weight: inherit;
}

.panel-type-pill {
    align-items: center;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    color: var(--text-light);
    display: inline-flex;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    padding: 6px 11px;
    white-space: nowrap;
}

.inline-editable-name {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
}

.inline-editable-name__text {
    border-bottom: 1px dashed transparent;
    cursor: text;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.2;
    transition: border-color 0.15s ease;
}

.inline-editable-name:hover .inline-editable-name__text,
.inline-editable-name.is-editing .inline-editable-name__text {
    border-bottom-color: rgba(15, 23, 42, 0.16);
}

.inline-editable-name__trigger {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    opacity: 0;
    padding: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    width: 28px;
}

.inline-editable-name__trigger svg {
    height: 15px;
    width: 15px;
}

.inline-editable-name:hover .inline-editable-name__trigger,
.inline-editable-name.is-editing .inline-editable-name__trigger {
    opacity: 1;
}

.inline-editable-name__trigger:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text);
}

.inline-editable-name__input {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 0 0 3px rgba(3, 156, 179, 0.08);
    display: none;
    font-size: inherit;
    font-weight: 600;
    max-width: 320px;
    min-width: 180px;
    padding: 6px 10px;
    width: min(320px, 100%);
}

.inline-editable-name.is-editing .inline-editable-name__text {
    display: none;
}

.inline-editable-name.is-editing .inline-editable-name__input {
    display: inline-block;
}

.new-panel-option-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.new-panel-option {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    min-height: 52px;
    padding: 10px 12px;
}

.new-panel-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.new-panel-option:has(input:checked) {
    background: rgba(3, 156, 179, 0.08);
    border-color: rgba(3, 156, 179, 0.42);
    box-shadow: 0 0 0 3px rgba(3, 156, 179, 0.08);
}

.new-panel-option-mark {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    display: inline-flex;
    flex: 0 0 30px;
    font-size: 13px;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.new-panel-option-mark img {
    display: block;
    max-height: 19px;
    max-width: 22px;
    object-fit: contain;
}

.upload-metrics-builder.is-locked {
    background: #f8fafc;
    border-style: dashed;
}

.upload-locked-box {
    align-items: center;
    background: #ffffff;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-height: 118px;
    padding: 18px;
    text-align: center;
}

.upload-locked-box strong {
    color: var(--ink);
}

/* ─── Performance panel — componentes visuais ───────────────────────────────── */

/* Chart card premium */
.perf-chart-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.perf-chart-card.perf-chart-empty {
    padding-bottom: 1.5rem;
}

.perf-chart-empty-state {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: .9rem;
    justify-content: center;
    min-height: 220px;
    padding: 1rem 1.5rem;
    text-align: center;
}

.perf-chart-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 20px 22px 16px;
}

.perf-chart-title {
    font-size: 15px;
    font-weight: 700;
}

.perf-chart-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.perf-chart-area {
    min-height: 300px;
    padding: 0 10px 10px;
}

#crmTabChart .apexcharts-line-series path.apexcharts-line,
#crmTabChart .apexcharts-line {
    stroke-width: 3px;
    vector-effect: non-scaling-stroke;
}

#crmTabChart .apexcharts-legend,
.perf-chart-area .apexcharts-legend {
    padding-top: 8px;
}

/* KPI grid nos painéis */
.perf-kpi-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Badge de tendência melhorado */
.kpi-m-trend.is-warn {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.kpi-m-trend.is-neutral {
    background: rgba(100, 116, 139, 0.1);
    color: var(--muted);
}

/* Section label dentro do painel */
.perf-section-label {
    align-items: center;
    color: var(--text);
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    letter-spacing: 0;
    margin-bottom: 12px;
    text-transform: none;
}

.perf-section-desc {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

/* Cabeçalho de tabela dentro do painel */
.perf-table-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 14px;
}

.perf-table-title {
    font-size: 14px;
    font-weight: 700;
}

.perf-table-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

/* Tabelas do painel */
.perf-table {
    font-size: .875rem;
}

.perf-table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--line);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: .65rem .75rem;
    text-transform: uppercase;
}

.perf-table tbody td {
    border-bottom: 1px solid var(--line);
    padding: .65rem .75rem;
    vertical-align: middle;
}

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

.perf-table tbody tr:hover td {
    background: #f8fafc;
}

.perf-table .fw-600 {
    font-weight: 600;
}

/* Badge de impacto dos eventos */
.perf-impact-badge {
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 8px;
}

.perf-impact-high   { background: rgba(239,68,68,.1);   color: #b91c1c; }
.perf-impact-medium { background: rgba(245,158,11,.1);  color: #b45309; }
.perf-impact-low    { background: rgba(16,185,129,.1);  color: #047857; }

/* Gráfico de pizza inline */
.perf-pie-chart {
    min-height: 300px;
    max-width: 480px;
}

/* Colapso do panel-collapse-btn (reutilizado) */
.panel-collapse-btn {
    color: #94a3b8;
    background: none;
    border: none;
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.panel-collapse-btn:hover { color: #334155; }
.panel-collapse-btn svg { display: block; transition: transform .2s ease; }
.panel-collapse-btn[aria-expanded="false"] svg { transform: rotate(-180deg); }

/* ─── KPI flat grid (todos os cards lado a lado, 4 por linha) ────────────────── */

.perf-kpi-flat {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1199px) {
    .perf-kpi-flat {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .perf-kpi-flat {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .perf-kpi-flat {
        grid-template-columns: 1fr;
    }
}

/* Eyebrow label dentro do kpi-card-m */
.kpi-m-eyebrow {
    color: var(--kpi-accent, var(--primary));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    margin-bottom: 10px;
    opacity: .85;
    padding-right: 30px;
    text-transform: uppercase;
}

/* ─── Resumo do perfil do Instagram ──────────────────────────────────────────── */

.perf-instagram-profile {
    align-items: center;
    display: flex;
    gap: 18px;
}

.perf-instagram-avatar {
    border-radius: 50%;
    flex-shrink: 0;
    height: 64px;
    overflow: hidden;
    width: 64px;
}

.perf-instagram-avatar img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.perf-instagram-avatar-fallback {
    align-items: center;
    background: var(--primary);
    color: #fff;
    display: flex;
    font-size: 1.5rem;
    font-weight: 700;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.perf-instagram-info {
    align-items: center;
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: space-between;
}

.perf-instagram-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.perf-instagram-name strong {
    font-size: 1.05rem;
}

.perf-instagram-stats {
    display: flex;
    gap: 28px;
}

.perf-instagram-stat {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.perf-instagram-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.perf-instagram-stat-label {
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

@media (max-width: 575px) {
    .perf-instagram-profile {
        text-align: center;
    }

    .perf-instagram-info,
    .perf-instagram-name {
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .perf-instagram-stats {
        gap: 18px;
        justify-content: center;
        width: 100%;
    }
}

/* ─── Ranking de publicações / campanhas em destaque ─────────────────────────── */

.perf-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.perf-ranking-item {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    gap: 14px;
    padding: 12px 16px;
}

.perf-ranking-rank {
    align-items: center;
    background: var(--primary);
    border-radius: 8px;
    color: #fff;
    display: flex;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.perf-ranking-logo {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: flex;
    flex-shrink: 0;
    height: 36px;
    justify-content: center;
    overflow: hidden;
    width: 36px;
}

.perf-ranking-logo img {
    height: 20px;
    object-fit: contain;
    width: 20px;
}

.perf-ranking-thumb {
    background: #f1f5f9;
    border: 1px solid var(--line);
    border-radius: 12px;
    flex-shrink: 0;
    height: 56px;
    overflow: hidden;
    position: relative;
    width: 56px;
}

.perf-ranking-thumb img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.perf-ranking-thumb-badge {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    bottom: -4px;
    display: flex;
    height: 20px;
    justify-content: center;
    overflow: hidden;
    position: absolute;
    right: -4px;
    width: 20px;
}

.perf-ranking-thumb-badge img {
    height: 12px;
    object-fit: contain;
    width: 12px;
}

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

.perf-ranking-title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
}

.perf-ranking-type {
    background: rgba(3, 156, 179, .1);
    border-radius: 999px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    text-transform: capitalize;
}

.perf-ranking-date {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.perf-ranking-metrics {
    display: flex;
    flex-shrink: 0;
    gap: 22px;
}

.perf-ranking-metric {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    min-width: 64px;
}

.perf-ranking-metric-value {
    font-size: 14px;
    font-weight: 700;
}

.perf-ranking-metric-label {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .perf-ranking-item {
        flex-wrap: wrap;
    }

    .perf-ranking-metrics {
        gap: 14px;
        margin-left: 46px;
        width: 100%;
    }

    .perf-ranking-metric {
        align-items: flex-start;
    }
}

/* Tabs do ranking de tráfego pago (anúncio / conjunto / campanha) */
.perf-ranking-tabs {
    border-bottom: 1px solid var(--line);
    flex-wrap: nowrap;
    gap: 4px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.perf-ranking-tabs .nav-link {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    margin-right: 20px;
    padding: 0 2px 10px;
    white-space: nowrap;
}

.perf-ranking-tabs .nav-link:hover {
    border-color: var(--line);
    color: var(--text);
}

.perf-ranking-tabs .nav-link.active {
    border-color: var(--primary);
    color: var(--primary);
}

.perf-ranking-tab-content {
    padding-top: 2px;
}

/* ─── Painéis conectados — seção rodapé de cada view ─────────────────────────── */

.perf-connected-panels {
    border-top: 1px solid var(--line);
    padding-top: 2rem;
}

.perf-config-stack .perf-connected-panels {
    border-top: 0;
    padding-top: 0;
}

.perf-panel-cards-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.perf-panel-pair {
    display: flex;
    flex-direction: column;
}

.perf-pair-link {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 auto;
    padding: 6px 0;
}

.perf-pair-link-line {
    border-left: 2px dashed var(--line);
    height: 10px;
    width: 0;
}

.perf-pair-link-icon {
    align-items: center;
    background: var(--panel);
    border: 1.5px dashed var(--line);
    border-radius: 999px;
    display: flex;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.perf-panel-pair:has(.perf-pair-link) > .upload-config-placeholder:first-child {
    flex: 1;
}

.upload-config-placeholder-compact {
    align-items: center;
    flex-direction: row;
    gap: .75rem;
    min-height: auto;
    padding: .75rem 1rem;
    text-align: left;
}

.upload-config-placeholder-compact .upload-config-plus {
    flex: 0 0 36px;
    font-size: 1.25rem;
    height: 36px;
    width: 36px;
}

.upload-config-placeholder-text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.upload-config-placeholder-compact .upload-config-label {
    font-size: .85rem;
}

.upload-config-placeholder-compact .text-muted {
    font-size: .75rem;
}

.perf-panel-card-empty {
    background: var(--bg);
    border-style: dashed;
    justify-content: space-between;
}

.perf-create-options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

.perf-connect-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.perf-connect-list-item {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    gap: .75rem;
    padding: .65rem .85rem;
}

.perf-connect-list-item p {
    font-size: .8rem;
    margin: 0;
}

.perf-panel-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 160px;
    padding: 1.25rem;
    transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.perf-panel-card:hover {
    border-color: #99E0EA;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.perf-panel-card.is-active-panel {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(3,156,179,.15), var(--shadow-md);
}

.perf-panel-card.is-disabled-panel {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.perf-panel-card-body {
    flex: 1;
}

.perf-panel-card-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: .3rem 0 .4rem;
}

.perf-panel-card-file {
    color: var(--muted);
    font-size: .8rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.perf-panel-card-meta {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: grid;
    gap: .15rem;
    margin: .65rem 0 .75rem;
    padding: .65rem .75rem;
}

.perf-panel-card-meta span {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.perf-panel-card-meta strong {
    color: var(--navy);
    font-size: .9rem;
}

.perf-panel-card-meta small {
    color: var(--muted);
    font-size: .76rem;
}

.perf-panel-config-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.perf-panel-card-meta .perf-panel-config-status {
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: .76rem;
    font-weight: 700;
    gap: .2rem;
    letter-spacing: 0;
    padding: .25rem .55rem;
    text-transform: none;
}

.perf-panel-card-meta .perf-panel-config-status strong {
    color: inherit;
    font-size: inherit;
}

.perf-panel-config-status.is-complete {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.perf-panel-config-status.is-pending {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.perf-panel-card-footer {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
}

.panel-status-form {
    line-height: 1;
}

.panel-switch-control {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: .45rem;
    min-height: 1.5rem;
    padding-left: 2.5rem;
}

.panel-switch-control span {
    color: var(--muted);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 800;
}

.panel-switch-control .form-check-input {
    cursor: pointer;
}

.upload-panel-status {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem;
}

.perf-connected-empty {
    align-items: center;
    background: var(--bg);
    border: 1.5px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    font-size: .9rem;
    gap: .75rem;
    min-height: 140px;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.perf-connected-empty svg {
    height: 32px;
    opacity: .3;
    width: 32px;
}

/* ─── Calendário de Comunicação ──────────────────────────────────────────────── */

.calendario-summary-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1199px) {
    .calendario-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .calendario-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .calendario-summary-grid {
        grid-template-columns: 1fr;
    }
}

.calendario-filters {
    align-items: flex-end;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 18px;
}

.calendario-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.calendario-channel-legend {
    align-items: center;
    column-gap: 14px;
    display: flex;
    flex-wrap: wrap;
    margin-left: auto;
    row-gap: 6px;
}

.calendario-legend-item {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 12px;
    gap: 6px;
}

.calendario-channel-dot {
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    height: 8px;
    width: 8px;
}

.calendario-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
    padding: 20px;
}

/* FullCalendar — alinhamento com o design system */
.fc {
    font-family: inherit;
}

.fc .fc-toolbar-title {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.fc .fc-button-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.fc .fc-button-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.fc .fc-button-primary:disabled {
    background-color: var(--primary);
    border-color: var(--primary);
    opacity: .5;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.fc .fc-day-today {
    background-color: rgba(3, 156, 179, 0.06) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
    background: var(--primary);
    box-shadow: 0 4px 10px rgba(3, 156, 179, 0.35);
    color: #fff;
}

.fc-event {
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    padding: 1px 4px;
}

.fc-daygrid-day-frame {
    position: relative;
}

.fc-daygrid-day-top {
    padding: 4px;
}

.fc-daygrid-day-number {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    min-width: 26px;
    padding: 2px 8px;
    text-align: center;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.calendario-day-add-btn {
    align-items: center;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: flex;
    height: 22px;
    justify-content: center;
    left: 4px;
    opacity: 0;
    padding: 0;
    position: absolute;
    top: 4px;
    transition: opacity .15s ease, background-color .15s ease;
    width: 22px;
    z-index: 4;
}

.calendario-day-add-btn:hover {
    background: var(--primary-dark);
}

.calendario-day-add-btn svg {
    height: 14px;
    pointer-events: none;
    width: 14px;
}

.fc-daygrid-day-frame:hover .calendario-day-add-btn,
.calendario-day-add-btn:focus-visible {
    opacity: 1;
}

/* ─── Indicador de período de campanhas/projetos (dentro das células do calendário) ── */

.calendario-workspace-markers {
    bottom: 3px;
    display: flex;
    gap: 3px;
    left: 3px;
    pointer-events: none;
    position: absolute;
    right: 3px;
    z-index: 3;
}

.calendario-workspace-marker {
    border-radius: 3px;
    cursor: pointer;
    flex: 1 1 0;
    height: 6px;
    pointer-events: auto;
    transition: transform .15s ease;
}

.calendario-workspace-marker:hover {
    transform: scaleY(1.6);
}

.calendario-workspace-marker:hover {
    transform: scale(1.4);
}

/* ─── Workspaces ─────────────────────────────────────────────────────────────── */

.workspace-back-link {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color .15s ease;
}

.workspace-back-link:hover {
    color: var(--primary);
}

/* Empty state (listagem) */
.workspace-empty-state {
    align-items: center;
    background: var(--bg);
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    margin-top: 1.5rem;
    min-height: 320px;
    padding: 2.5rem;
    text-align: center;
}

.workspace-empty-state svg {
    color: var(--text-light);
    height: 48px;
    margin-bottom: 6px;
    opacity: .4;
    width: 48px;
}

.workspace-empty-state h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.workspace-empty-state p {
    color: var(--muted);
    font-size: .9rem;
    margin: 0;
    max-width: 420px;
}

/* Empty state (dentro de abas) */
.workspace-tab-empty {
    align-items: center;
    background: var(--bg);
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    min-height: 220px;
    padding: 2.5rem;
    text-align: center;
}

.workspace-tab-empty svg {
    color: var(--text-light);
    height: 40px;
    margin-bottom: 6px;
    opacity: .4;
    width: 40px;
}

.workspace-tab-empty h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.workspace-tab-empty p {
    color: var(--muted);
    font-size: .9rem;
    margin: 0;
    max-width: 420px;
}

/* Toolbar (busca, filtros, toggle de visualização) */
.workspace-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.workspace-search {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    flex: 1 1 240px;
    gap: 8px;
    max-width: 320px;
    padding: 8px 12px;
}

.workspace-search svg {
    color: var(--text-light);
    flex-shrink: 0;
    height: 18px;
    width: 18px;
}

.workspace-search-input {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 14px;
    outline: none;
    width: 100%;
}

.workspace-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workspace-filter-chip {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.workspace-filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.workspace-filter-chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.workspace-status-filter .dropdown-menu {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
    min-width: 180px;
    padding: 6px;
}

.workspace-status-filter .dropdown-item {
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
}

.workspace-status-filter .dropdown-item:hover,
.workspace-status-filter .dropdown-item:focus {
    background: var(--primary-light, #E0F7FA);
    color: var(--primary);
}

.workspace-view-toggle {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: inline-flex;
    overflow: hidden;
}

.workspace-view-toggle button {
    align-items: center;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    height: 36px;
    justify-content: center;
    transition: background-color .15s ease, color .15s ease;
    width: 36px;
}

.workspace-view-toggle button svg {
    height: 16px;
    width: 16px;
}

.workspace-view-toggle button + button {
    border-left: 1px solid var(--line);
}

.workspace-view-toggle button.is-active {
    background: var(--primary);
    color: #fff;
}

.workspace-toolbar-filters {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.workspace-toolbar-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

/* Cards */
.workspace-cards-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    margin-top: 16px;
}

.workspace-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 4px solid var(--ws-color, var(--primary));
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    color: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    text-decoration: none;
    transition: box-shadow .2s ease, transform .2s ease;
}

.workspace-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.workspace-card-header {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.workspace-card-title {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.workspace-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.workspace-card-desc,
.workspace-card-objective {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.workspace-card-desc strong,
.workspace-card-objective strong {
    color: var(--text);
}

.workspace-card-dates {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 12px;
}

.workspace-card-footer {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 12px;
    justify-content: space-between;
}

.workspace-item-card .workspace-card-footer {
    gap: 4px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 4px;
}

.workspace-card-footer-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.workspace-card-actions {
    align-items: center;
    display: flex;
    gap: 4px;
}

/* Badges */
.workspace-type-badge,
.workspace-status-badge,
.workspace-priority-badge {
    border-radius: 6px;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 4px 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.workspace-type-badge.is-campanha {
    background: rgba(3, 156, 179, 0.12);
    color: #0E7490;
}

.workspace-type-badge.is-projeto {
    background: rgba(139, 92, 246, 0.12);
    color: #6d28d9;
}

.workspace-type-badge.is-diversos {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.workspace-type-badge.is-brand_hub {
    background: rgba(245, 158, 11, .12);
    color: #b45309;
}

.workspace-status-badge.is-planejado {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.workspace-status-badge.is-ativo {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.workspace-status-badge.is-em_andamento,
.workspace-status-badge.is-desenvolvendo {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.workspace-status-badge.is-pronto_revisao {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.workspace-status-badge.is-pausado {
    background: rgba(168, 85, 247, 0.12);
    color: #7e22ce;
}

.workspace-status-badge.is-concluido {
    background: rgba(4, 120, 87, 0.16);
    color: #065f46;
}

.workspace-status-badge.is-cancelado {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.workspace-status-badge.is-arquivado {
    background: rgba(51, 65, 85, 0.12);
    color: #334155;
}

.workspace-priority-badge.is-baixa {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.workspace-priority-badge.is-media {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.workspace-priority-badge.is-alta {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.workspace-priority-badge.is-muito_alta {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

/* Barra de progresso */
.workspace-progress-bar {
    background: var(--line);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
    width: 100%;
}

.workspace-progress-bar-fill {
    background: var(--primary);
    border-radius: 999px;
    height: 100%;
    transition: width .3s ease;
}

.workspace-progress-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

/* Tabela */
.workspace-table {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
    overflow: hidden;
}

.workspace-table thead th {
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.workspace-table tbody td {
    font-size: 13px;
    vertical-align: middle;
}

.workspace-table-row {
    cursor: pointer;
}

.workspace-table-color-dot {
    border-radius: 50%;
    display: inline-block;
    height: 8px;
    margin-right: 6px;
    width: 8px;
}

.workspace-actions-cell {
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    width: 1%;
}

.workspace-actions-cell-inner {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 4px;
    justify-content: flex-start;
}

.workspace-table-add-row {
    cursor: pointer;
}

.workspace-table-add-row td {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    padding: 14px 16px;
    text-align: center;
    transition: background-color .15s ease, color .15s ease;
}

.workspace-table-add-row:hover td {
    background-color: var(--primary-light, #E0F7FA);
    color: var(--primary);
}

.workspace-add-card {
    align-items: center;
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    min-height: 110px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.workspace-add-card:hover {
    background-color: var(--primary-light, #E0F7FA);
    border-color: var(--primary);
    color: var(--primary);
}

.workspace-icon-btn {
    align-items: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    width: 32px;
}

.workspace-icon-btn svg {
    height: 16px;
    width: 16px;
}

.workspace-icon-btn:hover {
    background-color: var(--primary-light, #E0F7FA);
    border-color: var(--primary);
    color: var(--primary);
}

.workspace-icon-btn.is-danger:hover {
    background-color: #fef2f2;
    border-color: var(--danger);
    color: var(--danger);
}

.workspace-icon-btn.is-starred {
    background-color: rgba(245, 158, 11, 0.12);
    border-color: var(--warning);
    color: var(--warning);
}

.workspace-icon-btn.is-starred:hover {
    background-color: rgba(245, 158, 11, 0.2);
    border-color: var(--warning);
    color: var(--warning);
}

.workspace-conteudo-btn.dropdown-toggle::after {
    display: none;
}

.workspace-conteudo-menu {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
    min-width: 190px;
    padding: 6px;
}

.workspace-conteudo-menu .dropdown-item {
    align-items: center;
    border-radius: 8px;
    color: var(--text);
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    padding: 6px 12px;
}

.workspace-conteudo-menu .dropdown-item svg {
    height: 14px;
    width: 14px;
}

.workspace-conteudo-menu .dropdown-item:hover,
.workspace-conteudo-menu .dropdown-item:focus {
    background: var(--primary-light, #E0F7FA);
    color: var(--primary);
}

.workspace-conteudo-menu .dropdown-item.is-ia svg {
    color: var(--accent);
}

.workspace-table-truncate {
    display: block;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal de visualização (Módulos/Atividades) */
.workspace-view-badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.workspace-view-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.workspace-view-field {
    margin-bottom: 14px;
}

.workspace-view-field:last-child {
    margin-bottom: 0;
}

.workspace-view-label {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.workspace-view-value {
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Seletor de cor */
.workspace-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.workspace-color-swatch {
    background: var(--swatch-color, var(--primary));
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    height: 28px;
    padding: 0;
    transition: border-color .15s ease, transform .15s ease;
    width: 28px;
}

.workspace-color-swatch:hover {
    transform: scale(1.1);
}

.workspace-color-swatch.is-selected {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--swatch-color, var(--primary));
}

.workspace-modal-section-title {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* Cabeçalho da página de detalhe */
.workspace-header-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 4px solid var(--ws-color, var(--primary));
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    padding: 20px;
}

.workspace-header-top {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
}

.workspace-header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.workspace-header-desc {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 4px 0;
}

.workspace-header-desc strong {
    color: var(--text);
}

.workspace-header-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 600;
    gap: 20px;
    margin: 12px 0 8px;
}

/* Abas */
.workspace-tabs {
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}

.workspace-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-weight: 600;
    padding: 10px 16px;
}

.workspace-tabs .nav-link:hover {
    color: var(--primary);
}

.workspace-tabs .nav-link.active {
    background: transparent;
    border-bottom-color: var(--primary);
    color: var(--primary);
}

/* Dashboard */
.workspace-dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1199.98px) {
    .workspace-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .workspace-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .workspace-status-card-2of3 {
        grid-column: span 1;
    }
}

.workspace-status-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
}

.workspace-status-card.is-atrasado {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.35);
}

.workspace-status-card-2of3 {
    grid-column: span 2;
}

.workspace-status-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
}

.workspace-status-card-title-center {
    text-align: center;
}

.workspace-status-card-chart {
    margin-bottom: 8px;
}

.workspace-status-card-chart-empty {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: .875rem;
    justify-content: center;
    min-height: 120px;
    padding: 1rem;
    text-align: center;
}

.workspace-kpi-headline {
    align-items: baseline;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.workspace-kpi-headline-value {
    color: var(--text);
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.workspace-kpi-headline-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.workspace-status-card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, 1fr);
}

.workspace-status-card-grid-3 {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);
}

.workspace-status-item {
    border-left: 3px solid var(--item-accent, var(--primary));
    padding-left: 12px;
}

.workspace-status-item-value {
    color: var(--item-accent, var(--text));
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.1;
}

.workspace-status-item-value-sm {
    color: var(--item-accent, var(--text));
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.workspace-status-item-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
}

.workspace-status-item-label-sm {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}

.workspace-status-item-flat {
    align-items: baseline;
    display: flex;
    gap: 4px;
    text-align: start;
}

.workspace-status-item-flat .workspace-status-item-label-sm {
    color: var(--item-accent, var(--muted));
    margin-top: 0;
}

.workspace-upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.workspace-upcoming-item {
    align-items: center;
    border-bottom: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    margin: 0 -8px;
    padding: 6px 8px 10px;
    transition: background-color .15s ease;
}

.workspace-upcoming-item:hover {
    background-color: var(--bg);
}

.workspace-upcoming-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.workspace-upcoming-date {
    background: rgba(3, 156, 179, 0.1);
    border-radius: 6px;
    color: #0E7490;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
}

.workspace-upcoming-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Progresso por backlog — barra de progresso com nome/percentual sobrepostos */
.workspace-progresso-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.workspace-progresso-row {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: border-color .15s ease;
}

.workspace-progresso-row:hover,
.workspace-progresso-row:focus-visible {
    border-color: var(--primary);
}

.workspace-progresso-row-fill {
    background: rgba(3, 156, 179, .18);
    bottom: 0;
    left: 0;
    position: absolute;
    top: 0;
}

.workspace-progresso-row-content {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 14px;
    position: relative;
}

.workspace-progresso-row-label {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-progresso-row-value {
    color: var(--primary);
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
}

/* Horas do Workspace (2/3) — gráfico à esquerda, dados à direita */
.workspace-horas-layout {
    align-items: center;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(180px, 240px) 1fr;
}

.workspace-horas-chart-col .workspace-status-card-chart {
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .workspace-horas-layout {
        grid-template-columns: 1fr;
    }
}

/* Link "ver todos" / "ver tudo" */
.workspace-link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    padding: 0;
}

.workspace-link-btn:hover {
    text-decoration: underline;
}

/* Cronograma + Próximas Entregas (2/3) — estatísticas à esquerda, lista à direita */
.workspace-cronograma-entregas-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(160px, 220px) 1fr;
}

.workspace-cronograma-stats {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width: 575.98px) {
    .workspace-cronograma-entregas-layout {
        grid-template-columns: 1fr;
    }
}

/* Backlog / Planning */
.workspace-section-toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.workspace-item-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    transition: border-color .15s ease;
}

.workspace-item-card:hover,
.workspace-item-card:focus-visible {
    border-color: var(--primary);
}

/* Planning: features (backlog items) como itens pai expansíveis */
.workspace-feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workspace-feature {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.workspace-feature-header-row {
    align-items: center;
    display: flex;
}

.workspace-feature-header {
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    font: inherit;
    gap: 12px;
    min-width: 0;
    padding: 14px 18px;
    row-gap: 6px;
    text-align: left;
}

.workspace-feature-add-btn {
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1.4;
    margin-right: 18px;
    padding: 4px 12px;
}

.workspace-feature-chevron {
    color: var(--muted);
    flex-shrink: 0;
    height: 18px;
    transition: transform .2s ease;
    width: 18px;
}

.workspace-feature-header.collapsed .workspace-feature-chevron {
    transform: rotate(-90deg);
}

.workspace-feature-title {
    flex: 1 1 auto;
    font-size: .95rem;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-feature-progress {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-feature-count {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.workspace-feature-body {
    border-top: 1px solid var(--line);
    padding: 16px 18px;
}

.workspace-feature.is-focused {
    animation: workspace-feature-focus 1.6s ease-out;
}

@keyframes workspace-feature-focus {
    0%, 60% {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(3, 156, 179, .25);
    }
    100% {
        border-color: var(--line);
        box-shadow: var(--shadow-sm);
    }
}

/* ───────────────────────── Conteúdo (aba de Workspace) ───────────────────────── */

/* Cards de conteúdo */
.conteudo-cards-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin-top: 16px;
}

.conteudo-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 4px solid var(--conteudo-accent, var(--primary));
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    transition: box-shadow .2s ease, transform .2s ease;
}

.conteudo-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.conteudo-card-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: space-between;
}

.conteudo-card-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.conteudo-card-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 12px;
}

.conteudo-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.conteudo-card-footer {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 8px;
    justify-content: space-between;
    margin-top: auto;
}

.conteudo-card.conteudo-card-add {
    align-items: center;
    border-color: var(--line);
    border-left-color: var(--line);
    border-style: dashed;
    border-width: 1.5px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    min-height: 110px;
    text-align: center;
}

.conteudo-card.conteudo-card-add:hover {
    background-color: var(--primary-light, #E0F7FA);
    border-color: var(--primary);
    box-shadow: none;
    color: var(--primary);
    transform: none;
}

/* Indicador de atraso */
.conteudo-atraso-flag {
    background: rgba(239, 68, 68, 0.12);
    border-radius: 6px;
    color: #b91c1c;
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    margin-left: 6px;
    padding: 2px 6px;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

/* Badges */
.conteudo-status-badge,
.conteudo-categoria-badge,
.conteudo-origem-badge,
.conteudo-canal-badge {
    border-radius: 6px;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 4px 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.conteudo-categoria-badge,
.conteudo-origem-badge,
.conteudo-canal-badge {
    background: rgba(3, 156, 179, 0.1);
    color: #0E7490;
}

.conteudo-status-badge.is-planejado {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.conteudo-status-badge.is-rascunho {
    background: rgba(148, 163, 184, 0.18);
    color: #64748b;
}

.conteudo-status-badge.is-executando {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.conteudo-status-badge.is-em_aprovacao {
    background: rgba(6, 182, 212, 0.12);
    color: #0e7490;
}

.conteudo-status-badge.is-aprovado {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.conteudo-status-badge.is-concluido {
    background: rgba(16, 185, 129, 0.16);
    color: #065f46;
}

.conteudo-status-badge.is-cancelado {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

/* Accent (borda lateral dos cards) por status */
.conteudo-card[data-status="planejado"] { --conteudo-accent: #64748b; }
.conteudo-card[data-status="rascunho"] { --conteudo-accent: #94a3b8; }
.conteudo-card[data-status="executando"] { --conteudo-accent: #f59e0b; }
.conteudo-card[data-status="em_aprovacao"] { --conteudo-accent: #06b6d4; }
.conteudo-card[data-status="aprovado"] { --conteudo-accent: #22c55e; }
.conteudo-card[data-status="concluido"] { --conteudo-accent: #10b981; }
.conteudo-card[data-status="cancelado"] { --conteudo-accent: #ef4444; }

.biblioteca-tag {
    background: rgba(3, 156, 179, 0.08);
    border-radius: 999px;
    color: var(--primary);
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
}

/* Painel lateral (offcanvas) */
.conteudo-offcanvas {
    width: 440px;
}

.conteudo-panel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.conteudo-panel-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.conteudo-panel-description {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 0;
}

.conteudo-panel-description:empty {
    display: none;
}

.conteudo-panel-section {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 16px;
}

.conteudo-panel-section-title {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 11px;
    font-weight: 700;
    gap: 8px;
    justify-content: space-between;
    letter-spacing: .04em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.conteudo-panel-dl {
    display: grid;
    gap: 8px 12px;
    grid-template-columns: 130px 1fr;
    margin: 0;
}

.conteudo-panel-dl dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.conteudo-panel-dl dd {
    font-size: 13px;
    margin: 0;
}

.conteudo-panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.conteudo-panel-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-top: 20px;
}

/* Aprovação — comentários e botão de revisão */
.conteudo-revisar-btn {
    text-transform: none;
    letter-spacing: normal;
}

.conteudo-comentarios-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    max-height: 220px;
    overflow-y: auto;
}

.conteudo-comentario-item {
    background: var(--surface, #f8fafc);
    border-radius: 8px;
    padding: 8px 10px;
}

.conteudo-comentario-meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.conteudo-comentario-texto {
    font-size: 13px;
    white-space: pre-wrap;
}

.conteudo-comentarios-empty {
    color: var(--muted);
    font-size: 12px;
    margin: 0 0 12px;
}

.conteudo-comentario-form textarea {
    resize: vertical;
}

.conteudo-panel-midia-preview:empty {
    display: none;
}

.conteudo-panel-midia-img {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    max-width: 100%;
}

.score-stat-card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 12px; padding: 16px; text-align: center;
}
.score-stat-card.is-highlight { background: rgba(3, 156, 179, 0.06); border-color: rgba(3, 156, 179, 0.25); }
.score-stat-label { color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.score-stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; margin-bottom: 8px; }

.score-status-badge {
    border-radius: 6px; display: inline-block; font-size: 11px; font-weight: 700;
    letter-spacing: .03em; padding: 4px 10px; text-transform: uppercase; white-space: nowrap;
}
.score-status-badge.is-muito-fraco { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.score-status-badge.is-fraco { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.score-status-badge.is-medio { background: rgba(14, 165, 233, 0.12); color: #0369a1; }
.score-status-badge.is-forte { background: rgba(16, 185, 129, 0.12); color: #047857; }
.score-status-badge.is-muito-forte { background: rgba(4, 120, 87, 0.16); color: #065f46; }

.concorrente-score-mini {
    display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 6px 12px; min-width: 230px;
}
.concorrente-score-mini-item { display: flex; flex-direction: column; gap: 2px; }
.concorrente-score-mini-label { color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; }
.concorrente-score-mini-value { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }

.concorrente-rank-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-muted); color: var(--primary);
    border-radius: 6px; font-size: 12px; font-weight: 700;
    min-width: 28px; padding: 2px 6px; letter-spacing: .01em;
}
