:root {
  --ink: #14202b;
  --muted: #5c6b76;
  --line: #e4eaef;
  --paper: #f3f6f8;
  --card: #fff;
  --brand: #0c3a56;
  --brand-2: #145a82;
  --accent: #1f7a4d;
  --danger: #9b2c2c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 8px 24px rgba(16, 32, 48, .05);
  --tap: 44px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
}
a { color: var(--brand-2); }
.top {
  background: linear-gradient(180deg, #0e4668, var(--brand));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: .7rem 1rem calc(.55rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; letter-spacing: -.01em; }
.who { color: #b7d4e8; font-size: .8rem; }
.top nav {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: .65rem;
  padding-bottom: .15rem;
  scrollbar-width: none;
}
.top nav::-webkit-scrollbar { display: none; }
.top nav a {
  flex: 0 0 auto;
  color: #e7f3fb;
  text-decoration: none;
  font-size: .85rem;
  padding: .4rem .75rem;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.top nav a:hover, .top nav a.is-on { background: #fff; color: var(--brand); }
.wrap { max-width: 980px; margin: 0 auto; padding: 1rem 1rem 2.5rem; }
h1 { margin: .2rem 0 .85rem; font-size: 1.45rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .6rem; }
.lede { color: var(--muted); margin: -.4rem 0 1rem; font-size: .95rem; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: .5rem; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(20,32,43,.04);
}
.card span { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f7fafc; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
form.panel {
  background: var(--card);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 720px;
}
label { display: block; margin: .7rem 0 .3rem; font-size: .82rem; font-weight: 650; color: #33424d; }
input, select, textarea {
  width: 100%;
  padding: .65rem .7rem;
  border: 1px solid #c9d4dc;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9ec4de; border-color: var(--brand-2); }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  margin-top: .9rem;
  padding: .55rem 1.1rem;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 650;
}
button.secondary { background: #5c6d78; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-ok { background: #e7f6ec; color: #17693a; }
.flash-err { background: #fdecec; color: var(--danger); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.empty { color: var(--muted); background: var(--card); border-radius: var(--radius); padding: 1rem; }
.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; }
.login-card { width: min(420px, 100%); }
.login-card h1 { margin-bottom: .25rem; }
.hint { color: var(--muted); font-size: .85rem; }
@media (min-width: 800px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
  .wrap { padding: 1.5rem 1.25rem 3rem; }
  .top { padding-left: 1.25rem; padding-right: 1.25rem; }
}
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.3rem; }
}
