/* ===== Variáveis CSS e Tokens de Design — identidade Zeerone =====
   Navy #12122B da marca, roxo #8B7DFF como acento primário, ciano #00C2FF (positivo/info)
   e coral #FF5A36 (negativo/alerta). Tipografia Archivo (display + corpo) e IBM Plex Mono
   (labels em caixa-alta, timestamps e números). Sem verde-vermelho genérico de sentimento. */
:root {
    /* Cores */
    --bg-primary: #0C0C1E;
    --bg-secondary: #12122B;
    --bg-card: rgba(255, 255, 255, 0.028);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --bg-sidebar: #12122B;
    --bg-input: rgba(255, 255, 255, 0.04);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.66);
    --text-muted: rgba(255, 255, 255, 0.42);

    --accent-1: #8B7DFF; /* Roxo Zeerone — acento primário */
    --accent-1-light: #A79BFF;
    --accent-2: #00C2FF; /* Ciano — positivo / informativo */
    --accent-2-light: #5FD8FF;
    --accent-3: #FFB020; /* Âmbar — atenção / "importante" */
    --accent-3-light: #FFC24D;
    --accent-4: #FF5A36; /* Coral — negativo / alerta */
    --accent-4-light: #FF8B6B;
    --accent-5: #6C4BF6; /* Roxo profundo */
    --accent-6: #FF5A36; /* Coral (ex-rosa) */
    --accent-7: #00C2FF; /* Ciano (ex-ciano) */

    /* Cores canônicas de canal — usadas pelos channel-card e badges de canal do Feed.
       O protótipo Zeerone veste Instagram em roxo, Facebook em ciano e Google em coral. */
    --color-instagram: #A79BFF;
    --color-instagram-bg: rgba(139, 125, 255, 0.14);
    --color-facebook: #5FD8FF;
    --color-facebook-bg: rgba(0, 194, 255, 0.12);
    --color-google: #FF8B6B;
    --color-google-bg: rgba(255, 90, 54, 0.12);

    /* Cores de sentimento — mesma paleta usada pelo badge de avaliação (renderAvaliacaoBadge) */
    --color-sentiment-pos: #00C2FF;
    --color-sentiment-pos-bg: rgba(0, 194, 255, 0.12);
    --color-sentiment-neu: rgba(255, 255, 255, 0.6);
    --color-sentiment-neu-bg: rgba(255, 255, 255, 0.08);
    --color-sentiment-neg: #FF5A36;
    --color-sentiment-neg-bg: rgba(255, 90, 54, 0.13);

    --gradient-1: linear-gradient(135deg, #8B7DFF, #6C4BF6);
    --gradient-2: linear-gradient(135deg, #00C2FF, #5FD8FF);
    --gradient-3: linear-gradient(135deg, #FFB020, #FF5A36);
    --gradient-4: linear-gradient(135deg, #8B7DFF, #00C2FF);

    --border-color: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(139, 125, 255, 0.3);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
    --shadow-glow: 0 18px 40px -18px rgba(139, 125, 255, 0.45);

    /* Tipografia — Archivo para display (800) e corpo; IBM Plex Mono para
       rótulos em caixa-alta, timestamps e números tabulares. */
    --font-display: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    /* Leiaute */
    --sidebar-width: 268px;
    --sidebar-collapsed: 72px;
    --topbar-height: 76px;
    --radius-sm: 8px;
    --radius-md: 11px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Transições */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Tema claro — alternado via #themeToggleBtn (ver common.js::initThemeToggle) ===== */
:root.light-mode {
    --bg-primary: #F4F4FB;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #F4F4FB;
    --bg-sidebar: #12122B;   /* sidebar segue navy da marca mesmo no tema claro */
    --bg-input: rgba(18, 18, 43, 0.04);

    --text-primary: #12122B;
    --text-secondary: #4A4A63;
    --text-muted: #6C6C85;

    --color-sentiment-neu: #6C6C85;
    --color-sentiment-neu-bg: rgba(18, 18, 43, 0.06);

    --border-color: rgba(18, 18, 43, 0.1);
    --border-glow: rgba(139, 125, 255, 0.35);

    --shadow-sm: 0 2px 8px rgba(18, 18, 43, 0.06);
    --shadow-md: 0 10px 30px -12px rgba(18, 18, 43, 0.14);
    --shadow-lg: 0 24px 60px -30px rgba(18, 18, 43, 0.22);
    --shadow-glow: 0 16px 36px -18px rgba(139, 125, 255, 0.4);

    --accent-1-light: #6C4BF6;
    --accent-2-light: #0098CC;
    --accent-3-light: #C77F00;
    --accent-4-light: #E5431F;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Reset e Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== Acessibilidade: foco visível para navegação por teclado =====
   Vários componentes usam `outline: none` por estética; este anel compensa,
   garantindo que todo elemento interativo tenha indicação clara de foco. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent-1-light);
    border-radius: 4px;
}

/* ===== Animated Background ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-1);
    top: -200px;
    left: -100px;
    animation: orbFloat1 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-5);
    top: 50%;
    right: -150px;
    animation: orbFloat2 25s ease-in-out infinite;
}

.bg-orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent-7);
    bottom: -100px;
    left: 40%;
    animation: orbFloat3 22s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, 50px) scale(1.1); }
    66% { transform: translate(-50px, 100px) scale(0.9); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, -60px) scale(0.9); }
    66% { transform: translate(60px, -30px) scale(1.1); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(70px, -80px) scale(1.1); }
    66% { transform: translate(-40px, 60px) scale(0.95); }
}

/* ===== Barra de rolagem ===== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--accent-1);
    border-radius: 10px;
}

/* ===== Menu lateral ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-medium), transform var(--transition-medium);
}

.sidebar-header {
    padding: 20px 16px 20px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
}

.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.6);
}

.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.page-switcher {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-switcher-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--gradient-1);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-1-light);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.data-source-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.data-source-info i {
    color: var(--accent-2);
    flex-shrink: 0;
}

/* ===== Estado Recolhido da Sidebar ===== */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 8px;
    justify-content: center;
    position: relative;
}

.sidebar.collapsed .logo {
    gap: 0;
}

.sidebar.collapsed .logo-icon {
    width: 38px;
    height: 38px;
}

.sidebar.collapsed .sidebar-collapse-btn {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    font-size: 9px;
}

.sidebar.collapsed .page-switcher {
    padding: 0 10px 16px;
    align-items: center;
}

.sidebar.collapsed .page-switcher-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0 auto;
    border-radius: var(--radius-md);
}

.sidebar.collapsed .page-switcher-btn span {
    display: none;
}

.sidebar.collapsed .page-switcher-btn i {
    margin: 0;
    font-size: 16px;
}

.sidebar.collapsed .sidebar-nav {
    padding: 14px 8px;
    align-items: center;
}

.sidebar.collapsed .nav-item {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0 auto;
    justify-content: center;
    gap: 0;
    border-radius: var(--radius-md);
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item i {
    width: auto;
    font-size: 18px;
    margin: 0;
}

.sidebar.collapsed .sidebar-footer {
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar.collapsed .data-source-info {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .data-source-info span {
    display: none;
}

.sidebar.collapsed .data-source-info i {
    font-size: 18px;
    margin: 0;
}

.sidebar.collapsed .account-info {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 0;
    margin-top: 8px;
    width: 100%;
}

.sidebar.collapsed .account-info-user {
    justify-content: center;
}

.sidebar.collapsed .account-info-user span {
    display: none;
}

.sidebar.collapsed .account-info-user i {
    font-size: 18px;
    margin: 0;
}

.sidebar.collapsed .account-info-actions {
    display: none;
}

.sidebar.collapsed:hover .account-info-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* ===== Conteúdo principal ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: margin-left var(--transition-medium);
}

.main-content.sidebar-collapsed,
body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ===== Barra superior ===== */
.top-bar {
    position: relative;
    z-index: 50;
    height: var(--topbar-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    gap: 16px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.page-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Alerta de fila: pulso lembra a brasa acesa do grill — urgência que respira, não pisca. */
.queue-alert {
    margin-left: 20px;
    color: var(--accent-4-light);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.12);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: emberPulse 2.4s ease-in-out infinite;
}

@keyframes emberPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.35); }
}

/* ===== Barra de filtros (inside Records section) ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    backdrop-filter: blur(20px);
}

.filter-shortcuts {
    display: flex;
    gap: 4px;
}

.filter-shortcut {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-body);
    padding: 4px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-shortcut:hover {
    border-color: var(--accent-1);
    color: var(--accent-1-light);
    background: rgba(99, 102, 241, 0.08);
}

.filter-shortcut.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
}

.date-input:focus {
    border-color: var(--accent-1);
}

.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 28px 6px 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.filter-select:focus {
    border-color: var(--accent-1);
}

/* .filter-select é pensado pra <select> (seta e cursor de ponteiro) — inputs de texto/senha que
   reaproveitam a classe pelo espaçamento/cor não devem herdar nem uma coisa nem outra. */
input.filter-select {
    cursor: text;
    background-image: none;
    padding-right: 10px;
}

.filter-group-search {
    flex: 1;
    min-width: 200px;
}

.filter-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-search-wrap i {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
}

.filter-search-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px 6px 30px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    width: 100%;
    transition: border-color var(--transition-fast);
}

.filter-search-input:focus {
    border-color: var(--accent-1);
}

.filter-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.import-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.records-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.btn-filter,
.btn-reset,
.btn-import,
.btn-sheets,
.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-filter {
    background: var(--gradient-1);
    color: white;
}

.btn-filter:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-reset {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-reset:hover {
    border-color: var(--accent-4);
    color: var(--accent-4);
}

.btn-reset.active {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--accent-4);
    color: var(--accent-4-light);
}



.btn-import {
    background: var(--gradient-2);
    color: white;
}

.btn-import:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 194, 255, 0.4);
}

.btn-sheets {
    background: rgba(0, 194, 255, 0.1);
    border: 1px solid rgba(0, 194, 255, 0.3);
    color: var(--accent-2-light);
}

.btn-sheets:hover {
    background: rgba(0, 194, 255, 0.2);
    transform: translateY(-1px);
}

.btn-export {
    background: var(--gradient-4);
    color: white;
}

.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.btn-json-import {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-3-light);
}

.btn-json-import:hover {
    background: rgba(245, 158, 11, 0.2);
    transform: translateY(-1px);
}

.btn-export-json {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
}

.btn-export-json:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* ===== Modal do Google Sheets ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--accent-2);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--accent-4);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.input-group {
    margin-bottom: 16px;
}

.sheets-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
}

.sheets-input:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.1);
}

.modal-hint {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-hint i {
    color: var(--accent-1-light);
    margin-top: 2px;
}

.btn-connect {
    width: 100%;
    padding: 12px;
    background: var(--gradient-2);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-connect:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 194, 255, 0.4);
}

/* ===== Seções de conteúdo ===== */
.content-section {
    display: none;
    padding: 28px;
    animation: sectionFadeIn 0.4s ease;
}

.content-section.active {
    display: block;
}

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

/* ===== Painéis de KPI ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

/* Variante com 3 colunas (ex: KPIs da aba Campanhas) — declarada antes das media queries
   abaixo de propósito, pra elas continuarem vencendo em telas menores (mesma especificidade,
   ordem de declaração decide). Nunca usar grid-template-columns inline: isso bate a
   especificidade de qualquer media query e quebra o responsivo. */
.kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-medium);
    position: relative;
    min-width: 0;
}

.kpi-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, transparent 40%, rgba(99, 102, 241, 0.03));
    pointer-events: none;
}

/* "Furo de ficha destacável": pequeno círculo vazado no topo do cartão, como uma
   comanda arrancada de um talão perfurado — a assinatura visual do dashboard. */
.kpi-card::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 22px;
    width: 11px;
    height: 11px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    z-index: 1;
}

.kpi-card:hover {
    transform: translateY(-4px) rotate(-0.6deg);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-icon-total {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    color: var(--accent-1-light);
}

.kpi-icon-today {
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.15), rgba(6, 182, 212, 0.15));
    color: var(--accent-2-light);
}

.kpi-icon-brands {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.15));
    color: var(--accent-3-light);
}

.kpi-icon-clients {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.15));
    color: var(--accent-6);
}

.kpi-icon-rating {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(6, 182, 212, 0.15));
    color: var(--color-sentiment-pos);
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* permite o texto encolher no flex — evita estourar o card (overflow horizontal) */
    overflow: hidden;
}

.kpi-trend {
    flex-shrink: 0;
    white-space: nowrap;
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kpi-value-date {
    letter-spacing: -1px;
}

.kpi-value-sm {
    font-size: 20px;
    letter-spacing: -0.2px;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kpi-trend {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.kpi-trend-up {
    background: rgba(0, 194, 255, 0.1);
    color: var(--accent-2);
}

.kpi-trend-down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-4);
}

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

/* ===== Mini-cards por canal (Visão Geral) ===== */
.channel-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.channel-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-medium);
}

.channel-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

/* Faixa colorida no topo do card, identificando o canal */
.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.channel-card-ig::before {
    background: var(--color-instagram);
}

.channel-card-fb::before {
    background: var(--color-facebook);
}

.channel-card-ggl::before {
    background: var(--color-google);
}

.channel-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.channel-card-icon-ig {
    background: var(--color-instagram-bg);
    color: var(--color-instagram);
}

.channel-card-icon-fb {
    background: var(--color-facebook-bg);
    color: var(--color-facebook);
}

.channel-card-icon-ggl {
    background: var(--color-google-bg);
    color: var(--color-google);
}

.channel-card-body {
    flex: 1;
    min-width: 0;
}

.channel-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.channel-card-value {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.channel-card-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.channel-card-badge {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.sentiment-pos {
    background: var(--color-sentiment-pos-bg);
    color: var(--color-sentiment-pos);
}

.sentiment-neu {
    background: var(--color-sentiment-neu-bg);
    color: var(--color-sentiment-neu);
}

.sentiment-neg {
    background: var(--color-sentiment-neg-bg);
    color: var(--color-sentiment-neg);
}

/* ===== Gráficos ===== */
.charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-medium);
}

.chart-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.chart-card-large {
    flex: 2;
}

.chart-card-small {
    flex: 1;
}

.chart-card-full {
    flex: 1;
}

.chart-card-half {
    flex: 1;
}

.chart-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h3 i {
    color: var(--accent-1-light);
    font-size: 13px;
}

.chart-body {
    padding: 20px;
    height: 320px;
    position: relative;
}

.chart-body-tall {
    height: 420px;
}

/* ===== Marca Cards ===== */
.brand-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.brand-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.brand-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.brand-card-name {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 400;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.brand-card-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.brand-stat-value {
    font-size: 16px;
    font-weight: 700;
}

.brand-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.brand-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

/* ===== Tabela do Feed de Comentários ===== */
.records-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    flex: 1;
    max-width: 500px;
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 100%;
    /* overflow-x: auto (não hidden): tabelas largas (ex: campanhas em tablet) ganham scroll
       horizontal em vez de estourar o layout da página */
    overflow-x: auto;
    overflow-y: hidden;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table thead {
    background: rgba(99, 102, 241, 0.06);
}

.records-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color var(--transition-fast);
    user-select: none;
    white-space: nowrap;
}

.records-table th:hover {
    color: var(--accent-1-light);
}

.records-table th i {
    margin-left: 6px;
    font-size: 10px;
}

.records-table td {
    padding: 14px 18px;
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    max-width: 300px;
}

.records-table tbody tr {
    transition: background var(--transition-fast);
}

.records-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

.records-table td:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.badge-marca {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-1-light);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Grupos de acesso (aba Dev, tabela por integrante) ===== */
#gruposTable td {
    max-width: none;
    vertical-align: top;
}

#gruposTable td:last-child {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.grupos-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 16px;
}

.grupo-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 14px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-1-light);
    font-size: 12px;
    font-weight: 600;
}

.grupo-chip-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.grupo-chip-remove:hover {
    color: var(--color-sentiment-neg);
    background: var(--color-sentiment-neg-bg);
}

.membro-form-novo {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 20px 16px;
}

.membro-form-novo #novoMembroNome {
    flex: 1;
    min-width: 180px;
}

.membro-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.grupo-membro-nome {
    font-size: 13px;
    font-weight: 500;
}

.grupo-membros-vazio {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
}

.badge-nivel-master {
    background: var(--color-sentiment-pos-bg);
    color: var(--color-sentiment-pos);
}

.badge-nivel-visualizador {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.grupo-membro-remove-btn {
    white-space: nowrap;
}

.grupo-secoes-toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 260px;
}

.secao-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.secao-chip:hover {
    border-color: var(--accent-1);
    color: var(--accent-1-light);
}

.secao-chip.ativa {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-1);
    color: var(--accent-1-light);
}

/* "Carimbo" de avaliação: mesma ideia de uma marca batida a carimbo numa comanda —
   fonte de dados (mono), borda tracejada e leve inclinação alternada, nunca reta
   demais. Usada pelo badge de sentimento (renderAvaliacaoBadge em app.js). */
.stamp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    border: 1px dashed currentColor;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transform: rotate(-1.2deg);
}

/* ===== Feed de Menções ===== */
.mention-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mention-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    transition: border-color var(--transition-fast);
}

.mention-card:hover {
    border-color: var(--border-glow);
}

.mention-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
}

/* Miniatura do post (Instagram/Facebook) quando disponível — reaproveitada da antiga aba
   Comentários. Sem miniatura (Google Maps, ou mídia ainda não carregada), cai pro avatar acima. */
.mention-thumb {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.mention-body {
    flex: 1;
    min-width: 0;
}

.mention-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.mention-username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.mention-canal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.mention-canal-instagram {
    background: rgba(225, 48, 108, 0.12);
    color: #e1306c;
}

.mention-canal-facebook {
    background: rgba(24, 119, 242, 0.12);
    color: #1877f2;
}

.mention-canal-google {
    background: rgba(139, 125, 255, 0.12);
    color: #8B7DFF;
}

.mention-canal-reclame {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.mention-brand-badge {
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.mention-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    font-size: 11px;
    color: var(--text-secondary);
}

.mention-rating-badge.mention-rating-neg {
    background: var(--color-sentiment-neg-bg);
    color: var(--color-sentiment-neg);
}

.mention-rating-badge.mention-rating-neu {
    background: var(--color-sentiment-neu-bg);
    color: var(--color-sentiment-neu);
}

.mention-rating-badge.mention-rating-pos {
    background: var(--color-sentiment-pos-bg);
    color: var(--color-sentiment-pos);
}

/* Nível de emergência (VERMELHO/AMARELO) — cor vem inline do renderNivelBadge */
.mention-nivel-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 600;
}

.mention-time {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.mention-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-line;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.mention-footer {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mention-link-btn,
.mention-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.mention-link-btn:hover,
.mention-action-btn:hover {
    border-color: var(--accent-1);
    color: var(--accent-1-light);
    background: rgba(99, 102, 241, 0.08);
}

/* ===== Campanhas (Marketing) ===== */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    padding: 2px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition-fast);
}

.toggle-switch.on {
    background: var(--accent-1);
    border-color: var(--accent-1);
}

.toggle-switch.on::after {
    transform: translateX(18px);
    background: white;
}

.platform-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    flex-shrink: 0;
}

.platform-chip-meta { background: var(--accent-1); color: white; }
.platform-chip-google { background: var(--text-primary); color: var(--bg-primary); }
.platform-chip-tiktok { background: #000; color: white; border: 1px solid var(--border-color); }

.spend-bar {
    height: 4px;
    width: 100%;
    background: var(--bg-input);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.spend-bar-fill {
    height: 100%;
    background: var(--accent-1-light);
    border-radius: 999px;
}

.mode-card {
    text-align: left;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    color: var(--text-secondary);
}

.mode-card:hover {
    border-color: var(--border-glow);
}

.mode-card.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
}

.mode-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
}

.mode-card-desc {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.85;
}

.roas-pill {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid currentColor;
}

.roas-pill-high { color: var(--accent-2); background: rgba(0, 194, 255, 0.1); }
.roas-pill-mid { color: var(--text-secondary); background: var(--bg-input); border-color: var(--border-color); }
.roas-pill-low { color: var(--accent-3); background: rgba(245, 158, 11, 0.1); }
.roas-pill-off { color: var(--text-muted); background: var(--bg-input); border-color: var(--border-color); }

/* ===== Paginação ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
}

.page-btn {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    border-color: var(--accent-1);
    color: var(--accent-1-light);
}

.page-btn.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
}

/* ===== Responsividade ===== */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .channel-cards-row {
        grid-template-columns: 1fr 1fr;
    }
    .charts-row {
        flex-direction: column;
    }
    .top-bar-right {
        flex-wrap: wrap;
    }
}

/* Sidebar vira drawer até 1024px (tablets retrato/livro): com sidebar fixa de 260px, o
   conteúdo em ~800px fica com ~530px e os grids de KPI/cards estouram. Esconder antes
   dá o viewport inteiro ao conteúdo. transition: none no drawer — a transição de transform
   com backdrop-filter em position:fixed congela no estado inicial em alguns ambientes
   (Chrome/CDP), deixando o menu preso escondido. Abrir/fechar instantâneo é mais confiável. */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: none;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar.collapsed {
        width: var(--sidebar-width);
    }
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .page-switcher-btn span,
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .data-source-info span,
    .sidebar.collapsed .account-info-user span {
        display: inline;
    }
    .sidebar.collapsed .nav-item {
        width: auto;
        padding: 12px 16px;
        justify-content: flex-start;
        gap: 14px;
    }
    .sidebar.collapsed .page-switcher-btn {
        width: 100%;
        height: auto;
        padding: 8px 16px;
        justify-content: center;
    }
    .sidebar.collapsed .sidebar-header {
        padding: 24px 20px;
        justify-content: flex-start;
    }
    .sidebar.collapsed .logo {
        gap: 14px;
    }
    .sidebar.collapsed .logo-icon {
        width: 44px;
        height: 44px;
    }
    .sidebar-collapse-btn {
        display: none !important;
    }
    .main-content,
    .main-content.sidebar-collapsed,
    body.sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    .channel-cards-row {
        grid-template-columns: 1fr;
    }
    .top-bar {
        flex-direction: column;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
    }
    .top-bar-right {
        width: 100%;
        justify-content: center;
    }
    .date-filter {
        width: 100%;
        justify-content: center;
    }
    .import-section {
        width: 100%;
        justify-content: center;
    }
    .content-section {
        padding: 16px;
    }
    .chart-body {
        height: 260px;
    }
}

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

/* ===== Animações para elementos dinâmicos ===== */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.kpi-value {
    animation: countUp 0.6s ease forwards;
}

/* Notificação Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 24px;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 300;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s ease;
}

.toast.success {
    border-color: var(--accent-2);
}

.toast.error {
    border-color: var(--accent-4);
}

.toast i {
    font-size: 18px;
}

.toast.success i {
    color: var(--accent-2);
}

.toast.error i {
    color: var(--accent-4);
}

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

/* ===== Seção Instagram ===== */
.social-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 15px;
}

.social-status-error {
    color: var(--accent-4-light);
}

.social-profile-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-6);
    flex-shrink: 0;
}

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

.social-profile-name {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.social-profile-fullname {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.social-profile-bio {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-line;
}

.social-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    padding: 20px 22px;
}

.social-media-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-medium);
    display: flex;
    flex-direction: column;
}

.social-media-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.social-media-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-secondary);
}

.social-media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.social-media-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(10, 14, 26, 0.75);
    color: #ffffff;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 6px;
}

.social-media-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.social-media-caption {
    font-size: 12.5px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.social-media-stats {
    display: flex;
    gap: 14px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.social-media-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.social-media-stats i.fa-heart { color: var(--accent-4-light); }
.social-media-stats i.fa-comment { color: var(--accent-1-light); }

.social-media-comment {
    font-size: 11.5px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.social-media-comment strong {
    color: var(--text-secondary);
}

.social-media-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.social-media-link {
    align-self: flex-start;
    font-size: 12px;
    color: var(--accent-1-light);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.social-media-link:hover {
    text-decoration: underline;
}

.social-media-comments-btn {
    color: var(--accent-6);
}

/* Destaque temporário no post certo, quando se chega até ele vindo do Feed de Menções
   (ver painel.js::abrirPublicacoesDaRede). */
.social-media-card-highlight {
    animation: mediaCardHighlight 2s ease;
}

@keyframes mediaCardHighlight {
    0%, 100% { box-shadow: none; border-color: var(--border-color); }
    15%, 65% { box-shadow: 0 0 0 3px var(--accent-1-light); border-color: var(--accent-1); }
}

/* ===== Chat (comentários e respostas) ===== */
.chat-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 220px);
    min-height: 420px;
}

.chat-post-list {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-post-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.chat-post-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.chat-post-item.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--border-glow);
}

.chat-post-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.chat-post-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 18px;
}

.chat-post-info {
    min-width: 0;
}

.chat-post-caption {
    font-size: 12.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-post-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.chat-thread-panel {
    flex: 1;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-thread-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.chat-thread-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.chat-thread-caption {
    font-size: 13.5px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-thread-comments {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-comment-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.chat-comment-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.chat-comment-time {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-comment-text {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-reply-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.chat-reply-item {
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 12.5px;
    color: var(--text-primary);
}

.chat-reply-toggle {
    margin-top: 10px;
    background: none;
    border: none;
    color: var(--accent-1-light);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.chat-reply-toggle:hover {
    text-decoration: underline;
}

.chat-reply-box {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-reply-box textarea {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    min-height: 38px;
}

.chat-reply-box textarea:focus {
    outline: none;
    border-color: var(--accent-1);
}

.chat-reply-send {
    flex-shrink: 0;
}

/* ===== Chat (inbox de mensagens diretas — demonstração, sem integração real ainda) ===== */
.inbox-msg-row {
    display: flex;
}

.inbox-msg-row-out {
    justify-content: flex-end;
}

.inbox-msg-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
}

.inbox-msg-in {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.inbox-msg-out {
    background: rgba(99, 102, 241, 0.16);
    color: var(--text-primary);
}

.inbox-msg-time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

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

/* ===== Página de login ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    justify-content: center;
    margin-bottom: 6px;
}

.login-msg {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--color-sentiment-neg-bg);
    color: var(--color-sentiment-neg);
}

.login-submit {
    width: 100%;
    justify-content: center;
}

/* ===== Widget de conta (sidebar de /painel/ e /dev/) ===== */
.account-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 0 0;
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
}

.account-info-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 0;
}

.account-info-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-info-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.account-info-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.account-info-actions button:hover {
    color: var(--accent-1-light);
    background: rgba(99, 102, 241, 0.1);
}

/* ===== Login por integrante (tabela de Grupos e Controle de Acesso, aba Dev) ===== */
.login-cell {
    min-width: 190px;
}

.login-cell-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.login-status-badge {
    cursor: pointer;
    border: none;
}

.login-status-badge.ativo {
    background: var(--color-sentiment-pos-bg);
    color: var(--color-sentiment-pos);
}

.login-status-badge.inativo {
    background: var(--color-sentiment-neg-bg);
    color: var(--color-sentiment-neg);
}

.login-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: color var(--transition-fast);
}

.login-icon-btn:hover {
    color: var(--accent-1-light);
}

.login-icon-btn.perigo:hover {
    color: var(--color-sentiment-neg);
}

.login-form-inline {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.login-form-inline input {
    padding: 6px 10px;
    min-width: 100px;
}

/* ===== Análise de Padrão do Post por IA (Alerta de Concorrência) ===== */
.btn-ai-pattern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.25));
    color: var(--accent-1-light);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: var(--radius-sm, 8px);
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast, 0.2s ease);
    text-decoration: none;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.btn-ai-pattern:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.45));
    color: #ffffff;
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
}

.btn-ai-pattern i {
    color: #A79BFF;
    animation: sparklePulse 2.5s infinite;
}

@keyframes sparklePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #A79BFF); }
    50% { transform: scale(1.18); filter: drop-shadow(0 0 6px #5FD8FF); }
}

.modal-ai-pattern {
    background: rgba(13, 18, 32, 0.96);
    backdrop-filter: blur(28px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.ai-modal-header {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, rgba(13, 18, 32, 0) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    padding: 16px 22px;
}

.ai-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-sparkle-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #8B7DFF, #6C4BF6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
    flex-shrink: 0;
}

.ai-header-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(139, 125, 255, 0.18);
    color: #A79BFF;
    border: 1px solid rgba(139, 125, 255, 0.35);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-header-subtitle {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Scanner Animation */
.ai-scan-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 45px 20px;
    text-align: center;
    gap: 20px;
}

.ai-radar-scanner {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px dashed rgba(139, 92, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(13, 18, 32, 0) 70%);
}

.ai-radar-sweep {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 270deg, rgba(139, 125, 255, 0.5) 360deg);
    animation: aiRadarSpin 1.4s linear infinite;
}

@keyframes aiRadarSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-radar-core {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B7DFF, #8B7DFF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 0 20px rgba(139, 125, 255, 0.6);
}

.ai-scan-info {
    max-width: 380px;
    width: 100%;
}

.ai-scan-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.ai-scan-step-text {
    font-size: 12.5px;
    color: var(--accent-1-light);
    margin-bottom: 12px;
    min-height: 18px;
}

.ai-scan-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.ai-scan-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8B7DFF, #A79BFF);
    transition: width 0.3s ease;
}

/* Post Context Banner inside modal */
.ai-post-context-banner {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
    align-items: center;
}

.ai-post-context-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.ai-post-context-thumb-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 24px;
    flex-shrink: 0;
}

.ai-post-context-body {
    flex: 1;
    min-width: 0;
}

.ai-post-context-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.ai-post-context-user {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.ai-post-context-type {
    font-size: 11px;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-secondary);
}

.ai-post-context-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.ai-post-context-caption {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* Grid de Análise */
.ai-analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.ai-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
}

.ai-card-title i {
    color: var(--accent-1-light);
}

.ai-item-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-item-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-item-value {
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.45;
}

/* Paleta de cores */
.color-palette-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.color-palette-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 8px 3px 4px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.color-swatch-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Tags e Pills */
.ai-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.ai-tag-item {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--accent-1-light);
    border-radius: 4px;
}

.ai-tag-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    background: rgba(0, 194, 255, 0.15);
    color: #00C2FF;
    border: 1px solid rgba(0, 194, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Gatilhos Mentais */
.triggers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .triggers-container {
        grid-template-columns: 1fr;
    }
}

.trigger-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trigger-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.trigger-bar-track {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.trigger-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Scores de Eficácia */
.scores-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.score-card-mini {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.score-card-val {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-display);
    color: #ffffff;
    line-height: 1.1;
}

.score-card-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Caixa de Recomendação O Burguês */
.ai-recommendation-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}

.ai-rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-rec-title {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-rec-title i {
    color: #f59e0b;
}

.btn-copy-ai {
    font-size: 11.5px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-copy-ai:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: #fbbf24;
    color: #fbbf24;
}

.ai-rec-body {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
}

.ai-rec-body p {
    margin: 0 0 8px;
}

.ai-rec-body p:last-child {
    margin-bottom: 0;
}

/* ===== Aba iFood ===== */
.ifood-stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 18px;
}

.ifood-store-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all var(--transition-medium);
    position: relative;
}

.ifood-store-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.ifood-store-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.ifood-store-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ifood-store-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: rgba(234, 29, 44, 0.12);
    color: #EA1D2C;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ifood-store-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ifood-store-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.ifood-brand-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-1-light);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.ifood-btn-external {
    font-size: 11.5px;
    color: var(--accent-1-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.18);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.ifood-btn-external:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: var(--accent-1-light);
    color: #ffffff;
}

.ifood-store-address {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ifood-store-address i {
    color: var(--accent-4);
    font-size: 11px;
    flex-shrink: 0;
}

.ifood-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ifood-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    min-width: 0;
}

.ifood-stat-val {
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.ifood-stat-val.rating {
    color: #FBBC05;
}

.ifood-stat-lbl {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.ifood-reviews-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto;
}

.ifood-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ifood-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.ifood-review-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color var(--transition-fast);
}

.ifood-review-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.ifood-review-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ifood-review-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.ifood-review-stars {
    font-size: 11px;
    color: #FBBC05;
    letter-spacing: 1px;
}

.ifood-review-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.ifood-review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.ifood-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
}

.ifood-status-pill.answered {
    background: rgba(0, 194, 255, 0.12);
    color: var(--accent-2-light);
    border: 1px solid rgba(0, 194, 255, 0.25);
}

.ifood-status-pill.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.ifood-feed-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* =====================================================================
   ===============  REDESIGN "INTERFACE ZE" — IDENTIDADE ZEERONE  =======
   =====================================================================
   Camada de skin aplicada por cima do sistema de componentes acima.
   Navy #12122B, roxo #8B7DFF (primário), ciano #00C2FF (positivo/info),
   coral #FF5A36 (negativo/alerta). Archivo 800 para display, IBM Plex
   Mono para rótulos em caixa-alta / timestamps / números. Nenhum hook de
   JS é alterado — só a apresentação. */

/* ---- Fundo: navy com brilho radial roxo/ciano (igual ao protótipo) ---- */
body { background: var(--bg-primary); }

.main-content {
    background:
        radial-gradient(900px 420px at 10% -14%, rgba(139, 125, 255, 0.18), transparent 68%),
        radial-gradient(700px 400px at 100% 0%, rgba(0, 194, 255, 0.08), transparent 70%),
        var(--bg-primary);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

:root.light-mode .main-content {
    background:
        radial-gradient(900px 420px at 10% -14%, rgba(139, 125, 255, 0.12), transparent 68%),
        radial-gradient(700px 400px at 100% 0%, rgba(0, 194, 255, 0.09), transparent 70%),
        var(--bg-primary);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Orbes do fundo antigo: recoloridas para a paleta Zeerone e bem discretas. */
.bg-orb { filter: blur(120px); opacity: 0.10; }
.bg-orb-1 { background: #8B7DFF; }
.bg-orb-2 { background: #6C4BF6; }
.bg-orb-3 { background: #00C2FF; }
:root.light-mode .bg-orb { opacity: 0.06; }

/* Barra de rolagem */
::-webkit-scrollbar-thumb { background: rgba(139, 125, 255, 0.5); }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 125, 255, 0.75); }

/* ---- Sidebar ---- */
.sidebar {
    background: #12122B;
    backdrop-filter: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo { gap: 12px; }

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px -6px rgba(108, 75, 246, 0.7);
}

.logo-icon img { object-fit: contain; transform: none; width: 82%; height: 82%; }

.logo-title {
    font-family: 'Archivo', sans-serif;
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #fff;
}

.logo-subtitle {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.24em;
    color: rgba(255, 255, 255, 0.42);
}

.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}
.sidebar-collapse-btn:hover {
    color: #fff;
    border-color: rgba(139, 125, 255, 0.5);
    background: rgba(139, 125, 255, 0.16);
    box-shadow: none;
}

.page-switcher { padding: 12px 16px 4px; }

.page-switcher-btn.filter-shortcut {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    padding: 9px 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.page-switcher-btn.filter-shortcut:hover {
    background: rgba(139, 125, 255, 0.14);
    border-color: rgba(139, 125, 255, 0.4);
    color: #fff;
}

.sidebar-nav {
    padding: 16px 14px 8px;
    gap: 18px;
}

/* Grupos do menu (Monitoramento / Canais / Inteligência) */
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-group-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 0 11px 6px;
}

.nav-item {
    gap: 11px;
    padding: 9px 11px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13.5px;
    font-weight: 500;
}

.nav-item::before {
    width: 3px;
    top: 9px;
    bottom: 9px;
    height: auto;
    background: #8B7DFF;
    border-radius: 0 3px 3px 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(139, 125, 255, 0.26), rgba(139, 125, 255, 0.04));
    box-shadow: inset 0 0 0 1px rgba(139, 125, 255, 0.3);
    color: #fff;
    font-weight: 600;
}

.nav-item i { font-size: 15px; width: 18px; color: currentColor; }

/* Marcador numérico / status à direita do item (ex.: Feed de Menções) */
.nav-item .nav-badge {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    color: #A79BFF;
    background: rgba(139, 125, 255, 0.16);
    padding: 3px 6px;
    border-radius: 6px;
    line-height: 1;
}
.nav-item .nav-badge.nav-badge-new { color: #00C2FF; background: none; border: 1px solid rgba(0, 194, 255, 0.4); letter-spacing: 0.1em; }
.nav-item .nav-badge.nav-badge-pilot { color: rgba(255, 255, 255, 0.4); background: none; border: 1px solid rgba(255, 255, 255, 0.16); letter-spacing: 0.1em; }
.nav-item .nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #8B7DFF; box-shadow: 0 0 10px 1px rgba(139, 125, 255, 0.8); }
.nav-item .nav-dot.nav-dot-alert { background: #FF5A36; box-shadow: 0 0 10px 1px rgba(255, 90, 54, 0.8); }

/* Rodapé da sidebar: fonte de dados + cartão de usuário */
.sidebar-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.data-source-info {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
}
.data-source-info i { color: rgba(139, 125, 255, 0.7); }

.account-info {
    border-top: none;
    margin-top: 0;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.account-info-user {
    color: #fff;
    font-weight: 600;
    font-size: 12.5px;
    gap: 10px;
}

.account-info-user i {
    font-size: 26px;
    color: transparent;
    background: linear-gradient(140deg, #8B7DFF, #00C2FF);
    -webkit-background-clip: text;
    background-clip: text;
}

.account-info-actions button { color: rgba(255, 255, 255, 0.4); }
.account-info-actions button:hover { color: #fff; background: rgba(139, 125, 255, 0.22); }

/* ---- Conteúdo / topbar ---- */
.top-bar {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: auto;
    min-height: var(--topbar-height);
    padding: 18px 28px;
    align-items: center;
}
:root.light-mode .top-bar { border-bottom-color: var(--border-color); }

.top-bar-left { flex-direction: column; align-items: flex-start; gap: 6px; }
.page-title-row { display: flex; align-items: center; gap: 12px; }

/* Breadcrumb mono (grupo / título) — preenchido por painel.js via #pageBreadcrumb */
.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.page-breadcrumb .crumb-sep { opacity: 0.5; }
.page-breadcrumb .crumb-current { color: var(--accent-2); }

.page-title {
    font-family: 'Archivo', sans-serif;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--text-primary);
}

.top-bar-right { gap: 10px; }

/* Botões da topbar (tema + Atualizar) */
.top-bar-right .btn-filter {
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-weight: 600;
    box-shadow: none;
}
:root.light-mode .top-bar-right .btn-filter { background: var(--bg-card); border-color: var(--border-color); }
.top-bar-right .btn-filter:hover {
    transform: none;
    background: rgba(139, 125, 255, 0.16);
    border-color: rgba(139, 125, 255, 0.4);
    color: var(--text-primary);
    box-shadow: none;
}

#themeToggleBtn.btn-filter { width: 38px; padding: 0; justify-content: center; }

#btnOverviewRefresh.btn-filter {
    background: linear-gradient(135deg, #8B7DFF, #6C4BF6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 26px -12px rgba(139, 125, 255, 0.9);
}
#btnOverviewRefresh.btn-filter:hover { filter: brightness(1.08); background: linear-gradient(135deg, #8B7DFF, #6C4BF6); color: #fff; }

.queue-alert {
    font-family: var(--font-mono);
    background: rgba(255, 90, 54, 0.12);
    border-color: rgba(255, 90, 54, 0.35);
    color: var(--accent-4-light);
}

/* ---- Seções ---- */
.content-section { padding: 24px 28px 32px; }

/* ---- KPI cards: achatados, rótulo mono, número Archivo 800 tabular ---- */
.kpi-card {
    background: var(--bg-card);
    backdrop-filter: none;
    border-radius: 13px;
    padding: 15px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}
.kpi-card::before, .kpi-card::after { display: none; }
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border-glow); box-shadow: var(--shadow-glow); }

.kpi-card .kpi-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 13px;
    background: rgba(139, 125, 255, 0.14) !important;
    color: #A79BFF !important;
}
.kpi-card .kpi-info { order: 2; }

.kpi-label {
    order: 1;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.kpi-value {
    font-family: 'Archivo', sans-serif;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    animation: none;
}
.kpi-value-sm { font-size: 22px; }

.kpi-trend { order: 3; margin-left: 0; align-self: flex-start; font-family: var(--font-body); font-weight: 500; border-radius: 6px; }
.kpi-trend-up { background: rgba(0, 194, 255, 0.1); color: var(--accent-2); }
.kpi-trend-down { background: rgba(255, 90, 54, 0.1); color: var(--accent-4-light); }
.kpi-trend-neutral { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }
:root.light-mode .kpi-trend-neutral { background: rgba(18, 18, 43, 0.05); }

/* KPI destaque (sentimento) */
#kpiRating {
    background: linear-gradient(150deg, rgba(0, 194, 255, 0.12), rgba(255, 255, 255, 0.02));
    border-color: rgba(0, 194, 255, 0.24);
}
#kpiRating .kpi-value { color: var(--accent-2); }
#kpiRating .kpi-icon { background: rgba(0, 194, 255, 0.14) !important; color: #5FD8FF !important; }

.kpi-grid, .kpi-grid-3 { grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Channel cards ---- */
.channel-cards-row { gap: 16px; margin-bottom: 16px; }
.channel-card {
    background: var(--bg-card);
    backdrop-filter: none;
    border-radius: 14px;
    padding: 18px;
    align-items: flex-start;
}
.channel-card::before { height: 2px; }
.channel-card-ig::before { background: linear-gradient(90deg, #8B7DFF, rgba(139, 125, 255, 0)); }
.channel-card-fb::before { background: linear-gradient(90deg, #00C2FF, rgba(0, 194, 255, 0)); }
.channel-card-ggl::before { background: linear-gradient(90deg, #FF5A36, rgba(255, 90, 54, 0)); }
.channel-card:hover { transform: translateY(-2px); }

.channel-card-icon { width: 40px; height: 40px; border-radius: 11px; border: 1px solid currentColor; }
.channel-card-icon-ig { background: rgba(139, 125, 255, 0.14); color: #A79BFF; }
.channel-card-icon-fb { background: rgba(0, 194, 255, 0.1); color: #5FD8FF; }
.channel-card-icon-ggl { background: rgba(255, 90, 54, 0.12); color: #FF8B6B; }

.channel-card-name { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--text-muted); }
.channel-card-value { font-family: 'Archivo', sans-serif; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.channel-card-sub { font-size: 11px; color: var(--text-muted); }
.channel-card-badge { font-family: var(--font-body); font-weight: 500; font-size: 11px; border-radius: 6px; padding: 5px 8px; }

/* ---- Chart cards ---- */
.charts-row { gap: 16px; margin-bottom: 16px; }
.chart-card { background: var(--bg-card); backdrop-filter: none; border-radius: 14px; }
.chart-card:hover { box-shadow: none; border-color: var(--border-color); }
.chart-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.chart-header h3 {
    font-family: 'Archivo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-primary);
}
.chart-header h3 i { color: var(--accent-1); font-size: 13px; }

/* ---- Tabelas ---- */
.table-container { background: var(--bg-card); border-radius: 14px; }
.records-table thead { background: transparent; }
.records-table th {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.records-table th:hover { color: var(--accent-1); }
.records-table td { border-top: 1px solid rgba(255, 255, 255, 0.04); color: var(--text-secondary); }
:root.light-mode .records-table td { border-top-color: var(--border-color); }
.records-table tbody tr:hover { background: rgba(139, 125, 255, 0.05); }
.badge-marca { font-family: var(--font-mono); background: rgba(139, 125, 255, 0.14); color: var(--accent-1-light); border-radius: 6px; }

/* ---- Botões utilitários (filtros, import, export) ---- */
.btn-filter { background: linear-gradient(135deg, #8B7DFF, #6C4BF6); color: #fff; border-radius: 9px; }
.btn-filter:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(139, 125, 255, 0.9); }
.btn-reset, .btn-sheets, .btn-import, .btn-export, .btn-json-import, .btn-export-json {
    border-radius: 9px;
}
.btn-import, .btn-export, .btn-export-json { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--border-color); }
:root.light-mode .btn-import, :root.light-mode .btn-export, :root.light-mode .btn-export-json { background: var(--bg-card); }
.btn-import:hover, .btn-export:hover, .btn-export-json:hover { box-shadow: none; border-color: rgba(139, 125, 255, 0.4); color: var(--text-primary); background: rgba(139, 125, 255, 0.12); }
.btn-sheets { background: rgba(0, 194, 255, 0.1); border-color: rgba(0, 194, 255, 0.3); color: var(--accent-2-light); }
.btn-sheets:hover { background: rgba(0, 194, 255, 0.2); }
.btn-json-import { background: rgba(255, 176, 32, 0.1); border-color: rgba(255, 176, 32, 0.3); color: var(--accent-3-light); }
.btn-json-import:hover { background: rgba(255, 176, 32, 0.2); }

/* Barra de filtros */
.filter-bar { background: var(--bg-card); backdrop-filter: none; border-radius: 14px; }
.filter-shortcut { border-radius: 8px; font-family: var(--font-body); }
.filter-shortcut:hover { border-color: rgba(139, 125, 255, 0.4); color: var(--accent-1-light); background: rgba(139, 125, 255, 0.08); }
.filter-shortcut.active { background: #fff; color: #0C0C1E; border-color: transparent; }
:root.light-mode .filter-shortcut.active { background: var(--accent-1); color: #fff; }
.filter-label { font-family: var(--font-mono); letter-spacing: 0.14em; }

/* ---- Feed de menções ---- */
.mention-card { background: var(--bg-card); backdrop-filter: none; border-radius: 14px; }
.mention-card:hover { background: rgba(139, 125, 255, 0.04); border-color: var(--border-glow); }
.mention-avatar { border-radius: 12px; }
.mention-username { font-weight: 600; }
.mention-canal-badge { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, 0.12); background: transparent !important; color: var(--text-muted) !important; }
:root.light-mode .mention-canal-badge { border-color: var(--border-color); }
.mention-time { font-family: var(--font-mono); }
.mention-link-btn:hover, .mention-action-btn:hover { border-color: rgba(139, 125, 255, 0.4); color: var(--accent-1-light); background: rgba(139, 125, 255, 0.08); }

/* ---- Cartões de marca ---- */
.brand-card { background: var(--bg-card); backdrop-filter: none; border-radius: 14px; }
.brand-card-name { font-family: 'Archivo', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.brand-stat-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.brand-bar { background: rgba(255, 255, 255, 0.06); }
:root.light-mode .brand-bar { background: rgba(18, 18, 43, 0.06); }

/* ---- Modais ---- */
.modal-content { background: #12122B; border-color: rgba(255, 255, 255, 0.1); border-radius: 16px; }
:root.light-mode .modal-content { background: #fff; border-color: var(--border-color); }
.modal-header h2 { font-family: 'Archivo', sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; }
.modal-header h2 i { color: var(--accent-1); }

/* ---- Perfil social / status vazio ---- */
.social-profile-card { background: var(--bg-card); backdrop-filter: none; border-radius: 14px; }
.social-avatar { border-color: var(--accent-1); }
.social-status-error { color: var(--accent-4-light); }

/* ---- Chat / inbox ---- */
.chat-post-list, .chat-thread-panel { background: var(--bg-card); backdrop-filter: none; border-radius: 14px; }
.chat-post-item.active, .chat-post-item:hover { background: rgba(139, 125, 255, 0.1); }
.chat-post-item.active { border-color: var(--border-glow); }
.chat-reply-item { background: rgba(139, 125, 255, 0.1); }
.inbox-msg-out { background: linear-gradient(135deg, rgba(139, 125, 255, 0.3), rgba(139, 125, 255, 0.14)); border: 1px solid rgba(139, 125, 255, 0.32); }
.inbox-msg-in { background: rgba(255, 255, 255, 0.04); border-color: var(--border-color); }
:root.light-mode .inbox-msg-in { background: var(--bg-card); }

/* ---- iFood ---- */
.ifood-store-card { background: var(--bg-card); backdrop-filter: none; border-radius: 14px; }
.ifood-brand-badge { font-family: var(--font-mono); background: rgba(139, 125, 255, 0.12); color: var(--accent-1-light); border-color: rgba(139, 125, 255, 0.25); }
.ifood-stats-grid { background: rgba(255, 255, 255, 0.02); }
:root.light-mode .ifood-stats-grid { background: rgba(18, 18, 43, 0.03); }
.ifood-stat-val { font-family: var(--font-mono); }
.ifood-stat-val.rating, .ifood-review-stars { color: #FF5A36; }
.ifood-status-pill.answered { background: rgba(0, 194, 255, 0.12); color: var(--accent-2-light); border-color: rgba(0, 194, 255, 0.25); }
.ifood-status-pill.pending { background: rgba(255, 176, 32, 0.12); color: var(--accent-3-light); border-color: rgba(255, 176, 32, 0.25); }

/* ---- Pílulas ROAS / paginação / toggles ---- */
.roas-pill-high { color: var(--accent-2); background: rgba(0, 194, 255, 0.1); }
.roas-pill-low { color: var(--accent-3); background: rgba(255, 176, 32, 0.1); }
.page-btn { background: var(--bg-card); border-radius: 8px; }
.page-btn:hover, .page-btn.active { border-color: rgba(139, 125, 255, 0.4); }
.page-btn.active { background: var(--gradient-1); color: #fff; }
.toggle-switch.on { background: var(--accent-1); border-color: var(--accent-1); }

/* ---- Login ---- */
.login-card { background: var(--bg-card); backdrop-filter: none; border-radius: 16px; }
:root.light-mode .login-card { background: #fff; }

/* ---- Toast ---- */
.toast { background: #12122B; border-radius: 12px; }
:root.light-mode .toast { background: #fff; }
.toast.success { border-color: var(--accent-2); }
.toast.success i { color: var(--accent-2); }

/* ---- Badges de nível de acesso (Dev) ---- */
.badge-nivel-master, .login-status-badge.ativo { background: rgba(0, 194, 255, 0.12); color: var(--accent-2); }

/* ---- Grid de KPIs volta a empilhar em telas estreitas ---- */
@media (max-width: 1200px) {
    .kpi-grid, .kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .kpi-grid, .kpi-grid-3 { grid-template-columns: 1fr 1fr; }
    .content-section { padding: 16px; }
    .top-bar { padding: 14px 16px; }
}
@media (max-width: 480px) {
    .kpi-grid, .kpi-grid-3 { grid-template-columns: 1fr; }
}

/* ---- Sidebar recolhida: esconder rótulos de grupo e badges ---- */
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-item .nav-badge,
.sidebar.collapsed .nav-item .nav-dot { display: none; }
.sidebar.collapsed .sidebar-nav { gap: 10px; }
.sidebar.collapsed .account-info { padding: 8px; }

/* Grupo do menu cujos itens foram todos ocultados (aplicarFiltroPorMembro /
   aplicarFlagsDeSecoes) — esconde o rótulo órfão. */
.nav-group:not(:has(a.nav-item:not([style*="display: none"]):not([style*="display:none"]))) {
    display: none;
}

