:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.row { display: grid; gap: 12px; }
.row.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.row.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.row.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .row.cols-2,.row.cols-3,.row.cols-4 { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn.sm { padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.stack { display: grid; gap: 16px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; justify-content: space-between; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow: auto; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; background: #eef2ff; color: #3730a3; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.off { background: #f3f4f6; color: #374151; }
.badge.warn { background: #fef3c7; color: #92400e; }
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #0f172a; color: #e5e7eb; padding: 18px 14px; }
.brand { font-weight: 800; font-size: 18px; margin-bottom: 18px; color: #fff; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: #fff; }
.login-brand { display: flex; justify-content: center; margin-bottom: 4px; }
.brand-logo-lg { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; }
.login-head { text-align: center; }
.nav a { display: block; padding: 10px 12px; border-radius: 10px; color: #cbd5e1; margin-bottom: 4px; }
.nav a.active, .nav a:hover { background: #1e293b; color: #fff; }
.main { padding: 20px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { position: sticky; top: 0; z-index: 2; } .nav { display: flex; flex-wrap: wrap; gap: 6px; } .nav a { margin: 0; } }
.alert { padding: 10px 12px; border-radius: 10px; background: #ecfeff; color: #155e75; border: 1px solid #cffafe; }
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fee2e2; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 420px; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
img.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
pre { white-space: pre-wrap; word-break: break-word; }
.small { font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.pagination { display: flex; gap: 8px; align-items: center; }
input[type="checkbox"] { width: auto; }
.grid-form { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-form .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .grid-form { grid-template-columns: 1fr; } }
