/* AGTU admin page: the site's navy and red, the email template's grays. */
:root {
  --navy: #10407c;
  --red: #ec2023;
  --red-dark: #c81a1d;
  --ink: #0f172a;
  --muted: #475569;
  --line: #d2d2d7;
  --line-soft: #ececf0;
  --canvas: #f5f5f7;
  --white: #ffffff;
  --blue-soft: #eef4fc;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #a16207;
  --warn-soft: #fef6e0;
  --bad: #b91c1c;
  --bad-soft: #fce8e8;
  --focus: #9cc1f0;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 var(--font);
}

h1, h2 { margin: 0 0 8px; color: var(--navy); line-height: 1.25; }
h1 { font-size: 19px; }
h2 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; margin-bottom: 0; }
.logo { display: block; height: auto; }

/* Header */
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--white);
  border-top: 4px solid var(--navy);
  border-bottom: 1px solid var(--line);
}
.top__title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.top__title strong { color: var(--navy); }
.top__title span { color: var(--muted); font-size: 13px; }

/* Layout */
/* minmax(0, 1fr): a wide table scrolls inside its card instead of widening the page */
.wrap { max-width: 780px; margin: 24px auto 48px; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__head h1 { margin: 0; }

/* Status pill */
.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--blue-soft);
  color: var(--navy);
  white-space: nowrap;
}
.pill[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
.pill[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
.pill[data-tone="bad"] { background: var(--bad-soft); color: var(--bad); }

/* QR code */
.qr { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-top: 8px; }
.qr img {
  width: 260px;
  height: 260px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  image-rendering: pixelated;
}
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 10px; }
.steps li::marker { color: var(--navy); font-weight: 700; }

/* Connected number */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.facts div { background: var(--blue-soft); border-radius: 8px; padding: 10px 12px; }
.facts dt { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* Queue numbers */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 12px; }
.stats div { border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; }
.stats span {
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.stats small { color: var(--muted); }

/* Recent sends */
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
td { padding: 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
.result { font-weight: 700; }
.result[data-tone="ok"] { color: var(--ok); }
.result[data-tone="warn"] { color: var(--warn); }
.result[data-tone="bad"] { color: var(--bad); }

/* Buttons and fields */
.btn {
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn--primary { width: 100%; background: var(--red); color: var(--white); }
.btn--primary:hover { background: var(--red-dark); }
.btn--danger { background: var(--white); color: var(--bad); border-color: #f5c2c2; }
.btn--danger:hover { background: var(--bad-soft); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { background: var(--blue-soft); }
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

label { font-weight: 600; font-size: 14px; }
input[type="password"] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.alert {
  margin: 0 0 4px;
  padding: 10px 12px;
  background: var(--bad-soft);
  border: 1px solid #f5c2c2;
  border-radius: 8px;
  color: var(--bad);
}

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login__card { width: 100%; max-width: 380px; display: grid; gap: 10px; border-top: 4px solid var(--navy); }
.login__card .logo { margin: 4px auto 8px; }
.login__card h1, .login__card .muted { text-align: center; }
.login__card .muted { margin: -6px 0 6px; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; padding: 12px 16px; }
  .top__title span { display: none; }
  .qr { grid-template-columns: 1fr; justify-items: center; }
  .facts, .stats { grid-template-columns: 1fr; }
}
