/* ================================================================
   CallingAnt — Light theme overrides (professional white UI)
================================================================ */

/* ── Navbar (public) ─────────────────────────────────────────── */
.va-navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.va-navbar .nav-link {
    color: var(--text-muted) !important;
}

.va-navbar .nav-link:hover,
.va-navbar .nav-link.active {
    color: var(--text-primary) !important;
    background: #f1f5f9 !important;
}

.va-navbar .navbar-brand {
    color: var(--text-primary) !important;
}

/* ── Sidebar (dark) + light main content ─────────────────────── */
.va-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.08);
}

.va-sidebar-brand {
    color: #f8fafc !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.va-sidebar-brand .text-accent {
    color: #a5b4fc !important;
}

.va-sidebar-link {
    color: #94a3b8 !important;
}

.va-sidebar-link:hover {
    color: #f1f5f9 !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

.va-sidebar-link.is-active {
    color: #ffffff !important;
    background: rgba(79, 70, 229, 0.35) !important;
    border-color: rgba(129, 140, 248, 0.45) !important;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.15) !important;
}

.va-sidebar-link.is-active i {
    color: #c7d2fe !important;
}

.va-sidebar-user {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.va-sidebar-user-btn {
    background: rgba(0, 0, 0, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

.va-sidebar-user-btn:hover {
    background: rgba(79, 70, 229, 0.2) !important;
    border-color: rgba(129, 140, 248, 0.35) !important;
}

.va-sidebar-user-name {
    color: #f1f5f9 !important;
}

.va-sidebar-user-email {
    color: #64748b !important;
}

.va-sidebar-user-chevron {
    color: #94a3b8 !important;
}

.va-sidebar-dropdown.va-dropdown {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.va-sidebar-dropdown .dropdown-item {
    color: #cbd5e1 !important;
}

.va-sidebar-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f8fafc !important;
}

/* Sidebar nav — independent scroll */
.va-sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.va-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.va-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.va-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.va-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.55);
}

.va-main-column {
    background: var(--bg-deep) !important;
}

.va-mobile-topbar {
    background: #ffffff !important;
    border-bottom-color: var(--border) !important;
}

.va-sidebar-toggle {
    background: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

.va-sidebar-toggle:hover {
    background: #eef2ff !important;
    color: var(--accent) !important;
}

.va-sidebar-backdrop {
    background: rgba(15, 23, 42, 0.35) !important;
}

@media (max-width: 991.98px) {
    .va-sidebar {
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35) !important;
    }
}

/* ── Dropdown ────────────────────────────────────────────────── */
.va-dropdown {
    background: #ffffff !important;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.1) !important;
}

.va-dropdown .dropdown-item {
    color: var(--text-muted) !important;
}

.va-dropdown .dropdown-item:hover {
    background: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

/* ── Cards ───────────────────────────────────────────────────── */
.va-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
    border-color: #c7d2fe !important;
}

.va-card-header,
.va-card-header h2,
.va-card-header h3 {
    color: var(--text-primary);
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-control {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: var(--text-primary) !important;
}

.form-control:focus {
    background-color: #ffffff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.form-select {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: var(--text-primary) !important;
    color-scheme: light !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234f46e5' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

.form-select:focus {
    background-color: #ffffff !important;
}

select.form-select option,
.form-select option {
    background-color: #ffffff;
    color: var(--text-primary);
}

.form-label {
    color: #475569 !important;
}

.input-group-text {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: var(--text-muted) !important;
}

.form-check-input[type="checkbox"] {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

/* ── Agent tabs & tools ──────────────────────────────────────── */
.agent-tabs {
    background: #f1f5f9 !important;
    border-color: var(--border) !important;
}

.agent-tab.is-active {
    background: #ffffff !important;
    color: var(--text-primary) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

.tools-tabs {
    background: #f1f5f9 !important;
}

.tools-tab.is-active {
    background: #ffffff !important;
}

.tool-toggle-card {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.widget-card,
.switch-row {
    background: #f8fafc !important;
}

.wizard-dot {
    background: #cbd5e1;
}

/* ── Tables ──────────────────────────────────────────────────── */
.va-table {
    --bs-table-bg: #ffffff;
    --bs-table-striped-bg: #f8fafc;
    --bs-table-hover-bg: #eef2ff;
    --bs-table-border-color: var(--border);
}

.va-table thead th {
    background: #f1f5f9 !important;
}

.table-dark {
    --bs-table-bg: #ffffff;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: #f8fafc;
    --bs-table-striped-bg: #f8fafc;
}

/* ── Telephony mapping ───────────────────────────────────────── */
.va-mapping-table-wrap {
    background: #ffffff !important;
    border-color: var(--border) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.va-mapping-table thead th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom-color: var(--border) !important;
}

.va-mapping-table tbody td {
    border-color: var(--border) !important;
}

.va-mapping-table tbody td:nth-child(2),
.va-mapping-table tbody td:nth-child(3) {
    color: var(--text-muted) !important;
}

.va-number-map-trigger {
    color: var(--text-primary) !important;
}

.va-number-map-trigger:hover:not(:disabled) {
    background: #f8fafc !important;
}

/* ── Modals ──────────────────────────────────────────────────── */
.va-modal-dark {
    background: #ffffff !important;
    color: var(--text-primary) !important;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12) !important;
}

.va-modal-dark .modal-header,
.va-modal-dark .modal-footer {
    background: #f8fafc !important;
    border-color: var(--border) !important;
}

.va-modal-dark .form-select {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color-scheme: light !important;
}

.va-modal-dark .form-check-input {
    background-color: #ffffff;
    border-color: #cbd5e1;
}

/* ── Hero & landing ──────────────────────────────────────────── */
.va-hero::before {
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 70, 229, 0.08) 0%, transparent 70%) !important;
}

.hero-badge {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
    color: var(--accent) !important;
}

.hero-desc {
    color: var(--text-muted) !important;
}

.gradient-text {
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
}

.feature-icon {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
    color: var(--accent) !important;
}

/* ── Workflow canvas ─────────────────────────────────────────── */
.workflow-canvas {
    background: #f8fafc !important;
}

.workflow-grid {
    background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px) !important;
}

.workflow-node.start {
    background: #f1f5f9 !important;
}

.workflow-line {
    background: #cbd5e1 !important;
}

.workflow-toolbar {
    background: #ffffff !important;
}

/* ── Security warnings (readable on light) ───────────────────── */
.security-warning {
    color: #991b1b !important;
    background: #fef2f2 !important;
    border-color: #fecaca !important;
}

.security-warning span {
    color: #b91c1c !important;
}

/* ── Payload / code blocks ───────────────────────────────────── */
.payload-pre {
    background: #f8fafc !important;
    color: #0f766e !important;
    border-color: var(--border) !important;
}

/* ── Footer ──────────────────────────────────────────────────── */
.va-footer,
.va-footer-app {
    background: #ffffff !important;
    border-top-color: var(--border) !important;
}

.va-footer .text-white {
    color: var(--text-primary) !important;
}

/* ── Conversations page inline overrides ─────────────────────── */
.conv-filter-bar select,
.conv-filter-bar input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-primary) !important;
}

.conv-table tbody tr:hover {
    background: #eef2ff !important;
}

.conv-table tbody tr.is-selected {
    background: #eef2ff !important;
    border-left-color: var(--accent) !important;
}

.transcript-bubble.agent {
    background: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

.transcript-bubble.user {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}

.conv-summary-box {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
    color: var(--text-primary) !important;
}

/* ── Admin call transcript (shared classes) ──────────────────── */
.transcript-bubble.transcript-agent {
    background: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

.transcript-bubble.transcript-user {
    background: #ffffff !important;
    border: 1px solid var(--border);
}

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
    border-bottom-color: var(--border) !important;
}

.page-header h1 {
    color: var(--text-primary);
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state i {
    color: #cbd5e1 !important;
}

/* ── Stat icons ──────────────────────────────────────────────── */
.stat-icon.purple {
    background: #eef2ff;
    color: var(--accent);
}

/* ── Bootstrap dark remnants ─────────────────────────────────── */
.text-bg-dark {
    background-color: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

.bg-dark {
    background-color: #f1f5f9 !important;
}

/* ── Card headers in dashboard ───────────────────────────────── */
.va-card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.card.va-card {
    background: #ffffff;
}

.card.va-card .card-body {
    color: var(--text-primary);
}

/* ── Log viewer panels ───────────────────────────────────────── */
.log-viewer-panel {
    max-height: 600px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.log-viewer-pre {
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-viewer-entry {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}
