:root {
  --bg: #0b1220;
  --panel: #111827;
  --card: #1e293b;
  --line: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #0284c7;
  --primary-2: #0ea5e9;
  --danger: #ef4444;
  --ok: #10b981;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #0c4a6e55, transparent),
              radial-gradient(900px 500px at 100% 0%, #0369a140, transparent),
              var(--bg);
  color: var(--text);
}

a { color: var(--primary-2); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.boot { padding: 48px; color: var(--muted); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 50px #0006;
}
.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
}
.brand span { color: var(--primary-2); }
.side .brand img { width: 34px; height: 34px; border-radius: 10px; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
input, select, textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid #0284c766;
  border-color: var(--primary);
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 700;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  width: 100%;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-danger { background: #7f1d1d; color: #fecaca; }
.btn-ok { background: #065f46; color: #a7f3d0; }
.btn-sm { padding: 7px 10px; font-size: 12px; width: auto; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.err { color: #fca5a5; font-size: 13px; margin: 8px 0 0; }
.ok { color: #6ee7b7; font-size: 13px; margin: 8px 0 0; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: #0a1628;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .brand { font-size: 22px; margin-bottom: 18px; }
.nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  font-weight: 600;
}
.nav button.active, .nav button:hover {
  background: #0c4a6e55;
  color: var(--text);
}
.main { padding: 24px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.top h1 { margin: 0; font-size: 22px; }
.muted { color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 18px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.stat b { display: block; font-size: 24px; margin-top: 4px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.form-grid .full { grid-column: 1 / -1; }
.actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #0c4a6e;
  color: #bae6fd;
}
.empty { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
}
