/* Supervisor Console Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.login-box h1 {
    margin-bottom: 10px;
    color: #333;
}

.login-box .subtitle {
    color: #666;
    margin-bottom: 30px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.login-btn {
    display: block;
    padding: 14px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    color: white;
}

.login-btn.google {
    background: #4285f4;
}

.login-btn.google:hover {
    background: #357ae8;
}

.login-btn.microsoft {
    background: #00a4ef;
}

.login-btn.microsoft:hover {
    background: #0093d6;
}

.login-box .info {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: white;
    padding: 0 24px;
    height: 60px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
}

/* Navigation */
.app-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.nav-item {
    padding: 8px 16px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.nav-item.active {
    background: #10b981;
    color: white;
}

.nav-item.active:hover {
    background: #059669;
    color: white;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.user-email {
    font-size: 12px;
    color: #6b7280;
}

.btn-logout {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background: #dc2626;
}

.app-main {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.app-main.full-width {
    max-width: 100%;
    padding: 20px 30px;
}

/* Product Tabs */
.product-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow-x: auto;
}

.product-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #4b5563;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.product-tab:hover {
    background: #e5e7eb;
    color: #111827;
}

.product-tab.active {
    background: white;
    color: #10b981;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

/* Month Navigation */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-month-nav {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-month-nav:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #6b7cff;
}

.btn-month-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.current-month {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    min-width: 150px;
    text-align: center;
}

/* Performer Highlights */
.performer-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.performer-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.performer-card.team-overall {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #f5f7ff 0%, #eef1ff 100%);
}

.performer-card.top-performer {
    border: 2px solid #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e9 100%);
}

.performer-card.least-performer {
    border: 2px solid #ff9800;
    background: linear-gradient(135deg, #fffbf5 0%, #fff3e0 100%);
}

.performer-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #666;
}

.team-overall .performer-label {
    color: #4f46e5;
}

.top-performer .performer-label {
    color: #2e7d32;
}

.least-performer .performer-label {
    color: #e65100;
}

.performer-name {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.team-score-display {
    margin-bottom: 12px;
}

.team-score-value {
    font-size: 42px;
    font-weight: 800;
    color: #4f46e5;
}

.team-score-value.score-high {
    color: #059669;
}

.team-score-value.score-medium {
    color: #d97706;
}

.team-score-value.score-low {
    color: #dc2626;
}

.performer-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.performer-stats .stat-item {
    color: #666;
    font-size: 14px;
}

.performer-stats .stat-item strong {
    color: #333;
}

/* Staff Cards Grid */
.staff-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.staff-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.staff-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.staff-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b7cff 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.staff-info {
    flex: 1;
}

.staff-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.staff-email {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

.rank-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.rank-badge.rank-1 {
    background: #ffd700;
    color: #5d4e00;
}

.rank-badge.rank-2 {
    background: #c0c0c0;
    color: #444;
}

.rank-badge.rank-3 {
    background: #cd7f32;
    color: #fff;
}

.staff-card-stats {
    display: flex;
    gap: 16px;
}

.stat-box {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Team Quality Section */
.team-quality-section {
    margin-top: 0;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header-row h2 {
    margin: 0;
}

.quality-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 140px;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.btn-small {
    padding: 8px 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-small:hover {
    background: #5a6fd6;
}

.team-quality-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.team-quality-table {
    width: 100%;
    border-collapse: collapse;
}

.team-quality-table th,
.team-quality-table td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.team-quality-table th {
    background: #1f2937;
    color: #9ca3af;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-quality-table th:first-child,
.team-quality-table td:first-child {
    text-align: center;
    padding-left: 12px;
    width: 60px;
}

.team-quality-table th:nth-child(2),
.team-quality-table td:nth-child(2) {
    text-align: left;
}

.team-quality-table tbody tr {
    background: white;
}

.team-quality-table tbody tr:hover {
    background: #f9fafb;
}

.team-quality-table tbody tr.team-totals-row {
    background: #f3f4f6;
    font-weight: 600;
}

.team-quality-table tbody tr.team-totals-row:hover {
    background: #e5e7eb;
}

.team-quality-table .rank-cell {
    font-weight: 700;
    color: #6b7280;
}

.team-quality-table tbody tr:nth-child(1) .rank-cell {
    color: #f59e0b;
}

.team-quality-table tbody tr:nth-child(2) .rank-cell {
    color: #9ca3af;
}

.team-quality-table tbody tr:nth-child(3) .rank-cell {
    color: #cd7f32;
}

.team-quality-table .staff-name-cell {
    font-weight: 500;
    color: #111827;
}

/* Staff Stats Section */
.staff-stats-section {
    margin-top: 0;
}

/* Calls List */
.calls-list {
    min-height: 200px;
}

.call-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.call-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.call-from,
.call-to {
    font-weight: 600;
}

.call-duration {
    color: #999;
    font-size: 14px;
}

/* Transcription Feed */
.transcription-feed {
    max-height: 400px;
    overflow-y: auto;
    min-height: 200px;
}

.transcription-entry {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
}

.transcription-entry:last-child {
    border-bottom: none;
}

.transcription-entry .timestamp {
    color: #999;
    font-size: 12px;
    min-width: 80px;
}

.transcription-entry .text {
    flex: 1;
}

/* Agent Grid */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.agent-item {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.agent-item.online {
    border-color: #4caf50;
    background: #f1f8f4;
}

.agent-item.offline {
    border-color: #ccc;
    background: #f9f9f9;
}

.agent-extension {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.agent-status {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

/* Page Header */
.page-header {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input,
.filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filters input[type="text"] {
    min-width: 150px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Calls Section */
.calls-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
}

.table-controls.bottom {
    border-bottom: none;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

.table-controls .calls-stats {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.table-controls .pagination {
    margin-top: 0;
}

.calls-stats {
    display: flex;
    gap: 24px;
}

.stat-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

/* Calls Table */
.calls-table-container {
    overflow-x: auto;
}

.calls-table {
    width: 100%;
    border-collapse: collapse;
}

.calls-table thead {
    background: #f5f5f5;
}

.calls-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.calls-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.calls-table tbody tr:hover {
    background: #f9f9f9;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-inbound {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-outbound {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-internal {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-product {
    background: #e0f2f1;
    color: #00695c;
}

.badge-source-twilio {
    background: #fce4ec;
    color: #c2185b;
}

.badge-source-telnyx {
    background: #e8eaf6;
    color: #3f51b5;
}

.badge-completed,
.badge-answered {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-failed {
    background: #ffebee;
    color: #c62828;
}

.badge-no-answer,
.badge-busy {
    background: #fff3e0;
    color: #e65100;
}

.badge-ringing {
    background: #fff3e0;
    color: #e65100;
}

/* Transcribed and Analyzed status badges */
.badge-transcribed {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-analyzed {
    background: #f3e5f5;
    color: #7b1fa2;
}

.uuid-cell {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.btn-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    padding: 0;
    transition: color 0.2s;
}

.btn-link:hover {
    color: #5568d3;
    text-decoration: none;
}

/* Icon Buttons */
.btn-icon {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f0f0ff;
    color: #5568d3;
}

.btn-icon.btn-listen {
    color: #10b981;
}

.btn-icon.btn-listen:hover {
    background: #ecfdf5;
    color: #059669;
}

.btn-icon.btn-view {
    color: #667eea;
}

.btn-icon.btn-view:hover {
    background: #f0f0ff;
    color: #5568d3;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pagination {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-pagination:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #6b7cff;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-page {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-page:hover {
    background: #f5f5f5;
    border-color: #6b7cff;
}

.btn-page.active {
    background: #6b7cff;
    color: white;
    border-color: #6b7cff;
}

.page-ellipsis {
    padding: 0 8px;
    color: #666;
}

/* Recordings Section */
.recordings-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.recording-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.recording-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.recording-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recording-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.recording-info {
    margin-bottom: 16px;
}

.recording-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.recording-actions {
    display: flex;
    gap: 12px;
}

/* Agents Section */
.agents-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.agent-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.agent-card.online {
    border-color: #4caf50;
    background: #f1f8f4;
}

.agent-card.offline {
    border-color: #ccc;
    background: #f9f9f9;
}

.agent-card.on-call {
    border-color: #ff9800;
    background: #fff3e0;
}

.agent-extension {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.agent-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.agent-card.online .agent-status-badge {
    background: #4caf50;
    color: white;
}

.agent-card.offline .agent-status-badge {
    background: #ccc;
    color: white;
}

.agent-card.on-call .agent-status-badge {
    background: #ff9800;
    color: white;
}

.agent-last-seen {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.agents-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.stat-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-card .stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .app-nav {
        overflow-x: auto;
    }

    .agent-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
    }

    .filters input,
    .filters select {
        flex: 1;
        min-width: 120px;
    }

    .calls-table {
        font-size: 12px;
    }

    .calls-table th,
    .calls-table td {
        padding: 8px;
    }

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

    .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* AI Outbound Caller Styles */
.ai-caller-controls {
    margin-bottom: 24px;
}

.add-number-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.add-number-form input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.add-number-form input[type="tel"] {
    min-width: 250px;
}

.add-number-form input[type="text"] {
    min-width: 180px;
}

.add-number-form button {
    padding: 12px 24px;
    white-space: nowrap;
}

.ai-caller-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.test-numbers-section,
.recent-calls-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.numbers-table-container,
.calls-table-container {
    overflow-x: auto;
    margin-top: 16px;
}

.numbers-table,
.calls-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.numbers-table thead,
.calls-table thead {
    background: #f5f5f5;
}

.numbers-table th,
.calls-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.numbers-table td,
.calls-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.numbers-table tbody tr:hover,
.calls-table tbody tr:hover {
    background: #f9f9f9;
}

.numbers-table .empty-state,
.calls-table .empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Responsive adjustments for AI caller */
@media (max-width: 768px) {
    .add-number-form {
        flex-direction: column;
    }
    
    .add-number-form input {
        width: 100%;
        min-width: 100%;
    }
    
    .numbers-table,
    .calls-table {
        min-width: 600px;
    }
    
    .numbers-table th,
    .calls-table th,
    .numbers-table td,
    .calls-table td {
        padding: 8px;
        font-size: 12px;
    }
}

/* ===================================================================
   AUDIO PLAYER (Spotify-style footer)
   ===================================================================*/
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(180deg, #1e1e1e 0%, #121212 100%);
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 180px;
}

.player-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.player-btn#play-pause-btn {
    width: 40px;
    height: 40px;
    background: white;
    color: black;
}

.player-btn#play-pause-btn:hover {
    transform: scale(1.06);
    background: #f0f0f0;
}

.player-close {
    margin-left: 16px;
    color: #999;
}

.player-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.player-info {
    flex: 0 0 30%;
    padding: 0 16px;
}

.player-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-subtitle {
    font-size: 12px;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}

.player-progress span {
    font-size: 12px;
    color: #b3b3b3;
    min-width: 40px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #4d4d4d;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover::-webkit-slider-thumb {
    opacity: 1;
}

.progress-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #4d4d4d;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    width: 100px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.app-main {
    padding-bottom: 110px; /* Add space for audio player */
}

/* ===================================================================
   MODAL
   ===================================================================*/
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 960px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h2 .badge {
    font-size: 12px;
    vertical-align: middle;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.call-detail-section {
    margin-bottom: 24px;
}

.call-detail-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.call-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.call-detail-item {
    display: flex;
    flex-direction: column;
}

.call-detail-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.call-detail-value {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.transcription-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #667eea;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.transcription-box.empty {
    color: #999;
    font-style: italic;
}

.summary-box {
    background: #fff3cd;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #ffc107;
    line-height: 1.6;
    color: #333;
}

.modal-audio-player {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 16px;
}

.modal-audio-player audio {
    width: 100%;
    border-radius: 4px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
}

/* Analysis Section in Modal */
.analysis-overall {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.analysis-list ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.8;
}

.analysis-list li {
    margin-bottom: 6px;
}

/* ===================================================================
   CALL ANALYSIS PAGE STYLES
   =================================================================== */

/* Date Navigation */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
}

.btn-date-nav {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-date-nav:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.date-picker {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Analysis Summary Stats */
.analysis-summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.summary-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-stat-card .stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.bulk-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Staff Analysis Table Wrapper */
.staff-analysis-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
}

/* Staff Analysis Table Header */
.staff-analysis-table-header {
    background: #1f2937;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.staff-table-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 1fr 1fr 40px;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
}

.staff-table-row.header-row {
    color: #9ca3af;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.staff-col {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-col.col-name {
    text-align: left;
    font-weight: 600;
}

.staff-col.col-calls,
.staff-col.col-analyzed,
.staff-col.col-duration {
    text-align: center;
}

.staff-col.col-expand {
    text-align: right;
}

.score-cell {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    background: #e5e7eb;
    color: #374151;
}

.score-cell.overall {
    background: #1f2937;
    color: white;
    font-size: 13px;
}

.score-cell.score-high {
    background: #dcfce7;
    color: #166534;
}

.score-cell.score-medium {
    background: #fef3c7;
    color: #92400e;
}

.score-cell.score-low {
    background: #fee2e2;
    color: #991b1b;
}

/* Staff Analysis Sections */
.staff-analysis-section {
    background: white;
    border-radius: 0;
    margin-bottom: 0;
    overflow: hidden;
    box-shadow: none;
    border-bottom: 1px solid #e5e7eb;
}

.staff-analysis-section:first-of-type {
    border-radius: 0;
}

.staff-analysis-section:last-of-type {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.staff-analysis-section.accordion .staff-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.staff-analysis-section.accordion .staff-header:hover {
    background: #e5e7eb;
}

.accordion-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #6b7280;
}

.staff-analysis-section.expanded .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    transition: all 0.2s ease;
    width: 100%;
    overflow: visible;
}

/* Grid-based calls container */
.calls-grid-container {
    background: white;
}

.calls-grid-header {
    background: #f9fafb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.calls-grid-row {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    overflow: visible;
}

.calls-grid-row:hover {
    background: #f3f4f6;
}

.calls-grid-row.analyzed {
    background: #f0fdf4;
}

.calls-grid-row.analyzed:hover {
    background: #dcfce7;
}

.calls-grid-row.pending {
    background: #fffbeb;
}

.calls-grid-row.pending:hover {
    background: #fef3c7;
}

.calls-grid-row .row-number {
    display: inline-block;
    min-width: 24px;
    color: #6b7280;
    font-weight: 500;
}

.calls-grid-row .actions-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
}

/* Action Dropdown */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.btn-action-menu {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.btn-action-menu:hover {
    background: #e5e7eb;
    color: #374151;
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    z-index: 1000;
    overflow: hidden;
}

.action-dropdown.open .action-dropdown-menu {
    display: block;
}

.action-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease;
}

.action-dropdown-menu .dropdown-item:hover {
    background: #f3f4f6;
}

.action-dropdown-menu .dropdown-item svg {
    flex-shrink: 0;
    color: #6b7280;
}

.action-dropdown-menu .dropdown-item.reanalyze {
    color: #f59e0b;
}

.action-dropdown-menu .dropdown-item.reanalyze svg {
    color: #f59e0b;
}

.staff-header {
    background: #f9fafb;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
}

.staff-header.staff-table-row {
    padding: 14px 16px;
}

.staff-header .col-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.staff-header .col-calls,
.staff-header .col-analyzed,
.staff-header .col-duration {
    font-size: 14px;
    color: #374151;
}

.staff-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    opacity: 0.9;
}

.staff-stats .stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.staff-stats .avg-score {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
}

.staff-scores-mini {
    display: flex;
    gap: 4px;
}

.score-pill {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Calls Analysis Table */
.calls-table-container {
    overflow-x: auto;
}

.calls-analysis-table {
    width: 100%;
    border-collapse: collapse;
}

.calls-analysis-table.aligned-table {
    table-layout: auto;
    min-width: 100%;
}

.calls-analysis-table.aligned-table th,
.calls-analysis-table.aligned-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column widths to match header grid */
.calls-analysis-table.aligned-table .col-sno { width: 40px; min-width: 40px; }
.calls-analysis-table.aligned-table .col-name { width: auto; min-width: 180px; text-align: left; }
.calls-analysis-table.aligned-table .col-calls { width: 70px; min-width: 70px; }
.calls-analysis-table.aligned-table .col-analyzed { width: 80px; min-width: 80px; }
.calls-analysis-table.aligned-table .col-duration { width: 80px; min-width: 80px; }
.calls-analysis-table.aligned-table .col-score { width: 65px; min-width: 65px; }
.calls-analysis-table.aligned-table .col-overall { width: 70px; min-width: 70px; }
.calls-analysis-table.aligned-table .col-actions { width: 80px; min-width: 80px; }

.calls-analysis-table th,
.calls-analysis-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.calls-analysis-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.calls-analysis-table tbody tr:hover {
    background: #f3f4f6;
}

.calls-analysis-table tbody tr.analyzed {
    background: #f0fdf4;
}

.calls-analysis-table tbody tr.analyzed:hover {
    background: #dcfce7;
}

.calls-analysis-table tbody tr.pending {
    background: #fffbeb;
}

.calls-analysis-table tbody tr.pending:hover {
    background: #fef3c7;
}

/* Score Badges */
.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.score-badge.score-high {
    background: #d1fae5;
    color: #065f46;
}

.score-badge.score-medium {
    background: #fef3c7;
    color: #92400e;
}

.score-badge.score-low {
    background: #fee2e2;
    color: #991b1b;
}

.score-badge.pending {
    background: #f3f4f6;
    color: #6b7280;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.analyzed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.no-transcript {
    background: #f3f4f6;
    color: #6b7280;
}

/* Action buttons */
.actions-cell {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    color: #6b7280;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #111827;
}

.btn-icon.btn-analyze-call {
    color: #10b981;
}

.btn-icon.btn-analyze-call:hover {
    background: #d1fae5;
}

.btn-icon.btn-analyze-call.reanalyze {
    color: #f59e0b;
}

.btn-icon.btn-analyze-call.reanalyze:hover {
    background: #fef3c7;
}

/* Modal Styles for Call Analysis */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content.modal-large {
    max-width: 960px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #111827;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

/* Call Detail Grid */
.call-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.call-info-section h4,
.scores-section h4,
.transcript-section h4,
.analysis-result-section h4 {
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-label {
    color: #6b7280;
    font-size: 13px;
}

.info-value {
    font-weight: 500;
}

/* Scores Grid */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.score-item .score-label {
    font-size: 12px;
    color: #6b7280;
}

.score-item .score-value {
    font-weight: 600;
    font-size: 14px;
}

.score-value.score-high { color: #059669; }
.score-value.score-medium { color: #d97706; }
.score-value.score-low { color: #dc2626; }

.no-scores {
    grid-column: 1 / -1;
    text-align: center;
    padding: 16px;
    color: #6b7280;
    font-style: italic;
}

/* Overall Score Display */
.overall-score-display {
    margin-top: 16px;
}

.overall-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
}

.overall-score.score-high {
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
}

.overall-score.score-medium {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.overall-score.score-low {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.overall-score .score-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.overall-score.score-high .score-number { color: #059669; }
.overall-score.score-medium .score-number { color: #d97706; }
.overall-score.score-low .score-number { color: #dc2626; }

.overall-score .score-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

/* Transcript Box */
.transcript-section {
    margin-top: 20px;
}

.transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px 12px;
    background: #f3f4f6;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.transcript-header:hover {
    background: #e5e7eb;
}

.transcript-header h4 {
    margin: 0;
}

.transcript-toggle-icon {
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.transcript-box {
    background: #f9fafb;
    border-radius: 0 0 8px 8px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0;
    border-top: 1px solid #e5e7eb;
}

.transcript-box pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
}

.transcript-box .no-transcript {
    color: #9ca3af;
    font-style: italic;
}

/* Analysis Result Section */
.analysis-result-section {
    margin-top: 20px;
}

.analysis-details {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
}

.analysis-item {
    margin-bottom: 16px;
}

.analysis-item:last-child {
    margin-bottom: 0;
}

.analysis-item strong {
    display: block;
    color: #374151;
    margin-bottom: 4px;
    font-size: 13px;
}

.analysis-item p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* Progress Modal */
.progress-container {
    margin-bottom: 16px;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-top: 8px;
}

.progress-status {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e5e7eb;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .analysis-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .call-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .scores-grid {
        grid-template-columns: 1fr;
    }
    
    .staff-table-row {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        padding: 10px 12px;
    }
    
    .staff-table-row.header-row {
        display: none;
    }
    
    .staff-col.col-name {
        grid-column: 1 / -1;
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .staff-col.col-score,
    .staff-col.col-overall {
        font-size: 10px;
    }
    
    .staff-col.col-expand {
        position: absolute;
        right: 12px;
        top: 12px;
    }
    
    .staff-header.staff-table-row {
        position: relative;
    }
}

@media (max-width: 1200px) {
    .staff-table-row {
        grid-template-columns: 1.5fr 0.6fr 0.6fr 0.8fr 0.6fr 0.6fr 0.6fr 0.6fr 0.6fr 0.6fr 0.7fr 30px;
        gap: 4px;
        padding: 10px 12px;
    }
    
    .staff-table-row.header-row {
        font-size: 10px;
    }
    
    .score-cell {
        padding: 2px 4px;
        font-size: 11px;
        min-width: 28px;
    }
}

/* ============================================
   AI Usage Page Styles
   ============================================ */

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 4px;
}

.page-subtitle {
    color: #6b7280;
    font-size: 14px;
}

/* Usage Summary Cards */
.usage-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.usage-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #6b7280;
}

.usage-card.total {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
}

.usage-card.transcription {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
}

.usage-card.analysis {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.usage-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.usage-icon {
    font-size: 24px;
}

.usage-title {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.usage-card-body {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.usage-stat {
    display: flex;
    flex-direction: column;
}

.usage-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.usage-value.cost {
    color: #059669;
}

.usage-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* Period Tabs */
.usage-period-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.period-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.period-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.period-tab.active {
    background: #8b5cf6;
    color: white;
}

/* Usage Details Grid */
.usage-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.usage-detail-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.usage-detail-card.full-width {
    grid-column: 1 / -1;
}

.usage-detail-card.projection {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
    border: 1px solid #fcd34d;
}

.usage-detail-card h3 {
    font-size: 16px;
    color: #374151;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.projection-info {
    margin-bottom: 12px;
}

.projection-note {
    font-size: 12px;
    color: #92400e;
    font-style: italic;
}

/* Usage Tables */
.usage-table-container {
    overflow-x: auto;
}

.usage-table {
    width: 100%;
    border-collapse: collapse;
}

.usage-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.usage-table td {
    padding: 12px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.usage-table td.cost {
    color: #059669;
    font-weight: 500;
}

.usage-table td.loading,
.usage-table td.no-data {
    text-align: center;
    color: #9ca3af;
    padding: 24px;
}

.usage-table tr.total-row {
    background: #f9fafb;
}

.usage-table tr.total-row td {
    border-top: 2px solid #e5e7eb;
}

/* Cost Rates Info */
.usage-rates-info {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 24px;
}

.usage-rates-info h4 {
    font-size: 14px;
    color: #374151;
    margin-bottom: 12px;
}

.rates-grid {
    display: flex;
    gap: 32px;
}

.rate-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rate-label {
    font-size: 12px;
    color: #6b7280;
}

.rate-value {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* AI Usage Responsive */
@media (max-width: 1024px) {
    .usage-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .usage-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .usage-period-tabs {
        width: 100%;
        justify-content: space-between;
    }
    
    .period-tab {
        flex: 1;
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .rates-grid {
        flex-direction: column;
        gap: 16px;
    }
    
    .usage-card-body {
        flex-direction: column;
        gap: 12px;
    }
}

/* ===================================================================
   USERS PAGE STYLES
   =================================================================== */

/* Hide Users menu by default until we check admin status */
.nav-item-admin {
    display: none;
}

.users-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.users-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.users-table-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.users-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    background: white;
}

.users-table tr:hover {
    background: #f9fafb;
}

.user-name-cell {
    font-weight: 500;
    color: #111827;
}

.actions-cell {
    white-space: nowrap;
}

.btn-icon {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    margin-right: 4px;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.btn-danger-icon:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-user {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.text-muted {
    color: #9ca3af;
    font-style: italic;
}

.text-warning {
    color: #d97706;
}

/* User Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background-color: #fff;
    color: #374151;
    font-family: inherit;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group .help-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* Standalone form select (used in modals outside form-group) */
.form-select {
    padding: 10px 36px 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    color: #374151;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select:hover {
    border-color: #9ca3af;
}

.checkbox-row {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.products-access-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.products-access-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

#products-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.empty-cell,
.error-cell {
    text-align: center;
    color: #6b7280;
    padding: 40px 20px !important;
}

.error-cell {
    color: #dc2626;
}

/* Delete Modal Styles */
.delete-modal-content {
    text-align: center;
}

.delete-modal-content .warning-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-modal-content .warning-icon svg {
    width: 32px;
    height: 32px;
    color: #dc2626;
}

.delete-modal-content p {
    margin-bottom: 24px;
    color: #374151;
    font-size: 15px;
}

.delete-modal-content #delete-user-name {
    font-weight: 600;
    color: #111827;
}

.delete-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-delete {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #b91c1c;
}


