/* ============================================
   InfluencIA — AlcaLink Design System
   ============================================ */

/* --- Hidden sections (kept in code, hidden from UI) --- */
.section-hidden {
    display: none !important;
}

.nav-item-campaigns {
    display: none !important;
}

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Brand */
    --brand-primary: #6C5CE7;
    --brand-primary-hover: #5A4BD1;
    --brand-primary-light: #E8E4FF;
    --brand-secondary: #00CEC9;
    --brand-secondary-light: #E0FBFB;
    --brand-accent: #FD79A8;
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: linear-gradient(180deg, #2D1B69 0%, #1A1035 100%);
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(108,92,231,0.35);
    
    /* Layout */
    --topbar-height: 64px;
    --content-bg: #F4F6FC;
    --card-bg: #FFFFFF;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
    --card-radius: 12px;
    
    /* Typography */
    --heading-color: #1E1B4B;
    --body-color: #475569;
    --muted-color: #94A3B8;
    
    /* Borders */
    --border-color: #E2E8F0;
    --border-radius: 10px;
    
    /* Status colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;
}

/* --- Global Reset & Base --- */
* { box-sizing: border-box; }

body {
    background: var(--content-bg);
    color: var(--body-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-weight: 700;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--brand-primary-hover); }

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1.25rem 1.5rem;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-brand-subtitle {
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar .nav-section {
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
}

.sidebar .nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.65);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    margin-bottom: 2px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 0.5rem 1rem;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    display: block;
}

.sidebar-user-logout {
    color: rgba(255,255,255,0.3);
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}
.sidebar-user-logout:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--content-bg);
}

/* --- Topbar --- */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.92);
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--heading-color);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h4 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--heading-color);
    margin: 0;
}

.page-header-subtitle {
    font-size: 0.9rem;
    color: var(--muted-color);
    font-weight: 400;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.card-header h6 {
    font-weight: 700;
    color: var(--heading-color);
    margin: 0;
    font-size: 0.95rem;
}

.card-body { padding: 1.25rem; }

/* --- KPI Cards --- */
.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

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

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

.kpi-icon-primary { background: var(--brand-primary-light); color: var(--brand-primary); }
.kpi-icon-success { background: var(--success-light); color: var(--success); }
.kpi-icon-warning { background: var(--warning-light); color: var(--warning); }
.kpi-icon-info { background: var(--info-light); color: var(--info); }
.kpi-icon-danger { background: var(--danger-light); color: var(--danger); }
.kpi-icon-accent { background: linear-gradient(135deg, var(--brand-primary-light), #FDE8EF); color: var(--brand-accent); }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--heading-color);
    line-height: 1;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--muted-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Tables --- */
.table {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    background: #F8FAFC;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-color);
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.15s;
}

.table tbody tr:hover {
    background: #F8FAFC;
}

.table tbody tr[onclick] {
    cursor: pointer;
}

/* --- Badges --- */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 0.4em 0.7em;
    border-radius: 6px;
}

.badge.bg-primary { background-color: var(--brand-primary) !important; }

/* Status badges */
.status-prospect { background: #F1F5F9; color: #64748B; }
.status-contacted { background: var(--info-light); color: var(--info); }
.status-negotiating { background: var(--warning-light); color: #92400E; }
.status-active { background: var(--success-light); color: #065F46; }
.status-inactive { background: #F1F5F9; color: #94A3B8; }
.status-blacklisted { background: var(--danger-light); color: var(--danger); }

/* Tier badges */
.tier-nano { background: #F1F5F9; color: #64748B; }
.tier-micro { background: var(--info-light); color: var(--info); }
.tier-macro { background: var(--warning-light); color: #92400E; }
.tier-mega { background: linear-gradient(135deg, #FDE8EF, #FDE68A); color: #9F1239; }

/* Platform icons */
.platform-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.platform-instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color:#fff; }
.platform-tiktok { background:#000; color:#fff; }
.platform-youtube { background:#FF0000; color:#fff; }
.platform-twitter { background:#000; color:#fff; }
.platform-linkedin { background:#0A66C2; color:#fff; }
.platform-facebook { background:#1877F2; color:#fff; }
.platform-twitch { background:#9146FF; color:#fff; }
.platform-pinterest { background:#E60023; color:#fff; }
.platform-snapchat { background:#FFFC00; color:#000; }
.platform-other { background:#64748B; color:#fff; }

/* --- Buttons --- */
.btn { border-radius: 8px; font-weight: 600; font-size: 0.875rem; transition: all 0.2s; }

.btn-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    box-shadow: 0 2px 4px rgba(108,92,231,0.2);
}
.btn-primary:hover {
    background: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108,92,231,0.3);
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-outline-primary:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* --- Forms --- */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--body-color);
    margin-bottom: 0.3rem;
}

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

/* --- Breadcrumb --- */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.breadcrumb-item a { color: var(--brand-primary); }
.breadcrumb-item.active { color: var(--muted-color); }

/* --- Flash Alerts --- */
.alert {
    border-radius: var(--card-radius);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success { background: var(--success-light); color: #065F46; }
.alert-danger { background: var(--danger-light); color: #991B1B; }
.alert-info { background: var(--info-light); color: #1E40AF; }
.alert-warning { background: var(--warning-light); color: #92400E; }

/* --- Tabs --- */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 2px;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    color: var(--muted-color);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.65rem 1.15rem;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    color: var(--heading-color);
    background: rgba(108,92,231,0.05);
}

.nav-tabs .nav-link.active {
    color: var(--brand-primary);
    border-bottom: 2px solid var(--brand-primary);
    background: transparent;
    font-weight: 700;
}

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2D1B69 0%, #1A1035 50%, #0F172A 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(108,92,231,0.15), transparent);
    top: -100px; right: -100px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(0,206,201,0.1), transparent);
    bottom: -80px; left: -80px;
    border-radius: 50%;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin: 0 auto 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--heading-color);
    text-align: center;
}

.login-subtitle {
    color: var(--muted-color);
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

/* --- Filter Bar --- */
.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-color);
}
.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 0.75rem;
    display: block;
}

/* --- Profile card in show view --- */
.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

/* --- Section card improvements --- */
.section-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.section-card-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: #FAFBFD;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-card-header i {
    color: var(--brand-primary);
    font-size: 1rem;
}

.section-card-header h6 {
    font-weight: 700;
    color: var(--heading-color);
    margin: 0;
    font-size: 0.9rem;
}

.section-card-body {
    padding: 1.25rem;
}

/* --- Data rows in detail view --- */
.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F8FAFC;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    color: var(--muted-color);
    font-size: 0.82rem;
    font-weight: 500;
    min-width: 160px;
}

.data-value {
    font-weight: 600;
    color: var(--heading-color);
    font-size: 0.875rem;
    text-align: right;
}

/* --- Platform card in show view --- */
.platform-card {
    background: #FAFBFD;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: all 0.2s;
}

.platform-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.platform-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.platform-card-body {
    padding: 0.85rem 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0,0,0,0.15);
    }
    .main-content {
        margin-left: 0;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .kpi-value { font-size: 1.35rem; }
    .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.3s ease-out;
}

/* --- Scrollbar (webkit) --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* --- Print --- */
@media print {
    .sidebar, .topbar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ===========================
   AI CHAT
   =========================== */

/* Dual panel layout */
.ai-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1rem;
    height: calc(100vh - 180px);
    min-height: 500px;
}

@media (max-width: 991px) {
    .ai-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .ai-chat-panel { min-height: 400px; }
    .ai-data-panel { min-height: 300px; }
}

/* Chat Panel */
.ai-chat-panel {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.ai-chat-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--heading-color);
    display: flex;
    align-items: center;
}

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

.ai-chat-messages::-webkit-scrollbar { width: 4px; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.ai-chat-input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.ai-chat-input-area textarea {
    border-radius: var(--radius);
    border-color: var(--border-color);
    resize: none;
    font-size: 0.875rem;
}

.ai-chat-input-area textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}

.ai-chat-input-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

/* Messages */
.ai-msg {
    display: flex;
    gap: 0.75rem;
    max-width: 90%;
    animation: msgIn 0.3s ease;
}

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

.ai-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.ai-msg-assistant .ai-msg-avatar {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
}

.ai-msg-user .ai-msg-avatar {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.ai-msg-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    border: 1px solid var(--border-color);
}

.ai-msg-user .ai-msg-content {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.ai-msg-content p:last-child { margin-bottom: 0; }
.ai-msg-content code {
    background: rgba(0,0,0,0.05);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.8em;
}

.ai-msg-user .ai-msg-content code {
    background: rgba(255,255,255,0.15);
}

/* Thinking indicator */
.ai-thinking {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.ai-thinking span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-primary);
    animation: blink 1.4s infinite both;
}

.ai-thinking span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Data Panel */
.ai-data-panel {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.ai-data-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--heading-color);
    display: flex;
    align-items: center;
}

.ai-data-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.ai-data-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    gap: 0.5rem;
}

.ai-data-empty i { font-size: 2.5rem; opacity: 0.3; }
.ai-data-empty p { margin-bottom: 0; }

/* Data fields preview */
.ai-data-section {
    margin-bottom: 0.75rem;
}

.ai-data-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.5rem 0.5rem 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-data-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.ai-data-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    transition: background 0.15s;
}

.ai-data-row:hover {
    background: var(--bg-secondary);
}

.ai-data-key {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 100px;
    flex-shrink: 0;
}

.ai-data-val {
    font-weight: 600;
    color: var(--heading-color);
    text-align: right;
    word-break: break-word;
}

.ai-data-val.confidence-high { color: var(--success); }
.ai-data-val.confidence-medium { color: var(--warning); }

/* Platform cards in data preview */
.ai-data-platform {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 0.8rem;
}

.ai-data-platform-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.ai-data-platform-info {
    flex: 1;
}

.ai-data-platform-name {
    font-weight: 600;
    color: var(--heading-color);
}

.ai-data-platform-stats {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Data actions bar */
.ai-data-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
}

.ai-data-actions .btn {
    flex: 1;
    font-size: 0.8rem;
}

/* Tool Calls in chat */
.ai-tool-call {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    margin-top: 0.35rem;
    background: rgba(108,92,231,0.08);
    border: 1px solid rgba(108,92,231,0.2);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--brand-primary);
    animation: toolPulse 1.5s ease-in-out infinite;
}

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

.ai-tool-result {
    padding: 0.25rem 0.5rem;
    margin-top: 0.25rem;
    background: rgba(0,206,201,0.06);
    border: 1px solid rgba(0,206,201,0.15);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-muted);
}