* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f3f5f9; color: #111827; }
button, input, select { border: 1px solid #d6dbe6; border-radius: 8px; padding: 9px 12px; font-size: 14px; }
button { cursor: pointer; }
button.primary { background: #2563eb; color: #fff; border: none; }
button.danger { background: #ef4444; color: #fff; border: none; }
pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px; min-height: 120px; overflow: auto; }

.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { width: 360px; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 20px; box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.auth-card h1 { margin: 0 0 8px; }
.auth-card label { display: block; margin-top: 10px; margin-bottom: 6px; font-size: 13px; color: #4b5563; }
.auth-card input, .auth-card button { width: 100%; }
.error { color: #ef4444; min-height: 20px; }
.muted { color: #6b7280; font-size: 13px; }

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #0b1220; color: #dbe4f3; padding: 16px; display: flex; flex-direction: column; }
.brand { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.menu { margin-top: 18px; display: grid; gap: 8px; }
.menu-item { text-align: left; background: transparent; color: #dbe4f3; border: 1px solid transparent; }
.menu-item.active { background: #1f2a44; border-color: #31456e; }
.sidebar-footer { margin-top: auto; }

.main { padding: 18px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.topbar h1 { margin: 0; font-size: 22px; }
.view { display: none; }
.view.active { display: block; }
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.panel-header { font-weight: 700; margin-bottom: 12px; }
.form-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.form-row label { color: #4b5563; font-size: 13px; }
.form-row .grow { flex: 1; min-width: 260px; }
.actions-row { margin-bottom: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; }
.stat-card span { color: #6b7280; font-size: 13px; }
.stat-card strong { display: block; font-size: 26px; margin-top: 4px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid #eef2f7; text-align: left; padding: 8px; white-space: nowrap; }
