:root {
    --bg-color: #0d1117;
    --sidebar-bg: #161b22;
    --panel-bg: #1c2128;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-color: #10b981;
    --accent-hover: #059669;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --danger-color: #f85149;
    --warning-color: #d29922;
    --info-color: #58a6ff;
    --border-color: rgba(255, 255, 255, 0.06);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme */
[data-theme="light"] {
    --bg-color: #f0f2f5;
    --sidebar-bg: #ffffff;
    --panel-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent-color: #059669;
    --accent-hover: #047857;
    --accent-glow: rgba(5, 150, 105, 0.1);
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #2563eb;
    --border-color: rgba(0, 0, 0, 0.08);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition), color var(--transition);
}

/* ============================
   Scrollbar
   ============================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================
   Sidebar
   ============================ */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 25px 0;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: background-color var(--transition);
}

.sidebar-header {
    padding: 0 25px 30px 25px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-header i {
    color: var(--accent-color);
    font-size: 1.3rem;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background-color: var(--accent-glow);
    color: var(--accent-color);
    border-left-color: var(--accent-color);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* ============================
   Main Content
   ============================ */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px 35px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    transition: background-color var(--transition);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.topbar h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Connection indicator */
.connection-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger-color);
    transition: background-color 0.3s;
    box-shadow: 0 0 6px rgba(248, 81, 73, 0.5);
}
.connection-dot.connected {
    background-color: var(--accent-color);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.8); }
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.theme-toggle:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* ============================
   Dashboard Cards
   ============================ */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--panel-bg);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--info-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before { opacity: 1; }

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 2rem;
    font-weight: 800;
}

.card-value.online { color: var(--accent-color); }
.card-value.offline { color: var(--danger-color); }

/* ============================
   Buttons
   ============================ */
.btn {
    padding: 9px 18px;
    border-radius: 8px;
    border: none;
    font-size: 0.88rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    white-space: nowrap;
}

.btn-primary { background-color: var(--accent-color); }
.btn-primary:hover { background-color: var(--accent-hover); transform: translateY(-1px); }

.btn-danger { background-color: var(--danger-color); }
.btn-danger:hover { background-color: #da3633; }

.btn-warning { background-color: var(--warning-color); color: #000; }
.btn-warning:hover { background-color: #b8860b; }

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-secondary:hover { background-color: var(--accent-glow); color: var(--accent-color); border-color: var(--accent-color); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-icon { padding: 6px 8px; }

/* ============================
   Forms
   ============================ */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, background-color var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============================
   Tables
   ============================ */
.table-container {
    background-color: var(--panel-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    transition: background-color var(--transition);
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(255,255,255,0.015); }

/* ============================
   Badges
   ============================ */
.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-up { background-color: rgba(16, 185, 129, 0.12); color: var(--accent-color); border: 1px solid rgba(16,185,129,0.25); }
.badge-down { background-color: rgba(248, 81, 73, 0.12); color: var(--danger-color); border: 1px solid rgba(248,81,73,0.25); }
.badge-paused { background-color: rgba(210, 153, 34, 0.12); color: var(--warning-color); border: 1px solid rgba(210,153,34,0.25); }
.badge-ssl-warn { background-color: rgba(210, 153, 34, 0.12); color: var(--warning-color); border: 1px solid rgba(210,153,34,0.25); font-size: 0.68rem; }
.badge-ssl-ok { background-color: rgba(16, 185, 129, 0.12); color: var(--accent-color); border: 1px solid rgba(16,185,129,0.25); font-size: 0.68rem; }

/* ============================
   Ping Color Coding
   ============================ */
.ping-fast { color: var(--accent-color); }
.ping-medium { color: var(--warning-color); }
.ping-slow { color: var(--danger-color); }

/* ============================
   Uptime Bar (90 day visualization)
   ============================ */
.uptime-bar {
    display: flex;
    gap: 1px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
}
.uptime-bar-day {
    flex: 1;
    min-width: 3px;
    transition: opacity 0.2s;
    cursor: pointer;
    position: relative;
}
.uptime-bar-day:hover { opacity: 0.7; }
.uptime-bar-day.up { background-color: var(--accent-color); }
.uptime-bar-day.partial { background-color: var(--warning-color); }
.uptime-bar-day.down { background-color: var(--danger-color); }
.uptime-bar-day.no-data { background-color: rgba(255,255,255,0.05); }

.uptime-bar-tooltip {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sidebar-bg);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    border: 1px solid var(--border-color);
    z-index: 10;
}
.uptime-bar-day:hover .uptime-bar-tooltip { opacity: 1; }

/* ============================
   Modal
   ============================ */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
    background: var(--sidebar-bg);
    padding: 30px;
    border-radius: 14px;
    width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}
.modal-header h2 { font-size: 1.3rem; font-weight: 700; }
.close-btn {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.4rem; cursor: pointer; transition: color 0.2s;
}
.close-btn:hover { color: var(--danger-color); }

/* ============================
   Toast Notifications
   ============================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast {
    padding: 14px 20px;
    border-radius: 10px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.toast.toast-success .toast-icon { color: var(--accent-color); }
.toast.toast-error .toast-icon { color: var(--danger-color); }
.toast.toast-warning .toast-icon { color: var(--warning-color); }
.toast.toast-info .toast-icon { color: var(--info-color); }

.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 3px; }
.toast-message { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4; }

.toast-close {
    background: none; border: none;
    color: var(--text-secondary); cursor: pointer;
    font-size: 1rem; flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }

.toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    border-radius: 0 0 10px 10px;
    animation: toastProgress 5s linear forwards;
}
.toast.toast-success .toast-progress { background: var(--accent-color); }
.toast.toast-error .toast-progress { background: var(--danger-color); }
.toast.toast-warning .toast-progress { background: var(--warning-color); }
.toast.toast-info .toast-progress { background: var(--info-color); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================
   Charts
   ============================ */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    margin-top: 15px;
}

/* ============================
   History logs
   ============================ */
.history-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.history-item:last-child { border: none; }
.error-msg { color: var(--danger-color); font-size: 0.82rem; margin-top: 4px; }

/* ============================
   Empty state
   ============================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state i { font-size: 3rem; margin-bottom: 15px; opacity: 0.3; }
.empty-state p { font-size: 1rem; }

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
    .sidebar { width: 60px; padding: 15px 0; }
    .sidebar-header { font-size: 0; padding: 0 0 15px 0; justify-content: center; }
    .sidebar-header i { font-size: 1.5rem; }
    .sidebar-menu li a { padding: 14px 0; justify-content: center; font-size: 0; gap: 0; }
    .sidebar-menu li a i { font-size: 1.2rem; width: auto; }
    .main-content { margin-left: 60px; padding: 20px 15px; }
}

/* ============================
   Dashboard v2 - Live Operations View
   ============================ */
:root {
    --info-glow: rgba(88, 166, 255, 0.12);
    --danger-glow: rgba(248, 81, 73, 0.12);
    --warning-glow: rgba(210, 153, 34, 0.12);
    --chart-grid: rgba(255, 255, 255, 0.055);
}

[data-theme="light"] {
    --info-glow: rgba(37, 99, 235, 0.09);
    --danger-glow: rgba(220, 38, 38, 0.08);
    --warning-glow: rgba(217, 119, 6, 0.09);
    --chart-grid: rgba(15, 23, 42, 0.07);
}

.dashboard-main { gap: 22px; padding-top: 26px; }
.dashboard-topbar { align-items: flex-start; }
.dashboard-topbar h1 { font-size: 1.85rem; margin-top: 3px; }
.eyebrow {
    color: var(--text-secondary);
    font-size: 0.68rem;
    line-height: 1;
    letter-spacing: 1.4px;
    font-weight: 800;
    text-transform: uppercase;
}
.live-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 10px;
}
.live-meta strong { color: var(--text-primary); font-weight: 700; }
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent-color);
    font-weight: 700;
}
.live-pill .connection-dot { width: 8px; height: 8px; }

.critical-banner {
    display: none;
    align-items: center;
    gap: 15px;
    min-height: 76px;
    border: 1px solid rgba(248, 81, 73, 0.34);
    background: linear-gradient(110deg, var(--danger-glow), rgba(248, 81, 73, 0.025));
    border-radius: 14px;
    padding: 15px 18px;
    box-shadow: 0 8px 28px rgba(248, 81, 73, 0.08);
    animation: alertGlow 2.2s ease-in-out infinite;
}
.critical-banner.show { display: flex; }
.critical-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--danger-color);
    background: var(--danger-glow);
    font-size: 1.15rem;
    flex: 0 0 auto;
}
.critical-content { flex: 1; min-width: 0; }
.critical-title { color: var(--danger-color); font-size: 0.95rem; font-weight: 800; margin-bottom: 4px; }
.critical-message { color: var(--text-secondary); font-size: 0.8rem; white-space: normal; }
.critical-pulse {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--danger-color);
    font-size: 0.68rem;
    letter-spacing: 0.8px;
    font-weight: 800;
    white-space: nowrap;
}
.critical-pulse span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger-color);
    box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.5);
    animation: alertPulse 1.4s infinite;
}
@keyframes alertPulse {
    0% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(248, 81, 73, 0); }
    100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); }
}
@keyframes alertGlow {
    0%, 100% { border-color: rgba(248, 81, 73, 0.25); }
    50% { border-color: rgba(248, 81, 73, 0.5); }
}

.dashboard-kpis {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 14px;
}
.metric-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 120px;
    padding: 18px;
}
.metric-card::before { opacity: 0.7; height: 2px; }
.metric-card .card-title { margin-bottom: 5px; font-size: 0.69rem; }
.metric-card .card-value { font-size: 1.62rem; line-height: 1.1; }
.metric-icon {
    width: 43px;
    height: 43px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--info-color);
    background: var(--info-glow);
    flex: 0 0 auto;
}
.metric-online .metric-icon { color: var(--accent-color); background: var(--accent-glow); }
.metric-offline .metric-icon { color: var(--danger-color); background: var(--danger-glow); }
.metric-caption { margin-top: 7px; color: var(--text-secondary); font-size: 0.67rem; line-height: 1.25; }

.dashboard-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.8fr);
    gap: 15px;
}
.dashboard-chart-card { min-height: 330px; padding: 20px 22px; }
.dashboard-chart-card:hover { transform: none; }
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.section-heading h2 { font-size: 1rem; margin-top: 5px; font-weight: 750; }
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.64rem;
    white-space: nowrap;
}
.live-badge { color: var(--accent-color); }
.live-badge span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent-color);
    animation: pulse-green 1.8s infinite;
}
.dashboard-chart-wrap { position: relative; height: 235px; margin-top: 18px; }

.health-chart-layout {
    height: 250px;
    display: grid;
    grid-template-columns: minmax(150px, 1fr);
    align-items: center;
    justify-items: center;
    gap: 10px;
    margin-top: 4px;
}
.health-donut-wrap { width: 155px; height: 155px; position: relative; }
.health-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.health-center strong { font-size: 1.45rem; line-height: 1; }
.health-center span { font-size: 0.62rem; color: var(--text-secondary); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.6px; }
.health-legend { width: 100%; display: grid; gap: 7px; }
.health-legend > div {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.73rem;
}
.health-legend strong { color: var(--text-primary); font-size: 0.8rem; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-online { background: var(--accent-color); }
.legend-offline { background: var(--danger-color); }
.legend-paused { background: var(--warning-color); }

.table-section { display: flex; flex-direction: column; gap: 10px; }
.table-heading { align-items: flex-end; }
.table-status-note { color: var(--text-secondary); font-size: 0.69rem; }
.table-status-note i { color: var(--accent-color); margin-right: 5px; }
.dashboard-table { overflow: auto; }
.dashboard-table table { min-width: 920px; }
.dashboard-table th { padding-top: 12px; padding-bottom: 12px; font-size: 0.67rem; }
.dashboard-table td { padding-top: 13px; padding-bottom: 13px; font-size: 0.8rem; }
.endpoint-name { display: flex; align-items: center; gap: 9px; }
.endpoint-type-icon {
    width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center;
    background: var(--info-glow); color: var(--info-color); font-size: 0.73rem;
}
.target-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.73rem;
}
.status-stack { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.status-led { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 5px; background: currentColor; }
.action-group { display: flex; gap: 5px; }
.btn-icon-wide { padding-left: 9px; padding-right: 9px; }
.endpoint-row-down td { background: rgba(248, 81, 73, 0.025); }
.endpoint-row-down:hover td { background: rgba(248, 81, 73, 0.05); }
.endpoint-row-down td:first-child { box-shadow: inset 2px 0 0 var(--danger-color); }

@media (max-width: 1250px) {
    .dashboard-kpis { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
    .dashboard-chart-grid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); }
}

@media (max-width: 980px) {
    .dashboard-kpis { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .dashboard-chart-grid { grid-template-columns: 1fr; }
    .health-chart-layout { grid-template-columns: 170px minmax(180px, 1fr); height: 210px; justify-items: stretch; }
    .health-donut-wrap { justify-self: center; }
}

@media (max-width: 768px) {
    .dashboard-topbar { flex-direction: column; gap: 14px; }
    .dashboard-topbar .topbar-actions { width: 100%; justify-content: flex-end; }
    .critical-banner { align-items: flex-start; }
    .critical-pulse { display: none; }
    .dashboard-kpis { grid-template-columns: 1fr 1fr; }
    .metric-card { min-height: 105px; }
}

@media (max-width: 520px) {
    .dashboard-kpis { grid-template-columns: 1fr; }
    .health-chart-layout { grid-template-columns: 1fr; height: 260px; }
    .dashboard-chart-wrap { height: 210px; }
    .live-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
}
