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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

body {
    font-family: "Public Sans", ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: white;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #e5e7eb;
}

.header h1 {
    color: #1f2937;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

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

#userEmail {
    color: #666;
    font-weight: 500;
}

/* Navigation Tabs */
.nav-tabs {
    background: white;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: flex;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
}

.tab-btn {
    background: none;
    border: none;
    padding: 16px 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #3b82f6;
    background: #f9fafb;
}

.tab-btn.active {
    color: #3b82f6;
    background: #f9fafb;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #3b82f6;
}

/* Content Area */
.content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    min-height: 500px;
}

.tab-content {
    display: none;
}

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

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.toolbar h2 {
    color: #2c3e50;
    font-size: 20px;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

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

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

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

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

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

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

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Uptime button link styling */
.uptime-btn a {
    color: black;
}

.uptime-btn a:hover {
    color: black;
}

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    display: block;
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: linear-gradient(to right, white 30%, rgba(255,255,255,0)),
                linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
                radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,.15), rgba(0,0,0,0)),
                radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.15), rgba(0,0,0,0)) 0 100%;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-position: 0 0, 100%, 0 0, 100%;
    background-attachment: local, local, scroll, scroll;
}

/* Data Table */
.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    font-size: 13px;
    white-space: nowrap;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

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

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

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

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 60vh;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-content.modal-large {
    max-width: 900px;
    width: 95%;
}

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

.modal-header h2 {
    color: #2c3e50;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
}

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

/* Forms */
.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Two-column form layout */
.form-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group-full {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .form-grid-2col {
        grid-template-columns: 1fr;
    }

    .form-group-full {
        grid-column: span 1;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
}

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

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s;
}

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

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

.toast.warning {
    background: #f39c12;
}

.toast.info {
    background: #3498db;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

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

.status-badge.draft {
    background: #e2e3e5;
    color: #383d41;
}

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

.status-badge.completed {
    background: #cce5ff;
    color: #004085;
}

.status-badge.archived {
    background: #f8f9fa;
    color: #6c757d;
}

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

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

/* Call Status Colors */
.status-badge.INITIATED,
.status-badge.initiated {
    background: #fff3e1;
    color: #ff6f00;
}

.status-badge.RINGING,
.status-badge.ringing {
    background: #fff8e1;
    color: #f57c00;
}

.status-badge.CONNECTED,
.status-badge.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.ENDED,
.status-badge.ended {
    background: #e1f5fe;
    color: #01579b;
}

.status-badge.COMPLETED,
.status-badge.completed {
    background: #cce5ff;
    color: #004085;
}

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

.status-badge.NO_ANSWER,
.status-badge.no_answer {
    background: #fce4ec;
    color: #880e4f;
}

.status-badge.BUSY,
.status-badge.busy {
    background: #fffde7;
    color: #f57f17;
}

.status-badge.CANCELLED,
.status-badge.cancelled {
    background: #efebe9;
    color: #3e2723;
}

.status-badge.ERROR,
.status-badge.error {
    background: #ffebee;
    color: #c62828;
    font-weight: 600;
}

.status-badge.EXPIRED,
.status-badge.expired {
    background: #fff3e0;
    color: #e65100;
    font-weight: 600;
}

/* Disposition Colors */
.status-badge.SUCCESS,
.status-badge.success {
    background: #c8e6c9;
    color: #1b5e20;
    font-weight: 600;
}

.status-badge.NOT_SUCCESS,
.status-badge.not_success {
    background: #ffcdd2;
    color: #b71c1c;
}

.status-badge.INTERESTED,
.status-badge.interested {
    background: #bbdefb;
    color: #0d47a1;
}

.status-badge.NOT_INTERESTED,
.status-badge.not_interested {
    background: #ffccbc;
    color: #bf360c;
}

.status-badge.CALLBACK,
.status-badge.callback {
    background: #d1c4e9;
    color: #4527a0;
}

.status-badge.VOICEMAIL,
.status-badge.voicemail {
    background: #f8bbd0;
    color: #880e4f;
}

.status-badge.WRONG_NUMBER,
.status-badge.wrong_number {
    background: #d7ccc8;
    color: #3e2723;
}

.status-badge.DNC,
.status-badge.dnc {
    background: #ffab91;
    color: #bf360c;
    font-weight: 600;
}

/* Audio Player Styles */
.audio-player-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

audio {
    width: 100%;
    max-width: 500px;
    height: 45px;
    border-radius: 25px;
    background: linear-gradient(to right, #f5f5f5, #e9ecef);
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

audio::-webkit-media-controls-panel {
    background: linear-gradient(to right, #f5f5f5, #e9ecef);
    border-radius: 25px;
}

audio::-webkit-media-controls-play-button {
    background-color: #4CAF50;
    border-radius: 50%;
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: #333;
    font-weight: 500;
}

audio::-webkit-media-controls-timeline {
    background: #dee2e6;
    border-radius: 10px;
    margin: 0 10px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.audio-controls .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    background: white;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s;
}

.audio-controls .btn-sm:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.audio-controls .btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.audio-controls .btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

/* Call Session Details Styles */
.modal-body {
    padding: 0;
}

.session-info {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.session-info h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item label {
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.info-item span {
    color: #212529;
    font-size: 14px;
}

.session-messages {
    padding: 20px;
}

.session-messages h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
}

.dark-mode .session-messages h3 {
    color: #f3f4f6;
}

.messages-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    background: #f8f9fa;
}

.message-item {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

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

.message-sender {
    font-weight: 600;
    font-size: 14px;
}

.message-sender.user {
    color: #007bff;
}

.message-sender.bot {
    color: #28a745;
}

.message-time {
    color: #6c757d;
    font-size: 12px;
}

.message-content {
    color: #212529;
    font-size: 14px;
    line-height: 1.5;
}

/* Monospace text for IDs and technical values */
.monospace-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.monospace {
    font-size: 12px;
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 5px;
    min-width: 120px;
    display: inline-block;
    text-align: left;
}

.copy-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    color: #6b7280;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

.copy-btn:active {
    background: #d1d5db;
}

.copy-btn.copied {
    color: #374151;
}

/* Summarization content styling */
.summarization-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.summarization-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.summarization-content .json-key {
    color: #0066cc;
    font-weight: 600;
}

.summarization-content .json-value {
    color: #333;
}

/* Recording URL styling */
#sessionRecordingUrl a {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
}

#sessionRecordingUrl a:hover {
    text-decoration: underline;
}

/* Hide certain columns on small screens */
@media (max-width: 1200px) {
    .hide-on-small {
        display: none !important;
    }

    .data-table {
        width: 100%;
        min-width: auto;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .content {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

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

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

    .search-bar input,
    .search-bar select,
    .search-bar button {
        width: 100%;
        margin: 0 !important;
    }

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

    .data-table th,
    .data-table td {
        padding: 8px;
        font-size: 11px;
    }

    .table-responsive {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
        border-left: 0;
        border-right: 0;
    }

    .action-buttons {
        flex-direction: column;
    }

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

    .tab-btn {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* Events Log Styles */
.session-events {
    padding: 20px;
    background: #f8f9fa;
}

.session-events h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
}

.dark-mode .session-events {
    padding: 20px;
    background: #1f2937;
}

.dark-mode .session-events h3 {
    color: #f3f4f6;
    font-size: 18px;
    margin-bottom: 15px;
}

.events-controls {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.events-container {
    max-height: 600px;
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
}

.event-item {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #dee2e6;
    border-radius: 4px;
    transition: background 0.2s;
}

.event-item:hover {
    background: #e9ecef;
}

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

.event-type {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-time {
    font-size: 12px;
    color: #999;
}

.event-payload {
    margin-top: 8px;
}

.event-json {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 8px;
    font-size: 14px;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.4;
}

.json-key {
    color: #0066cc;
    font-weight: 600;
}

.json-value {
    color: #008000;
}

/* Message Items */
.message-item {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.message-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-user {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.message-bot {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.message-tool {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

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

.message-role {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.message-time {
    font-size: 11px;
    color: #666;
}

.message-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-content.tool-content {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* CCU Stats Dashboard */
.subtitle {
    text-align: center;
    color: #6b7280;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
}

.ccu-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

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

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

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.2;
}

.stat-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: #3b82f6;
    color: white;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .ccu-stats-container {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Toggle Button */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dark-mode-toggle {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.dark-mode-toggle:hover {
    background: #e5e7eb;
    color: #374151;
}

.dark-mode-toggle .moon-icon {
    display: none;
}

.dark-mode .dark-mode-toggle .sun-icon {
    display: none;
}

.dark-mode .dark-mode-toggle .moon-icon {
    display: block;
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #111827;
    color: #f3f4f6;
}

.dark-mode body {
    background-color: #111827;
    color: #f3f4f6;
}

.dark-mode .header {
    background: #1f2937;
    border-color: #374151;
}

.dark-mode .header h1 {
    color: #f3f4f6;
}

.dark-mode .subtitle {
    color: #9ca3af;
}

.dark-mode a.btn {
    color: #f3f4f6;
}

.dark-mode a.btn:hover {
    color: #f3f4f6;
}

.dark-mode .stat-card {
    background: #1f2937;
    border-color: #374151;
}

.dark-mode .stat-card .stat-label {
    color: #9ca3af;
}

.dark-mode .stat-card .stat-value {
    color: #f3f4f6;
}

.dark-mode .stat-badge {
    background: #3b82f6;
}

.dark-mode .nav-tabs {
    background: #1f2937;
    border-color: #374151;
}

.dark-mode .tab-btn {
    color: #9ca3af;
}

.dark-mode .tab-btn:hover {
    color: #3b82f6;
    background: #374151;
}

.dark-mode .tab-btn.active {
    color: #3b82f6;
    background: #374151;
}

.dark-mode .content {
    background: #1f2937;
    border-color: #374151;
}

.dark-mode .search-input,
.dark-mode .filter-select {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}

.dark-mode .search-input:focus,
.dark-mode .filter-select:focus {
    border-color: #3b82f6;
    background: #1f2937;
}

.dark-mode .data-table th {
    background: #111827;
    color: #f3f4f6;
    border-color: #374151;
}

.dark-mode .data-table td {
    color: #f3f4f6;
    border-color: #374151;
}

.dark-mode .data-table tbody tr:hover {
    background: #111827;
}

.dark-mode .table-responsive {
    border-color: #374151;
    background: linear-gradient(to right, #1f2937 30%, rgba(31,41,55,0)),
                linear-gradient(to right, rgba(31,41,55,0), #1f2937 70%) 0 100%,
                radial-gradient(farthest-side at 0% 50%, rgba(255,255,255,.1), rgba(255,255,255,0)),
                radial-gradient(farthest-side at 100% 50%, rgba(255,255,255,.1), rgba(255,255,255,0)) 0 100%;
    background-repeat: no-repeat;
    background-color: #1f2937;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-position: 0 0, 100%, 0 0, 100%;
    background-attachment: local, local, scroll, scroll;
}

.dark-mode .table-responsive::-webkit-scrollbar-track {
    background: #111827;
}

.dark-mode .table-responsive::-webkit-scrollbar-thumb {
    background: #374151;
}

.dark-mode .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

.dark-mode .pagination button {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}

.dark-mode .pagination button:hover:not(:disabled) {
    background: #374151;
    border-color: #4b5563;
}

.dark-mode .pagination .page-info {
    color: #9ca3af;
}

.dark-mode .modal {
    background-color: rgba(0,0,0,0.8);
}

.dark-mode .modal-content {
    background: #1f2937;
    color: #f3f4f6;
}

.dark-mode .modal-header h2 {
    color: #f3f4f6;
}

.dark-mode .modal-close {
    color: #9ca3af;
}

.dark-mode .modal-close:hover {
    color: #f3f4f6;
}

.dark-mode .session-info {
    border-color: #374151;
}

.dark-mode .session-info h3 {
    color: #f3f4f6;
}

.dark-mode .info-item label {
    color: #9ca3af;
}

.dark-mode .info-item span {
    color: #f3f4f6;
}

.dark-mode .monospace {
    background: #111827;
    color: #f3f4f6;
    min-width: 120px;
    display: inline-block;
    text-align: left;
}

.dark-mode .copy-btn {
    background: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

.dark-mode .copy-btn:hover {
    background: #4b5563;
    color: #f3f4f6;
}

.dark-mode .copy-btn:active {
    background: #6b7280;
}

.dark-mode .copy-btn.copied {
    color: white;
}

.dark-mode .messages-container {
    background: #111827;
    border-color: #374151;
}

.dark-mode .message-item {
    background: #1f2937;
}

.dark-mode .message-content {
    color: #f3f4f6;
}

.dark-mode .events-container {
    background: #1f2937;
    border-color: #374151;
}

.dark-mode .event-item {
    background: #111827;
    border-left-color: #374151;
}

.dark-mode .event-item:hover {
    background: #0f1419;
}

.dark-mode .message-item {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode .message-user {
    background: #1a2332;
    border-left-color: #2196f3;
}

.dark-mode .message-bot {
    background: #241a2d;
    border-left-color: #9c27b0;
}

.dark-mode .message-tool {
    background: #2d2316;
    border-left-color: #ff9800;
}

.dark-mode .message-role {
    color: #f3f4f6;
}

.dark-mode .message-time {
    color: #9ca3af;
}

.dark-mode .message-content.tool-content {
    background: rgba(255, 255, 255, 0.05);
    color: #f3f4f6;
}

.dark-mode .event-json {
    background: #1f2937;
    border-color: #374151;
}

.dark-mode .summarization-content {
    background: #111827;
    border-color: #374151;
}

.dark-mode .dark-mode-toggle {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark-mode .dark-mode-toggle:hover {
    background: #4b5563;
    color: #f3f4f6;
}

.dark-mode ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}

.dark-mode .form-group label {
    color: #9ca3af;
}

.dark-mode .audio-player-container {
    background: #111827;
    border-color: #374151;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }

    .dark-mode-toggle {
        align-self: flex-end;
    }
}

/* LiveKit Management Styles */
.section-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.health-status {
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    text-align: center;
}

.items-container {
    display: grid;
    gap: 16px;
}

.item-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

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

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.item-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.item-body code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.loading-text {
    text-align: center;
    color: #6b7280;
    padding: 20px;
    font-size: 14px;
}

/* Token Generator Styles */
.token-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.token-result {
    margin-top: 20px;
    padding: 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
}

.token-result h4 {
    color: #166534;
    margin-bottom: 12px;
    font-size: 16px;
}

.token-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.token-info div {
    font-size: 14px;
    color: #166534;
}

.token-text {
    display: block;
    background: white;
    padding: 8px;
    border-radius: 4px;
    word-break: break-all;
    font-size: 12px;
    margin-top: 4px;
    color: #059669;
    font-family: 'Courier New', monospace;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Dark Mode - LiveKit Management */
.dark-mode .section-card {
    background: #1f2937;
    border-color: #374151;
}

.dark-mode .section-header {
    border-color: #374151;
}

.dark-mode .section-header h3 {
    color: #f3f4f6;
}

.dark-mode .health-status {
    background: #111827;
}

.dark-mode .item-card {
    background: #111827;
    border-color: #374151;
}

.dark-mode .item-header {
    border-color: #374151;
}

.dark-mode .item-header h4 {
    color: #f3f4f6;
}

.dark-mode .item-body {
    color: #9ca3af;
}

.dark-mode .item-body code {
    background: #374151;
    color: #f3f4f6;
}

.dark-mode .loading-text {
    color: #9ca3af;
}

.dark-mode .token-result {
    background: #1f2937;
    border-color: #10b981;
}

.dark-mode .token-result h4 {
    color: #10b981;
}

.dark-mode .token-info div {
    color: #9ca3af;
}

.dark-mode .token-text {
    background: #111827;
    color: #10b981;
}

.dark-mode .modal-actions {
    border-color: #374151;
}