/* =========================================================================
Admin Control Panel — System
   =========================================================================

Extracted from the Leptos `<style>` blocks that used to sit inside these
components. Those blocks only existed in the DOM while their component was
mounted, which made cross-panel styling depend on what happened to be on
screen, and made the same rule easy to declare twice with different values.

Sources:
     - apps/frontend-admin/src/ui/panels/admin/system.rs
   ========================================================================= */

/* ---- system.rs ---- */
    .system-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
        margin-top: 2rem;
    }
    .health-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        position: relative;
    }
    .status-indicator {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: var(--danger-color);
        margin-bottom: 1rem;
        box-shadow: 0 0 10px var(--danger-border);
        transition: all 0.3s ease;
    }
    .status-indicator.online {
        background: var(--success-color);
        box-shadow: 0 0 10px var(--success-border);
    }
    .status-indicator.warning {
        background: var(--warning-color);
        box-shadow: 0 0 10px var(--warning-border);
    }
    .analytics-row {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        margin-top: 2rem;
    }
    .chart-box {
        min-height: 450px;
        width: 100%;
    }
    .api-status-list {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 1.5rem;
    }
    .api-status-list h3 {
        margin: 0 0 1.5rem 0;
        font-size: 0.9rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .api-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .api-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .api-item:last-child {
        border-bottom: none;
    }
    .api-info {
        display: flex;
        flex-direction: column;
        flex: 1;
    }
    .api-top {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.25rem;
    }
    .api-name {
        font-weight: 500;
        font-size: 1rem;
    }
    .status-tag {
        font-size: 0.7rem;
        padding: 1px 6px;
        border-radius: 4px;
        background: var(--danger-bg);
        color: var(--danger-color);
        text-transform: uppercase;
        font-weight: 600;
    }
    .status-tag.online {
        background: var(--success-bg);
        color: var(--success-color);
    }
    .status-tag.warning {
        background: var(--warning-bg);
        color: var(--warning-color);
    }
    .api-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-right: 1.5rem;
    }
    .api-latency {
        font-size: 0.85rem;
        color: var(--success-color);
        font-family: monospace;
        font-weight: 600;
    }
    .api-timestamp {
        font-size: 0.75rem;
        color: var(--text-muted);
    }
    .status-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--danger-color);
        box-shadow: 0 0 8px var(--danger-border);
    }
    .status-dot.online {
        background: var(--success-color);
        box-shadow: 0 0 8px var(--success-border);
    }
    .status-dot.warning {
        background: var(--warning-color);
        box-shadow: 0 0 8px var(--warning-border);
    }
    .error-state {
        padding: 2rem;
        text-align: center;
        color: var(--danger-color);
        background: var(--danger-bg);
        border-radius: 8px;
        margin-top: 2rem;
    }
    .capacity-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 1.5rem;
    }
    .capacity-card h3 {
        margin: 0 0 1rem 0;
        font-size: 0.9rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .capacity-metrics {
        display: flex;
        align-items: baseline;
        gap: 0.25rem;
        margin-bottom: 1rem;
    }
    .capacity-metrics .used {
        font-size: 1.5rem;
        font-weight: 700;
        color: #fff;
    }
    .capacity-metrics .divider {
        color: #6b7280;
    }
    .capacity-metrics .total {
        font-weight: 600;
        color: var(--text-muted);
    }
    .capacity-metrics .percentage {
        margin-left: auto;
        font-weight: 600;
        color: var(--color-accent);
    }
    .progress-bar-bg {
        height: 12px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        overflow: hidden;
        margin-bottom: 0.75rem;
    }
    .progress-bar-fill {
        height: 100%;
        background: var(--accent-color);
        border-radius: 6px;
        transition: width 0.5s ease;
    }
    .progress-bar-fill.warning {
        background: var(--warning-color);
    }
    .progress-bar-fill.danger {
        background: var(--danger-color);
    }
    .capacity-footer {
        display: flex;
        justify-content: space-between;
        font-size: 0.8rem;
        color: var(--text-muted);
    }
    .capacity-footer .warning { color: var(--warning-color); font-weight: 600; }
    .capacity-footer .danger { color: var(--danger-color); font-weight: 700; }

    @media (max-width: 768px) {
        .system-grid {
            gap: 0.75rem;
            margin-top: 1rem;
            grid-template-columns: 1fr 1fr;
        }
        .health-card {
            padding: 1rem;
            border-radius: 10px;
        }
        .status-indicator {
            margin-bottom: 0.5rem;
            width: 10px;
            height: 10px;
        }
        .health-card h3 {
            font-size: 0.9rem;
        }
        .status-text {
            font-size: 0.9rem;
        }
        .meta {
            font-size: 0.75rem;
        }
        .analytics-row {
            gap: 1rem;
            margin-top: 1rem;
        }
        .api-status-list, .capacity-card {
            padding: 1rem;
        }
        .api-item {
            padding-bottom: 0.5rem;
        }
        .api-name {
            font-size: 0.9rem;
        }
        .api-latency {
            font-size: 0.75rem;
        }
        .api-timestamp {
            font-size: 0.7rem;
        }
        .chart-box {
            min-height: 350px;
        }
        .capacity-metrics .used {
            font-size: 1.25rem;
        }
    }

    @media (max-width: 480px) {
        .system-grid {
            grid-template-columns: 1fr;
        }
        .health-card {
            flex-direction: row;
            align-items: center;
            text-align: left;
            gap: 0.75rem;
            justify-content: flex-start;
        }
        .status-indicator {
            margin-bottom: 0;
        }
    }

.memory-section { margin-top: 2.5rem; }
.mem-header { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 2rem; }
.mem-overview { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1.5rem; }
.mem-top-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}
.mem-cache-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.mem-stat-card { justify-content: center; }
.mem-rss-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.mem-rss-head h3 { margin: 0; }
.mem-rss-bar { position: relative; }
.mem-threshold-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--warning-color);
    box-shadow: 0 0 4px var(--warning-color);
}
.mem-unavailable { color: var(--text-muted); font-size: 0.9rem; margin: 0.5rem 0 1rem 0; }
.mem-kv-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mem-kv-row:last-child { border-bottom: none; }
.mem-kv-val { color: #fff; font-family: monospace; font-weight: 600; }
@media (max-width: 768px) {
    .mem-top-row { grid-template-columns: 1fr; }
    .mem-cache-row { grid-template-columns: 1fr; }
}

