/* Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 20px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

#usernameDisplay {
    color: var(--text-muted);
    font-size: 14px;
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 36px;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-light);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
}

/* Panel Styles */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.btn-refresh {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--border);
    color: var(--text-light);
}

.panel-content {
    padding: 24px;
}

/* Queue Stats */
.queue-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-dark);
}

.badge-high { border-left: 3px solid var(--danger); }
.badge-medium { border-left: 3px solid var(--warning); }
.badge-low { border-left: 3px solid var(--success); }

.queue-next h4 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Gap Summary */
.gap-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gap-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
}

.gap-stat .label {
    color: var(--text-muted);
    font-size: 14px;
}

.gap-stat .value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
}

/* Source List */
#sourceList {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.source-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 16px;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    align-items: center;
}

.source-name {
    font-weight: 500;
}

.source-stat {
    font-size: 14px;
    color: var(--text-muted);
}

.status-online { color: var(--success); }
.status-slow { color: var(--warning); }
.status-degraded { color: var(--danger); }

.source-overall {
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

/* Activity Feed */
#activityList {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.activity-message {
    font-size: 14px;
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Health Stats */
.health-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.health-item {
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
}

.health-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.health-value {
    font-size: 16px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 24px 20px;
    }
    
    .header {
        padding: 16px 20px;
    }
}

@media (max-width: 640px) {
    .stats-overview {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .health-stats {
        grid-template-columns: 1fr;
    }
}

/* Watchlist Panel */
.watchlist-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    flex-wrap: wrap;
}

.watchlist-summary span {
    color: var(--text-muted);
    font-size: 14px;
}

.watchlist-summary strong {
    color: var(--text-light);
    margin-left: 4px;
}

.watchlist-add {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.watchlist-add input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
}

.watchlist-add input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-add {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add:hover {
    background: #5558e3;
    transform: scale(1.05);
}

.watchlist-item {
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.watchlist-item-info {
    flex: 1;
}

.watchlist-item-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.watchlist-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.watchlist-item-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--border);
}

.btn-small.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Quick Actions Panel */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.action-btn {
    padding: 16px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 24px;
}

