:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #657084;
    --border: #dfe3ec;
    --primary: #1f5eff;
    --danger: #c62828;
    --success: #177245;
    --warning: #9a6500;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand a { color: var(--text); font-weight: 700; font-size: 1.05rem; }
nav { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
nav a { font-size: .92rem; color: var(--text); }
.container { width: min(1180px, calc(100% - 2rem)); margin: 1.25rem auto 3rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.15rem; box-shadow: 0 8px 24px rgba(20, 31, 54, .05); margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.login-card { width: min(420px, calc(100% - 2rem)); margin: 5rem auto; }
h1, h2, h3 { margin: 0 0 1rem; line-height: 1.2; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { color: var(--muted); line-height: 1.55; }
label { display: block; font-weight: 600; margin: .7rem 0 .3rem; }
input, select, textarea { width: 100%; padding: .72rem .78rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; font: inherit; }
input[type="checkbox"] { width: auto; }
textarea { min-height: 96px; resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 10px; padding: .74rem 1rem; font-weight: 700; cursor: pointer; background: var(--primary); color: #fff; margin-top: .8rem; }
.button.secondary, button.secondary { background: #edf1ff; color: var(--primary); }
.button.danger, button.danger { background: var(--danger); }
.button.success, button.success { background: var(--success); }
.button.warning, button.warning { background: var(--warning); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
th, td { padding: .72rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #f0f3f9; font-size: .86rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: .25rem .5rem; border-radius: 999px; font-size: .8rem; background: #edf1ff; color: var(--primary); font-weight: 700; }
.badge.success { background: #e8f5ee; color: var(--success); }
.badge.warning { background: #fff4dc; color: var(--warning); }
.badge.danger { background: #fdeaea; color: var(--danger); }
.alert { border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid var(--border); background: #fff; }
.alert-success { border-color: #bfe6cf; background: #ecfbf3; color: var(--success); }
.alert-error, .alert-danger { border-color: #f3b8b8; background: #fff0f0; color: var(--danger); }
.alert-warning { border-color: #f1d18f; background: #fff7e7; color: var(--warning); }
.muted { color: var(--muted); }
.kpi { font-size: 1.65rem; font-weight: 800; margin: .2rem 0; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }
.inline-form { display: inline; }
.codebox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f0f3f9; padding: .75rem; border-radius: 10px; overflow-x: auto; }
@media print {
    .topbar, .footer, .no-print, button, .button { display: none !important; }
    body { background: #fff; }
    .container { width: 100%; margin: 0; }
    .card { box-shadow: none; border: 0; }
}
