:root {
    --tahoe-blue: #0077be;
    --deep-water: #003366;
    --snow-white: rgba(255, 255, 255, 0.9);
    --pine-green: #1a472a;
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.25);
    --accent-glow: rgba(0, 119, 190, 0.6);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--snow-white);
    background-color: #001a33;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: linear-gradient(rgba(0, 26, 51, 0.5), rgba(0, 26, 51, 0.8)), 
                      url('background.jpg?v=1');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

header {
    padding: 2.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

h1 {
    font-weight: 700;
    letter-spacing: 4px;
    font-size: 1.8rem;
    text-shadow: 0 0 20px rgba(0, 119, 190, 0.8);
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #a0d8f1;
    margin-top: 5px;
}

.status-badge {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px var(--accent-glow);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 100%;
    margin: 0;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--tahoe-blue), transparent);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--tahoe-blue);
    box-shadow: 0 15px 50px rgba(0, 119, 190, 0.3);
}

.card h3 {
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin: 0;
    color: #a0d8f1;
    text-transform: uppercase;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.current-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.gauge-container {
    background: rgba(0, 0, 0, 0.3);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.gauge {
    height: 100%;
    background: linear-gradient(90deg, var(--tahoe-blue), #87ceeb);
    width: 0%;
    transition: width 1.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 0 10px var(--tahoe-blue);
}

.chart-container {
    position: relative;
    height: 180px;
    width: 100%;
}

.status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 15px #4caf50;
    display: inline-block;
    margin-top: 1rem;
}

.card.wide {
    grid-column: span 2;
}

.log-stream {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    height: 180px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.6;
}

.log-stream p {
    margin-bottom: 0.5rem;
    color: #c0e6f8;
    border-left: 3px solid var(--tahoe-blue);
    padding-left: 0.8rem;
}

footer {
    padding: 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    color: #a0d8f1;
}

#ip { font-weight: bold; color: #fff; }

/* AGENT_CORE STYLES */
.agent-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.agent-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.agent-stat-item .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #a0d8f1;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
}

.agent-stat-item .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.pulse-active {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { text-shadow: 0 0 5px #4caf50; opacity: 0.8; }
    50% { text-shadow: 0 0 20px #4caf50; opacity: 1; }
    100% { text-shadow: 0 0 5px #4caf50; opacity: 0.8; }
}

.pulse-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #a0d8f1;
    opacity: 0.5;
    margin-top: 1.5rem;
    text-align: right;
}

@media (max-width: 900px) {
    .card.wide { grid-column: span 1; }
}
