:root {
    --bg-color: #0d1117;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary: #22d3ee;
    --secondary: #a855f7;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 10%, rgba(34, 211, 238, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(168, 85, 247, 0.05) 0%, transparent 40%);
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 40px;
}

.sidebar ul {
    list-style: none;
    flex-grow: 1;
}

.sidebar li {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.sidebar li.active {
    background: var(--primary);
    color: #000;
    font-weight: 600;
}

.sidebar-footer {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
}

/* Main Content */
.content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 40px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
}

header p {
    color: var(--text-dim);
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.btn.primary {
    background: var(--primary);
    color: #000;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.purple {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.stat-icon.blue {
    background: rgba(34, 211, 238, 0.2);
    color: #22d3ee;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.stat-details h3 {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.stat-details p {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Health Status Panel */
.health-status-panel {
    padding: 24px;
    margin-bottom: 32px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.panel-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

#health-last-updated {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.health-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s;
}

.health-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.service-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
}

.status-indicator.operational { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-indicator.degraded { background: var(--warning); box-shadow: 0 0 10px var(--warning); }
.status-indicator.down { background: var(--error); box-shadow: 0 0 10px var(--error); }
.status-indicator.config { background: #64748b; }

.status-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.4;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.service-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.latency {
    color: var(--primary);
    font-family: monospace;
}

.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-box {
    padding: 24px;
    height: 450px;
    display: flex;
    flex-direction: column;
}

.chart-box h3 {
    margin-bottom: 20px;
}

.mini-logs {
    max-height: 400px;
    overflow-y: auto;
}

.log-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.log-item:last-child {
    border: none;
}

.status-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.status-tag.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-tag.error, .status-tag.failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.sidebar-environment {
    margin-top: 20px;
    padding: 0 16px;
}

#env-selector {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    padding: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
}

#env-selector:focus {
    border-color: var(--primary);
    color: var(--text-main);
}

/* Table */
.table-container {
    padding: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th {
    text-align: left;
    padding: 12px;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.empty-msg {
    text-align: center;
    color: var(--text-dim);
    padding: 20px;
}

/* User Actions */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.btn-icon.danger:hover {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}

.btn-icon.success:hover {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}