:root {
    --ink: #172033;
    --muted: #64748b;
    --line: #dbe3ef;
    --panel: #ffffff;
    --blue: #2563eb;
    --green: #0f766e;
    --amber: #b45309;
    --rose: #be123c;
}

* {
    letter-spacing: 0;
}

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

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

.sidebar {
    background: #111827;
    color: #e5e7eb;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 22px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-weight: 800;
}

.brand small,
.user-chip small,
.eyebrow {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.nav-list {
    display: grid;
    gap: 4px;
    margin-top: 18px;
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-radius: 8px;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
}

.nav-list a:hover,
.nav-list a.active {
    color: white;
    background: rgba(37, 99, 235, .28);
}

.main-panel {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: white;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    font-size: 24px;
    margin: 0;
    font-weight: 750;
}

.content-wrap {
    padding: 24px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}

.user-chip a {
    color: #475569;
}

.metric-card,
.module-card,
.table-panel,
.form-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.metric-card {
    padding: 18px;
}

.metric-card strong {
    font-size: 28px;
}

.metric-card i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: white;
}

.icon-blue { background: var(--blue); }
.icon-green { background: var(--green); }
.icon-amber { background: var(--amber); }
.icon-rose { background: var(--rose); }

.module-card {
    padding: 18px;
    height: 100%;
}

.badge-soft {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    background: #e0f2fe;
    color: #075985;
}

.table-panel,
.form-panel {
    padding: 18px;
}

.workflow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.workflow span {
    background: #f1f5f9;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.workflow i {
    color: var(--muted);
}

@media (max-width: 991px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        position: fixed;
        z-index: 20;
        width: 280px;
    }

    .sidebar.open {
        display: block;
    }

    .content-wrap,
    .topbar {
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
    }

    .user-chip {
        max-width: 180px;
    }
}
