/* --- GLOBAL THEME --- */
:root {
    --sidebar-bg: #0f172a;
    --content-bg: #f8fafc;
    --accent: #2563eb;
    --text-main: #1e293b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --healthy: #10b981;
    --warning: #f59e0b;
    --critical: #ef4444;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    color: var(--text-main);
}

/* --- SIDEBAR NAVIGATION --- */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding-top: 20px;
}

.sidebar h2 {
    font-size: 0.9rem;
    padding: 0 25px;
    margin-bottom: 25px;
    color: #38bdf8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar a {
    padding: 14px 25px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.sidebar a:hover, .sidebar a.active {
    background: #1e293b;
    color: white;
    border-left-color: var(--accent);
}

/* --- MAIN CONTENT AREA --- */
.content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    background: var(--content-bg);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 { font-size: 1.8rem; margin: 0; font-weight: 700; }

.btn-refresh {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-refresh:hover { opacity: 0.9; }

/* --- KPI CARDS & STATES --- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kpi-card.healthy { border-top: 6px solid var(--healthy); }
.kpi-card.critical { border-top: 6px solid var(--critical); background-color: #fff1f2; }

.kpi-val {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 10px;
    color: var(--text-main);
}

/* --- DBA TIPS BOX --- */
.dba-tips {
    background: #fffbeb;
    border-left: 6px solid #f59e0b;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- TABLE STYLING --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

th {
    background: #f1f5f9;
    text-align: left;
    padding: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

/* --- THRESHOLD COLOR CLASSES --- */
.text-critical { color: var(--critical); font-weight: bold; }
.text-warning { color: var(--warning); font-weight: bold; }
.text-healthy { color: var(--healthy); font-weight: bold; }

/* --- SPECIAL UTILITIES --- */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
}
.badge-red { background: var(--critical); }
.badge-orange { background: var(--warning); }
.badge-green { background: var(--healthy); }

.sql-box {
    font-family: 'Consolas', 'Monaco', monospace;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    display: block;
    max-width: 450px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}