:root {
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #d9e2ec;
    --panel: #ffffff;
    --bg: #f5f7fb;
    --nav: #102a43;
    --accent: #0f766e;
    --warn: #f59e0b;
    --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    background: var(--nav);
    color: #fff;
    padding: 22px 16px;
    flex: 0 0 250px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand span {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--accent);
    font-weight: 800;
}
.sidebar nav { display: grid; gap: 6px; }
.sidebar a {
    color: #dbeafe;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
}
.sidebar a:hover { background: rgba(255,255,255,.1); color: #fff; }
.app-main { flex: 1; padding: 24px; min-width: 0; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.topbar h1 { margin: 0; font-size: 1.5rem; }
.topbar small { color: var(--muted); }
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}
.stat-card span { color: var(--muted); font-size: .9rem; }
.stat-card strong { display: block; margin-top: 8px; font-size: 1.5rem; }
.status-pill {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: capitalize;
}
.status-green { background: #dcfce7; color: #166534; }
.status-yellow { background: #fef3c7; color: #92400e; }
.status-red { background: #fee2e2; color: #991b1b; }
.status-gray { background: #e5e7eb; color: #374151; }
.table td, .table th { vertical-align: middle; }
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fb, #e0f2fe);
}
.login-box { width: min(430px, 100%); }

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 20;
    }
    .sidebar.open { transform: translateX(0); }
    .app-main { padding: 18px; }
}
