:root {
  --bg: #eef2f7;
  --sidebar: #0f172a;
  --sidebar-border: #1e293b;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --border: #d7deea;
  --border-strong: #c0cad8;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #3759d7;
  --green: #16a34a;
  --yellow: #d97706;
  --red: #dc2626;
  --shadow: 0 8px 28px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  height: 100vh;
  overflow: auto;
  padding: 18px 14px;
  color: #e5e7eb;
  background: linear-gradient(180deg, #0b1220, #111b33);
  border-right: 1px solid var(--sidebar-border);
}
.brand {
  padding: 10px 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 14px;
}
.brand-kicker { font-size: 13px; color: #c7d2fe; font-weight: 700; }
.brand-title { margin-top: 6px; font-size: 28px; font-weight: 800; }
.brand-sub { margin-top: 6px; color: #94a3b8; font-size: 13px; line-height: 1.45; }
.menu { display: flex; flex-direction: column; gap: 10px; }
.menu-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  color: #e5e7eb;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .03);
  border-radius: 8px;
  transition: .18s ease;
}
.menu-item span { font-size: 16px; font-weight: 700; }
.menu-item small { color: #94a3b8; font-size: 12px; }
.menu-item:hover,
.menu-item.active {
  background: rgba(55, 89, 215, .18);
  border-color: rgba(96, 165, 250, .28);
}
.main-panel { min-height: 100vh; margin-left: 280px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 54px;
  padding: 8px 18px;
  background: #f9fbff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}
.topbar-group { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.inline-form { display: inline-flex; margin: 0; }
.inline-form button,
.control-form button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  color: #334155;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
}
.pill.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.pill.warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.pill.protect { background: #ffedd5; border-color: #fdba74; color: #9a3412; }
.container { max-width: 1780px; margin: 0 auto; padding: 14px 18px 24px; }
.hero-panel,
.summary-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.hero-panel h1 { margin: 0 0 6px; font-size: 22px; }
.hero-panel p { margin: 0; color: var(--muted); line-height: 1.5; }
.metric-strip { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.metric-item {
  min-width: 132px;
  padding: 10px 12px;
  background: #f8fbff;
  border: 1px solid #d6e4ff;
  border-radius: 8px;
}
.metric-item span { display: block; color: var(--muted); font-size: 12px; }
.metric-item strong { display: block; margin-top: 4px; font-size: 16px; }
.summary-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.summary-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-grid.four-up { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-panel { padding: 18px 20px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 18px; }
.summary-list,
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
}
.summary-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-list span { color: var(--muted); }
.feed-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.feed-item.ok { background: #f0fdf4; border-color: #bbf7d0; }
.feed-item.warn { background: #fff7ed; border-color: #fed7aa; }
.feed-item.danger { background: #fff1f1; border-color: #fecaca; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.pass { background: #dcfce7; color: #166534; }
.badge.review { background: #fef3c7; color: #92400e; }
.badge.block { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1d4ed8; }
.badge.subtle { background: #eef2f7; color: #475569; }
.notice {
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 700;
}
.control-form {
  display: grid;
  gap: 12px;
}
.control-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.control-form input,
.control-form select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.account-table th,
.account-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
}
.account-table th {
  color: var(--muted);
  background: #f8fafc;
}
.full-span { grid-column: 1 / -1; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login-shell { width: min(460px, 100%); }
.login-panel {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-panel h1 { margin: 6px 0 8px; }
.login-panel p { color: var(--muted); line-height: 1.5; }
.login-message {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f1;
  color: #991b1b;
}

@media (max-width: 1240px) {
  .sidebar { position: static; width: auto; height: auto; }
  .main-panel { margin-left: 0; }
  .summary-grid.two-up,
  .summary-grid.four-up { grid-template-columns: 1fr; }
  .hero-panel { flex-direction: column; }
  .topbar { justify-content: flex-start; }
}
