:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --accent-blue: #3b82f6;
    --accent-gold: #fbbf24;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    background-image: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(251, 191, 36, 0.1) 0%, transparent 40%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: var(--glass-border);
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

.brand span {
    color: var(--accent-blue);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
    gap: 20px;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Specific Areas */
.area-pulse {
    grid-column: span 8;
}

.area-treasury {
    grid-column: span 4;
}

.area-ops {
    grid-column: span 4;
}

.area-ministry {
    grid-column: span 4;
}

.area-agents {
    grid-column: span 4;
}

/* Metrics */
.metric-big {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-blue);
    width: 0%;
    /* JS will fill */
    transition: width 1s ease;
}

/* Agent List */
.agent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.status-online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-working {
    background: var(--accent-gold);
}

.status-error {
    background: var(--danger);
}

/* Red-to-Green Progress Bars */
.progress-track {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-gradient {
    height: 100%;
    /* Red -> Yellow -> Green Gradient */
    background: linear-gradient(90deg, #ef4444 0%, #fbbf24 50%, #22c55e 100%);
    width: 100%;
    /* The container is the full gradient */
    clip-path: inset(0 100% 0 0);
    /* We reveal it using clip-path */
    transition: clip-path 1s ease;
}

/* Specific Width Classes for Logic (or inline styles) */
/* Usage: style="clip-path: inset(0 20% 0 0);" for 80% */

.client-item {
    margin-bottom: 15px;
}

.client-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

/* Research Feed */
.research-item {
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 2px solid var(--accent-blue);
}

.research-title {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.research-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Alerts */
#firefighter-alert {
    display: none;
    /* Injected by JS */
}