:root {
    --bg-main: #0b1220;
    --bg-surface: #111827;
    --bg-card: #1f2937;
    --border-main: #334155;
    --border-soft: rgba(255, 255, 255, 0.05);
    --text-primary: #e5e7eb;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --accent-blue: #38bdf8;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Inter", -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

/* Sidebar Refinement */
.sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-main);
    padding: 32px 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    font-family: "Space Grotesk", sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--accent-blue);
    letter-spacing: -0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 14px;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(56, 189, 248, 0.08);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.2);
}

/* Main Area */
.main {
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-main);
    background: rgba(11, 18, 32, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.status-strip {
    display: flex;
    gap: 16px;
    padding: 14px 32px;
    border-bottom: 1px solid var(--border-main);
    background: rgba(17, 24, 39, 0.4);
}

.pill {
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-main);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Content & Layout */
.content {
    padding: 32px;
}

.page-title {
    font-family: "Space Grotesk", sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-secondary);
    margin: 0 0 32px;
    font-size: 16px;
    max-width: 800px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
    border-color: #475569;
}

.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* Metrics & Typography */
.metric {
    font-family: "IBM Plex Mono", monospace;
    font-size: 32px;
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: -1px;
}

h2 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-main); }
td { padding: 16px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }

/* Buttons & Inputs */
.input {
    width: 100%;
    border: 1px solid var(--border-main);
    border-radius: var(--radius-md);
    background: #0f172a;
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.input:focus {
    outline: 0;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-primary { background: var(--accent-blue); color: #082032; }
.btn-primary:hover { background: #7dd3fc; transform: translateY(-1px); }

.btn-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); border: 1px solid var(--border-main); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: #475569; }

/* Utils */
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-yellow); }
.text-danger { color: var(--accent-red); }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .content, .topbar, .status-strip { padding-left: 20px; padding-right: 20px; }
    .grid { grid-template-columns: 1fr; }
    .col-4, .col-6, .col-8, .col-12 { grid-column: span 1; }
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}
.skeleton {
    background: #1e293b;
    background-image: linear-gradient(to right, #1e293b 0%, #334155 20%, #1e293b 40%, #1e293b 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    display: inline-block;
    position: relative;
    animation: shimmer 1.5s infinite linear;
}
