/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    padding: 40px 0;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-form {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 40px auto;
}

.login-form h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: #3498db;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header h1 {
    color: #2c3e50;
}

/* User Info */
.user-info {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.user-details {
    flex: 1;
}

.user-info h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.last-updated {
    color: #7f8c8d;
    font-size: 14px;
}

/* Toggle Switch */
.status-toggle {
    display: flex;
    align-items: flex-start;
    margin: 0;
}

.toggle-container {
    position: relative;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-slider {
    width: 80px;
    height: 40px;
    background-color: #e74c3c;
    border-radius: 20px;
    position: relative;
    transition: background-color 0.3s;
    margin: 0 15px;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 32px;
    height: 32px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    background-color: #27ae60;
}

.toggle-input:checked + .toggle-label .toggle-slider::after {
    transform: translateX(40px);
}

.status-text {
    font-size: 18px;
    font-weight: 500;
}

.status-text.unavailable {
    color: #e74c3c;
}

.toggle-input:checked + .toggle-label .status-text.unavailable {
    display: none;
}

.status-text.available {
    color: #27ae60;
    display: none;
}

.toggle-input:checked + .toggle-label .status-text.available {
    display: block;
}

/* Licensed States */
.licensed-states {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.licensed-states h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.section-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header-inline h3 {
    margin: 0;
    color: #2c3e50;
}

.section-header-inline .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.states-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.state-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: #3498db;
    color: white;
    border-radius: 20px;
    font-size: 14px;
}

/* Messages */
.error-message,
.success-message,
.update-message {
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}

.error-message {
    background-color: #fee;
    color: #c0392b;
    border: 1px solid #fcc;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.update-message {
    display: none;
}

.update-message.show {
    display: block;
}

/* Admin Link */
.admin-link {
    text-align: center;
    margin-top: 20px;
}

.admin-link a {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

.admin-link a:hover {
    text-decoration: underline;
}

/* Loading */
.loading {
    color: #7f8c8d;
    font-style: italic;
}

/* Management Dashboard Specific Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

.stat-card h3 {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

/* User Management */
.section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

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

.section h2 {
    color: #2c3e50;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* User Table */
.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table th,
.user-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.user-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.user-table tr:hover {
    background-color: #f8f9fa;
}

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

.availability-indicator.available {
    background-color: #27ae60;
}

.availability-indicator.unavailable {
    background-color: #e74c3c;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
}

.close-btn:hover {
    color: #2c3e50;
}

/* State Selection */
.state-selection {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 20px;
}

.state-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.state-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.state-checkbox label {
    margin-bottom: 0;
    font-weight: normal;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
}

.actions .btn {
    font-size: 14px;
    padding: 8px 16px;
}

/* Pending Leads Section */
.pending-leads-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

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

.section-header h3 {
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lead-count {
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.view-all-link {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

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

.lead-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.3s, transform 0.1s;
    background: white;
}

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

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.lead-initials {
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

.lead-time {
    font-size: 12px;
    color: #666;
}

.lead-card-body {
    margin-bottom: 16px;
}

.lead-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.lead-state {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.lead-age {
    color: #666;
    font-size: 14px;
}

.lead-type {
    color: #4CAF50;
    font-weight: 500;
    font-size: 14px;
}

.lead-details-expanded {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.claim-lead-btn {
    width: 100%;
    margin-top: 10px;
}

/* Loading and No Leads states */
.pending-leads-section .loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.pending-leads-section .no-leads {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.notification-success {
    background: #4CAF50;
}

.notification-error {
    background: #f44336;
}

.notification-info {
    background: #2196F3;
}

/* DID Warning Banner */
.did-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.warning-text {
    flex: 1;
    color: #856404;
    font-weight: 500;
}

.did-warning .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* DID Info Section */
.did-info {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.did-info h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.did-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

.did-label {
    font-weight: 500;
    color: #555;
}

.did-value {
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
    flex: 1;
}

.did-display .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* DID Modal Styles */
.modal form .form-group label {
    font-weight: 500;
    margin-bottom: 8px;
}

.modal form .form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.modal .error-message {
    margin-top: 15px;
}

/* Working Hours */
.working-hours-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.working-hours-summary {
    margin-top: 15px;
}

.schedule-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timezone-info {
    font-size: 14px;
    color: #666;
}

.days-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-summary {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.day-name {
    font-weight: 600;
}

.day-hours {
    color: #666;
}

.no-schedule {
    color: #999;
    font-style: italic;
}

/* Override Countdown */
.override-countdown {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 12px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
}

.countdown-icon {
    font-size: 20px;
}

.countdown-text {
    flex: 1;
    font-size: 14px;
    color: #856404;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Schedule Grid */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.schedule-day {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    background: #f8f9fa;
}

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

.day-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.day-header label {
    font-weight: 600;
    margin: 0;
    cursor: pointer;
}

.day-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-left: 28px;
}

.time-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.time-input label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.time-input input[type="time"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.time-input input[type="time"]:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

/* Modal Wide */
.modal-content.modal-wide {
    max-width: 700px;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

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

.checkbox-label span {
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }

    .info-header {
        flex-direction: column;
        align-items: stretch;
    }

    .status-toggle {
        justify-content: center;
        margin-top: 15px;
    }

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

    .filters {
        flex-direction: column;
        width: 100%;
    }

    .filters select {
        width: 100%;
    }

    .user-table {
        font-size: 14px;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
    }

    /* Pending Leads Responsive */
    .pending-leads-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }

    .notification.show {
        transform: translateY(0);
    }

    /* DID Warning Responsive */
    .did-warning {
        flex-direction: column;
        align-items: flex-start;
    }

    .did-warning .btn {
        width: 100%;
    }

    .did-display {
        flex-direction: column;
        align-items: flex-start;
    }

    .did-display .btn {
        width: 100%;
    }
}

/* ============================================================================
   CALL CENTER DASHBOARD STYLES
   ============================================================================ */

/* Header Info */
.header-info {
    flex: 1;
}

.header-info h1 {
    margin-bottom: 5px;
}

.call-center-name {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

/* Stat Card Variants */
.stat-card.stat-new .number {
    color: #3498db;
}

.stat-card.stat-claimed .number {
    color: #f39c12;
}

.stat-card.stat-completed .number {
    color: #27ae60;
}

/* Conversion Stats */
.conversion-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

.conversion-card h4 {
    color: #7f8c8d;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.conversion-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.conversion-desc {
    color: #95a5a6;
    font-size: 12px;
    margin: 0;
}

/* Time Metrics */
.time-metrics {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.time-card {
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.time-label {
    color: #7f8c8d;
    font-size: 14px;
}

.time-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* Campaign Stats */
.campaign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.campaign-stat-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    border-left: 4px solid #3498db;
}

.campaign-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.campaign-code {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.campaign-numbers {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 13px;
    color: #555;
}

.stat-item strong {
    color: #2c3e50;
}

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

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

.status-badge.status-claimed {
    background: #fff3e0;
    color: #f57c00;
}

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

.status-badge.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

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

/* Call-only row highlight */
.call-only-row {
    background-color: #fff9e6;
}

/* No Lead badge */
.no-lead-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #ffecb3;
    color: #f57c00;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Call status badges */
.call-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.call-status-badge.call-status-answered {
    background: #e8f5e9;
    color: #2e7d32;
}

.call-status-badge.call-status-no_answer {
    background: #ffebee;
    color: #c62828;
}

.call-status-badge.call-status-voicemail {
    background: #e3f2fd;
    color: #1565c0;
}

.call-status-badge.call-status-ringing,
.call-status-badge.call-status-initiated {
    background: #fff3e0;
    color: #ef6c00;
}

.call-status-badge.call-status-failed {
    background: #fce4ec;
    color: #c2185b;
}

/* Recording play button */
.btn-play-recording {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-play-recording:hover {
    background: #2980b9;
}

.btn-play-recording svg {
    margin-left: 2px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#pageInfo {
    color: #7f8c8d;
    font-size: 14px;
}

/* Filters for date inputs */
.filters input[type="date"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* No data message */
.no-data {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 40px;
}

/* Form small helper text */
.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
}

/* Call Center Responsive */
@media (max-width: 768px) {
    .time-metrics {
        flex-direction: column;
    }

    .time-card {
        justify-content: space-between;
    }

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

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

    .pagination {
        flex-direction: column;
        gap: 10px;
    }
}

/* Audio Player Modal */
.audio-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;
}

.audio-modal.active {
    display: flex;
}

.audio-modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    min-width: 320px;
    max-width: 90%;
    text-align: center;
    position: relative;
}

.audio-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

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

.audio-modal h3 {
    margin: 0 0 16px 0;
}

.audio-modal audio {
    width: 100%;
    margin-bottom: 16px;
}

.audio-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Super Admin Styles */

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.tab-btn,
.tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover,
.tab:hover {
    color: #333;
    background: #f5f5f5;
}

.tab-btn.active,
.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
}

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

/* =====================================================
   DATE FILTER BAR (Call Data Tab)
   ===================================================== */

.date-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.date-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

.preset-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.preset-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

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

.custom-date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.custom-date-range span {
    color: #7f8c8d;
}

/* =====================================================
   ACTIONS BAR (Call Data Tab)
   ===================================================== */

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 140px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* =====================================================
   CALLS SUMMARY (Call Data Tab)
   ===================================================== */

.calls-summary {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.calls-summary span {
    color: #7f8c8d;
    font-size: 14px;
}

.calls-summary strong {
    color: #2c3e50;
}

.calls-summary .sync-time {
    margin-left: auto;
    font-size: 12px;
}

/* Responsive adjustments for call data tab */
@media (max-width: 768px) {
    .date-filter-bar {
        padding: 12px;
    }

    .date-presets {
        justify-content: center;
    }

    .preset-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .custom-date-range {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-date-range input[type="date"] {
        width: 100%;
    }

    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

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

    .filter-group select {
        width: 100%;
    }

    .action-buttons {
        justify-content: center;
    }

    .calls-summary {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .calls-summary .sync-time {
        margin-left: 0;
    }
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 4px;
}

.activity-name {
    font-weight: 500;
    min-width: 150px;
}

.activity-agency {
    color: #666;
    min-width: 120px;
}

.activity-time {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

/* Status badges for super admin */
.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background: #ffebee;
    color: #c62828;
}

/* Button variations */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Modal enhancements */
.modal-large {
    max-width: 700px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Code styling */
code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
}

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

.section-header h2 {
    margin: 0;
}

/* Role badges for admin management */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
    background: #e8e8e8;
    color: #333;
}

.role-badge.role-super_admin {
    background: #ff6b6b;
    color: white;
}

.role-badge.role-agency_admin {
    background: #4ecdc4;
    color: white;
}

.btn-remove-role {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.7;
}

.btn-remove-role:hover {
    opacity: 1;
}

.roles-cell {
    max-width: 300px;
}

/* =====================================================
   RETREAVER SECTION STYLES
   ===================================================== */

.retreaver-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-left: 4px solid #9b59b6;
}

.retreaver-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.retreaver-section .section-header h2 {
    margin: 0;
    color: #2c3e50;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sync-time {
    color: #7f8c8d;
    font-size: 13px;
}

/* Retreaver Stats Cards */
.retreaver-stats {
    margin-bottom: 20px;
}

.retreaver-stats .stat-card.stat-answered .number {
    color: #27ae60;
}

.retreaver-stats .stat-card.stat-missed .number {
    color: #e74c3c;
}

.retreaver-stats .stat-card.stat-duration .number {
    color: #9b59b6;
}

/* Retreaver Time Metrics */
.retreaver-time-metrics {
    margin-bottom: 20px;
}

/* Refresh button loading state */
.btn-refreshing {
    opacity: 0.7;
    pointer-events: none;
}

/* Call status badges for Retreaver */
.call-status-badge.call-status-answered,
.call-status-badge.call-status-completed {
    background: #d4edda;
    color: #155724;
}

.call-status-badge.call-status-missed,
.call-status-badge.call-status-no_answer {
    background: #f8d7da;
    color: #721c24;
}

.call-status-badge.call-status-voicemail {
    background: #fff3cd;
    color: #856404;
}

.call-status-badge.call-status-busy,
.call-status-badge.call-status-failed {
    background: #f5c6cb;
    color: #721c24;
}

/* Responsive adjustments for Retreaver section */
@media (max-width: 768px) {
    .retreaver-section .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}