/* ==========================================================================
   HonestMarket Finance: World-Class Premium Dark Design System ("Coisa Fina")
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #070A11;
    --bg-surface: #0F172A;
    --bg-surface-elevated: #1E293B;
    
    --card-bg: rgba(15, 23, 42, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(99, 102, 241, 0.3);
    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);

    /* Accents */
    --accent-indigo: #6366F1;
    --accent-cyan: #06B6D4;
    --accent-emerald: #10B981;
    --accent-amber: #F59E0B;
    --accent-rose: #F43F5E;
    --accent-purple: #A855F7;

    /* Text Colors */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Dynamic Sizing */
    --cfo-drawer-width: 380px;
    --cfo-split-width: 840px;
}

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

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

body.resizing-col {
    cursor: col-resize !important;
    user-select: none !important;
}

/* Background Radial Glow Effect */
.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Layout Grid */
.app-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 280px 1fr var(--cfo-drawer-width, 380px);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    transition: grid-template-columns 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container.resizing-active {
    transition: none !important;
}

/* ==========================================================================
   Sidebar Navigation Styles
   ========================================================================== */
.sidebar {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.5rem;
    gap: 1.75rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-box {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.logo-icon {
    font-size: 1.5rem;
}

.brand-text h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.brand-sub {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Bank Status Card */
.bank-card {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.08), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 18px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.bank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bank-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.15);
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.status-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.status-pill.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
}

.bank-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bank-logo {
    font-size: 1.6rem;
}

.bank-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.bank-account {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.bank-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.725rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.6rem;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

/* Infrastructure Node Status */
.infra-status {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.infra-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.dot.active {
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.sidebar-footer {
    margin-top: auto;
}

.sdk-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--card-border);
}

/* ==========================================================================
   Main Workspace Styles
   ========================================================================== */
.main-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 2rem;
    gap: 2rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.breadcrumb {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.4rem;
    border-radius: 14px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    color: #FFFFFF;
    box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -5px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Dashboard Grid & Cards ("Coisa Fina")
   ========================================================================== */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    border-color: var(--card-hover-border);
    transform: translateY(-3px);
}

.kpi-card.hover-effect {
    cursor: pointer;
}

.kpi-card.selected-card {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.1), rgba(15, 23, 42, 0.8));
}

.kpi-card.accent-gradient {
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.12), rgba(15, 23, 42, 0.7));
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    position: relative;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.35;
    flex: 1;
}

.kpi-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.kpi-icon-wrapper.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.kpi-icon-wrapper.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.kpi-icon-wrapper.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.kpi-icon-wrapper.purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.kpi-value {
    font-family: var(--font-mono);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.kpi-value.glow {
    color: #E9D5FF;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.kpi-bottom {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pill-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

.pill-tag.green { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.pill-tag.amber { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.pill-tag.cyan { background: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }
.pill-tag.purple { background: rgba(168, 85, 247, 0.2); color: var(--accent-purple); }

.kpi-subtext {
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.chart-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: var(--card-shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.chart-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.tab-item {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9px;
    color: var(--text-secondary);
    cursor: pointer;
}

.tab-item.active {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

/* Chart Filter Toolbar */
.chart-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-bank-filters {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bank-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    border-radius: 18px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bank-pill:hover {
    border-color: rgba(59, 130, 246, 0.5);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}

.bank-pill.active {
    background: rgba(59, 130, 246, 0.16);
    border-color: #3b82f6;
    color: #60a5fa;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.chart-right-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Capital Contribution Toggle Button */
.capital-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.capital-toggle-btn.active {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

.capital-toggle-btn:not(.active) {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.capital-toggle-icon {
    font-size: 0.85rem;
}

/* Chart Category Dropdown Popover */
.chart-category-dropdown {
    position: relative;
}

.chart-category-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 5px 11px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-category-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.07);
}

.chart-category-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 270px;
    max-height: 360px;
    background: #11151f;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
    z-index: 120;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-category-list {
    overflow-y: auto;
    max-height: 280px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.chart-category-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.chart-category-item input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.chart-category-item-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-category-count {
    font-size: 0.7rem;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
}

.chart-body {
    position: relative;
    height: 280px;
    width: 100%;
}

/* Table Card */
.table-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: var(--card-shadow);
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-card-header > div:first-child {
    min-width: 220px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stylish-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.6rem 1rem 0.6rem 2.2rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
    width: 240px;
}

.stylish-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.stylish-select {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 480px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 0.65rem;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.custom-table td {
    padding: 0.75rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.custom-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem !important;
}

/* Method Pill */
.method-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.725rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
}

.cat-badge {
    font-size: 0.725rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(168, 85, 247, 0.15);
    color: #D8B4FE;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ==========================================================================
   Right AI CFO Chat Drawer & Resizable Split View
   ========================================================================== */
.chat-drawer {
    position: relative;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 320px;
    overflow: hidden;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.45);
}

/* Draggable Resizer Bar on Left Boundary */
.drawer-resizer {
    position: absolute;
    top: 0;
    left: -6px;
    width: 14px;
    height: 100%;
    cursor: col-resize;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: background 0.15s ease;
}

.drawer-resizer::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    transition: all 0.2s ease;
}

.drawer-resizer:hover::before,
.drawer-resizer.active::before {
    background: var(--accent-indigo);
    box-shadow: 0 0 12px var(--accent-indigo);
}

.resizer-pill {
    position: absolute;
    width: 18px;
    height: 46px;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.2s ease;
    pointer-events: none;
}

.drawer-resizer:hover .resizer-pill,
.drawer-resizer.active .resizer-pill {
    opacity: 1;
    transform: scale(1);
}

.resizer-pill span {
    width: 3px;
    height: 3px;
    background: #94a3b8;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.drawer-resizer:hover .resizer-pill span,
.drawer-resizer.active .resizer-pill span {
    background: #6366f1;
}

/* Split Container */
.drawer-split-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Left Pane: Chat Canvas */
.chat-canvas-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1 1 100%;
    min-width: 320px;
    overflow: hidden;
    position: relative;
    transition: flex 0.2s ease;
}

.chat-drawer.split-mode .chat-canvas-pane {
    flex: 1 1 50%;
    border-right: 1px solid var(--card-border);
}

.chat-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.voice-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-observability-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-observability-toggle:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.btn-observability-toggle.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(168, 85, 247, 0.45));
    border-color: #a855f7;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}

.obs-header-badge {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    font-size: 0.62rem;
    padding: 1px 5px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.agent-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(168, 85, 247, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.agent-emoji {
    font-size: 1.5rem;
}

.agent-meta h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.status-indicator {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--card-border);
}

.action-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.725rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-chip:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
    border-color: var(--accent-indigo);
    transform: scale(1.03);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 92%;
}

.message.user {
    align-self: flex-end;
}

.message.user .msg-bubble {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    color: #FFFFFF;
    border-radius: 18px 18px 4px 18px;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.message.agent {
    align-self: flex-start;
}

.message.agent .msg-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 18px 18px 18px 4px;
}

.msg-bubble {
    padding: 0.85rem 1.15rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.msg-bubble p {
    margin-bottom: 0.5rem;
}

.msg-bubble p:last-child {
    margin-bottom: 0;
}

.thought-container {
    background: rgba(168, 85, 247, 0.08);
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    padding: 0.85rem 1.25rem;
    font-size: 0.75rem;
    color: #E9D5FF;
}

.hidden { display: none !important; }
.thought-container.hidden { display: none !important; }

.thought-header {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.chat-input-bar {
    padding: 1.25rem;
    border-top: 1px solid var(--card-border);
}

#chatForm {
    display: flex;
    gap: 0.6rem;
}

#chatInput {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.85rem 1.15rem;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
}

#chatInput:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

#btnSendChat {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    color: #FFFFFF;
    border: none;
    border-radius: 16px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

#btnSendChat:hover {
    transform: scale(1.05);
}

/* Nubank / Pluggy Purple Theme Extensions */
.bank-card.purple-theme {
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.1), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.bank-badge.purple {
    color: #D8B4FE;
    background: rgba(168, 85, 247, 0.18);
}

.badge-dot.purple {
    background: #A855F7;
    box-shadow: 0 0 8px #A855F7;
}

.status-pill.purple {
    background: rgba(168, 85, 247, 0.2);
    color: #E9D5FF;
}

.btn-purple {
    background: linear-gradient(135deg, #8B5CF6, #A855F7);
    color: #FFFFFF;
    box-shadow: 0 8px 25px -5px rgba(168, 85, 247, 0.4);
}

.btn-purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -5px rgba(168, 85, 247, 0.6);
}

.bank-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.725rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.bank-pill.pagbank {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.bank-pill.nubank {
    background: rgba(168, 85, 247, 0.15);
    color: #D8B4FE;
    border: 1px solid rgba(168, 85, 247, 0.3);
}



/* Added by Antigravity */
.view-section { animation: fadeIn 0.3s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Multi-Bank Ledger Period Filter & Cash KPI Cards Styles
   ========================================================================== */
.ledger-top-bar {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.25rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(16px);
}

.ledger-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ledger-heading {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.cash-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
}

.ledger-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ledger-period-filter {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Segmented Control (Dual button MTD / YTD) */
.segmented-control {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 4px;
    gap: 4px;
}

.segment-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.segment-btn.active {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    color: #FFFFFF;
    box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.45);
}

/* Period Dropdown Container & Trigger Button */
.period-dropdown-container {
    position: relative;
    z-index: 150;
}

.period-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.6rem 1.15rem;
    border-radius: 14px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-dropdown-btn:hover,
.period-dropdown-container.open .period-dropdown-btn {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
    background: rgba(15, 23, 42, 0.8);
}

.period-icon {
    font-size: 1rem;
}

.chevron-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.period-dropdown-container.open .chevron-arrow {
    transform: rotate(180deg);
    color: var(--accent-cyan);
}

/* Period Dropdown Popover (Floating Multi-Select Panel) */
.period-dropdown-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 999;
    background: #0B1120;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 25px rgba(99, 102, 241, 0.25);
    width: 290px;
    overflow: hidden;
    animation: fadeInScale 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.popover-quick-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.popover-action-btn {
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.popover-action-btn.select-all {
    color: var(--accent-cyan);
}

.popover-action-btn.select-all:hover {
    background: rgba(6, 182, 212, 0.15);
}

.popover-action-btn.clear-all {
    color: var(--accent-rose);
}

.popover-action-btn.clear-all:hover {
    background: rgba(244, 63, 94, 0.15);
}

.popover-options-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.popover-options-list::-webkit-scrollbar {
    width: 6px;
}

.popover-options-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.period-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.period-option-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.period-option-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.period-option-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--text-muted);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    outline: none;
}

.period-option-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    border-color: transparent;
}

.period-option-item input[type="checkbox"]:checked::after {
    content: '✓';
    font-size: 0.75rem;
    color: #FFFFFF;
    font-weight: 800;
}

.period-option-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.period-option-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 2px 7px;
    border-radius: 8px;
    font-family: var(--font-mono);
}

/* 3-Column Ledger KPI Grid */
.ledger-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 1100px) {
    .ledger-kpi-grid {
        grid-template-columns: 1fr;
    }
    .ledger-top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Multi-Bank Ledger Category Multi-Select Dropdown Styles
   ========================================================================== */
.category-dropdown-container {
    position: relative;
    z-index: 80;
}

.category-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.category-dropdown-btn:hover,
.category-dropdown-container.open .category-dropdown-btn {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
    background: rgba(15, 23, 42, 0.85);
}

.category-icon {
    font-size: 0.95rem;
}

.category-dropdown-container.open .chevron-arrow {
    transform: rotate(180deg);
    color: var(--accent-cyan);
}

.category-dropdown-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 999;
    background: #0B1120;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 25px rgba(99, 102, 241, 0.25);
    width: 320px;
    max-width: 90vw;
    overflow: hidden;
    animation: fadeInScale 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.category-option-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.category-option-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 220px;
}

.category-option-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--text-muted);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    outline: none;
    flex-shrink: 0;
}

.category-option-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    border-color: transparent;
}

.category-option-item input[type="checkbox"]:checked::after {
    content: '✓';
    font-size: 0.75rem;
    color: #FFFFFF;
    font-weight: 800;
}

.category-option-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-option-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 2px 7px;
    border-radius: 8px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Category Inline Editing */
.category-edit-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.edit-category-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.65;
    padding: 3px 5px;
    border-radius: 4px;
    transition: opacity 0.2s, background-color 0.2s, transform 0.15s;
    line-height: 1;
}

.category-edit-wrapper:hover .edit-category-btn,
.edit-category-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.category-inline-edit {
    padding: 4px 8px;
    font-size: 0.8rem;
    height: 30px;
    min-width: 170px;
    background: #1e293b;
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    color: #f8fafc;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
}

/* Card Three Dots Options Menu */
.kpi-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-options-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.btn-card-options {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-card-options:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.05);
}

.kpi-card:has(.card-options-dropdown:not(.hidden)),
.dashboard-card:has(.card-options-dropdown:not(.hidden)) {
    z-index: 50;
}

.card-options-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 250px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.8), 0 0 15px rgba(99, 102, 241, 0.2);
    padding: 6px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    backdrop-filter: blur(20px);
    animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* On KPI cards, open downwards towards the right so it never overlaps the left sidebar */
.kpi-card .card-options-dropdown {
    left: 0;
    right: auto;
}

.card-options-dropdown.hidden {
    display: none !important;
}

.card-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    transition: all 0.15s ease;
    width: 100%;
}

.card-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.card-menu-item.opt-ask:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
}

.card-menu-item .opt-icon {
    font-size: 1.1rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.card-menu-item .opt-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-menu-item .opt-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f8fafc;
}

.card-menu-item .opt-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.2;
}

/* Chat Stop Button */
.btn-chat-stop {
    background: rgba(244, 63, 94, 0.18);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fb7185;
    border-radius: 16px;
    padding: 0 14px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-chat-stop:hover {
    background: rgba(244, 63, 94, 0.35);
    border-color: #f43f5e;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
}

.btn-chat-stop.hidden {
    display: none !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Multimodal Voice & Vision Assistant (Gemini Flash Live API)
   ========================================================================== */
.btn-voice-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-voice-toggle:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.btn-voice-toggle.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
    animation: pulseVoiceBtn 2s infinite ease-in-out;
}

@keyframes pulseVoiceBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); box-shadow: 0 0 20px rgba(16, 185, 129, 0.7); }
}

.voice-assistant-panel {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin: 10px 14px 4px 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeInDown 0.3s ease;
}

.voice-orb-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* 3D Animated Voice Orb */
.voice-orb {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.orb-core {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #64748b;
    transition: all 0.3s ease;
}

.orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid transparent;
}

.ring-1 { width: 34px; height: 34px; }
.ring-2 { width: 44px; height: 44px; }

/* Orb States */
.voice-orb.state-listening .orb-core {
    background: #06b6d4;
    box-shadow: 0 0 16px #06b6d4;
    animation: pulseCore 1.5s infinite;
}
.voice-orb.state-listening .ring-1 {
    border-color: rgba(6, 182, 212, 0.5);
    animation: spinRing 3s linear infinite;
}
.voice-orb.state-listening .ring-2 {
    border-color: rgba(6, 182, 212, 0.25);
    animation: spinRingReverse 4s linear infinite;
}

.voice-orb.state-thinking .orb-core {
    background: #f59e0b;
    box-shadow: 0 0 16px #f59e0b;
    animation: pulseCore 0.8s infinite alternate;
}
.voice-orb.state-thinking .ring-1 {
    border-color: rgba(245, 158, 11, 0.6);
    border-top-color: transparent;
    animation: spinRing 1s linear infinite;
}

.voice-orb.state-speaking .orb-core {
    background: #10b981;
    box-shadow: 0 0 20px #10b981;
    animation: pulseSpeaking 0.6s infinite alternate;
}
.voice-orb.state-speaking .ring-1 {
    border-color: rgba(16, 185, 129, 0.7);
    animation: pulseCore 1s infinite;
}

@keyframes pulseCore {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

@keyframes pulseSpeaking {
    0% { transform: scale(0.95); box-shadow: 0 0 12px #10b981; }
    100% { transform: scale(1.2); box-shadow: 0 0 24px #10b981; }
}

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

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

.voice-status-info {
    display: flex;
    flex-direction: column;
}

.voice-status-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
}

.voice-subtext {
    font-size: 0.7rem;
    color: #94a3b8;
}

.voice-controls-bar {
    display: flex;
    gap: 8px;
}

.btn-voice-ctrl {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-voice-ctrl:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.btn-voice-ctrl.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.voice-camera-preview {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.2);
}

/* Action Cards */
.voice-cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.voice-card {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    animation: fadeInDown 0.25s ease;
}

.voice-card .card-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #f8fafc;
}

.voice-card .card-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 4px;
}

.price-col {
    background: rgba(15, 23, 42, 0.6);
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.price-col.highlight {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.disambiguation-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.disambiguation-opt-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #e0e7ff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.disambiguation-opt-btn:hover {
    background: rgba(99, 102, 241, 0.35);
    border-color: #818cf8;
}

.opt-badge {
    background: #6366f1;
    color: #ffffff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.confirmation-card {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(41, 37, 36, 0.9);
}

.confirmation-card .card-title {
    color: #fbbf24;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-confirm-yes {
    flex: 1;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-confirm-no {
    flex: 1;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
}

.voice-floating-notification {
    position: fixed;
    bottom: 24px;
    right: 380px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.5);
    color: #f8fafc;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeInDown 0.3s ease;
}

/* ==========================================================================
   Voice Observability & Telemetry Split Pane (Enterprise Live UI)
   ========================================================================== */
.observability-split-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1 1 50%;
    min-width: 360px;
    background: rgba(10, 15, 29, 0.96);
    backdrop-filter: blur(25px);
    overflow: hidden;
    position: relative;
    animation: fadeInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.observability-split-pane.hidden {
    display: none !important;
}

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

/* Header */
.obs-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.25rem 0.9rem;
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.7);
}

.obs-pane-title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.obs-pane-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    font-family: var(--font-heading);
}

.obs-status-tag {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-weight: 700;
    font-family: var(--font-mono);
}

.obs-pane-subtitle {
    font-size: 0.71rem;
    color: #94a3b8;
}

.obs-pane-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.obs-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.obs-btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.obs-btn-icon.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366f1;
    color: #a5b4fc;
}

.btn-close-split {
    color: #94a3b8;
}

.btn-close-split:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* Telemetry Metrics Strip */
.obs-metrics-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--card-border);
}

.obs-metric-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.obs-metric-lbl {
    font-size: 0.64rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.obs-metric-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f1f5f9;
}

.obs-metric-val.highlight {
    color: #38bdf8;
}

.obs-metric-val.mono {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #a5b4fc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toolbar & Filters */
.obs-filter-toolbar {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.4);
}

.obs-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.obs-search-box .search-icon {
    position: absolute;
    left: 10px;
    font-size: 0.8rem;
    opacity: 0.6;
    pointer-events: none;
}

.obs-search-box input {
    width: 100%;
    height: 32px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0 28px 0 30px;
    color: #f8fafc;
    font-size: 0.76rem;
    outline: none;
    transition: all 0.2s ease;
}

.obs-search-box input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.obs-search-clear {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.75rem;
}

.obs-filter-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.obs-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.obs-pill:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.obs-pill.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366f1;
    color: #c7d2fe;
    font-weight: 600;
}

/* Event Timeline List */
.voice-logs-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-entry {
    background: rgba(24, 33, 54, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 4px solid #6366f1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: rgba(30, 41, 68, 0.85);
    border-color: rgba(255, 255, 255, 0.12);
}

.log-entry.user {
    border-left-color: #06b6d4;
}

.log-entry.tool {
    border-left-color: #f59e0b;
}

.log-entry.agent {
    border-left-color: #10b981;
}

.log-entry.system {
    border-left-color: #8b5cf6;
}

.log-entry.in-progress {
    border-left-color: #38bdf8 !important;
    background: rgba(30, 48, 80, 0.85);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
}

.log-entry.in-progress .log-entry-content::after {
    content: ' ▍';
    display: inline-block;
    color: #38bdf8;
    font-size: 0.82rem;
    animation: blinkLogCursor 0.8s infinite;
}

@keyframes blinkLogCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.log-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #64748b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 4px;
}

.log-badge-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.log-speaker-badge {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.log-speaker-badge.user {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.log-speaker-badge.agent {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.log-speaker-badge.tool {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.log-speaker-badge.system {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.log-event-tag {
    font-size: 0.65rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.log-event-tag.live {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-weight: 600;
    animation: pulseLiveTag 1.4s infinite ease-in-out;
}

@keyframes pulseLiveTag {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.97); }
}

.log-time-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.log-latency-pill {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.65rem;
    font-family: var(--font-mono);
}

.log-latency-pill.fast {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.log-time-str {
    font-family: var(--font-mono);
    color: #64748b;
    font-size: 0.68rem;
}

.log-entry-content {
    color: #e2e8f0;
    line-height: 1.45;
    word-break: break-word;
}

.log-tool-call-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #fbbf24;
    font-size: 0.79rem;
}

.log-tool-resumo {
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 2px solid #fbbf24;
    padding: 6px 8px;
    border-radius: 0 4px 4px 0;
    color: #cbd5e1;
    font-style: italic;
    font-size: 0.74rem;
}

.log-payload-details {
    margin-top: 4px;
}

.log-payload-toggle {
    background: transparent;
    border: none;
    color: #818cf8;
    font-size: 0.68rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
}

.log-payload-toggle:hover {
    text-decoration: underline;
    color: #a5b4fc;
}

.log-payload-pre {
    margin-top: 6px;
    background: #070a11;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #38bdf8;
    overflow-x: auto;
    max-height: 180px;
    white-space: pre-wrap;
    word-break: break-all;
}
