:root {
  --nav: #123574;
  --blue: #145bd7;
  --blue-dark: #0e47ad;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #17233b;
  --muted: #5e6b80;
  --line: #d9e2ef;
  --success: #16794b;
  --success-bg: #e8f7ef;
  --warning-bg: #fff8df;
  --warning-line: #ead58c;
  --danger: #a61b1b;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  padding: 12px 22px;
  background: var(--nav);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.brand { font-size: 22px; font-weight: 800; white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 14px; flex: 1; overflow-x: auto; scrollbar-width: thin; }
.topnav a { color: #fff; text-decoration: none; font-size: 14px; white-space: nowrap; opacity: .95; }
.topnav a:hover { text-decoration: underline; }
.logout-form { margin: 0; }
.link-button { border: 0; background: transparent; color: #fff; cursor: pointer; font-weight: 700; padding: 8px; }

.page-shell { width: min(1500px, calc(100% - 36px)); margin: 28px auto 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
h1 { margin: 0 0 8px; font-size: 32px; }
h2 { margin-top: 0; }
p { line-height: 1.5; color: var(--muted); }

.card, .stat-card, .login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(19, 42, 79, .05);
}
.card { padding: 22px; margin-bottom: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { padding: 20px; }
.stat-card strong { display: block; color: var(--blue); font-size: 34px; }
.stat-card span { color: var(--muted); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; }
.dot.ok { background: var(--success); }
.warning-card { background: var(--warning-bg); border-color: var(--warning-line); }

.status-badge { display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status-badge.success { color: var(--success); background: var(--success-bg); }
.status-badge.neutral { color: #42536f; background: #e9eef6; }

.login-wrap { min-height: calc(100vh - 150px); display: grid; place-items: center; }
.login-card { width: min(440px, 100%); padding: 28px; }
.login-card label { display: block; margin-top: 16px; font-weight: 700; }
.login-card input[type="text"], .login-card input[type="password"] { width: 100%; margin-top: 7px; padding: 12px; border: 1px solid #bdc9d9; border-radius: 9px; font-size: 16px; }
.login-card .remember { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.primary-button { width: 100%; margin-top: 18px; padding: 12px 15px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 800; cursor: pointer; }
.primary-button:hover { background: var(--blue-dark); }

.flash-stack { display: grid; gap: 10px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.flash.success { color: var(--success); background: var(--success-bg); }
.flash.error { color: var(--danger); background: #fdecec; border-color: #f4b7b7; }
.empty-state { text-align: center; padding: 50px 24px; }

@media (max-width: 1000px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; }
  .stats-grid, .check-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 650px) {
  .page-shell { width: min(100% - 20px, 1500px); margin-top: 18px; }
  .page-heading { flex-direction: column; }
  .stats-grid, .check-grid { grid-template-columns: 1fr; }
  h1 { font-size: 27px; }
}
