:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #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;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, var(--gray-900), var(--dark));
    color: white;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-light);
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--gray-300);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: var(--primary);
    color: white;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.header p {
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-filter input {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background-color: #e0e7ff; color: var(--primary); }
.stat-icon.success { background-color: #d1fae5; color: var(--success); }
.stat-icon.warning { background-color: #fef3c7; color: var(--warning); }
.stat-icon.danger { background-color: #fee2e2; color: var(--danger); }

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

.stat-trend.positive {
    background-color: #d1fae5;
    color: var(--success);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Performance List */
.performance-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.performance-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.performance-item:hover {
    background-color: var(--gray-100);
}

.agent-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.agent-info p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.performance-stats {
    display: flex;
    gap: 1.5rem;
    margin-left: auto;
}

.performance-stats .stat {
    text-align: center;
}

.performance-stats .value {
    display: block;
    font-weight: 700;
    font-size: 1.125rem;
}

.performance-stats .label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.activity-item:hover {
    background-color: var(--gray-100);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.success { background-color: #d1fae5; color: var(--success); }
.activity-icon.primary { background-color: #e0e7ff; color: var(--primary); }
.activity-icon.warning { background-color: #fef3c7; color: var(--warning); }

.activity-content p {
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Chart */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Remove the old chart placeholder styles */
.chart-placeholder,
.chart-bars,
.chart-bar,
.chart-labels {
    display: none;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

/* Filter Select */
.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background-color: white;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .container {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background-color: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-completed {
    background-color: #d1fae5;
    color: var(--success);
}

.status-pending {
    background-color: #fef3c7;
    color: var(--warning);
}

.status-missed {
    background-color: #fee2e2;
    color: var(--danger);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.agent-card {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.agent-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
}

.agent-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.agent-info p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-online { color: var(--success); }
.status-offline { color: var(--gray-400); }
.status-busy { color: var(--warning); }

.agent-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.agent-stat {
    text-align: center;
}

.agent-stat .value {
    display: block;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--gray-900);
}

.agent-stat .label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.agent-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Filters Row */
.filters-row {
    display: flex;
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.75rem;
}

/* Recordings Grid */
.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.recording-card {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.recording-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.recording-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.recording-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.recording-info p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.recording-duration {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.recording-player {
    margin: 1rem 0;
}

.audio-player {
    width: 100%;
    height: 40px;
    border-radius: 8px;
}

.recording-actions {
    display: flex;
    gap: 0.5rem;
}

/* Reports Specific Styles */
.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.report-tables {
    position: relative;
}

.report-table {
    display: none;
}

.report-table.active {
    display: block;
}

/* Charts */
.chart-container {
    padding: 1rem 0;
}

.chart-bars-horizontal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.chart-bar-h:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.performance-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.performance-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.agent-name {
    width: 120px;
    font-weight: 600;
}

.performance-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--success), var(--success));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.performance-value {
    width: 50px;
    text-align: right;
    font-weight: 600;
}

/* Cost Grid */
.cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.cost-item {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.cost-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.cost-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.cost-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

.cost-trend.positive {
    background: #d1fae5;
    color: var(--success);
}

.cost-trend.negative {
    background: #fee2e2;
    color: var(--danger);
}

.stat-icon.info {
    background-color: #dbeafe;
    color: #3b82f6;
}

.stat-trend.negative {
    background-color: #fee2e2;
    color: var(--danger);
}

/* Ensure the stats grid can accommodate the new card */
.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
/* Add to your existing CSS */

/* Loading states */
.loading-state {
    color: var(--gray-500);
}

.loading-state i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error states */
.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--danger);
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* Form improvements */
.form-text {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Filter improvements */
.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background-color: white;
    font-size: 0.875rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .agents-grid,
    .recordings-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .cost-grid {
        grid-template-columns: 1fr;
    }
    
    .agent-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}