:root {
  --bg: #F1F5F9; --surface: #fff; --ink: #0F172A; --ink-soft: #64748B;
  --line: #E2E8F0; --navy: #0F172A; --navy-mid: #1E293B;
  --good: #059669; --good-soft: #ECFDF5; --warn: #B45309; --warn-soft: #FFFBEB;
  --radius: 10px; --radius-md: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--ink);
  min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--navy); color: #fff; padding: 20px 14px;
  flex-shrink: 0; display: flex; flex-direction: column; gap: 4px;
}
.sidebar .brand { font-weight: 700; font-size: 1rem; margin-bottom: 20px; letter-spacing: -0.02em; }
.sidebar .brand span { display: block; font-size: 0.7rem; font-weight: 500; opacity: 0.6; margin-top: 2px; }
.sidebar button {
  font: inherit; font-size: 0.85rem; font-weight: 500; text-align: left;
  background: transparent; border: none; color: rgba(255,255,255,.75);
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.sidebar button:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar button.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.main { flex: 1; padding: 28px 28px 48px; max-width: 960px; }
h1 { font-size: 1.4rem; font-weight: 650; letter-spacing: -0.03em; margin-bottom: 6px; }
.sub { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 18px; margin-bottom: 14px;
}
.card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
label { display: block; font-size: 0.75rem; font-weight: 550; color: var(--ink-soft); margin-bottom: 5px; }
input, select, textarea {
  font: inherit; font-size: 0.9rem; padding: 10px 12px; width: 100%;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px rgba(15,23,42,.06);
}
.btn {
  font: inherit; font-size: 0.85rem; font-weight: 550; padding: 9px 14px;
  border-radius: 8px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-mid); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.pill {
  display: inline-block; font-size: 0.68rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: #F1F5F9; color: var(--navy);
}
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.max { background: #EEF2FF; color: #4338CA; }
.hint { font-size: 0.8rem; color: var(--ink-soft); }
.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--navy); color: #fff;
  padding: 12px 16px; border-radius: 999px; font-size: 0.85rem; opacity: 0;
  transform: translateY(12px); transition: .25s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }
.banner {
  background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF;
  padding: 12px 14px; border-radius: 10px; font-size: 0.85rem; margin-bottom: 18px;
}
.check-row {
  display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 8px;
}
.check-row label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem;
  color: var(--ink); font-weight: 500; cursor: pointer; margin: 0;
}
.check-row input { width: auto; margin: 0; }
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.login-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 28px; width: 100%; max-width: 340px;
}
.login-box h1 { margin-bottom: 4px; }
.login-box .sub { margin-bottom: 20px; }
.login-error { color: #DC2626; font-size: 0.82rem; margin: -4px 0 10px; min-height: 1em; }
.sidebar .logout-btn { margin-top: auto; color: rgba(255,255,255,.55); }
