/* Apex Collection Copilot - Call Intelligence */

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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-elevated: #2d333b;
    --border: #30363d;
    --border-subtle: #262c34;
    --text: #f0f6fc;
    --text-secondary: #b1bac4;
    --text-dim: #768390;
    --accent: #e3a008;
    --accent-hover: #f0b429;
    --accent-glow: rgba(227, 160, 8, 0.15);
    --accent-soft: rgba(227, 160, 8, 0.08);
    --success: #3fb950;
    --success-soft: rgba(63, 185, 80, 0.15);
    --warning: #d29922;
    --danger: #f85149;
    --danger-soft: rgba(248, 81, 73, 0.15);
    --info: #58a6ff;
    --ringing: #fbbf24;
    --connected: #22c55e;
    --wrapup: #a855f7;
    --console-bg: #0d1117;
    --console-text: #e6edf3;
    --purple: #a78bfa;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.95) 100%);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    backdrop-filter: blur(12px);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 5%,
        rgba(227, 160, 8, 0.5) 30%,
        rgba(248, 81, 73, 0.4) 50%,
        rgba(227, 160, 8, 0.5) 70%,
        transparent 95%
    );
}

/* Header Top Row */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, var(--accent) 0%, #dc6b10 50%, var(--danger) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(227, 160, 8, 0.25);
}

.logo-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.logo-text h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-text .title-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #f0b429 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Section */
.header-hero {
    text-align: center;
    flex: 1;
}

.hero-title {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--purple) 0%, var(--info) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 0.6875rem;
    color: var(--text-dim);
    margin-top: 0.125rem;
}

/* Header Bottom Row */
.header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    gap: 1.5rem;
}

/* Agent Info */
.agent-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.agent-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--info) 0%, var(--purple) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.agent-details {
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.agent-title {
    font-size: 0.6875rem;
    color: var(--text-dim);
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.agent-status.available {
    background: var(--success-soft);
    color: var(--success);
}

.agent-status.available .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.agent-status.on-call {
    background: rgba(34, 197, 94, 0.15);
    color: var(--connected);
}

.agent-status.on-call .status-dot {
    background: var(--connected);
    animation: pulse 1.5s ease-in-out infinite;
}

.agent-status.wrapup {
    background: rgba(168, 85, 247, 0.15);
    color: var(--wrapup);
}

.agent-status.wrapup .status-dot {
    background: var(--wrapup);
}

.agent-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Agent Stats */
.agent-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.625rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-item.highlight .stat-value {
    color: var(--success);
}

/* Demo Controls */

.demo-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.scenario-select-wrapper {
    position: relative;
}

.scenario-select {
    appearance: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    min-width: 180px;
}

.scenario-select:focus {
    outline: none;
    border-color: var(--accent);
}

.scenario-select-wrapper::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text-dim);
    pointer-events: none;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-accent {
    background: var(--accent);
    color: #000;
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.header-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
}

.connection-status.connected {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.connection-status.connected .status-dot {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Main Layout - 3 Columns */
.main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

.column {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.column-left {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    flex-shrink: 0;
}

.column-center {
    flex: 1;
    min-width: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

.column-right {
    width: 340px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Debtor Panel (Left Column) */
.panel-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.debtor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.debtor-avatar {
    width: 56px;
    height: 56px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dim);
    border: 2px solid var(--border);
}

.debtor-identity h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.debtor-phone {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.section-header svg {
    opacity: 0.7;
}

.section-header.warning {
    color: var(--danger);
}

.section-header.warning svg {
    opacity: 1;
}

.account-card {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 0.75rem;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.account-row.highlight {
    background: var(--accent-soft);
    margin: 0.25rem -0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    border-bottom: none;
}

.account-label {
    font-size: 0.8125rem;
    color: var(--text-dim);
}

.account-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.account-value.balance {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
}

.account-value.dpd {
    color: var(--danger);
    font-weight: 600;
}

.preferences-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.preference-item {
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
}

.pref-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.pref-value {
    font-size: 0.875rem;
    font-weight: 500;
}

.compliance-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compliance-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--danger-soft);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #f87171;
}

.empty-state {
    font-size: 0.8125rem;
    color: var(--text-dim);
    font-style: italic;
}

.empty-state.small {
    font-size: 0.75rem;
}

.history-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.history-stat {
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 0.75rem;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.history-outcomes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.outcome-pill {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Call Card (Center Column) */
.call-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    flex-shrink: 0;
}

.call-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.status-indicator.idle .status-icon {
    color: var(--text-dim);
}

.status-indicator.ringing {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-indicator.ringing .status-icon {
    color: var(--ringing);
    animation: ring 1s ease-in-out infinite;
}

.status-indicator.ringing .status-text {
    color: var(--ringing);
}

@keyframes ring {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.status-indicator.connected {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-indicator.connected .status-icon {
    color: var(--connected);
}

.status-indicator.connected .status-text {
    color: var(--connected);
}

.status-indicator.wrapup {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.status-indicator.wrapup .status-icon {
    color: var(--wrapup);
}

.status-indicator.wrapup .status-text {
    color: var(--wrapup);
}

.status-text {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.call-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.call-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.call-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
}

.info-label {
    color: var(--text-dim);
    font-weight: 500;
}

.info-value {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
}

.info-arrow {
    color: var(--text-dim);
}

/* Insights Panel */
.insights-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    flex-shrink: 0;
}

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

.insights-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.insights-header h3 svg {
    color: var(--accent);
}

.insights-badge {
    padding: 0.25rem 0.625rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-dim);
}

.insights-badge.analyzing {
    background: rgba(251, 191, 36, 0.15);
    color: var(--ringing);
    animation: pulse 1.5s ease-in-out infinite;
}

.insights-badge.ready {
    background: var(--success-soft);
    color: var(--success);
}

.insights-badge.cached {
    background: rgba(88, 166, 255, 0.15);
    color: var(--info);
}

.insight-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.insight-section:last-child {
    border-bottom: none;
}

.insight-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.625rem;
}

.insight-label svg {
    opacity: 0.7;
}

.insight-summary {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text);
}

.insights-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.metric-card {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.metric-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.importance-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.metric-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

.sentiment-gauge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-svg {
    width: 120px;
    height: 60px;
}

.sentiment-label {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-transform: capitalize;
}

.compliance-flags {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flag-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-primary);
    border-radius: 6px;
    border-left: 3px solid var(--danger);
    animation: slideIn 0.3s ease-out;
}

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

.flag-item.medium {
    border-left-color: var(--warning);
}

.flag-item.low {
    border-left-color: var(--info);
}

.flag-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger-soft);
    flex-shrink: 0;
}

.flag-item.medium .flag-icon {
    background: rgba(210, 153, 34, 0.15);
}

.flag-item.low .flag-icon {
    background: rgba(88, 166, 255, 0.15);
}

.flag-icon svg {
    width: 12px;
    height: 12px;
    color: var(--danger);
}

.flag-item.medium .flag-icon svg {
    color: var(--warning);
}

.flag-item.low .flag-icon svg {
    color: var(--info);
}

.flag-content {
    flex: 1;
}

.flag-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}

.flag-note {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.125rem;
}

.payment-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--success-soft);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: 8px;
    padding: 1rem;
}

.payment-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
}

.payment-details {
    flex: 1;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Secondary Tabs */
.secondary-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    flex-shrink: 0;
}

.secondary-tabs .tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-tabs .tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.secondary-tabs .tab-btn.active {
    background: var(--accent);
    color: #000;
}

/* Tab Content */
.tab-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tab-pane {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.tab-pane.active {
    display: block;
}

.transcript-viewer {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
}

.transcript-empty,
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    text-align: center;
}

.transcript-empty svg,
.history-empty svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.transcript-bubble {
    max-width: 80%;
    margin-bottom: 1rem;
    animation: bubbleIn 0.3s ease-out;
}

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

.transcript-bubble.agent {
    margin-left: auto;
}

.transcript-bubble.customer {
    margin-right: auto;
}

.bubble-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.375rem;
}

.transcript-bubble.agent .bubble-label {
    text-align: right;
    color: var(--accent);
}

.bubble-content {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.transcript-bubble.agent .bubble-content {
    background: var(--accent-soft);
    border: 1px solid rgba(227, 160, 8, 0.2);
    border-top-right-radius: 4px;
}

.transcript-bubble.customer .bubble-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.history-timeline {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
}

/* Actions Panel (Right Column) */
.actions-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.actions-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.actions-header h3 svg {
    color: var(--success);
}

.actions-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.actions-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    text-align: center;
}

.actions-empty svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.action-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    animation: cardIn 0.3s ease-out;
}

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

.action-card:hover {
    border-color: var(--accent);
    transform: translateX(-4px);
}

.action-card.high {
    border-left: 4px solid var(--danger);
}

.action-card.medium {
    border-left: 4px solid var(--warning);
}

.action-card.low {
    border-left: 4px solid var(--info);
}

.action-priority {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.action-card.high .action-priority {
    background: var(--danger-soft);
    color: #f87171;
}

.action-card.medium .action-priority {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
}

.action-card.low .action-priority {
    background: rgba(88, 166, 255, 0.15);
    color: var(--info);
}

.action-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem;
    margin-top: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* API Console Panel */
.console-panel {
    width: 0;
    background: var(--console-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.console-panel.open {
    width: 380px;
}

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

.console-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.console-header h3 svg {
    color: var(--accent);
}

.console-clear-btn {
    padding: 0.375rem 0.625rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.console-clear-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.console-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.console-empty {
    color: var(--text-dim);
    font-style: italic;
}

.console-entry {
    margin-bottom: 1rem;
    animation: consoleIn 0.3s ease;
}

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

.console-entry-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.console-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.console-badge.event {
    background: rgba(129, 140, 248, 0.2);
    color: #a5b4fc;
}

.console-badge.request {
    background: rgba(251, 191, 36, 0.2);
    color: var(--ringing);
}

.console-badge.response {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.console-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.console-timestamp {
    color: var(--text-dim);
    font-size: 0.625rem;
}

.console-json {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
}

.console-stats {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.console-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.console-stat-label {
    font-size: 0.625rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.console-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}

.console-stat-value.success {
    color: var(--success);
}

/* Workflow Overlay */
.workflow-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.workflow-overlay.active {
    display: flex;
}

.workflow-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.workflow-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.workflow-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #dc6b10);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workflow-icon svg {
    color: white;
}

.workflow-title h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.workflow-title span {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.workflow-steps {
    padding: 1.25rem;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.workflow-step:last-child {
    border-bottom: none;
}

.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-dim);
    border: 2px solid var(--border);
}

.workflow-step.active .step-indicator {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    animation: stepPulse 1s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(227, 160, 8, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(227, 160, 8, 0); }
}

.workflow-step.complete .step-indicator {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.workflow-step.complete .step-indicator::after {
    content: '\2713';
}

.step-name {
    font-size: 0.875rem;
    color: var(--text-dim);
}

.workflow-step.active .step-name,
.workflow-step.complete .step-name {
    color: var(--text);
}

.workflow-status {
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    text-align: center;
}

.workflow-status .status-text {
    font-size: 0.875rem;
    color: var(--accent);
}

.workflow-status.success .status-text {
    color: var(--success);
}

/* ================================================
   CENTER PANEL STATES
   ================================================ */

/* Call Meta (shown after analysis) */
.call-meta {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

.call-meta span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Center State Containers */
.center-state {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.center-state.active {
    display: flex !important;
}

/* STATE 1: During Call - Quick Reference */
.quick-reference {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.qr-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

.qr-items {
    padding: 1rem;
}

.qr-empty {
    color: var(--text-dim);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem 0;
}

.qr-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.qr-item-icon {
    font-size: 1rem;
}

.qr-item-text {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.5;
}

.qr-item-text.warning {
    color: var(--warning);
}

.qr-item-text.danger {
    color: var(--danger);
}

/* Next in Queue */
.next-in-queue {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.niq-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

.niq-preview {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.niq-name {
    color: var(--text);
    font-weight: 600;
}

.niq-separator {
    margin: 0 0.375rem;
    color: var(--text-dim);
}

.niq-balance {
    color: var(--accent);
    font-weight: 600;
}

/* STATE 2: Analyzing */
.state-analyzing {
    align-items: center;
    justify-content: center;
}

.analyzing-container {
    text-align: center;
    padding: 3rem;
}

.analyzing-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    animation: spin 2s linear infinite;
}

.analyzing-spinner svg {
    width: 100%;
    height: 100%;
    color: var(--accent);
}

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

.analyzing-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.analyzing-progress {
    max-width: 300px;
    margin: 0 auto;
}

.progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--info));
    width: 0%;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { width: 30%; opacity: 0.8; }
    50% { width: 70%; opacity: 1; }
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* STATE 3: Analysis Complete */
.state-complete {
    /* flex-direction already set by .center-state */
}

.analysis-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.analysis-tabs .tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.analysis-tabs .tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.analysis-tabs .tab-btn.active {
    background: var(--accent-soft);
    border-color: rgba(227, 160, 8, 0.3);
    color: var(--accent);
}

.analysis-content {
    flex: 1;
    overflow-y: auto;
}

.analysis-content .tab-pane {
    display: none;
}

.analysis-content .tab-pane.active {
    display: block;
}

/* Summary Section */
.summary-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.summary-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.summary-text {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.6;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.metric-header {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.metric-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.metric-card.priority .metric-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin: 0.75rem 0;
    overflow: hidden;
}

.metric-card.priority .metric-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

.metric-bar-fill.high {
    background: linear-gradient(90deg, var(--danger), var(--warning));
}

.metric-bar-fill.medium {
    background: linear-gradient(90deg, var(--warning), var(--accent));
}

.metric-bar-fill.low {
    background: var(--success);
}

.metric-level {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.metric-level.high {
    color: var(--danger);
}

.metric-level.medium {
    color: var(--warning);
}

.metric-level.low {
    color: var(--success);
}

.metric-reasons {
    list-style: none;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.metric-reasons li {
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.metric-reasons li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-dim);
}

.metric-card.sentiment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sentiment-gauge {
    position: relative;
    width: 120px;
    height: 70px;
}

.gauge-svg {
    width: 100%;
    height: auto;
}

.sentiment-label {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

/* Extracted Data */
.extracted-data {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.extracted-header {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.extracted-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.extracted-icon {
    font-size: 1.125rem;
}

.extracted-label {
    font-size: 0.8125rem;
    color: var(--text-dim);
    min-width: 110px;
}

.extracted-value {
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 500;
    flex: 1;
}

.extracted-confidence {
    font-size: 0.75rem;
    color: var(--success);
    background: var(--success-soft);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.extracted-severity {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.extracted-severity.high {
    color: var(--danger);
    background: var(--danger-soft);
}

.extracted-severity.medium {
    color: var(--warning);
    background: rgba(210, 153, 34, 0.15);
}

/* Notes Tab */
.notes-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.notes-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.notes-header span {
    color: var(--accent);
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-btn {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.tag-btn.selected {
    background: var(--accent-soft);
    border-color: rgba(227, 160, 8, 0.3);
    color: var(--accent);
}

.notes-input {
    width: 100%;
    min-height: 100px;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.notes-input:focus {
    outline: none;
    border-color: var(--accent);
}

.notes-input::placeholder {
    color: var(--text-dim);
}

.save-note-btn {
    width: 100%;
}

/* Previous Notes */
.previous-notes {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.prev-notes-header {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.note-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.note-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.note-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.note-agent {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.note-tags {
    display: flex;
    gap: 0.375rem;
}

.note-tag {
    padding: 0.125rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-dim);
}

.note-content {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.6;
}

/* Analysis Complete Status */
.status-indicator.complete {
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.status-indicator.complete .status-icon {
    color: var(--success);
}

.status-indicator.complete .status-icon svg {
    display: none;
}

.status-indicator.complete .status-icon::before {
    content: '✓';
    font-size: 1.25rem;
}

.status-indicator.complete .status-text {
    color: var(--success);
}

/* History Tab - Call History Items */
.history-section,
.transcript-section {
    padding: 0;
}

.history-header,
.transcript-header {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.history-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.history-duration {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
}

.history-summary {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.history-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.history-sentiment {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: capitalize;
}

.history-sentiment.cooperative,
.history-sentiment.positive {
    background: var(--success-soft);
    color: var(--success);
}

.history-sentiment.hostile,
.history-sentiment.negative {
    background: var(--danger-soft);
    color: var(--danger);
}

.history-sentiment.frustrated,
.history-sentiment.neutral {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
}

.history-ptp {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: var(--success-soft);
    color: var(--success);
}

/* Transcript Bubbles in History Tab */
.transcript-bubbles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-timeline .transcript-bubble {
    max-width: 85%;
    animation: bubbleIn 0.3s ease-out;
}

.history-timeline .transcript-bubble.agent {
    margin-left: auto;
}

.history-timeline .transcript-bubble.customer {
    margin-right: auto;
}

.history-timeline .bubble-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.375rem;
}

.history-timeline .transcript-bubble.agent .bubble-label {
    text-align: right;
    color: var(--accent);
}

.history-timeline .bubble-content {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.history-timeline .transcript-bubble.agent .bubble-content {
    background: var(--accent-soft);
    border: 1px solid rgba(227, 160, 8, 0.2);
    border-top-right-radius: 4px;
}

.history-timeline .transcript-bubble.customer .bubble-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

/* Responsive */
@media (max-width: 1600px) {
    .column-left {
        width: 280px;
    }

    .column-right {
        width: 300px;
    }
}

@media (max-width: 1400px) {
    .console-panel.open {
        width: 320px;
    }
}
