#resource-monitor-panel .text-muted,
.resource-monitor-results .muted {
    color: #6b7280;
    font-size: 0.9rem;
}

.resource-monitor-results {
    margin-top: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    font-size: 0.95rem;
    color: #0f172a;
    line-height: 1.5;
}

.resource-monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.resource-monitor-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    background: #fff;
}

.resource-monitor-card h4 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: #475569;
}

.resource-monitor-card p {
    margin: 0 0 4px;
    font-weight: 600;
}

.resource-monitor-card small {
    color: #6b7280;
    display: block;
}

/* Organizations Page Fixes */
#organizations-page #orgSearchInput {
    min-width: 250px;
    height: 40px;
    padding: 8px 12px;
}
#organizations-page #orgServerFilter {
    height: 40px;
}

#settings-page .form-group label {
    color: #1f2937 !important;
}

/* =============================================================================
   REPORTS PAGE STYLES - Phase 5: Report Builder UI
   ============================================================================= */

/* Reports Dashboard */
.reports-dashboard {
    padding: 20px;
    direction: rtl;
    text-align: right;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    direction: rtl;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 28px;
    color: #1f2937;
}

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

.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: box-shadow 0.2s;
    direction: rtl;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

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

.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.dashboard-sections .section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    direction: rtl;
    text-align: right;
}

.dashboard-sections .section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #1f2937;
}

/* Quick Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.template-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.template-card:hover {
    border-color: #E8731A;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.template-icon {
    font-size: 36px;
    color: #E8731A;
    margin-bottom: 10px;
}

.template-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.template-desc {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
    min-height: 30px;
}

/* Recent Reports */
.recent-reports {
    display: flex;
    flex-direction: column;
    gap: 10px;
    direction: rtl;
}

.report-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    direction: rtl;
}

.report-info {
    flex: 1;
    text-align: right;
}

.report-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.report-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    direction: rtl;
}

.report-actions {
    display: flex;
    gap: 8px;
}

/* Report Builder */
.report-builder {
    background: white;
    border-radius: 8px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.builder-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.builder-header h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #1f2937;
}

.builder-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.builder-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.step.active .step-number {
    background: #E8731A;
    border-color: #E8731A;
    color: white;
}

.step-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.step.active .step-label {
    color: #E8731A;
    font-weight: 600;
}

.builder-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.step-content h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #1f2937;
}

.step-content > p {
    color: #6b7280;
    margin-bottom: 25px;
}

.builder-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.builder-navigation {
    display: flex;
    gap: 10px;
}

/* Template Selection */
.templates-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-option:hover {
    border-color: #E8731A;
    background: #f8fafc;
}

.template-option.selected {
    border-color: #E8731A;
    background: #FFF8F0;
}

.template-option .template-icon {
    font-size: 32px;
    color: #E8731A;
}

.template-details {
    flex: 1;
}

/* Filter Builder */
.filter-builder {
    max-width: 700px;
}

.date-range-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f8fafc;
}

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

/* Field Selector */
.field-selector {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    min-height: 400px;
}

.available-fields,
.selected-fields {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    background: #f8fafc;
}

.available-fields h4,
.selected-fields h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1f2937;
}

.field-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.field-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.field-item:hover {
    background: #FFF8F0;
    border-color: #E8731A;
}

.field-item.selected {
    background: #FFF8F0;
    border-color: #E8731A;
}

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

.field-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.field-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

/* Format Options */
.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.format-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.format-card:hover {
    border-color: #E8731A;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.format-card.selected {
    border-color: #E8731A;
    background: #FFF8F0;
}

.format-card i {
    font-size: 48px;
    color: #E8731A;
    margin-bottom: 15px;
}

.format-name {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.format-desc {
    font-size: 14px;
    color: #6b7280;
}

/* Delivery Configuration */
.delivery-config {
    max-width: 700px;
}

/* Review Step */
.review-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.review-section {
    margin-bottom: 20px;
}

.review-section:last-child {
    margin-bottom: 0;
}

.review-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
}

.review-item {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.review-item strong {
    color: #475569;
    margin-right: 10px;
}

/* My Reports */
.my-reports {
    padding: 20px;
}

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

.reports-header h2 {
    margin: 0;
    font-size: 28px;
    color: #1f2937;
}

.reports-table {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.empty-state p {
    color: #6b7280;
    font-size: 18px;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    
    .field-selector {
        grid-template-columns: 1fr;
    }
    
    .field-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .builder-steps {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .builder-steps::before {
        display: none;
    }
    
    .usage-charts-grid {
        grid-template-columns: 1fr !important;
    }
    
    .usage-stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =============================================================================
   ANALYTICS & USAGE PAGES STYLES - Phase 6
   ============================================================================= */

/* Usage Analytics Overview */
.usage-overview {
    padding: 20px;
}

.usage-overview h2 {
    margin: 0 0 25px 0;
    font-size: 28px;
    color: #1f2937;
}

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

.usage-stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.usage-stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.usage-stat-card .stat-content {
    flex: 1;
}

.usage-stat-card .stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.usage-stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 5px;
}

.usage-stat-card .stat-change {
    font-size: 12px;
    color: #10b981;
    font-weight: 500;
}

/* Usage Charts Grid */
.usage-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.usage-chart-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

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

.usage-chart-card h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #1f2937;
    font-weight: 600;
}

.usage-chart-card canvas {
    width: 100% !important;
}

/* Usage Tables */
.usage-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.usage-table thead {
    background: #f8fafc;
}

.usage-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
    border-bottom: 2px solid #e2e8f0;
}

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

.usage-table tbody tr:hover {
    background: #f8fafc;
}

.usage-table tbody tr:last-child td {
    border-bottom: none;
}

/* Usage Navigation Tabs */
.usage-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.usage-nav-tabs button {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.usage-nav-tabs button:hover {
    color: #E8731A;
    background: #f8fafc;
}

.usage-nav-tabs button.active {
    color: #E8731A;
    border-bottom-color: #E8731A;
}

/* Transcription Summary Cards */
.transcription-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.summary-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

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

/* Chart Container */
.chart-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.chart-container canvas {
    width: 100% !important;
}

/* Table Containers */
.clients-table-container,
.scenarios-table-container,
.endpoints-table-container,
.transcriptions-table-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}

/* Analytics Page Specific */
.analytics-filters {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.analytics-filters label {
    font-weight: 500;
    color: #475569;
    margin-right: 8px;
}

.analytics-filters select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 150px;
}

.analytics-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.analytics-summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.analytics-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.analytics-summary-card .card-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.analytics-summary-card .card-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.analytics-summary-card .card-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
}

/* Loading Indicator */
#analytics-loading,
#usage-loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

#analytics-loading i,
#usage-loading i {
    font-size: 48px;
    color: #E8731A;
    animation: spin 1s linear infinite;
}

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

/* Comparison Mode */
.comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.comparison-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.comparison-panel h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
}

/* Success Rate Badge Colors */
.badge.badge-success {
    background: #10b981;
    color: white;
}

.badge.badge-warning {
    background: #f59e0b;
    color: white;
}

.badge.badge-danger {
    background: #ef4444;
    color: white;
}

.badge.badge-secondary {
    background: #6b7280;
    color: white;
}

/* Date Badge */
.date-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    background: #e5e7eb;
    color: #374151;
}

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

.date-badge.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Export Button */
.btn-export {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-export:hover {
    background: #059669;
}

.btn-export i {
    margin-right: 8px;
}

/* Responsive adjustments for charts */
@media (max-width: 1024px) {
    .usage-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .analytics-filters select {
        width: 100%;
    }
    
    .usage-nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Bulk Operations Styling */
.scenario-checkbox {
    cursor: pointer;
    accent-color: #E8731A;
}

.scenario-checkbox:hover {
    transform: scale(1.1);
}

.my-scenario-card:has(.scenario-checkbox:checked) {
    border-color: #E8731A !important;
    box-shadow: 0 0 0 2px rgba(232, 115, 26, 0.2);
    background: #f0f4ff !important;
}

#bulkActionsBar {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =====================================================
   Simplified Webhook Provider Builder Styles
   ===================================================== */

/* Modal Overlay - Specific to Simplified Builder */
#simplifiedProviderBuilderModal.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

#simplifiedProviderBuilderModal#simplifiedProviderBuilderModal.modal-overlay .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#simplifiedProviderBuilderModal.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

#simplifiedProviderBuilderModal.modal-overlay .modal-header h2 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#simplifiedProviderBuilderModal.modal-overlay .modal-header .btn-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#simplifiedProviderBuilderModal.modal-overlay .modal-header .btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

#simplifiedProviderBuilderModal.modal-overlay .modal-body {
    padding: 24px;
}

#simplifiedProviderBuilderModal.modal-overlay .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.simplified-builder .form-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.simplified-builder .form-section h3 {
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3b82f6;
    color: #1f2937;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.simplified-builder .form-section h3 i {
    color: #3b82f6;
}

.simplified-builder .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.simplified-builder .form-row .form-group {
    flex: 1;
}

.simplified-builder .form-group {
    margin-bottom: 15px;
}

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

.simplified-builder .form-group label .required {
    color: #ef4444;
}

.simplified-builder .form-group label .tooltip-icon {
    color: #6b7280;
    cursor: help;
    font-size: 13px;
    margin-right: 4px;
}

.simplified-builder .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

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

.simplified-builder .form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.simplified-builder .form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

/* Format Selector */
.format-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.format-option {
    display: flex;
    gap: 15px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.format-option:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.format-option.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.format-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    border-radius: 8px;
    font-size: 24px;
}

.format-option.active .format-icon {
    background: #2563eb;
}

.format-details h4 {
    margin: 0 0 6px;
    font-size: 16px;
    color: #1f2937;
}

.format-details p {
    margin: 0 0 8px;
    font-size: 13px;
    color: #6b7280;
}

.format-details code {
    display: inline-block;
    padding: 4px 8px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 12px;
    color: #475569;
    font-family: 'Courier New', monospace;
}

/* Field Mappings Table */
.field-mappings-table {
    overflow-x: auto;
    margin-top: 15px;
}

.field-mappings-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.field-mappings-table thead {
    background: #f3f4f6;
}

.field-mappings-table th {
    padding: 12px;
    text-align: right;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    border-bottom: 2px solid #e5e7eb;
}

.field-mappings-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

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

.field-mappings-table tbody tr:last-child td {
    border-bottom: none;
}

.field-mappings-table .btn-icon {
    padding: 6px 10px;
    font-size: 14px;
}

/* Alert Styles */
.simplified-builder .alert {
    padding: 14px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.simplified-builder .alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.simplified-builder .alert-info i {
    color: #3b82f6;
}

/* Button Improvements */
.simplified-builder .btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

#settings-page .form-group input[type="text"],
#settings-page .form-group input[type="number"],
#settings-page .form-group input[type="password"],
#settings-page .form-group input[type="email"],
#settings-page .form-group input[type="tel"],
#settings-page .form-group textarea,
#settings-page .form-group select {
    background-color: #ffffff;
    color: #111827 !important;
    border: 1px solid #cbd5e1;
}

#settings-page .form-group select option {
    background-color: #ffffff;
    color: #111827;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

body {
    font-family: 'Heebo', sans-serif;
    background: #f5f7fa;
    color: #333;
    direction: rtl;
    margin: 0;
    padding: 0;
}

/* .app-container - MOVED TO layout-foundation.css */
/* This file should not override the foundation */

/* Navigation styles moved to design-system/components/navigation.css */

/* .main-content - MOVED TO layout-foundation.css */
/* This file should not override the foundation */

.top-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Don't shrink header */
    min-height: 70px; /* Ensure consistent height */
}

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

.server-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.server-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* ============================================
   PAGE CONTENT VISIBILITY - STABLE SYSTEM
   ============================================
   This is the ONLY place that controls page visibility.
   JavaScript should ONLY toggle .active class, never set inline styles.
   ============================================ */

/* Base page-content - hidden by default */
.page-content {
    display: none !important; /* Hidden by default - CRITICAL */
    padding: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 0% !important; /* Grow and shrink, start from 0 */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    min-height: 0 !important; /* Critical for flexbox scrolling */
    align-items: stretch !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    visibility: hidden !important; /* Hidden when not active */
}

/* Active page-content - visible and properly laid out */
.page-content.active {
    display: flex !important; /* Show when active - CRITICAL */
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important; /* Critical for flexbox scrolling */
    align-items: stretch !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    visibility: visible !important; /* Visible when active - CRITICAL */
}

/* Prevent any element from causing horizontal overflow */
.page-content > * {
    max-width: 100%;
}

/* Tables should be scrollable if too wide */
.page-content table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
}

.page-content .data-table {
    overflow-x: auto;
    display: table !important; /* Changed from block to table - CRITICAL FIX */
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

.page-content .data-table thead,
.page-content .data-table tbody {
    display: table-row-group !important;
    width: 100%;
    max-width: 100%;
    table-layout: auto;
}

/* ============================================
   MAIN CONTENT LAYOUT - SYSTEMATIC FIX
   ============================================
   This is the foundation for all SPA pages.
   Follows flexbox best practices from the roadmap.
   ============================================ */

/* .main-content - MOVED TO layout-foundation.css */
/* This file should not override the foundation */
/* Layout foundation handles all width, height, flex, and positioning */

/* Header - fixed size, doesn't grow or shrink */
.main-content > .top-header,
.main-content > header {
    flex: 0 0 auto !important; /* Don't grow, don't shrink, use natural size */
    position: relative !important;
    z-index: 10 !important;
    margin: 0 !important;
    /* Header padding is intentional - keep it */
}

/* Page content - takes all remaining space, starts immediately after header */
.main-content > .page-content {
    flex: 1 1 0% !important; /* Grow and shrink, start from 0 */
    min-height: 0 !important; /* Critical for flexbox scrolling */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-self: stretch !important; /* Ensure it stretches to fill width */
}

/* Active page content - same as above */
.main-content > .page-content.active {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important; /* Allow flex layout for page content */
    flex-direction: column !important;
    align-self: stretch !important; /* Ensure it stretches to fill width */
}

/* ============================================
   PAGE-SPECIFIC FIXES
   ============================================
   These pages need specific layout handling.
   All follow the same flexbox pattern.
   ============================================ */

/* All SPA pages - consistent flex layout when active */
.page-content#servers-page.active,
.page-content#transcriptions-page.active,
.page-content#organizations-page.active,
.page-content#users-page.active,
.page-content#analytics-page.active,
.page-content#clients-page.active,
.page-content#scenarios-page.active,
.page-content#reports-page.active,
.page-content#dashboard-page.active {
    /* Layout - only when active */
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    
    /* Overflow */
    overflow-x: hidden !important;
    overflow-y: auto !important;
    
    /* Sizing */
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    
    /* Spacing */
    margin: 0 !important;
    padding: 0 !important;
    
    /* Positioning */
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    align-self: stretch !important; /* Ensure it stretches to fill width */
    visibility: visible !important; /* Ensure visibility when active */
}

/* Remove inline style hacks - use flexbox instead */
#dashboard-page[style*="height"] {
    height: auto !important;
}

/* CRITICAL: Ensure all pages start at top */
#servers-page,
#organizations-page,
#clients-page,
#users-page,
#analytics-page {
    margin-top: 0 !important;
    padding-top: 0 !important;
    top: 0 !important;
    position: relative !important;
}

/* Force all child elements to respect width constraints */
#servers-page *,
#transcriptions-page *,
#organizations-page *,
#users-page *,
#analytics-page *,
#clients-page *,
#reports-page *,
#scenarios-page * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Direct children must not overflow */
#servers-page > *,
#transcriptions-page > *,
#organizations-page > *,
#users-page > *,
#analytics-page > *,
#clients-page > *,
#scenarios-page > * {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    flex-shrink: 0 !important; /* Don't shrink — let parent scroll instead */
}

/* Tables - make them scrollable if too wide */
#servers-page table,
#transcriptions-page table,
#organizations-page table,
#users-page table,
#analytics-page table,
#clients-page table,
#servers-page .data-table,
#transcriptions-page .data-table,
#organizations-page .data-table,
#users-page .data-table,
#analytics-page .data-table,
#clients-page .data-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    box-sizing: border-box !important;
    display: table !important;
    overflow-x: auto !important;
    border-collapse: collapse !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#servers-page .data-table thead,
#transcriptions-page .data-table thead,
#organizations-page .data-table thead,
#users-page .data-table thead,
#analytics-page .data-table thead,
#clients-page .data-table thead {
    display: table-header-group !important;
}

#servers-page .data-table tbody,
#transcriptions-page .data-table tbody,
#organizations-page .data-table tbody,
#users-page .data-table tbody,
#analytics-page .data-table tbody,
#clients-page .data-table tbody {
    display: table-row-group !important;
}

#servers-page .data-table tr,
#transcriptions-page .data-table tr,
#organizations-page .data-table tr,
#users-page .data-table tr,
#analytics-page .data-table tr,
#clients-page .data-table tr {
    display: table-row !important;
}

#servers-page .data-table th,
#servers-page .data-table td,
#transcriptions-page .data-table th,
#transcriptions-page .data-table td,
#organizations-page .data-table th,
#organizations-page .data-table td,
#users-page .data-table th,
#users-page .data-table td,
#analytics-page .data-table th,
#analytics-page .data-table td,
#clients-page .data-table th,
#clients-page .data-table td {
    display: table-cell !important;
}

/* Panels and forms - critical for layout */
#servers-page .panel,
#transcriptions-page .panel,
#organizations-page .panel,
#users-page .panel,
#analytics-page .panel,
#clients-page .panel,
#scenarios-page .panel {
    max-width: calc(100% - 60px) !important; /* Account for 30px margins on each side */
    overflow-x: hidden !important;
    width: calc(100% - 60px) !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    margin-left: 30px !important;
    margin-right: 30px !important;
}

#transcriptions-page {
    background: #f4f6fb;
    padding-bottom: 40px;
}

#transcriptions-page .panel {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    margin-bottom: 28px;
}

#transcriptions-page .panel .panel-header {
    padding: 20px 28px;
    border-bottom: 1px solid #edf2f7;
}

#transcriptions-page .panel .panel-body {
    padding: 22px 28px;
}

#transcriptions-page .bulk-actions-panel {
    background: #f0f8ff !important;
    border: 1px solid #2196F3 !important;
    min-height: auto !important;
}

#transcriptions-page .bulk-actions-panel .panel-body {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px !important;
}

#transcriptions-page .bulk-actions-panel .panel-body > div {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#transcriptions-page .transcription-options-panel .panel-body {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

#transcriptions-page .transcription-options-grid > div {
    flex: 1 1 320px;
    border-right: 1px solid #e5e7eb;
    padding-right: 20px;
}

#transcriptions-page .transcription-options-grid > div:last-child {
    border-right: none;
    padding-right: 0;
}

#transcriptions-page .transcription-options-grid .section-title {
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
    color: #111827;
}

#transcriptions-page .transcription-options-grid .option-row {
    margin-bottom: 12px;
}

#transcriptions-page .transcription-options-grid .checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #111827;
}

#transcriptions-page .transcription-options-grid .description {
    display: block;
    color: #6b7280;
}

#transcriptions-page .transcription-summary-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

#transcriptions-page .transcription-summary-block h5 {
    margin-bottom: 8px;
    font-weight: 600;
}

#transcriptions-page .transcription-analysis {
    margin-top: 24px;
    border: 1px solid #FDEAD8;
    border-radius: 10px;
    padding: 16px 20px;
    background: #f8faff;
}

#transcriptions-page .transcription-analysis h4 {
    margin-bottom: 12px;
    color: #374151;
}

#transcriptions-page .analysis-section {
    margin-bottom: 16px;
}

#transcriptions-page .analysis-section:last-child {
    margin-bottom: 0;
}

#transcriptions-page .analysis-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#transcriptions-page .analysis-list li {
    margin-bottom: 10px;
    line-height: 1.5;
}

#transcriptions-page .analysis-list li:last-child {
    margin-bottom: 0;
}

#transcriptions-page .analysis-list.metadata-list li {
    display: flex;
    gap: 6px;
    align-items: baseline;
}

#transcriptions-page .analysis-sample {
    margin-top: 4px;
    background: rgba(96, 165, 250, 0.15);
    padding: 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2937;
}

#transcriptions-page .speaker-transcript {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 20px;
    overflow: hidden;
}

#transcriptions-page .speaker-row {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

#transcriptions-page .speaker-row:last-child {
    border-bottom: none;
}

#transcriptions-page .speaker-label {
    font-weight: 700;
    color: #111827;
    min-width: 110px;
}

#transcriptions-page .speaker-text {
    flex: 1;
    color: #111827;
}

#transcriptions-page .speaker-time {
    color: #6b7280;
    display: inline-block;
    margin-top: 4px;
}

#transcriptions-page .recording-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

#transcriptions-page .recording-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #FFF8F0;
    color: #1d4ed8;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

#transcriptions-page .recording-link.compact {
    padding: 4px 10px;
    font-size: 12px;
}

#transcriptions-page .recording-link i {
    font-size: 12px;
}

#transcriptions-page .recording-link:hover {
    background: #dbeafe;
    border-color: #F0C8A0;
    color: #1e3a8a;
}

#transcriptions-page .recording-filename {
    font-size: 12px;
    color: #475569;
}

#transcriptions-page .recording-missing {
    color: #94a3b8;
    font-size: 13px;
}

#transcriptions-page {
    background: linear-gradient(180deg, #f8fafc 0%, #edf2ff 40%, #f8fafc 100%);
    padding: 10px 0 40px;
}

#transcriptions-page .transcriptions-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 20px 40px;
}

#transcriptions-page .page-header {
    padding: 10px 0 0;
    margin-bottom: 10px;
}

#transcriptions-page .page-header h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

#transcriptions-page .page-header .page-subtitle {
    font-size: 15px;
    color: #475569;
    margin: 0;
}

#transcriptions-page .panel {
    background: #fff;
    border-radius: 18px;
    border: none;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
    padding: 0;
}

#transcriptions-page .panel + .panel {
    margin-top: 18px;
}

#transcriptions-page .panel-header {
    border-bottom: 1px solid #FFF8F0;
    padding: 18px 24px;
}

#transcriptions-page .panel-body {
    padding: 24px;
}

#transcriptions-page .job-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

#transcriptions-page .job-filters .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#transcriptions-page .job-filters select,
#transcriptions-page .job-filters input {
    background: #fff;
    color: #0f172a;
    border: 1px solid #F0D4B8;
    border-radius: 10px;
    min-height: 42px;
    padding: 10px 12px;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

#transcriptions-page .job-filters button {
    width: 100%;
    min-height: 42px;
}

#transcriptions-page .job-filters .refresh-group {
    align-self: flex-end;
}

#transcriptions-page .job-recording {
    margin-top: 8px;
}

#transcriptions-page .recording-links.recording-links-compact {
    gap: 8px;
}

#transcriptions-page .recording-links.recording-links-compact span {
    display: none;
}

#transcriptions-page .recording-links.recording-links-compact a {
    padding: 6px 8px;
    border-radius: 999px;
    line-height: 1;
    font-size: 12px;
}

#transcriptions-page .transcription-meta-card {
    border: 1px solid #FDEAD8;
    border-radius: 16px;
    background: #f8fafc;
    padding: 18px 22px;
    margin-bottom: 20px;
}

#transcriptions-page .transcription-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

#transcriptions-page .transcription-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#transcriptions-page .transcription-meta-item .meta-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#transcriptions-page .transcription-meta-item .meta-value {
    font-weight: 600;
    color: #0f172a;
}

#transcriptions-page .transcription-options-panel .form-control.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#transcriptions-page .transcription-filters .form-group label,
#transcriptions-page .panel .panel-header h3,
#transcriptions-page label {
    font-weight: 600;
    color: #0f172a !important;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#transcriptions-page .transcription-filters input,
#transcriptions-page .transcription-filters select,
#transcriptions-page .transcription-filters textarea {
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    min-height: 44px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#transcriptions-page .transcription-filters input:focus,
#transcriptions-page .transcription-filters select:focus,
#transcriptions-page .transcription-filters textarea:focus {
    border-color: #E8731A;
    box-shadow: 0 0 0 3px rgba(232, 115, 26, 0.25);
    outline: none;
}

#transcriptions-page .transcription-filters input::placeholder,
#transcriptions-page .transcription-filters textarea::placeholder {
    color: #6b7280 !important;
    opacity: 0.85;
}

#transcriptions-page .transcription-filters input:-ms-input-placeholder,
#transcriptions-page .transcription-filters textarea:-ms-input-placeholder {
    color: #6b7280 !important;
}

#transcriptions-page .transcription-filters input::-ms-input-placeholder,
#transcriptions-page .transcription-filters textarea::-ms-input-placeholder {
    color: #6b7280 !important;
}

#transcriptions-page .transcription-filters select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
    background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

#transcriptions-page .transcription-filters button[type="submit"] {
    min-height: 44px;
}

#transcriptions-page .transcriptions-tabs-panel {
    background: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

#transcriptions-page .transcriptions-tabs-panel .form-control {
    min-width: 180px;
}

#transcriptions-page .transcriptions-tab-select {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

#transcriptions-page .transcriptions-tabs-panel label {
    margin: 0;
    color: #475569;
}

#transcriptions-page .transcriptions-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

#transcriptions-page .transcriptions-tab {
    border: none;
    background: #f1f5f9;
    color: #374151;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    flex: 0 0 auto;
}

#transcriptions-page table.data-table th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

#transcriptions-page .transcriptions-tab:hover {
    background: #e2e8f0;
}

#transcriptions-page .transcriptions-tab.active {
    background: #E8731A;
    color: #fff;
    box-shadow: 0 6px 20px rgba(232, 115, 26, 0.35);
}

#transcriptions-page .transcription-tab-content {
    display: none !important;
}

#transcriptions-page .transcription-tab-content.active {
    display: block !important;
}

/* Hide all tabs by default, show only the active one */
#transcriptions-page[data-active-tab="calls"] .transcription-tab-content[data-tab="calls"] {
    display: block !important;
}

#transcriptions-page[data-active-tab="calls"] .transcription-tab-content[data-tab="jobs"],
#transcriptions-page[data-active-tab="calls"] .transcription-tab-content[data-tab="upload"] {
    display: none !important;
}

#transcriptions-page[data-active-tab="jobs"] .transcription-tab-content[data-tab="jobs"] {
    display: block !important;
}

#transcriptions-page[data-active-tab="jobs"] .transcription-tab-content[data-tab="calls"],
#transcriptions-page[data-active-tab="jobs"] .transcription-tab-content[data-tab="upload"] {
    display: none !important;
}

#transcriptions-page[data-active-tab="upload"] .transcription-tab-content[data-tab="upload"] {
    display: block !important;
}

#transcriptions-page[data-active-tab="upload"] .transcription-tab-content[data-tab="calls"],
#transcriptions-page[data-active-tab="upload"] .transcription-tab-content[data-tab="jobs"] {
    display: none !important;
}

/* Fallback: Hide all tabs except the one with active class */
#transcriptions-page .transcription-tab-content:not(.active) {
    display: none !important;
}


/* Job Stats Grid Layout */
#transcriptions-page .job-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

#transcriptions-page .job-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-top: 3px solid #6b7280;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

#transcriptions-page .job-stat-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#transcriptions-page .job-stat-card .label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

#transcriptions-page .job-stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}


#transcriptions-page .job-stat-card.queued {
    border-top-color: #38bdf8;
}

#transcriptions-page .job-stat-card.processing {
    border-top-color: #fbbf24;
}

#transcriptions-page .job-stat-card.success {
    border-top-color: #34d399;
}

#transcriptions-page .job-stat-card.failed {
    border-top-color: #f87171;
}

#transcriptions-page .job-filters-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 20px;
}

#transcriptions-page .job-filters-toolbar .form-group {
    min-width: 180px;
    flex: 0 1 200px;
}

#transcriptions-page .job-filters-toolbar .form-group.flex-grow {
    flex: 1 1 280px;
}

#transcriptions-page .job-filters-toolbar .refresh-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#transcriptions-page .job-filters-toolbar .form-group input,
#transcriptions-page .job-filters-toolbar .form-group select {
    width: 100%;
}

#transcriptions-page .job-filters-toolbar .form-group label {
    font-size: 13px;
    margin-bottom: 4px;
    color: #0f172a;
}

@media (max-width: 1600px) {
    #transcriptions-page .job-filters-toolbar .form-group {
        flex: 0 1 45%;
    }
    #transcriptions-page .job-filters-toolbar .form-group.flex-grow {
        flex: 1 1 100%;
    }
}

#transcriptions-page .job-table-panel table {
    width: 100%;
}

#transcriptions-page .job-actions,
#transcriptions-page .call-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#transcriptions-page .job-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

#transcriptions-page .job-refresh-label {
    font-size: 12px;
    color: #6b7280;
}

#transcriptions-page .job-progress {
    margin-top: 8px;
}

#transcriptions-page .job-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #475467;
    margin-bottom: 4px;
}

#transcriptions-page .job-progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

#transcriptions-page .job-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #6366f1);
    border-radius: 999px;
    transition: width 0.25s ease;
}

#transcriptions-page .call-actions .btn {
    min-width: 70px;
}

#transcriptions-page .empty-row {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
}

#transcriptions-page form,
#organizations-page form,
#users-page form,
#analytics-page form,
#transcriptions-page .panel-header,
#organizations-page .panel-header,
#users-page .panel-header,
#analytics-page .panel-header {
    max-width: 100% !important;
    overflow-x: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

/* Panel body should allow scrolling if content is too tall */
#servers-page .panel-body,
#transcriptions-page .panel-body,
#organizations-page .panel-body,
#users-page .panel-body,
#analytics-page .panel-body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: visible !important; /* Allow content to flow naturally */
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

/* Grid layouts - ensure they don't overflow */
#transcriptions-page [style*="grid"],
#organizations-page [style*="grid"] {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Stats row - common in organizations page */
#transcriptions-page .stats-row,
#organizations-page .stats-row {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    flex-wrap: wrap !important;
    margin-left: 30px !important;
    margin-right: 30px !important;
}

/* Stats grid inside panel - matches statistics page pattern */
.panel-body .stats-grid {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    gap: 15px !important;
}

/* Ensure panel-body constrains content properly */
.panel-body {
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: auto !important;
    height: auto !important;
}

/* Ensure stat-cards fit within panel */
.panel-body .stat-card {
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
}

/* Ensure stat-card content doesn't overflow */
.panel-body .stat-card .stat-icon,
.panel-body .stat-card .stat-info {
    flex-shrink: 1 !important;
    min-width: 0 !important;
}

/* CRITICAL: Ensure stats-grid is visible in organizations page */
#organizations-page .panel-body .stats-grid {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

#organizations-page .panel-body .stat-card {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: auto !important;
}

/* Ensure the stats panel is visible */
#organizations-page .panel:first-child .panel-body {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: auto !important;
    padding: 20px 24px !important;
}

/* Ensure the filters panel (second panel) is visible */
#organizations-page .panel:nth-child(2) {
    overflow: visible !important;
}

#organizations-page .panel:nth-child(2) .panel-body {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: auto !important;
    padding: 20px 24px !important;
    overflow: visible !important;
}

/* Form controls */
#transcriptions-page input,
#transcriptions-page select,
#transcriptions-page textarea,
#organizations-page input,
#organizations-page select,
#organizations-page textarea,
#users-page input,
#users-page select,
#users-page textarea,
#analytics-page input,
#analytics-page select,
#analytics-page textarea,
#clients-page input,
#clients-page select,
#clients-page textarea,
#scenarios-page input,
#scenarios-page select,
#scenarios-page textarea {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Stat card styles moved to design-system/components/cards.css */

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.green { background: #d4edda; color: #28a745; }
.stat-icon.blue { background: #cce5ff; color: #007bff; }
.stat-icon.cyan { background: #d1ecf1; color: #17a2b8; }
.stat-icon.teal { background: #d1ecf1; color: #17a2b8; }
.stat-icon.orange { background: #fff3cd; color: #ffc107; }
.stat-icon.purple { background: #FDE8D0; color: #E8731A; }
.stat-icon.red { background: #f8d7da; color: #dc3545; }

/* Utility classes for spacing */
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }

/* Logs page specific styles */
#logs-page .stats-grid {
    padding: 20px;
    margin-bottom: 0;
}

#logs-page .panel {
    margin: 0 20px 20px;
}

.stat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stat-info h3 {
    font-size: 13px;
    color: #666;
    font-weight: 400;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Panel */
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
    margin-left: 30px;
    margin-right: 30px;
    width: calc(100% - 60px); /* Account for left/right margins (30px each) */
    max-width: calc(100% - 60px);
    box-sizing: border-box;
    min-width: 0; /* Allow flexbox to shrink */
}

/* Ensure panels on organizations page don't overflow */
#organizations-page .panel {
    width: calc(100% - 60px) !important;
    max-width: calc(100% - 60px) !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

/* Stats panel specifically - ensure it's visible and content isn't clipped */
#organizations-page .panel:first-child {
    overflow: visible !important;
    min-height: auto !important;
    height: auto !important;
}

#organizations-page .panel:first-child .panel-body {
    overflow: visible !important;
}

/* First panel in page-content should have top margin - but not for organizations page */
/* ============================================
   UNIFIED PAGE HEADER STYLING
   ============================================
   All pages use the same page-header structure
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i {
    color: #E8731A;
}

/* First panel in page-content - consistent spacing */
.page-content > .panel:first-child {
    margin-top: 20px; /* Consistent spacing from header */
}

/* Pages with page-header - first panel should have top margin */
.page-content:has(.page-header) > .panel:first-child {
    margin-top: 20px;
}

/* Pages without page-header - add top spacing on first element */
.page-content:not(:has(.page-header)) > *:first-child {
    margin-top: 20px;
}

/* Fallback for browsers without :has() support */
.page-content > .panel:first-child:not(:has(.page-header)) {
    margin-top: 20px;
}

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

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1B2A4A;
}

.panel-body {
    padding: 20px 24px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Table */
/* Generic data-table styles moved to design-system/components/tables.css */
/* Use .table, .data-table classes from design system */

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

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

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

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

.status-badge.active {
    background: #d1ecf1;
    color: #0c5460;
}

/* Buttons */
/* Button styles moved to design-system/components/buttons.css */

/* Activity List */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-content p {
    font-size: 13px;
    color: #666;
}

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

/* Logs Container */
.logs-container {
    max-height: 600px;
    overflow-y: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    line-height: 1.5;
}

.log-entry.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left-color: #dc3545;
}

.log-entry.warn {
    background: rgba(255, 193, 7, 0.1);
    color: #ff9800;
    border-left-color: #ff9800;
}

.log-entry.info {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
    border-left-color: #2196f3;
}

.log-entry.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border-left-color: #4caf50;
}

.log-entry .log-type {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0 4px;
}

.log-entry .log-server {
    font-weight: 600;
}

.log-entry .log-description {
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
}

/* Forms */
.settings-form {
    max-width: 600px;
}

/* Form styles moved to design-system/components/forms.css */

.filters {
    display: flex;
    gap: 12px;
}

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

/* Stats Panels */
.stats-panels {
    display: grid;
    gap: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Action buttons in tables */
.action-btns {
    display: flex;
    gap: 8px;
}

/* Icon button styles moved to design-system/components/buttons.css */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #1e1e1e;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #444;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: calc(90vh - 100px);
    padding: 30px;
}

/* Scenario Builder Modal specific styles */
#scenarioBuilderModal {
    display: none;
    align-items: center;
    justify-content: center;
}

#scenarioBuilderModal.active,
#scenarioBuilderModal[style*="flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#scenarioBuilderModal .modal-content {
    max-width: 95% !important;
    width: 90vw !important;
    max-width: 1600px !important;
    max-height: 92vh !important;
    height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin: auto !important;
    box-sizing: border-box !important;
}

#scenarioBuilderModal .modal-header {
    flex-shrink: 0 !important;
}

#scenarioBuilderModal .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 20px 30px !important;
}

#scenarioBuilderModal #scenarioBuilderModalContent {
    min-height: 0 !important;
    overflow: visible !important;
}

/* Button-based form controls */
#scenarioBuilderModal .priority-btn:hover,
#scenarioBuilderModal .status-btn:hover,
#scenarioBuilderModal .day-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#scenarioBuilderModal .priority-btn.active,
#scenarioBuilderModal .status-btn.active,
#scenarioBuilderModal .day-btn.active {
    font-weight: 600;
}

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

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: calc(90vh - 150px);
}

/* Scenario Builder Modal body */
#scenarioBuilderModal .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: calc(90vh - 100px);
    padding: 30px;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 22px;
    font-weight: 600;
}

.modal-body {
    padding: 25px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: #fff;
}

/* Generic form-group styles moved to design-system/components/forms.css */
/* Keeping only page-specific overrides below */
.form-group-legacy {
    margin-bottom: 20px;
}

.form-group-legacy label {
    margin-bottom: 8px;
    color: #ffffff !important;
    font-weight: 500;
}

/* Form styles moved to design-system/components/forms.css */

/* Button styles moved to design-system/components/buttons.css */

/* ============= CLIENTS GRID ============= */
#clientsGrid,
.clients-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 12px !important;
    margin-top: 20px;
    align-items: start;
    width: 100% !important;
    box-sizing: border-box;
}

/* Responsive grid for mobile only */
@media (max-width: 768px) {
    #clientsGrid,
    .clients-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* Remove the 769-1200px breakpoint that was interfering */

#clientsGrid .client-card,
.clients-grid .client-card,
.client-card {
    background: white;
    border: none;
    border-top: 3px solid #E8731A;
    border-radius: 10px;
    padding: 12px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s, transform 0.2s;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
    width: 100%;
}

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

#clientsGrid .client-header,
.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #f7fafc;
    flex: 0 0 auto;
    min-height: 0;
    gap: 8px;
}

#clientsGrid .client-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

#clientsGrid .client-header .status-badge,
.client-header .status-badge {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-left: auto;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 12px;
}

#clientsGrid .client-header .status-badge.status-active,
.client-header .status-badge.status-active {
    background: #d4edda;
    color: #155724;
}

#clientsGrid .client-header .status-badge.status-inactive,
.client-header .status-badge.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

#clientsGrid .license-badge,
.license-badge {
    display: inline-block;
    padding: 3px 6px;
    font-size: 9px;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 3px;
    background: #e2e8f0;
    color: #4a5568;
}

#clientsGrid .client-header h4,
.client-header h4 {
    margin: 0;
    font-size: 1em;
    color: #1B2A4A;
}

#clientsGrid .client-name,
.client-name {
    font-size: 14px !important;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 3px;
    line-height: 1.3;
    word-break: break-word;
}

#clientsGrid .client-code,
.client-code {
    font-size: 10px !important;
    color: #718096;
    font-family: monospace;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 2px;
}

#clientsGrid .client-org,
.client-org {
    font-size: 11px !important;
    color: #4a5568;
    margin-top: 3px;
    margin-bottom: 4px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#clientsGrid .client-info,
.client-info {
    display: none;
    margin: 10px 0 !important;
    flex: 1 1 auto;
    min-height: 0;
}

#clientsGrid .info-row,
.info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0 !important;
    font-size: 11px !important;
    color: #4a5568;
    line-height: 1.4;
    word-break: break-word;
}

#clientsGrid .info-row i,
.info-row i {
    width: 14px;
    color: #E8731A;
    font-size: 11px;
}

#clientsGrid .client-stats,
.client-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 10px 0 !important;
    padding: 8px 0 !important;
    border-top: 1px solid #f7fafc;
    border-bottom: 1px solid #f7fafc;
    flex: 0 0 auto;
}

#clientsGrid .stat-item,
.stat-item {
    text-align: center;
}

#clientsGrid .stat-number,
.stat-number {
    font-size: 16px !important;
    font-weight: 700;
    color: #E8731A;
}

#clientsGrid .stat-label,
.stat-label {
    font-size: 9px !important;
    color: #718096;
    margin-top: 2px;
}

.client-details {
    margin: 12px 0;
}

.client-details p {
    margin: 6px 0;
    font-size: 0.9em;
    color: #555;
}

#clientsGrid .client-actions,
.client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto !important;
    padding-top: 10px !important;
    border-top: 1px solid #f7fafc;
    align-items: center;
    justify-content: flex-start;
}

#clientsGrid .client-actions button,
.client-actions button {
    padding: 6px 8px !important;
    font-size: 10px !important;
    white-space: nowrap;
    flex: 0 0 calc(50% - 2px);
    min-width: fit-content;
    display: inline-flex;
    align-items: center;
}

.client-actions button span:not(.fas):not(.fa) {
    display: none;
}
    gap: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#clientsGrid .client-actions button:hover,
.client-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Badge styles moved to design-system/components/badges.css */

/* ============= STATS GRID ============= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Stat card styles moved to design-system/components/cards.css */

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.green {
    background: #d4edda;
    color: #27ae60;
}

.stat-icon.orange {
    background: #fff3cd;
    color: #e67e22;
}

.stat-icon.red {
    background: #f8d7da;
    color: #e74c3c;
}

.stat-details h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #1B2A4A;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #E8731A;
    margin: 5px 0;
}

.stat-label {
    font-size: 0.9em;
    color: #777;
}

/* ============= RESPONSIVE TABLES ============= */
@media (max-width: 768px) {
    .clients-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============= MODALS - LARGE SIZE ============= */
.large-modal {
    max-width: 900px !important;
    width: 90% !important;
}

.details-section {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.details-section h4 {
    margin: 0 0 15px 0;
    color: #1B2A4A;
    font-size: 1.1em;
    border-bottom: 2px solid #E8731A;
    padding-bottom: 8px;
}

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

.info-grid div {
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* ============= ENDPOINTS GRID ============= */
.endpoints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.endpoint-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
}

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

.endpoint-details {
    margin: 10px 0;
    font-size: 0.9em;
    color: #555;
}

.endpoint-details div {
    margin: 5px 0;
}

.endpoint-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

/* ============= FORM GROUPS ============= */
/* Generic form-group styles moved to design-system/components/forms.css */
/* Use .form-group, .form-label, .form-control classes from design system */

/* ============= BUTTON VARIANTS ============= */
/* Button styles moved to design-system/components/buttons.css */

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .large-modal {
        max-width: 95% !important;
        width: 95% !important;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .endpoints-grid {
        grid-template-columns: 1fr;
    }
}

/* Analytics Advanced Filters */
#advancedFilters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#advancedFilters .form-group {
    margin-bottom: 15px;
}

#advancedFilters label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

#advancedFilters select,
#advancedFilters input[type="datetime-local"],
#advancedFilters input[type="number"],
#advancedFilters input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
}

#advancedFilters select option {
    color: #333;
    background: white;
}

#advancedFilters select:focus,
#advancedFilters input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

#advancedFilters select[multiple] {
    height: 100px;
    padding: 5px;
}

#advancedFilters select[multiple] option {
    padding: 5px;
    border-radius: 3px;
    margin: 2px 0;
}

#advancedFilters select[multiple] option:hover {
    background: #e9ecef;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.filter-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Analytics Table */
#callsTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

#callsTable thead {
    background: #f8f9fa;
}

#callsTable th {
    padding: 12px;
    text-align: right;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

#callsTable td {
    padding: 12px;
    border-bottom: 1px solid #f1f3f5;
}

#callsTable tbody tr:hover {
    background: #f8f9fa;
}

#callsTable input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

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

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

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

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #007bff;
}

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

/* Analysis Results Panel */
#analysisResultsPanel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

#analysisResultsPanel h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

/* Rule Builder Modal Styles */
#createRuleModal .modal-content {
    max-width: 600px;
}

.template-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.conditions-builder,
.actions-builder {
    margin-top: 15px;
}

.condition-row,
.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.condition-row button,
.action-row button {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
}

.condition-row button:hover,
.action-row button:hover {
    background: #c82333;
}

.add-btn {
    background: #28a745 !important;
    color: white;
    padding: 8px 16px !important;
    width: auto !important;
    height: auto !important;
}

.add-btn:hover {
    background: #218838 !important;
}

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

/* Stat card styles moved to design-system/components/cards.css */

/* Panel Sections */
.panel-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.panel-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

/* Selected Count */
#selectedCallsCount {
    font-weight: 600;
    color: #007bff;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Call Details Modal */
.modal {
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: #1B2A4A;
    color: #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: #E8731A;
    margin-top: 0;
    border-bottom: 2px solid #142038;
    padding-bottom: 10px;
}

.modal-content h4 {
    color: #e74c3c;
    margin-top: 20px;
    margin-bottom: 10px;
}

.modal-content p {
    color: #ecf0f1;
    line-height: 1.6;
}

.modal-content strong {
    color: #f39c12;
}

.modal-content pre {
    background: #1a252f;
    color: #2ecc71;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    border-left: 4px solid #E8731A;
}

.modal-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.modal-content table th {
    background: #142038;
    color: #ecf0f1;
    padding: 10px;
    text-align: right;
    border: 1px solid #4a5f7f;
}

.modal-content table td {
    background: #1B2A4A;
    color: #bdc3c7;
    padding: 8px;
    border: 1px solid #142038;
}

.modal-content .close {
    color: #ecf0f1;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    float: left;
    line-height: 1;
}

.modal-content .close:hover {
    color: #e74c3c;
}

/* Event Timeline Styles */
.event-item {
    padding: 10px;
    margin: 5px 0;
    background: #142038;
    border-right: 3px solid #E8731A;
    border-radius: 4px;
}

.event-item:hover {
    background: #3d566e;
}

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

.event-type {
    color: #E8731A;
    font-weight: bold;
}

.event-data {
    color: #bdc3c7;
    font-size: 13px;
    margin-top: 5px;
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: #E8731A;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-right: 5px;
    vertical-align: middle;
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: #1B2A4A;
    color: #ecf0f1;
    text-align: right;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    top: -5px;
    left: 125%;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    font-size: 13px;
    line-height: 1.4;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent #1B2A4A transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Form field with tooltip */
.field-with-tooltip {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===========================
   Tooltip System
   =========================== */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
}

.tooltip-icon {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #E8731A, #D06818);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    box-shadow: 0 2px 4px rgba(232, 115, 26, 0.3);
    transition: all 0.3s ease;
}

.tooltip-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(232, 115, 26, 0.5);
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: #1B2A4A;
    color: #ecf0f1;
    text-align: right;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    right: 0;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 13px;
    line-height: 1.5;
    font-weight: normal;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 10px;
    border-width: 8px;
    border-style: solid;
    border-color: #1B2A4A transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Field with tooltip styling */
.field-with-tooltip {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.field-with-tooltip label {
    margin-bottom: 0;
    margin-right: 5px;
}

/* ===========================
   Enhanced Modal Styles
   =========================== */
#createRuleModal .modal-header h3 {
    margin: 0;
    font-size: 22px;
    color: #1B2A4A;
}

.mode-selection {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    border-radius: 8px;
}

.mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-option:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.mode-option input[type="radio"] {
    margin: 0;
}

.mode-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #1B2A4A;
}

.template-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
}

.basic-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.conditions-section,
.actions-section {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.conditions-section {
    background: linear-gradient(to bottom, #e3f2fd, #f5f5f5);
    border: 2px solid #2196f3;
}

.actions-section {
    background: linear-gradient(to bottom, #e8f5e9, #f5f5f5);
    border: 2px solid #4caf50;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #1B2A4A;
}

.conditions-section .section-title {
    color: #1976d2;
}

.actions-section .section-title {
    color: #388e3c;
}

.condition-group,
.action-group {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.form-row select,
.form-row input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
}

.form-row button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-row button.add-btn {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.form-row button.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.form-row button.remove-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.form-row button.remove-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

.enable-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    border-radius: 8px;
    margin: 20px 0;
}

.enable-section label {
    color: white;
    font-weight: 500;
    margin: 0;
}

.enable-section input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#createRuleModal .modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

#createRuleModal .modal-footer button {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#createRuleModal .modal-footer button:first-child {
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
}

#createRuleModal .modal-footer button:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 115, 26, 0.4);
}

#createRuleModal .modal-footer button:last-child {
    background: #95a5a6;
    color: white;
}

#createRuleModal .modal-footer button:last-child:hover {
    background: #7f8c8d;
}

/* Modal Form Controls - Fix Text Visibility */
#createRuleModal input[type="text"],
#createRuleModal textarea,
#createRuleModal select,
#createRuleModal .form-control {
    color: #333 !important;
    background: white !important;
}

#createRuleModal select option,
#createRuleModal select optgroup {
    color: #333 !important;
    background: white !important;
}

#createRuleModal .condition-row select,
#createRuleModal .condition-row input,
#createRuleModal .action-row select,
#createRuleModal .action-row input {
    color: #333 !important;
    background: white !important;
    border: 1px solid #ddd !important;
    padding: 8px !important;
}

/* Enhanced Table Styles */
#callsTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#callsTable thead {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

#callsTable th {
    padding: 16px 12px;
    text-align: right;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

#callsTable tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

#callsTable tbody tr:hover {
    background: #f7fafc;
}

#callsTable tbody tr:last-child {
    border-bottom: none;
}

#callsTable td {
    padding: 14px 12px;
    color: #4a5568;
    font-size: 14px;
    vertical-align: middle;
}

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

.status-badge.ANSWERED,
.status-badge.answered {
    background: #d4edda;
    color: #155724;
}

.status-badge.unanswered,
.status-badge.NO.ANSWER {
    background: #fff3cd;
    color: #856404;
}

.status-badge.BUSY,
.status-badge.busy {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.FAILED,
.status-badge.failed {
    background: #f5f5f5;
    color: #6c757d;
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
}


/* CRITICAL: Force hide non-active pages */
/* Ensure non-active pages are hidden - redundant but explicit */
.page-content:not(.active) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Page Layout Fixes */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 30px 30px 0 30px; /* Top padding to start content after header */
    margin-top: 0;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 25px;
    margin: 0 30px 25px 30px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.filters-section {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 30px;
    flex-wrap: wrap;
}

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

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
}

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

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
    padding: 0 15px;
}

/* Generic data-table styles moved to design-system/components/tables.css */
/* Use .table, .data-table classes from design system */

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

/* Filter buttons */
.filter-btn {
    padding: 10px 20px;
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.filter-btn.active {
    background: #4a5568;
    color: white;
    border-color: #4a5568;
}

.quick-filter-chip {
    padding: 8px 16px;
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.quick-filter-chip:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* Button icon styles moved to design-system/components/buttons.css */

/* Badge styles moved to design-system/components/badges.css */

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
    border-bottom: none;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: white;
}

.modal-close,
.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
}

.modal-body {
    padding: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3748;
}

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

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

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

.required {
    color: #e53e3e;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ============================================================================
   AMI Event Monitor Styles (Phase 1.4)
   ============================================================================ */

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
}

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

.tab-btn:hover {
    background: #f7fafc;
    color: #4a5568;
}

.tab-btn.active {
    color: #4299e1;
    border-bottom-color: #4299e1;
    background: #f7fafc;
}

.ami-tab-content {
    display: none;
}

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

/* Monitor Controls */
.monitor-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

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

.status-indicator.active {
    background: #48bb78;
    box-shadow: 0 0 8px rgba(72, 187, 120, 0.5);
    animation: pulse 2s infinite;
}

.status-indicator.inactive {
    background: #cbd5e0;
}

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

/* Filter Rows */
.filter-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 4px;
}

.filter-dimension-select,
.filter-operator-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
}

.filter-value-input {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
}

/* Event Display */
.monitor-events-container {
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
}

.monitor-events-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.monitor-category-group {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #f7fafc;
    cursor: pointer;
    transition: background 0.2s;
}

.category-header:hover {
    background: #edf2f7;
}

.category-name {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
}

.category-count {
    background: #4299e1;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.category-toggle {
    color: #718096;
    transition: transform 0.2s;
}

.category-events {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.monitor-event-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-right: 4px solid;
    border-radius: 6px;
    padding: 15px;
    transition: box-shadow 0.2s;
}

.monitor-event-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

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

.event-type {
    font-weight: 600;
    color: #2d3748;
}

.event-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.event-field {
    color: #4a5568;
}

.event-field strong {
    color: #2d3748;
    margin-left: 5px;
}

.event-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

/* Flow View */
.monitor-events-flow {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flow-call-group {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    background: white;
}

.flow-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 15px;
}

.flow-events {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flow-event {
    padding: 12px;
    border-right: 4px solid;
    background: #f7fafc;
    border-radius: 4px;
    margin-right: 20px;
}

.flow-event-time {
    font-size: 11px;
    color: #718096;
    margin-bottom: 5px;
}

.flow-event-type {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.flow-event-details {
    font-size: 13px;
    color: #4a5568;
}

/* Table View */
.monitor-events-table-container {
    overflow-x: auto;
}

.monitor-events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.monitor-events-table th {
    background: #f7fafc;
    padding: 12px;
    text-align: right;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

.monitor-events-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.monitor-events-table tr:hover {
    background: #f7fafc;
}

.event-type-badge {
    background: #4299e1;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.category-badge {
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* JSON Viewer */
.json-viewer {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

/* Organization Discovery Wizard Styles */
/* Wizard Progress Steps */
.wizard-steps { 
    display: flex; 
    justify-content: space-between; 
    margin: 30px 20px; 
    padding: 0 40px; 
    position: relative;
}
.wizard-steps .step { 
    flex: 1; 
    text-align: center; 
    position: relative; 
    z-index: 1;
}
.wizard-steps .step::after { 
    content: ''; 
    position: absolute; 
    top: 25px; 
    right: 50%; 
    width: 100%; 
    height: 3px; 
    background: linear-gradient(to left, #e2e8f0, #cbd5e0); 
    z-index: 0; 
}
.wizard-steps .step:last-child::after { 
    display: none; 
}
.wizard-steps .step.active::after {
    background: linear-gradient(to left, #4299e1, #63b3ed);
}
.wizard-steps .step.completed::after {
    background: linear-gradient(to left, #48bb78, #68d391);
}
.wizard-steps .step.completed .step-number { 
    background: linear-gradient(135deg, #48bb78, #38a169); 
    color: white; 
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}
.wizard-steps .step.active .step-number { 
    background: linear-gradient(135deg, #4299e1, #3182ce); 
    color: white; 
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
    transform: scale(1.1);
}
.wizard-steps .step .step-number { 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    background: #e2e8f0; 
    color: #a0aec0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 auto 12px; 
    font-weight: bold; 
    font-size: 18px;
    position: relative; 
    z-index: 2;
    transition: all 0.3s ease;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.wizard-steps .step .step-label { 
    font-size: 14px; 
    color: #a0aec0; 
    font-weight: 500;
    transition: all 0.3s ease;
}
.wizard-steps .step.active .step-label { 
    color: #2c5282; 
    font-weight: 700; 
}
.wizard-steps .step.completed .step-label { 
    color: #2f855a; 
    font-weight: 600; 
}
.wizard-content { 
    padding: 24px 32px; 
    min-height: 450px; 
}

/* Organization Cards */
.org-card { 
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 12px;
}
.org-card:hover { 
    background: #f7fafc !important; 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.org-card.selected { 
    border-color: #4299e1 !important; 
    background: #ebf8ff !important; 
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.2);
}

/* Wizard Content Improvements */
.wizard-step h3 {
    color: #2d3748;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-step h3 i {
    color: #4299e1;
    font-size: 28px;
}

.wizard-step p {
    font-size: 15px;
    line-height: 1.6;
    color: #4a5568;
}

/* Organization Search and Filter Bar */
.wizard-step .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.wizard-step .btn-outline-secondary {
    background: white;
    border-color: #cbd5e0;
    color: #4a5568;
}

.wizard-step .btn-outline-secondary:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

.wizard-step .btn-outline-secondary:active {
    transform: scale(0.98);
}

.wizard-step input[type="text"]::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* Organization List Styling */
.organizations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

/* Extensions Table Enhancement */
.extensions-list .data-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 16px;
}

.extensions-list .data-table thead {
    background: linear-gradient(135deg, #4299e1, #3182ce);
}

.extensions-list .data-table thead th {
    color: white;
    font-weight: 600;
    padding: 14px;
}

.extensions-list .data-table tbody tr:hover {
    background: #f7fafc;
}

/* Client Preview Box */
.client-preview {
    border: 2px solid #4299e1;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.15);
    border-radius: 8px;
}

.client-preview h4 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 600;
}

/* Form Controls in Wizard */
.wizard-step .form-control {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
    font-size: 15px;
    padding: 10px 14px;
}

.wizard-step .form-control:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    outline: none;
}

/* Wizard Action Buttons */
.wizard-actions {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    padding: 20px 32px;
}

.wizard-actions .btn {
    min-width: 120px;
    font-weight: 600;
    padding: 10px 24px;
}

/* Alert Boxes in Wizard */
.wizard-step .alert {
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
}

.wizard-step .alert i {
    font-size: 20px;
}

.wizard-step .alert-info {
    background: #ebf8ff;
    color: #2c5282;
}

.wizard-step .alert-warning {
    background: #fefcbf;
    color: #744210;
}

/* Modal Enhancements */
#orgDiscoveryWizardModal .modal-content {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: none;
}

#orgDiscoveryWizardModal .modal-header {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 24px 32px;
    border-bottom: none;
}

#orgDiscoveryWizardModal .modal-header h2 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

#orgDiscoveryWizardModal .modal-header .close-btn {
    color: white;
    opacity: 0.9;
    transition: all 0.2s ease;
}

#orgDiscoveryWizardModal .modal-header .close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Organization selection checkbox styling */
.org-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4299e1;
}

/* Stats badges in org cards */
.org-card .badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.badge.bg-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

/* Wizard Modal Size */
#orgDiscoveryWizardModal .modal-dialog {
    max-width: 900px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wizard-steps {
        padding: 0 10px;
        margin: 20px 10px;
    }
    
    .wizard-steps .step .step-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .wizard-steps .step .step-label {
        font-size: 12px;
    }
    
    .wizard-content {
        padding: 16px;
    }
    
    .organizations-grid {
        grid-template-columns: 1fr;
    }
    
    #orgDiscoveryWizardModal .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }
}

/* Smooth transitions for all interactive elements */
.wizard-step .form-control,
.wizard-step .btn,
.org-card,
.wizard-steps .step {
    transition: all 0.2s ease;
}

/* Focus states */
.wizard-step input:focus,
.wizard-step select:focus,
.wizard-step textarea:focus {
    transform: translateY(-1px);
}

/* Loading states */
.wizard-step.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success animations */
@keyframes checkmark {
    0% { transform: scale(0) rotate(45deg); }
    50% { transform: scale(1.2) rotate(45deg); }
    100% { transform: scale(1) rotate(45deg); }
}

.wizard-steps .step.completed .step-number i {
    animation: checkmark 0.4s ease;
}

/* Settings Page Styles */
.settings-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 120px);
}

.settings-sidebar {
    width: 250px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    flex-shrink: 0;
}

.settings-tab {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    text-align: right;
    transition: all 0.3s;
}

.settings-tab:hover {
    background: #e9ecef;
}

.settings-tab.active {
    background: #E8731A;
    color: white;
    border-color: #E8731A;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

#transcription-settings .token-status {
    background: #FFF8F0;
    border: 1px solid #F0C8A0;
    color: #312e81;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

#transcription-settings .token-status.error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

#transcription-settings .token-status.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #064e3b;
}

#transcription-settings .token-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

#transcription-settings .token-help {
    margin: 0;
    padding-left: 20px;
    color: #475569;
}

#transcription-settings .token-help li {
    margin-bottom: 6px;
}

/* Scenarios Page Styles */
#scenarios-page .tabs {
    display: flex !important;
    background: white;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 0;
}

#scenarios-page .tab {
    flex: 1;
    padding: 18px 20px;
    text-align: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    background: white;
}

#scenarios-page .tab:hover {
    background: #f8f9fa;
    color: #E8731A;
}

#scenarios-page .tab.active {
    background: white;
    color: #E8731A;
    border-bottom-color: #E8731A;
}

#scenarios-page .tab i {
    margin-left: 8px;
    font-size: 18px;
}

#scenarios-page .content {
    padding: 20px;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-y: visible !important;
    overflow-x: hidden !important;
    max-height: none !important;
    min-height: auto !important;
}

#scenarios-page .tab-content {
    display: none !important;
}

#scenarios-page .tab-content.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Template Categories */
#scenarios-page .template-category {
    margin-bottom: 40px;
}

#scenarios-page .template-category.collapsed .template-grid {
    display: none;
}

#scenarios-page .template-category.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

#scenarios-page .category-header {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #E8731A;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

#scenarios-page .category-header:hover {
    color: #D06818;
}

#scenarios-page .toggle-icon {
    transition: transform 0.3s;
    font-size: 14px;
}

#scenarios-page .template-count {
    color: #666;
    font-size: 16px;
    font-weight: normal;
}

/* Scenarios Page - Ensure proper scrolling */
#scenarios-page {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
    max-height: none !important;
}

#scenarios-page .panel {
    overflow-y: visible !important;
    overflow-x: hidden !important;
    max-height: none !important;
}

#scenarios-page .panel-body {
    overflow-y: visible !important;
    overflow-x: hidden !important;
    max-height: none !important;
    height: auto !important;
}

/* Template Categories - EXACT from backup */
#scenarios-page .template-category {
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

#scenarios-page .template-category.collapsed .template-grid {
    display: none;
}

#scenarios-page .template-category.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

#scenarios-page .category-header {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #E8731A;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

#scenarios-page .category-header:hover {
    color: #E8731A;
}

#scenarios-page .toggle-icon {
    transition: transform 0.3s ease;
    font-size: 14px;
}

#scenarios-page .template-count {
    color: #999;
    font-size: 16px;
    font-weight: 400;
    margin-right: auto;
}

/* Template Grid - EXACT from backup */
#scenarios-page .template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Template Cards - EXACT Original Style from backup scenarios.html */
#scenarios-page .template-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

#scenarios-page .template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 115, 26, 0.3);
    border-color: #E8731A;
}

#scenarios-page .template-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E8731A 0%, #D06818 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0 auto;
    color: white;
    font-size: 28px;
    flex-shrink: 0;
}

#scenarios-page .template-card h4 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

#scenarios-page .template-card p,
#scenarios-page .template-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Template Header - Icon and Badge */
#scenarios-page .template-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

#scenarios-page .template-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-top: 15px;
}

#scenarios-page .template-badge.priority-high {
    background: #e74c3c;
    color: white;
}

#scenarios-page .template-badge.priority-medium {
    background: #95a5a6;
    color: white;
}

#scenarios-page .template-badge.priority-low {
    background: #95a5a6;
    color: white;
}

/* Template Footer - Stats and Actions */
#scenarios-page .template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    margin-top: 15px;
}

#scenarios-page .template-stats {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 13px;
}

#scenarios-page .template-stats i {
    color: #E8731A;
}

#scenarios-page .template-actions {
    display: flex;
    gap: 8px;
}

/* Hide use-case if not needed */
#scenarios-page .template-use-case {
    display: none;
}

/* Buttons - match image exactly */
#scenarios-page .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#scenarios-page .btn-primary {
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
}

#scenarios-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 115, 26, 0.4);
}

#scenarios-page .btn-secondary {
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
}

#scenarios-page .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 115, 26, 0.4);
}

#scenarios-page .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Scenario Cards */
#scenarios-page .scenario-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

#scenarios-page .scenario-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #E8731A;
}

#scenarios-page .scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#scenarios-page .scenario-header h3 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

#scenarios-page .scenario-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

#scenarios-page .scenario-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #999;
    font-size: 14px;
}

#scenarios-page .scenario-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

#scenarios-page .scenario-actions {
    display: flex;
    gap: 10px;
}

/* My Scenarios Cards */
#scenarios-page .client-scenario-group {
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#scenarios-page .my-scenario-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    position: relative;
    transition: all 0.3s;
}

#scenarios-page .my-scenario-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #E8731A;
}

/* Badges */
#scenarios-page .badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

#scenarios-page .badge-success {
    background: #28a745;
    color: white;
}

#scenarios-page .badge-secondary {
    background: #6c757d;
    color: white;
}

/* Empty States */
#scenarios-page .no-scenarios {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    #scenarios-page .template-grid {
        grid-template-columns: 1fr;
    }
    
    #scenarios-page .scenario-meta {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===========================
   Scenario Builder - Enhanced Form Styles
   =========================== */

/* Builder Tabs */
.builder-tabs {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    border-bottom: 2px solid #dee2e6;
}

.builder-tab {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    cursor: pointer;
    background: #f8f9fa;
    color: #6c757d;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.builder-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.builder-tab.active {
    background: white;
    color: #007bff;
    border-bottom-color: #007bff;
}

.builder-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Groups - Enhanced Spacing */
.builder-tab-content .form-group {
    margin-bottom: 16px;
}

.builder-tab-content .form-group:last-child {
    margin-bottom: 0;
}

/* Field Mapping Section - Improved Layout */
.field-mapping-container,
.custom-params-container {
    background: #f8f9fa;
    border: 1px solid #e0e7ed;
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
}

.field-mapping-container h5,
.custom-params-container h5 {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-mapping-container h5 i,
.custom-params-container h5 i {
    color: #007bff;
    font-size: 14px;
}

.webhook-action-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.webhook-section {
    background: #f8f9fa;
    border: 1px solid #e0e7ed;
    border-radius: 8px;
    padding: 14px;
}

.webhook-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.webhook-section h4 i {
    color: #007bff;
}

.field-mapping-list,
.custom-params-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: visible;
    padding: 6px;
    position: relative;
}

.field-mapping-list {
    overflow: visible;
}

.field-mapping-row,
.custom-param-row {
    display: grid;
    grid-template-columns: 1fr 30px 1fr 36px;
    gap: 8px;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    box-sizing: border-box;
    max-width: 100%;
    overflow: visible;
}

.field-mapping-row:hover,
.custom-param-row:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

/* Searchable Field Dropdown */
.field-mapping-row .field-search-input {
    cursor: pointer;
}

.field-mapping-row .field-search-input:focus {
    outline: none;
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
}

.field-mapping-row .source-field-select {
    padding: 0;
    border: 1px solid #007bff;
    overflow-y: auto;
}

.field-mapping-row .source-field-select option {
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.field-mapping-row .source-field-select option:hover {
    background: #e7f3ff;
}

.field-mapping-row .source-field-select option[value=""] {
    font-weight: 600;
    background: #f8f9fa;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.field-mapping-row .source-field-select option[style*="display: none"] {
    display: none !important;
}

.field-mapping-row .target-param-name,
.custom-param-row .param-key,
.custom-param-row .param-value {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

.field-mapping-row .target-param-name:focus,
.custom-param-row .param-key:focus,
.custom-param-row .param-value:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Enhanced Select Dropdown */
.field-mapping-row .source-field-select {
    padding: 0;
    border: 1px solid #007bff;
    overflow-y: auto;
}

.field-mapping-row .source-field-select option {
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.field-mapping-row .source-field-select option:hover {
    background: #e7f3ff;
}

.field-mapping-row .source-field-select option[value=""] {
    font-weight: 600;
    background: #f8f9fa;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.field-mapping-row .source-field-select option[style*="display: none"] {
    display: none !important;
}

/* Improve main form select dropdowns */
.builder-tab-content select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

.builder-tab-content select.form-control option {
    padding: 8px;
}

.builder-tab-content select.form-control optgroup {
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    background: #f8f9fa;
    padding: 6px 8px;
}

.builder-tab-content select.form-control option:not([value=""]) {
    padding-right: 24px;
}

/* Arrow Icon Between Fields */
.field-mapping-row i.fa-arrow-left,
.custom-param-row span {
    color: #6c757d;
    font-size: 14px;
    text-align: center;
}

/* Remove Button */
.field-mapping-row .remove-field-mapping,
.custom-param-row .remove-custom-param {
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid #dc3545;
    background: white;
    color: #dc3545;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.field-mapping-row .remove-field-mapping:hover,
.custom-param-row .remove-custom-param:hover {
    background: #dc3545;
    color: white;
}

/* Empty State */
.field-mapping-list .empty-state,
.custom-params-list .empty-state {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-size: 14px;
}

/* Add Field/Param Buttons */
.add-field-mapping,
.add-custom-param {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    border: 2px dashed #007bff;
    border-radius: 6px;
    background: white;
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-field-mapping:hover,
.add-custom-param:hover {
    background: #e7f3ff;
    border-color: #0056b3;
}

/* Action Row Container */
.action-row {
    background: white;
    border: 1px solid #e0e7ed;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    max-width: 100%;
}

.action-row:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.12);
}

.action-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e7ed;
}

.action-row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.action-row-title i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
    border-radius: 8px;
    font-size: 14px;
}

.action-row-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-row-controls .action-type-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    min-width: 160px;
    background: white;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

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

.btn-icon.btn-danger:hover {
    background: #c82333;
    transform: scale(1.05);
}

.action-fields {
    padding: 16px;
}

/* Form Group Styling */
.action-fields .form-group {
    margin-bottom: 14px;
}

.action-fields .form-group:last-child {
    margin-bottom: 0;
}

.action-fields .form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 6px;
}

.action-fields .form-group input[type="text"],
.action-fields .form-group input[type="url"],
.action-fields .form-group input[type="email"],
.action-fields .form-group input[type="tel"],
.action-fields .form-group select,
.action-fields .form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.action-fields .form-group input:focus,
.action-fields .form-group select:focus,
.action-fields .form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.action-fields .form-group input[readonly] {
    background: #f8f9fa;
    color: #6c757d;
}

.action-fields .help-text {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.action-fields .help-text i {
    margin-left: 4px;
    color: #007bff;
}

/* Condition Row Container */
.condition-row {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 2fr 1.5fr 2fr 36px;
    gap: 8px;
    align-items: center;
    transition: all 0.2s ease;
}

.condition-row:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.12);
}

.condition-row select,
.condition-row input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
}

.condition-row .remove-condition {
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid #dc3545;
    background: white;
    color: #dc3545;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.condition-row .remove-condition:hover {
    background: #dc3545;
    color: white;
}

/* Webhook Preview */
.webhook-preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.webhook-preview-container h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.webhook-preview {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Scrollbar Styling for Lists */
.field-mapping-list::-webkit-scrollbar,
.custom-params-list::-webkit-scrollbar,
.webhook-preview::-webkit-scrollbar {
    width: 8px;
}

.field-mapping-list::-webkit-scrollbar-track,
.custom-params-list::-webkit-scrollbar-track,
.webhook-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.field-mapping-list::-webkit-scrollbar-thumb,
.custom-params-list::-webkit-scrollbar-thumb,
.webhook-preview::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.field-mapping-list::-webkit-scrollbar-thumb:hover,
.custom-params-list::-webkit-scrollbar-thumb:hover,
.webhook-preview::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Better Form Control Styling */
.builder-tab-content input[type="text"],
.builder-tab-content input[type="time"],
.builder-tab-content textarea,
.builder-tab-content select {
    transition: all 0.2s ease;
    box-sizing: border-box;
    max-width: 100%;
}

.builder-tab-content input[type="text"]:focus,
.builder-tab-content input[type="time"]:focus,
.builder-tab-content textarea:focus,
.builder-tab-content select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Helper Text Styling */
.builder-tab-content small.form-text {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
}

/* Info Boxes */
.builder-tab-content .info-box {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 18px;
    color: #004085;
}

.builder-tab-content .info-box strong {
    color: #003060;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    #scenarioBuilderModal .modal-content {
        width: 95% !important;
        max-width: 95% !important;
    }
    
    .field-mapping-row,
    .custom-param-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .field-mapping-row i.fa-arrow-left,
    .custom-param-row span {
        display: none;
    }
    
    .condition-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .builder-tabs {
        flex-wrap: wrap;
    }
    
    .builder-tab {
        flex: 1 1 50%;
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* ============= CLIENT MODAL MODERN STYLING ============= */
.modal-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 20px;
}

.modal-tabs .tab {
    padding: 14px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    position: relative;
}

.modal-tabs .tab:hover {
    color: #E8731A;
    background: rgba(232, 115, 26, 0.05);
}

.modal-tabs .tab.active {
    color: #E8731A;
    background: white;
    border-bottom-color: #E8731A;
}

.tab-content {
    display: none;
}

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

.modal .form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}

.modal .form-section:last-child {
    margin-bottom: 0;
}

.modal .form-section h3 {
    font-size: 16px;
    color: #2d3748;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.modal .form-section h3 i {
    color: #E8731A;
}

.modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.modal .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: #E8731A;
    box-shadow: 0 0 0 3px rgba(232, 115, 26, 0.1);
}

.modal .form-group small {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
/* ============= END CLIENT MODAL STYLING =============*/

/* ============= BULK ACTIONS BAR STYLING =============*/
.bulk-actions-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(232, 115, 26, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-actions-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.bulk-selection-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 15px;
}

.bulk-selection-info i {
    font-size: 20px;
}

.bulk-selection-info .btn-link {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
}

.bulk-selection-info .btn-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.bulk-actions-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bulk-actions-buttons .btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-actions-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bulk-actions-buttons .btn-info {
    background: #3b82f6;
    color: white;
}

.bulk-actions-buttons .btn-info:hover {
    background: #2563eb;
}

.bulk-actions-buttons .btn-primary {
    background: #E8731A;
    color: white;
}

.bulk-actions-buttons .btn-primary:hover {
    background: #D06818;
}

.bulk-actions-buttons .btn-warning {
    background: #f59e0b;
    color: white;
}

.bulk-actions-buttons .btn-warning:hover {
    background: #d97706;
}

.bulk-actions-buttons .btn-danger {
    background: #ef4444;
    color: white;
}

.bulk-actions-buttons .btn-danger:hover {
    background: #dc2626;
}

.bulk-actions-buttons .btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

/* Checkbox styling for select all */
#selectAllCheckbox {
    accent-color: #E8731A;
    cursor: pointer;
}

#selectAllCheckbox:indeterminate {
    accent-color: #f59e0b;
}

/* Client card checkbox */
.client-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #E8731A;
    margin-left: 10px;
}

/* Responsive bulk actions */
@media (max-width: 768px) {
    .bulk-actions-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-actions-buttons {
        justify-content: stretch;
    }
    
    .bulk-actions-buttons .btn {
        flex: 1;
        justify-content: center;
    }
}
/* ============= END BULK ACTIONS BAR STYLING =============*/

/* ============= PROVIDER TAGS STYLING =============*/
.client-providers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.provider-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, #E8731A 0%, #C45E14 100%);
    color: white;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(232, 115, 26, 0.2);
    transition: all 0.2s;
}

.provider-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(232, 115, 26, 0.3);
}

.provider-tag i {
    font-size: 10px;
}

.provider-tag.no-provider {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    opacity: 0.7;
}

.provider-tag.no-provider:hover {
    opacity: 0.9;
}
/* ============= END PROVIDER TAGS STYLING =============*/

/* Dynamic Field Selector Styles */
.dynamic-field-dropdown {
    font-family: 'Heebo', sans-serif;
}

.dynamic-field-dropdown .field-search-input:focus {
    outline: none;
    border-color: #E8731A;
}

.dynamic-field-dropdown .field-item {
    transition: background 0.15s ease;
}

.dynamic-field-dropdown .field-item:hover {
    background: #f0f4ff !important;
}

.dynamic-field-dropdown .show-more-btn:hover {
    background: #e8eaed !important;
}

.insert-field-btn:hover {
    background: #D06818 !important;
    transform: translateY(-50%) scale(1.05);
}

.insert-field-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Dynamic field input styling */
.condition-value-input[style*="monospace"] {
    font-weight: 500;
}

/* Badge for dynamic field indicator */
.dynamic-field-badge {
    position: absolute;
    top: -8px;
    right: 8px;
    background: #E8731A;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    pointer-events: none;
}

/* Dashboard Monitoring Panel Styles */
.system-health-panel .panel-body {
    padding: 25px;
}

.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.monitor-card {
    background: linear-gradient(135deg, rgba(74, 35, 90, 0.25) 0%, rgba(52, 73, 94, 0.25) 100%);
    border: 2px solid rgba(155, 89, 182, 0.4);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.monitor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
    border-color: rgba(155, 89, 182, 0.7);
    background: linear-gradient(135deg, rgba(74, 35, 90, 0.35) 0%, rgba(52, 73, 94, 0.3) 100%);
}

.monitor-label {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 18px;
    color: #bb8fce !important;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.monitor-label::before {
    content: '';
    width: 4px;
    height: 26px;
    background: linear-gradient(180deg, #bb8fce 0%, #9b59b6 100%);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(155, 89, 182, 0.6);
}

.monitor-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.monitor-stats .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border-left: 3px solid rgba(155, 89, 182, 0.5);
    transition: all 0.2s ease;
}

.monitor-stats .stat-item:hover {
    background: rgba(0, 0, 0, 0.35);
    border-left-color: #bb8fce;
    transform: translateX(-3px);
}

.monitor-stats .stat-item:last-child {
    margin-bottom: 0;
}

.monitor-stats .stat-label {
    color: #d7bde2 !important;
    font-size: 1.1rem !important;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.monitor-stats .stat-value {
    font-weight: 700 !important;
    font-size: 1.75rem !important;
    color: #ffffff !important;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 1px;
}

.monitor-stats .stat-value.time {
    font-size: 1.1rem !important;
    color: #c39bd3 !important;
    font-family: inherit;
    letter-spacing: normal;
}

.monitor-stats .stat-item.success {
    border-left-color: #00d4aa;
}

.monitor-stats .stat-item.success .stat-value {
    color: #00d4aa !important;
    text-shadow: 0 0 10px rgba(0, 212, 170, 0.5);
}

.monitor-stats .stat-item.error {
    border-left-color: #ff4757;
}

.monitor-stats .stat-item.error .stat-value {
    color: #ff4757 !important;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.system-alerts {
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.08) 100%);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.system-alerts .alert {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffc107;
    font-weight: 500;
}

.system-alerts .alert i {
    font-size: 1.2rem;
}

#system-health-badge {
    font-size: 0.8rem;
    padding: 6px 16px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Tooltip Styles (Scenario Builder) ===== */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #E8731A;
    color: white;
    font-size: 11px;
    cursor: help;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.tooltip-icon:hover {
    background: #C45E14;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(232, 115, 26, 0.4);
}

.tooltip-icon i {
    font-size: 10px;
}

/* Native browser tooltip enhancement */
[title] {
    position: relative;
}

/* Custom tooltip for scenario fields */
.form-group label .tooltip-icon {
    margin-right: 5px;
}

/* Builder Tab Help Icon */
.builder-tab i.fa-question-circle {
    margin-left: 6px;
    font-size: 14px;
}

/* Help Tab Content Styling */
.builder-tab-content[data-builder-content="help"] {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.builder-tab-content[data-builder-content="help"]::-webkit-scrollbar {
    width: 8px;
}

.builder-tab-content[data-builder-content="help"]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.builder-tab-content[data-builder-content="help"]::-webkit-scrollbar-thumb {
    background: #E8731A;
    border-radius: 10px;
}

.builder-tab-content[data-builder-content="help"]::-webkit-scrollbar-thumb:hover {
    background: #C45E14;
}

/* Responsive table in help tab */
@media (max-width: 768px) {
    .builder-tab-content[data-builder-content="help"] table {
        font-size: 12px;
    }
    
    .builder-tab-content[data-builder-content="help"] table th,
    .builder-tab-content[data-builder-content="help"] table td {
        padding: 8px !important;
    }
    
    .builder-tab-content[data-builder-content="help"] > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}
/* =============================================================================
   SMTP CONFIGURATION STYLES
   ============================================================================= */

/* SMTP Status Card */
.smtp-status-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.smtp-status-card h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 18px;
}

.smtp-status-card .status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.smtp-status-card .status-row:last-child {
    border-bottom: none;
}

.smtp-status-card .status-label {
    font-weight: 500;
    color: #6b7280;
}

.smtp-status-card .status-value {
    color: #1f2937;
}

.smtp-status-card .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

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

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

/* SMTP Providers List */
.smtp-providers-list {
    margin-top: 20px;
}

.smtp-provider-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.smtp-provider-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.smtp-provider-card .provider-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
}

.smtp-provider-card .provider-actions {
    display: flex;
    gap: 8px;
}

.smtp-provider-card .provider-details {
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.smtp-provider-card .provider-details > div {
    padding: 4px 0;
    color: #6b7280;
    font-size: 14px;
}

.smtp-provider-card .provider-details strong {
    color: #1f2937;
    margin-left: 8px;
}

/* SMTP Form Layout */
#smtp-settings .form-grid,
#clientSmtpModal .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

#smtp-settings .form-group,
#clientSmtpModal .form-group {
    margin-bottom: 0;
}

#smtp-settings .form-group.full-width,
#clientSmtpModal .form-group.full-width {
    grid-column: 1 / -1;
}

/* SMTP Preset Dropdown */
.smtp-preset-row {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.smtp-preset-row .form-group {
    margin-bottom: 0;
}

/* SMTP Test Button */
.smtp-test-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state.error {
    color: #dc2626;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state p {
    margin: 0;
    font-size: 16px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.loading i {
    font-size: 24px;
}

/* SMTP Tab in Client Modal */
#smtpTab .tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#smtpTab .tab-header h3 {
    margin: 0;
    color: #1f2937;
}

/* Responsive */
@media (max-width: 768px) {
    #smtp-settings .form-grid,
    #clientSmtpModal .form-grid {
        grid-template-columns: 1fr;
    }
    
    .smtp-provider-card .provider-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .smtp-test-section {
        flex-direction: column;
    }
}

/* ===== DID Management Toggle Switch ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #444;
    border-radius: 20px;
    transition: 0.3s;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ccc;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #4ecdc4;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
    background-color: #fff;
}

/* DID list and scan results */
.did-list .empty-state,
.did-scan-list .empty-state {
    text-align: center;
    padding: 24px;
    color: #888;
}
.did-scan-list .extension-item {
    border-bottom: 1px solid #2a2a3e;
}
}