:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
    --border-radius: 16px;
    --border-radius-sm: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

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

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

.header-titles h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlight {
    font-size: 1.2rem;
    font-weight: 500;
    background: linear-gradient(to right, var(--accent-primary), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    background: var(--bg-card-hover);
    border-color: rgba(59, 130, 246, 0.3);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon svg {
    width: 24px;
    height: 24px;
}

.total-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

.completed-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.running-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.failed-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
}

.kpi-info h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: border-color 0.3s ease;
}

.chart-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

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

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.chart-container {
    width: 100%;
    min-height: 320px;
}

.chart-container.large {
    min-height: 400px;
}

/* Lists Grid */
.lists-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.list-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.list-container::-webkit-scrollbar {
    width: 6px;
}
.list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.detail-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    transition: background 0.2s;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.detail-item .label {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.detail-item .sub-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.detail-item .value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

/* Expandable list items */
.detail-item.clickable {
    cursor: pointer;
    flex-direction: column;
    align-items: stretch;
}

.detail-item.clickable .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-breakdown {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item.expanded .status-breakdown {
    display: flex;
}

.status-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.status-name {
    text-transform: capitalize;
}

.status-name.completed { color: var(--accent-success); }
.status-name.failed, .status-name.error { color: var(--accent-danger); }
.status-name.running, .status-name.submitted { color: var(--accent-warning); }

.status-count {
    color: var(--text-main);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid, .lists-grid {
        grid-template-columns: 1fr;
    }
}
