/* ==========================================================================
   DICIONÁRIO DO INVESTIDOR 2.0 - DESIGN SYSTEM (ESTILO FACEBOOK DOS ATIVOS)
   ========================================================================== */

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

:root {
    --bg-main: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --primary: #1877f2;
    --primary-hover: #166fe5;
    --primary-light: #e7f3ff;
    --text-primary: #050505;
    --text-secondary: #65676b;
    --text-muted: #8a8d91;
    --border-color: #e4e6eb;
    --divider-color: #f0f2f5;
    --green-up: #00a650;
    --green-light: #e6f7ed;
    --red-down: #e41e3f;
    --red-light: #fde8eb;
    --gold: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   GLOBAL NAVBAR (MENU SUPERIOR)
   ========================================================================== */

.v2-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.v2-navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
    white-space: nowrap;
}

.v2-navbar-brand img {
    height: 36px;
}

/* CAMPO DE BUSCA NO MENU SUPERIOR */
.v2-search-container {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.v2-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 12px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.v2-search-form:focus-within {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.v2-search-form input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 6px 8px;
    font-size: 0.88rem;
    font-family: var(--font-main);
    color: var(--text-primary);
    outline: none;
}

.v2-search-form button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 4px;
}

.v2-search-results-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1200;
}

.v2-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--divider-color);
    transition: background 0.15s;
}

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

.v2-search-item:hover {
    background-color: var(--primary-light);
}

.v2-search-item-ticker {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary);
    min-width: 65px;
}

.v2-search-item-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.v2-search-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-search-item-type {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.v2-search-no-results {
    padding: 14px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* NAV LINKS */
.v2-navbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.v2-nav-item {
    position: relative;
}

.v2-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.v2-nav-link:hover, .v2-nav-item.active .v2-nav-link {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Dropdown Menu */
.v2-dropdown-caret {
    display: inline-block;
    font-size: 0.72rem;
    margin-left: 3px;
    opacity: 0.75;
    transition: transform 0.2s ease;
    vertical-align: middle;
}

.v2-nav-item:hover .v2-dropdown-caret {
    transform: rotate(180deg);
}

.v2-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 8px 0;
    z-index: 1100;
    list-style: none;
}

.v2-nav-item:hover .v2-dropdown-menu {
    display: block;
}

.v2-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: background 0.2s, color 0.2s;
}

.v2-dropdown-item:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}

/* User Actions Right */
.v2-navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.v2-btn-google {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #dadce0;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #3c4043;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.v2-btn-google:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.v2-btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 7px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

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

/* ==========================================================================
   ADSENSE CONTAINER
   ========================================================================== */

.v2-adsense-banner {
    max-width: 1240px;
    margin: 8px auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    text-align: center;
    height: 110px !important;
    max-height: 110px !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.v2-adsense-banner ins.adsbygoogle {
    max-height: 90px !important;
    height: 90px !important;
    overflow: hidden !important;
    display: inline-block !important;
}

.v2-adsense-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* ==========================================================================
   ASSET PROFILE HEADER (FAIXA AZUL REPOSICIONADA COM NOME DO FUNDO E TICKER)
   ========================================================================== */

.v2-profile-header {
    background: transparent;
    margin-bottom: 20px;
}

.v2-profile-cover {
    min-height: 140px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #0284c7 100%);
    border-radius: 16px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 6px 18px rgba(30, 58, 138, 0.25);
    position: relative;
    overflow: hidden;
    gap: 16px;
    flex-wrap: wrap;
}

.v2-profile-cover-content {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
}

.v2-profile-avatar {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 16px;
    background: #ffffff;
    border: 3px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
}

.v2-profile-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.v2-profile-title {
    font-family: var(--font-heading);
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.v2-profile-ticker {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.v2-profile-name {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.v2-profile-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.v2-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.v2-badge-fii { background: #ffffff; color: #1e3a8a; }
.v2-badge-fiagro { background: #ffffff; color: #14532d; }
.v2-badge-acao { background: #ffffff; color: #7c2d12; }
.v2-badge-bdr { background: #ffffff; color: #581c87; }

.v2-badge-sub { background: rgba(255, 255, 255, 0.22); color: #ffffff; backdrop-filter: blur(4px); }
.v2-badge-cnpj { background: rgba(0, 0, 0, 0.3); color: #ffffff; }

.v2-btn-carteira-header {
    background: #ffffff;
    color: var(--primary);
    border: none;
    padding: 10px 22px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.v2-btn-carteira-header:hover {
    transform: translateY(-1px);
    background: #f8fafc;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* Dashboard Indicators Sticky Bar */
.v2-indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    max-width: 1240px;
    margin: 16px auto 24px auto;
    padding: 0 24px;
}

.v2-indicator-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.v2-indicator-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.v2-indicator-value {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
}

.v2-indicator-sub {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}

.text-up { color: var(--green-up); }
.text-down { color: var(--red-down); }

/* ==========================================================================
   LAYOUT PRINCIPAL 3 COLUNAS (ESTILO FACEBOOK)
   ========================================================================== */

.v2-container-3col {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 40px 24px;
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 24px;
}

/* Coluna Esquerda: Menu do Ativo */
.v2-sidebar-left {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 16px 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    align-self: start;
    position: sticky;
    top: 76px;
}

.v2-sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0 12px 8px 12px;
    border-bottom: 1px solid var(--divider-color);
    margin-bottom: 8px;
}

.v2-asset-menu {
    list-style: none;
}

.v2-asset-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
}

.v2-asset-menu-item a:hover, .v2-asset-menu-item.active a {
    background-color: var(--primary-light);
    color: var(--primary);
}

.v2-asset-menu-icon {
    font-size: 1.1rem;
}

/* Coluna Central: Timeline Feed */
.v2-timeline-center {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tabs da Timeline */
.v2-timeline-tabs {
    display: flex;
    gap: 8px;
    background: #ffffff;
    padding: 8px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.v2-tab-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.v2-tab-btn.active, .v2-tab-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Card de Publicação do Post */
.v2-post-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.v2-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.v2-post-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.v2-post-meta h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.v2-post-meta span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.v2-post-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.v2-post-body {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.v2-post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--divider-color);
}

.v2-post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.v2-post-action-btn:hover {
    background: var(--bg-main);
}

/* Coluna Direita: Sidebar Informações Cadastrais */
.v2-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.v2-widget-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.v2-widget-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--divider-color);
}

.v2-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v2-info-item {
    display: flex;
    flex-direction: column;
}

.v2-info-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.v2-info-value {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* RESPONSIVIDADE PARA DISPOSITIVOS MÓVEIS (PWA / APP READY) */
@media (max-width: 992px) {
    .v2-container-3col {
        grid-template-columns: 1fr;
    }
    .v2-sidebar-left {
        position: static;
    }
    .v2-search-container {
        max-width: 200px;
    }
}

/* ==========================================================================
   FASE 2: DARK MODE OVERRIDES
   ========================================================================== */

body.v2-dark-mode {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.18);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --divider-color: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.v2-dark-mode .v2-navbar,
body.v2-dark-mode .v2-dropdown-menu,
body.v2-dark-mode .v2-sidebar-left,
body.v2-dark-mode .v2-post-card,
body.v2-dark-mode .v2-widget-card,
body.v2-dark-mode .v2-indicator-card,
body.v2-dark-mode .v2-timeline-tabs,
body.v2-dark-mode .v2-search-results-dropdown,
body.v2-dark-mode .v2-simulador-card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.v2-dark-mode .v2-search-form {
    background-color: #0f172a;
    border-color: var(--border-color);
}

body.v2-dark-mode .v2-btn-google {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}

/* TEMA TOGGLE BUTTON */
.v2-theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    transition: background 0.2s, border-color 0.2s;
}

.v2-theme-toggle:hover {
    background-color: var(--primary-light);
}

/* ==========================================================================
   HEALTH CHECK BADGES (SAÚDE FINANCEIRA DO ATIVO)
   ========================================================================== */

.v2-health-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.v2-health-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s;
}

.v2-health-chip:hover {
    transform: translateY(-1px);
}

.v2-chip-green {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.v2-chip-blue {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.v2-chip-yellow {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.v2-chip-gray {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

body.v2-dark-mode .v2-chip-green {
    background-color: rgba(6, 95, 70, 0.35);
    color: #6ee7b7;
    border-color: #047857;
}

body.v2-dark-mode .v2-chip-blue {
    background-color: rgba(30, 64, 175, 0.35);
    color: #93c5fd;
    border-color: #1d4ed8;
}

body.v2-dark-mode .v2-chip-yellow {
    background-color: rgba(146, 64, 14, 0.35);
    color: #fde047;
    border-color: #b45309;
}

body.v2-dark-mode .v2-chip-gray {
    background-color: rgba(71, 85, 105, 0.35);
    color: #cbd5e1;
    border-color: #475569;
}

/* ==========================================================================
   WIDGET SIMULADOR DE DIVIDENDOS & JUROS COMPOSTOS
   ========================================================================== */

.v2-simulador-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

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

.v2-simulador-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-simulador-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.v2-simulador-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    background: var(--bg-main);
    color: var(--text-primary);
}

.v2-simulador-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.v2-sim-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.v2-sim-btn:hover, .v2-sim-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.v2-simulador-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    background: var(--bg-main);
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.v2-sim-result-box {
    display: flex;
    flex-direction: column;
}

.v2-sim-result-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.v2-sim-result-value {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 2px;
}

/* CARDS VIEW PARA TABELAS EM TELAS PEQUENAS */
@media (max-width: 768px) {
    .v2-table-responsive-cards {
        display: block;
    }
    .v2-table-responsive-cards thead {
        display: none;
    }
    .v2-table-responsive-cards tbody,
    .v2-table-responsive-cards tr,
    .v2-table-responsive-cards td {
        display: block;
        width: 100%;
    }
    .v2-table-responsive-cards tr {
        margin-bottom: 14px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        padding: 12px;
        box-shadow: var(--shadow-sm);
    }
    .v2-table-responsive-cards td {
        text-align: right;
        padding: 6px 0;
        position: relative;
        border-bottom: 1px dashed var(--divider-color);
    }
    .v2-table-responsive-cards td:last-child {
        border-bottom: none;
    }
    .v2-table-responsive-cards td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        text-align: left;
        font-weight: 700;
        font-size: 0.8rem;
        color: var(--text-muted);
    }
}

/* ==========================================================================
   SISTEMA DE RESPONSIVIDADE MOBILE-FIRST (SMARTPHONES & TABLETS)
   ========================================================================== */

:root {
    --bottom-nav-height: 60px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-top: env(safe-area-inset-top, 0px);
}

/* Evita zoom automático involuntário no Safari iOS ao focar em inputs */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* --------------------------------------------------------------------------
   HEADER MOBILE & BOTÃO HAMBÚRGUER
   -------------------------------------------------------------------------- */

.v2-mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 7px 11px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-primary);
    transition: background 0.2s, border-color 0.2s;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 40px;
    -webkit-tap-highlight-color: transparent;
}

.v2-mobile-toggle:hover,
.v2-mobile-toggle:active {
    background-color: var(--primary-light);
    color: var(--primary);
}

@media (max-width: 992px) {
    .v2-navbar {
        padding: 0 16px;
        height: 58px;
        gap: 12px;
    }

    /* Oculta o menu horizontal clássico em telas médias e compactas */
    .v2-navbar-nav {
        display: none !important;
    }

    .v2-mobile-toggle {
        display: inline-flex;
    }

    .v2-search-container {
        max-width: 220px;
    }
}

@media (max-width: 640px) {
    .v2-navbar {
        padding: 0 12px;
    }

    .v2-navbar-brand img {
        height: 34px !important;
        width: 34px !important;
    }

    .v2-search-container {
        display: none; /* Busca disponível no Drawer móvel e nas páginas */
    }

    .v2-navbar-actions {
        gap: 6px;
    }

    .v2-navbar-actions .v2-btn-google span {
        display: none;
    }

    .v2-navbar-actions .v2-btn-google {
        padding: 6px 10px;
    }

    .v2-navbar-actions .v2-btn-primary {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* --------------------------------------------------------------------------
   MENU GAVETA LATERAL MOBILE (OFFCANVAS DRAWER)
   -------------------------------------------------------------------------- */

.v2-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.v2-drawer-overlay.active {
    display: block;
    opacity: 1;
}

.v2-mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 310px;
    max-width: 86vw;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    box-shadow: -6px 0 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.v2-mobile-drawer.active {
    right: 0;
}

body.v2-dark-mode .v2-mobile-drawer {
    background: #1e293b;
    border-left: 1px solid #334155;
    color: #f8fafc;
}

.v2-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
}

.v2-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-heading);
}

.v2-drawer-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.v2-drawer-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.v2-drawer-user-box {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

body.v2-dark-mode .v2-drawer-user-box {
    background: #1e293b;
}

.v2-drawer-search {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.v2-drawer-search form {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 12px;
}

.v2-drawer-search input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.v2-drawer-search button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
}

.v2-drawer-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex: 1;
}

.v2-drawer-item {
    border-bottom: 1px solid var(--divider-color);
}

.v2-drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.v2-drawer-link:hover,
.v2-drawer-link:active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.v2-drawer-subnav {
    display: none;
    list-style: none;
    background: var(--bg-main);
    padding: 6px 0;
    margin: 0;
    border-top: 1px solid var(--border-color);
}

.v2-drawer-subnav.active {
    display: block;
}

.v2-drawer-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 36px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.v2-drawer-sublink:hover,
.v2-drawer-sublink:active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.v2-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   BARRA DE NAVEGAÇÃO INFERIOR FIXA (BOTTOM TAB BAR - ESTILO APP / PWA)
   -------------------------------------------------------------------------- */

.v2-mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 12px) !important;
    }

    .v2-mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
        padding-bottom: var(--safe-area-bottom);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--border-color);
        z-index: 9000;
        align-items: center;
        justify-content: space-around;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    }

    body.v2-dark-mode .v2-mobile-bottom-nav {
        background: rgba(30, 41, 59, 0.96);
        border-top-color: #334155;
    }

    .v2-bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-muted);
        padding: 6px 0;
        transition: color 0.15s ease, transform 0.1s ease;
        -webkit-tap-highlight-color: transparent;
        background: transparent;
        border: none;
        cursor: pointer;
    }

    .v2-bottom-nav-item:active {
        transform: scale(0.92);
    }

    .v2-bottom-nav-item.active {
        color: var(--primary);
    }

    .v2-bottom-nav-icon {
        font-size: 1.25rem;
        line-height: 1;
        margin-bottom: 3px;
    }

    .v2-bottom-nav-label {
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: -0.2px;
    }

    /* --------------------------------------------------------------------------
       PÁGINA DE ATIVO INDIVIDUAL (RESPONSIVIDADE NO ATIVO_V2.PHP)
       -------------------------------------------------------------------------- */

    .v2-profile-header {
        margin-bottom: 14px !important;
    }

    .v2-profile-cover {
        padding: 16px 14px !important;
        gap: 12px !important;
        border-radius: 12px !important;
    }

    .v2-profile-cover-content {
        gap: 12px !important;
    }

    .v2-profile-avatar {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        font-size: 1.1rem !important;
        border-radius: 10px !important;
    }

    .v2-profile-ticker {
        font-size: 1.25rem !important;
    }

    .v2-profile-name {
        font-size: 0.72rem !important;
    }

    .v2-btn-carteira-header {
        width: 100% !important;
        text-align: center !important;
        padding: 9px 16px !important;
        font-size: 0.84rem !important;
    }

    /* Grade 2x2 para indicadores do ativo */
    .v2-indicators-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 0 12px !important;
        margin-bottom: 16px !important;
    }

    .v2-indicator-card {
        padding: 10px 12px !important;
    }

    .v2-indicator-value {
        font-size: 1.15rem !important;
    }

    .v2-indicator-title {
        font-size: 0.72rem !important;
    }

    /* Gráfico Highcharts ajustado para caber na tela do celular */
    #chart-container {
        height: 290px !important;
    }

    /* MENU DE ABAS DO ATIVO: ROLAGEM HORIZONTAL SUAVE (SEM EMPILHAMENTO VERTICAL GIGANTE) */
    .v2-sidebar-left {
        padding: 8px !important;
        margin-bottom: 14px !important;
        border-radius: 12px !important;
        position: static !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    .v2-sidebar-title {
        display: none !important;
    }

    .v2-asset-menu {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        gap: 6px !important;
        padding-bottom: 6px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .v2-asset-menu::-webkit-scrollbar {
        display: none !important;
    }

    .v2-asset-menu-item {
        flex-shrink: 0 !important;
    }

    .v2-asset-menu-item a {
        padding: 8px 16px !important;
        font-size: 0.82rem !important;
        border-radius: 20px !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        white-space: nowrap !important;
        box-shadow: var(--shadow-sm) !important;
    }

    .v2-asset-menu-item.active a {
        background: var(--primary) !important;
        color: #ffffff !important;
        border-color: var(--primary) !important;
    }

    /* --------------------------------------------------------------------------
       TABELAS FINANCEIRAS COM PRIMEIRA COLUNA CONGELADA (STICKY TICKER)
       -------------------------------------------------------------------------- */

    .v2-table-wrapper,
    .v2-table-card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .v2-table-sticky-ticker th:first-child,
    .v2-table-sticky-ticker td:first-child,
    .v2-data-table th:first-child,
    .v2-data-table td:first-child,
    .v2-table-compact th:first-child,
    .v2-table-compact td:first-child {
        position: sticky !important;
        left: 0 !important;
        background: #ffffff !important;
        z-index: 3 !important;
        box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08) !important;
    }

    body.v2-dark-mode .v2-table-sticky-ticker th:first-child,
    body.v2-dark-mode .v2-table-sticky-ticker td:first-child,
    body.v2-dark-mode .v2-data-table th:first-child,
    body.v2-dark-mode .v2-data-table td:first-child,
    body.v2-dark-mode .v2-table-compact th:first-child,
    body.v2-dark-mode .v2-table-compact td:first-child {
        background: #1e293b !important;
    }

    .v2-data-table th, 
    .v2-data-table td,
    .v2-ranking-table th,
    .v2-ranking-table td {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }

    /* --------------------------------------------------------------------------
       CONTAINERS, GRIDS E FORMULÁRIOS DE FILTRO EM DISPOSITIVOS MÓVEIS
       -------------------------------------------------------------------------- */

    .v2-container-3col {
        padding: 0 12px 24px 12px !important;
        gap: 14px !important;
    }

    .v2-proventos-container,
    .v2-altasbaixas-container,
    .v2-ranking-container,
    .v2-calendar-container,
    .v2-comparador-container {
        padding: 0 12px !important;
        margin: 14px auto !important;
    }

    .v2-filter-card {
        padding: 14px !important;
    }

    .v2-filter-card form {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .v2-filter-card form > div {
        width: 100% !important;
    }

    .v2-filter-card select,
    .v2-filter-card input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 42px !important;
    }

    .v2-filter-card button[type="submit"] {
        width: 100% !important;
        padding: 11px !important;
        font-size: 0.92rem !important;
        height: 44px !important;
    }

    /* Card de Publicação do Feed */
    .v2-post-card {
        padding: 14px !important;
    }

    .v2-post-header {
        gap: 10px !important;
    }

    .v2-post-icon-badge {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        font-size: 1rem !important;
    }

    .v2-post-meta h4 {
        font-size: 0.9rem !important;
    }

    .v2-post-footer {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .v2-post-action-btn {
        padding: 6px 10px !important;
        font-size: 0.78rem !important;
    }

    .v2-mobile-scroll-tip {
        display: block !important;
        font-size: 0.75rem !important;
        color: var(--text-muted) !important;
        padding: 6px 14px !important;
        background: var(--bg-main) !important;
        border-bottom: 1px solid var(--border-color) !important;
        font-weight: 600 !important;
    }
}

/* Wrappers responsivos de seções */
.v2-profile-wrapper,
.v2-chart-section-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.v2-chart-section-wrapper {
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .v2-profile-wrapper,
    .v2-chart-section-wrapper {
        padding: 0 12px !important;
        margin-bottom: 16px !important;
    }
}
