:root {
    color-scheme: light;
    font-family: "Inter", "Segoe UI", sans-serif;
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #1b1f2a;
    --muted: #6b7280;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --border: #e5e7eb;
    --pill: #eef2ff;
    --success: #16a34a;
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

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

.sidebar {
    background: #0f172a;
    color: #e2e8f0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand h1 {
    margin: 0;
    font-size: 20px;
}

.brand p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
}

main {
    padding: 32px 40px 64px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar h2 {
    margin: 0;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    gap: 12px;
}

button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background: var(--primary-dark);
}

button.secondary {
    background: #e2e8f0;
    color: #0f172a;
}

button.secondary:hover {
    background: #cbd5e1;
}

button.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

button.ghost:hover {
    background: var(--bg);
}

.grid {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

.grid.two-columns {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.card h3,
.card h4 {
    margin-top: 0;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.metrics .label {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

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

.module {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.module-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.pill {
    background: var(--pill);
    color: #4338ca;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.module-body {
    display: grid;
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 6px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.form-grid textarea {
    min-height: 140px;
    font-family: "Fira Mono", monospace;
}

.form-grid .checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-actions button {
    width: fit-content;
}

.results-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
}

.results-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.results-panel li {
    padding: 6px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.results-panel li:last-child {
    border-bottom: none;
}

.results-panel pre {
    margin: 0;
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
}

.full-width {
    grid-column: 1 / -1;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

th,
 td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.status.success {
    background: #dcfce7;
    color: var(--success);
}

.status.warning {
    background: #fef3c7;
    color: var(--warning);
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 12px;
    border-radius: 10px;
}

.checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.error {
    color: #b91c1c;
    font-weight: 600;
}

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

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
    }

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