/* Common CSS for Voice Agent Application */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-right: 3px solid white;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Top Navigation */
.top-navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: var(--gray-100);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Content Area */
.content-area {
    padding: 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.stat-card-change {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card-change.positive {
    color: var(--success);
}

.stat-card-change.negative {
    color: var(--danger);
}

/* Tables */
.table-container {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.table {
    margin: 0;
}

.table thead th {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-700);
    padding: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

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

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

/* Forms */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid var(--gray-300);
    padding: 0.625rem 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--gray-200);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-navbar {
        padding: 1rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Common Card Styles */
.card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Status Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-block;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-danger {
    background-color: var(--danger);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: white;
}

.badge-info {
    background-color: var(--info);
    color: white;
}

.badge-secondary {
    background-color: var(--gray-500);
    color: white;
}

/* Status Indicators */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
    display: inline-block;
}

.status-indicator.completed {
    background-color: var(--success);
}

.status-indicator.failed {
    background-color: var(--danger);
}

.status-indicator.in-progress {
    background-color: var(--warning);
    animation: pulse 2s infinite;
}

.status-indicator.ringing {
    background-color: var(--info);
    animation: pulse 2s infinite;
}

.status-indicator.call-disconnected {
    background-color: var(--gray-500);
}

.status-indicator.no-answer {
    background-color: var(--gray-500);
}

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

/* Action Buttons */
.action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background: white;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btn:hover {
    background: var(--gray-50);
    color: var(--gray-800);
    text-decoration: none;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.stat-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Call Cards */
.call-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.call-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.call-info {
    flex: 1;
}

.call-phone {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.call-name {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.call-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.call-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.call-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.call-actions {
    display: flex;
    gap: 0.5rem;
}

/* Analysis Cards */
.analysis-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.analysis-info {
    flex: 1;
}

.analysis-phone {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.analysis-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.analysis-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.analysis-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Confidence Bar */
.confidence-bar {
    background-color: var(--gray-200);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.confidence-fill[data-width] {
    width: attr(data-width)%;
}

.confidence-high {
    background-color: var(--success);
}

.confidence-medium {
    background-color: var(--warning);
}

.confidence-low {
    background-color: var(--danger);
}

/* Chart Containers */
.chart-container {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    margin-bottom: 1rem;
    overflow: hidden;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

/* Ensure charts never grow infinitely tall */
.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 300px !important; /* default canvas height */
    max-height: 420px;        /* hard stop to prevent runaway growth */
}

/* Home page hero */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 1rem;
    padding: 3rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.hero-content { position: relative; z-index: 1; }
.hero-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.125rem; opacity: 0.9; margin-bottom: 2rem; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2rem; margin-top: 2rem; }
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 2rem; font-weight: 700; margin-bottom: 0.25rem; }
.hero-stat-label { font-size: 0.875rem; opacity: 0.8; }

/* Activity list */
.activity-item { display: flex; align-items: center; padding: 1rem; border-bottom: 1px solid var(--gray-100); transition: background-color 0.2s ease; }
.activity-item:hover { background-color: var(--gray-50); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; margin-right: 1rem; font-size: 1rem; }
.activity-content { flex: 1; }
.activity-title { font-weight: 500; color: var(--gray-800); margin-bottom: 0.25rem; }
.activity-subtitle { font-size: 0.875rem; color: var(--gray-600); }
.activity-time { font-size: 0.875rem; color: var(--gray-500); }
.activity-icon.success { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.activity-icon.info { background-color: rgba(6, 182, 212, 0.1); color: var(--info); }

/* Quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.quick-action { background: white; border: 1px solid var(--gray-200); border-radius: 0.75rem; padding: 1.5rem; text-align: center; text-decoration: none; color: var(--gray-800); transition: all 0.2s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.quick-action:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); color: var(--primary); }
.quick-action-icon { width: 3rem; height: 3rem; border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.5rem; }
.quick-action-title { font-weight: 600; margin-bottom: 0.5rem; }
.quick-action-desc { font-size: 0.875rem; color: var(--gray-600); }

/* Config page cards (if used on other pages) */
.config-card { background: white; border-radius: 0.75rem; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); border: 1px solid var(--gray-200); margin-bottom: 1rem; }
.config-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border: 1px solid var(--gray-200); border-radius: 0.5rem; margin-bottom: 0.75rem; background: var(--gray-50); transition: all 0.2s ease; }
.config-item:hover { background: var(--gray-100); border-color: var(--gray-300); }
.config-key { font-weight: 600; color: #374151; flex: 1; }
.config-value { color: #6b7280; font-family: monospace; background: white; padding: 0.5rem; border-radius: 0.375rem; border: 1px solid #d1d5db; min-width: 200px; margin-right: 1rem; }
.config-actions { display: flex; gap: 0.5rem; }
.btn-edit { background: #3b82f6; color: white; border: none; padding: 0.375rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem; cursor: pointer; transition: background 0.2s ease; }
.btn-edit:hover { background: #2563eb; }
.btn-save { background: #10b981; color: white; border: none; padding: 0.375rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem; cursor: pointer; transition: background 0.2s ease; }
.btn-save:hover { background: #059669; }
.btn-cancel { background: #6b7280; color: white; border: none; padding: 0.375rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem; cursor: pointer; transition: background 0.2s ease; }
.btn-cancel:hover { background: #4b5563; }
.edit-mode { background: #fef3c7; border-color: #f59e0b; }
.input-edit { width: 100%; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 0.375rem; font-family: monospace; font-size: 0.875rem; }
.config-category { margin-bottom: 2rem; }
.category-title { font-size: 1.25rem; font-weight: 600; color: #374151; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid #e5e7eb; }

@media (max-width: 768px) {
    .hero-section { padding: 2rem; }
    .hero-title { font-size: 2rem; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .quick-actions { grid-template-columns: 1fr; }
}

/* Filters */
.filters-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.status-filter {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 2px solid transparent;
    position: relative;
}

.status-filter:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-filter.active:hover {
    background: var(--primary-dark);
    color: white;
    border-color: var(--primary-dark);
}

.status-filter.active {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    font-weight: 600;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Cache Keys List */
.cache-keys-list {
    max-height: 300px;
    overflow-y: auto;
    background: var(--gray-50);
    border-radius: 0.75rem;
    padding: 1rem;
}

.cache-key-item {
    background: white;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cache-key {
    font-family: 'Courier New', monospace;
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.cache-actions {
    display: flex;
    gap: 0.5rem;
}

/* Configuration Cards */
.config-card {
    transition: transform 0.2s;
    border-left: 4px solid var(--primary);
}

.config-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.config-item {
    margin-bottom: 1rem;
}

.config-key {
    font-family: 'Courier New', monospace;
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-800);
    display: block;
    margin-bottom: 0.5rem;
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.insight-item {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
}

.insight-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.insight-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.insight-description {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Filter Row */
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.filter-input {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.status-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Metrics Dashboard */
.period-selector {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.period-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.period-btn.active { 
    background: var(--primary); 
    color: white; 
    border-color: var(--primary); 
}

.metric-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-label {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Cache Stats */
.stats-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    background: var(--gray-50);
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.stat-key {
    font-weight: 600;
    color: var(--gray-700);
    flex: 1;
}

.stat-value {
    color: var(--gray-600);
    font-family: monospace;
    background: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--gray-300);
    min-width: 120px;
    text-align: center;
    margin-right: 1rem;
}

.stat-actions {
    display: flex;
    gap: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card-large {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.stat-value-large {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label-large {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.3s ease;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-healthy { background: var(--success); }
.status-warning { background: var(--warning); }
.status-error { background: var(--danger); }

.refresh-indicator {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Transcript Analysis Detail */
.detail-card {
    transition: transform 0.2s;
}

.detail-card:hover {
    transform: translateY(-2px);
}

.confidence-score {
    font-weight: bold;
}

.high-confidence { color: var(--success); }
.medium-confidence { color: var(--warning); }
.low-confidence { color: var(--danger); }

.json-content {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* Additional Details Cache Stats */
.metric-card {
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-healthy { background-color: var(--success); }
.status-warning { background-color: var(--warning); }
.status-danger { background-color: var(--danger); }

/* Icon color variants */
.stat-card-icon.primary {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-card-icon.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card-icon.danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card-icon.info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.insight-icon.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.insight-icon.info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.insight-icon.danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Utility classes for common inline styles */
.scrollable-content {
    max-height: 200px;
    overflow-y: auto;
}

.scrollable-large {
    max-height: 400px;
    overflow-y: auto;
}

.performance-chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.hidden {
    display: none !important;
}

.small-text {
    font-size: 0.9em;
}

/* Global Loader */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(1px);
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .call-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .call-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .call-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .analysis-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .analysis-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
}

/* Call List Page Specific Styles */
/* Filter Layout */
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.filter-group .form-control {
    height: 2.5rem;
}

/* Responsive adjustments for call list */
@media (max-width: 768px) {
    .status-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .status-filter {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Pagination improvements */
.pagination-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.pagination .page-link {
    color: var(--primary);
    border-color: var(--gray-300);
    padding: 0.5rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.pagination .page-link:hover {
    color: var(--primary-dark);
    background-color: var(--gray-100);
    border-color: var(--gray-400);
}
