:root {
    --bg: #ffffff;
    --muted: #6b7280;
    --border: #e5e7eb;
    --card: #f8fafc;
    --primary: #111827;
    --primary-contrast: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: #111; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.title { margin: 0 0 8px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.mtop { margin-top: 8px; }
.mt { margin-top: 16px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.between { justify-content: space-between; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(17, 24, 39, 0.06);
}

.btn {
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 0 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.06s ease, box-shadow 0.2s ease;
    will-change: transform;
}
.btn:hover { background: #f3f4f6; }
.btn:active { transform: translateY(1px); }
.btn.primary {
    background: var(--primary);
    color: var(--primary-contrast);
    border-color: var(--primary);
}
.btn.primary:hover { filter: brightness(0.95); }
.btn.ghost { background: transparent; }
.btn.outline {
    background: #fff;
    color: #111827;
    border-color: #cbd5e1;
}
.btn.outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
.btn.lg { height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 600; }
.btn.pill { border-radius: 9999px; }

.form { width: 100%; max-width: 560px; display: grid; gap: 12px; }
.input {
    width: 100%; height: 42px; border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 12px; background: #fff; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus { outline: none; border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,0.2); }
.input.full { grid-column: 1 / -1; }
.label { display: grid; gap: 6px; font-size: 14px; color: #111; }

#sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; border-right: 1px solid var(--border); padding: 16px; background: #f6f7f9; }
#topbar { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--border); height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px; margin-left: 240px; z-index: 10; }
.content { margin-left: 240px; padding: 16px; }

.nav h2 { font-size: 14px; color: var(--muted); margin: 8px 0; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; color: #111; border: 1px solid transparent; }
.nav a.active, .nav a:hover { background: #eef2ff; border: 1px solid #e0e7ff; }

.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.list { display: grid; gap: 12px; }
.table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.trow { display: grid; grid-template-columns: 1fr 160px; }
.trow.thead { background: #f3f4f6; font-weight: 600; }
.trow > div { padding: 8px 10px; border-top: 1px solid var(--border); }
.kpi { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: 0.2px; }
.accordion details { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fff; }
.accordion summary { cursor: pointer; font-weight: 600; }

@media (max-width: 920px) {
    #sidebar { position: static; width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
    #topbar, .content { margin-left: 0; }
    .grid3 { grid-template-columns: 1fr; }
    .grid2 { grid-template-columns: 1fr; }
}
