/* ===========================================
   DASHBOARD CSS - Extracted from dashboard.py
   Lines 305-808 + new additions for tabs, combo, WG health
   =========================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 0;
}

.app-header {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(184, 181, 212, 0.1);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #B8B5D4 0%, #E4B5CB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: -0.05em;
}

.stats-bar {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: #9ca3af;
    align-items: center;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    color: #B8B5D4;
    font-weight: 600;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    margin-left: 1rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #B8B5D4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Enclave Health Grid */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.health-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.health-card.status-ready {
    border-left: 4px solid #22c55e;
}

.health-card.status-unhealthy {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.health-card.status-starting {
    border-left: 4px solid #fbbf24;
}

.health-card.status-draining {
    border-left: 4px solid #3b82f6;
}

.health-card-title {
    font-weight: 600;
    color: #B8B5D4;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.health-card-type {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.health-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #9ca3af;
}

.health-card-heartbeat {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.btn {
    background: linear-gradient(135deg, #B8B5D4 0%, #E4B5CB 100%);
    color: #1a1a2e;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(184, 181, 212, 0.4);
}

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

.btn-secondary {
    background: rgba(184, 181, 212, 0.1);
    color: #B8B5D4;
    border: 1px solid rgba(184, 181, 212, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(184, 181, 212, 0.2);
}

.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #9ca3af;
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #B8B5D4;
    background: rgba(255, 255, 255, 0.08);
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 200px;
}

.qr-container img {
    max-width: 280px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.5rem;
}

.status-pending {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.status-showing {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-scanning {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.status-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-running {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.status-completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #B8B5D4 0%, #E4B5CB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1a1a2e;
    font-size: 0.75rem;
}

.progress-container {
    margin: 1.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #B8B5D4 0%, #E4B5CB 100%);
    transition: width 0.5s ease;
    position: relative;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #9ca3af;
}

.results-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #B8B5D4;
}

.result-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.video-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.video-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.video-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #B8B5D4;
}

.video-item.repost {
    background: rgba(251, 191, 36, 0.05);
    border-left-color: #fbbf24;
}

.video-author {
    color: #B8B5D4;
    font-weight: 600;
}

.video-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #B8B5D4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(184, 181, 212, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 181, 212, 0.5);
}

/* ===========================================
   NEW: TAB NAVIGATION
   =========================================== */

.tab-container {
    margin-bottom: 1.5rem;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #B8B5D4;
}

.tab-btn.active {
    color: #B8B5D4;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #B8B5D4 0%, #E4B5CB 100%);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===========================================
   NEW: COMBO INPUT (Type-to-search + Dropdown)
   =========================================== */

.combo-input-wrapper {
    position: relative;
    width: 100%;
}

.combo-input {
    width: 100%;
    padding: 0.75rem;
    padding-right: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.combo-input:focus {
    outline: none;
    border-color: #B8B5D4;
    background: rgba(255, 255, 255, 0.08);
}

.combo-input::placeholder {
    color: #6b7280;
}

.combo-dropdown-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.combo-dropdown-btn:hover {
    color: #B8B5D4;
}

.combo-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(26, 26, 46, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.combo-suggestions.show {
    display: block;
}

.combo-suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s ease;
}

.combo-suggestion:hover,
.combo-suggestion.highlighted {
    background: rgba(184, 181, 212, 0.1);
}

.combo-suggestion-icon {
    color: #B8B5D4;
}

.combo-no-results {
    padding: 0.75rem 1rem;
    color: #6b7280;
    font-style: italic;
}

/* ===========================================
   NEW: WIREGUARD HEALTH DISPLAY
   =========================================== */

.wg-health-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .wg-health-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wg-health-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

#wg-health-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.wg-bucket {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
}

.wg-bucket.healthy {
    border-left: 3px solid #22c55e;
}

.wg-bucket.unhealthy {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.wg-bucket.unknown {
    border-left: 3px solid #6b7280;
}

.wg-bucket-id {
    font-weight: 700;
    color: #B8B5D4;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.wg-bucket-status {
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.wg-bucket.healthy .wg-bucket-status {
    color: #22c55e;
}

.wg-bucket.unhealthy .wg-bucket-status {
    color: #ef4444;
}

.wg-bucket-ip {
    font-size: 0.7rem;
    color: #6b7280;
    font-family: monospace;
}

.wg-bucket-latency {
    font-size: 0.7rem;
    color: #9ca3af;
}

.wg-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.wg-summary-stat {
    text-align: center;
}

.wg-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.wg-summary-value.healthy {
    color: #22c55e;
}

.wg-summary-value.degraded {
    color: #fbbf24;
}

.wg-summary-value.unhealthy {
    color: #ef4444;
}

.wg-summary-label {
    font-size: 0.75rem;
    color: #6b7280;
}

/* ===========================================
   LOGIN PAGE
   =========================================== */

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #B8B5D4 0%, #E4B5CB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: #9ca3af;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.login-info-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
}

.login-info-box code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #B8B5D4;
}

/* ===========================================
   MODE TOGGLE
   =========================================== */

.mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.mode-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    color: #e0e0e0;
}

.mode-btn.active {
    background: rgba(184, 181, 212, 0.2);
    color: #B8B5D4;
}

/* ===========================================
   TEST RESULTS TABLE
   =========================================== */

.test-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.test-results-table th,
.test-results-table td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.test-results-table th {
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.test-results-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.test-status-passed {
    color: #22c55e;
    font-weight: 500;
}

.test-status-failed {
    color: #ef4444;
    font-weight: 500;
}

.test-status-skipped {
    color: #fbbf24;
    font-weight: 500;
}

.test-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.test-summary-item {
    text-align: center;
}

.test-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.test-summary-label {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
}

/* ===========================================
   METRICS / HEALTH HISTORY
   =========================================== */

.metrics-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .metrics-summary {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .metrics-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

.metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #B8B5D4;
    margin-bottom: 0.25rem;
}

.metric-value.healthy {
    color: #22c55e;
}

.metric-value.warning {
    color: #fbbf24;
}

.metric-value.error {
    color: #ef4444;
}

.metric-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metrics-chart {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    min-height: 200px;
}

.metrics-chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 2px;
    padding: 0 0.5rem;
}

.metrics-chart-bar {
    flex: 1;
    background: linear-gradient(180deg, #B8B5D4 0%, rgba(184, 181, 212, 0.3) 100%);
    border-radius: 2px 2px 0 0;
    min-width: 4px;
    max-width: 20px;
    transition: height 0.3s ease;
}

.metrics-chart-bar.low {
    background: linear-gradient(180deg, #22c55e 0%, rgba(34, 197, 94, 0.3) 100%);
}

.metrics-chart-bar.medium {
    background: linear-gradient(180deg, #fbbf24 0%, rgba(251, 191, 36, 0.3) 100%);
}

.metrics-chart-bar.high {
    background: linear-gradient(180deg, #ef4444 0%, rgba(239, 68, 68, 0.3) 100%);
}

.metrics-chart-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.error-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.error-breakdown-item .error-type {
    color: #e0e0e0;
}

.error-breakdown-item .error-count {
    color: #ef4444;
    font-weight: 600;
}

/* Chart Tabs */
.chart-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.chart-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

.chart-tab.active {
    background: rgba(184, 181, 212, 0.2);
    border-color: #B8B5D4;
    color: #B8B5D4;
}

/* Neutral bar color for requests chart */
.metrics-chart-bar.neutral {
    background: linear-gradient(180deg, #B8B5D4 0%, rgba(184, 181, 212, 0.3) 100%);
}

/* Chart Tooltip */
.chart-tooltip {
    position: fixed;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #fff;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chart-tooltip.visible {
    opacity: 1;
}

.chart-tooltip-value {
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 2px;
}

.chart-tooltip-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

.chart-tooltip-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 4px;
}

/* Collapsible Sections */
.collapsible-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    font-size: 0.9rem;
    color: #9ca3af;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-icon {
    font-size: 0.75rem;
    color: #6b7280;
}

.collapsible-content {
    padding: 1rem;
    display: block;
}

/* Metrics Table */
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.metrics-table th,
.metrics-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metrics-table th {
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.metrics-table td {
    color: #e0e0e0;
}

.metrics-table .empty-cell {
    text-align: center;
    color: #6b7280;
    padding: 1.5rem;
}

.endpoint-path {
    font-family: monospace;
    font-size: 0.8rem;
    color: #B8B5D4;
}

.method-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.method-badge.get { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.method-badge.post { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.method-badge.put { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.method-badge.delete { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.latency-high { color: #ef4444 !important; }
.latency-medium { color: #fbbf24 !important; }
.error-high { color: #ef4444 !important; font-weight: 600; }
.error-low { color: #fbbf24 !important; }

/* Latency Chart */
.latency-chart {
    padding: 1rem 0;
}

.latency-chart-area {
    position: relative;
    height: 150px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    overflow: hidden;
}

.latency-line {
    position: absolute;
    inset: 0;
}

.latency-point {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--line-color);
    border-radius: 50%;
    transform: translate(-50%, 50%);
    cursor: pointer;
    /* Connect dots with trailing line */
    box-shadow: -6px 0 0 var(--line-color), -12px 0 0 var(--line-color);
}

/* Invisible larger hover zone */
.latency-point::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.latency-point:hover {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 10px var(--line-color);
    z-index: 10;
}

.latency-legend {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.latency-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.latency-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.latency-max {
    margin-left: auto;
    color: #6b7280;
}

/* Errors Chart */
.errors-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.error-series {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-series-label {
    min-width: 100px;
    font-size: 0.8rem;
    font-weight: 500;
}

.error-series-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    height: 30px;
    gap: 1px;
}

.error-bar {
    flex: 1;
    min-width: 2px;
    border-radius: 1px 1px 0 0;
}

/* Recent Errors Table */
.error-log-table .error-time {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.error-category-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.error-message {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: #9ca3af;
}

.error-endpoint {
    font-family: monospace;
    font-size: 0.75rem;
    color: #6b7280;
}

/* ===========================================
   ARCHIVE HEALTH TAB
   =========================================== */

/* Unavailable banner */
.unavailable-banner {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #fbbf24;
    text-align: center;
}

/* Auth pipeline */
.auth-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    flex-wrap: wrap;
}

.pipeline-stage {
    text-align: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    min-width: 80px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pipeline-stage.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.pipeline-stage.expired {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pipeline-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e0e0e0;
}

.pipeline-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.pipeline-arrow {
    color: #6b7280;
    font-size: 1.25rem;
}

/* Wrapped status */
.wrapped-status {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 1.5rem;
    flex-wrap: wrap;
}

.wrapped-item {
    text-align: center;
}

.wrapped-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #e0e0e0;
}

.wrapped-count.healthy {
    color: #22c55e;
}

.wrapped-count.warning {
    color: #fbbf24;
}

.wrapped-label {
    font-size: 0.85rem;
    color: #9ca3af;
    text-transform: capitalize;
}

/* Task name in jobs table */
.task-name {
    font-family: monospace;
    font-size: 0.85rem;
    color: #B8B5D4;
}

/* Color classes for table cells */
.metrics-table td.healthy {
    color: #22c55e;
}

.metrics-table td.warning {
    color: #fbbf24;
}

.metrics-table td.error {
    color: #ef4444;
}

/* ===========================================
   QUEUE & AUTH HEALTH SECTIONS
   =========================================== */

/* Health section container */
.health-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.health-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    font-size: 0.9rem;
    color: #9ca3af;
    transition: background 0.2s;
}

.health-section .section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.health-section .section-content {
    padding: 1rem;
}

/* Auth metrics mini cards */
.auth-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .auth-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

.auth-metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.auth-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #B8B5D4;
    margin-bottom: 0.25rem;
}

.auth-metric-value.healthy {
    color: #22c55e;
}

.auth-metric-value.warning {
    color: #fbbf24;
}

.auth-metric-value.error {
    color: #ef4444;
}

.auth-metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Queue health progress bars */
.queue-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.queue-bar-label {
    min-width: 120px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #B8B5D4;
}

.queue-bar-track {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.queue-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.queue-bar-fill.healthy {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.queue-bar-fill.warning {
    background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
}

.queue-bar-fill.error {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.queue-bar-stats {
    min-width: 150px;
    text-align: right;
    font-size: 0.85rem;
}

.queue-bar-rate {
    font-weight: 600;
    margin-right: 0.5rem;
}

.queue-bar-rate.healthy { color: #22c55e; }
.queue-bar-rate.warning { color: #fbbf24; }
.queue-bar-rate.error { color: #ef4444; }

.queue-bar-counts {
    color: #6b7280;
    font-size: 0.8rem;
}

/* Health alert banner */
.health-alert {
    background: rgba(251, 191, 36, 0.1);
    border-left: 3px solid #fbbf24;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #fbbf24;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}

.health-alert:hover {
    background: rgba(251, 191, 36, 0.15);
}

/* Queue failures section */
.queue-failures-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.time-range-tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 3px;
}

.time-range-btn {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.time-range-btn:hover {
    color: #e0e0e0;
}

.time-range-btn.active {
    background: rgba(184, 181, 212, 0.2);
    color: #B8B5D4;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.pagination-btn {
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #9ca3af;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

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

/* Queue failures table */
.queue-failures-table {
    font-size: 0.8rem;
}

.queue-failures-table td {
    vertical-align: top;
}

.queue-failures-table .failure-time {
    white-space: nowrap;
    color: #6b7280;
    font-size: 0.75rem;
}

.queue-failures-table .failure-operation {
    font-family: monospace;
    color: #B8B5D4;
}

.queue-failures-table .failure-code {
    color: #ef4444;
    font-weight: 500;
}

.queue-failures-table .failure-message {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9ca3af;
}

.queue-failures-table .failure-message:hover {
    white-space: normal;
    word-break: break-word;
}

/* Pattern highlighting for repeated errors */
.queue-failures-table tr.repeated-error {
    background: rgba(239, 68, 68, 0.05);
}

.queue-failures-table tr.repeated-error .failure-code {
    font-weight: 700;
}
