/* Tiju's Academy brand: Purply Blue carries structure, the four accents are marks only. */
:root {
  --navy: #2E2B70;
  --navy-deep: #232158;
  --yellow: #F3D011;
  --blue: #01A1E4;
  --green: #77DD77;
  --red: #FF0D00;
  --ink: #1B1935;
  --text: #3C3956;
  --muted: #75728C;
  --rule: #E3E1EE;
  --tint: #F5F4FA;
  --white: #FFFFFF;
  --error-text: #C00A00;
  --display: "Montserrat", "Gilroy", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--tint);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2 { font-family: var(--display); color: var(--navy); margin: 0; text-wrap: balance; }
p { margin: 0; }
code { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 0.9em; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.link { color: var(--navy); font-weight: 600; text-underline-offset: 3px; }
.link:hover { color: var(--blue); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- Four-dot motif: growing dots, yellow -> blue -> green -> red ---- */
.dots { display: inline-flex; align-items: center; gap: 0.26em; font-size: 10px; vertical-align: middle; }
.dots i { display: block; border-radius: 50%; }
.dots i:nth-child(1) { width: 0.32em; height: 0.32em; background: var(--yellow); }
.dots i:nth-child(2) { width: 0.44em; height: 0.44em; background: var(--blue); }
.dots i:nth-child(3) { width: 0.56em; height: 0.56em; background: var(--green); }
.dots i:nth-child(4) { width: 0.72em; height: 0.72em; background: var(--red); }
.dots--lg { font-size: 26px; }

/* ---- Logo card ---- */
.logo {
  display: inline-flex; flex-direction: column; gap: 0.12em;
  padding: 0.5em 0.72em 0.56em; border-radius: 0.42em;
  font-family: var(--display); font-size: 22px; line-height: 1;
}
.logo__name { font-weight: 800; letter-spacing: 0.02em; }
.logo__apos { color: var(--red); }
.logo__sub { display: flex; align-items: center; gap: 0.3em; font-size: 0.5em; font-weight: 600; letter-spacing: 0.02em; }
.logo__sub .dots { font-size: 1.15em; }
.logo--navy { background: var(--navy); color: var(--white); }
.logo--white { background: var(--white); color: var(--navy); }

/* ---- Shared pieces ---- */
.label, .kicker {
  font-family: var(--display); font-weight: 700; font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}

.notice {
  background: var(--white); border: 1px solid var(--rule); border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px;
}
.notice > * + * { margin-top: 6px; }
.notice .label { color: var(--navy); }
.notice--ok { border-left-color: var(--green); }
.notice--error { border-left-color: var(--red); }
.notice h2 { font-size: 1.5rem; letter-spacing: -0.02em; }

.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend {
  display: block; padding: 0; margin: 0 0 6px;
  font-weight: 600; color: var(--ink); font-size: 0.95rem;
}
.field input[type="text"], .field input[type="tel"], .field input[type="password"],
.filter input[type="search"], .filter select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; color: var(--ink); background: var(--white);
  border: 1.5px solid #B9B6CE; border-radius: var(--radius);
}
.field input:hover, .filter input:hover, .filter select:hover { border-color: var(--navy); }
.field input:focus-visible, .filter input:focus-visible, .filter select:focus-visible {
  border-color: var(--navy); outline: 3px solid rgba(1, 161, 228, 0.45); outline-offset: 0;
}
.field__hint { margin-top: 6px; font-size: 0.875rem; color: var(--muted); }
.field__error { margin-top: 6px; font-size: 0.9rem; font-weight: 600; color: var(--error-text); }
.field--error input[type="text"], .field--error input[type="tel"] { border-color: var(--red); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; min-height: 52px;
  font-family: var(--display); font-weight: 700; color: var(--navy);
  background: var(--white); border: 1.5px solid #B9B6CE; border-radius: var(--radius);
}
.choice:hover span { border-color: var(--navy); }
.choice input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.choice input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.field--error .choice span { border-color: var(--red); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; padding: 12px 22px;
  font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em;
  color: var(--white); background: var(--navy);
  border: 1.5px solid var(--navy); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.button--small { width: auto; min-height: 44px; padding: 8px 16px; font-size: 0.9rem; }
.button--outline { background: var(--white); color: var(--navy); }
.button--outline:hover { background: var(--tint); border-color: var(--navy); }
.button--ghost {
  width: auto; min-height: 40px; padding: 6px 14px; font-size: 0.85rem;
  background: transparent; border-color: rgba(255, 255, 255, 0.55);
}
.button--ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--white); }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Entry page ---- */
.hero { background: var(--navy); color: var(--white); }
.hero__inner { max-width: 520px; margin: 0 auto; padding: 28px 20px 72px; }
.kicker { color: var(--yellow); margin-top: 36px; }
.hero__title {
  color: var(--white); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02;
  font-size: clamp(2.5rem, 11vw, 4.25rem); margin: 10px 0 18px;
}
.hero__lede { margin-top: 18px; color: #CFCDE8; font-size: 1.05rem; max-width: 34ch; }

.panel__inner {
  max-width: 520px; margin: -44px auto 0; padding: 26px 20px 22px;
  background: var(--white); border-radius: 16px 16px 0 0; min-height: 50vh;
}
.panel__title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.panel__title + .dots { margin-bottom: 22px; display: flex; }
.panel form .button { margin-top: 6px; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--rule);
  font-size: 0.875rem; color: var(--muted);
}

@media (min-width: 900px) {
  .entry { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
  .hero { display: flex; align-items: center; }
  .hero__inner { padding: 56px 56px 56px 64px; max-width: 600px; margin: 0 0 0 auto; width: 100%; }
  .kicker { margin-top: 72px; }
  .panel { display: flex; align-items: center; background: var(--tint); }
  .panel__inner {
    width: 100%; max-width: 480px; margin: 40px auto 40px 64px; min-height: 0;
    padding: 36px 36px 26px; border-radius: 16px; border: 1px solid var(--rule);
  }
}

/* ---- Admin ---- */
.login { max-width: 400px; margin: 0 auto; padding: 56px 20px; }
.login__title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 28px 0 4px; }
.login__title + .dots { display: flex; margin-bottom: 24px; }

.bar { background: var(--navy); color: var(--white); }
.bar__inner, .wrap { max-width: 1100px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.bar__brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.bar__brand .logo { font-size: 15px; flex: none; }
.bar__title { display: none; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 0.95rem; }
@media (min-width: 560px) { .bar__title { display: inline-flex; } }

.wrap { padding-top: 24px; padding-bottom: 48px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
.stat { background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--yellow); border-radius: var(--radius); padding: 12px 14px; }
.stat:nth-child(2) { border-top-color: var(--blue); }
.stat:nth-child(3) { border-top-color: var(--green); }
.stat dt { font-family: var(--display); font-weight: 700; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat dd { margin: 4px 0 0; font-family: var(--display); font-weight: 800; font-size: 1.9rem; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }

.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 320px; }
.filter input[type="search"] { flex: 1 1 200px; width: auto; min-height: 44px; }
.filter select { flex: 0 0 auto; width: auto; min-height: 44px; }

.count { font-size: 0.875rem; color: var(--muted); margin-bottom: 8px; }
.empty { background: var(--white); border: 1px dashed #B9B6CE; border-radius: var(--radius); padding: 32px 20px; text-align: center; color: var(--muted); }

.tablewrap { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { padding: 11px 14px; text-align: left; vertical-align: middle; }
thead th {
  background: var(--navy); color: var(--white);
  font-family: var(--display); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
tbody tr + tr td { border-top: 1px solid var(--rule); }
tbody tr:hover td { background: var(--tint); }
td { color: var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); width: 1%; }
thead .num { color: var(--white); }
.nowrap { white-space: nowrap; }
.actions { text-align: right; width: 1%; }

.chip {
  display: inline-block; padding: 2px 10px 2px 8px; border-radius: 999px;
  border: 1px solid var(--rule); border-left: 4px solid var(--blue);
  font-size: 0.8rem; font-weight: 600; color: var(--ink); background: var(--white);
}
.chip--offline { border-left-color: var(--green); }

.textbutton {
  background: none; border: 0; padding: 8px 4px; font: inherit; font-size: 0.875rem; font-weight: 600;
  color: var(--error-text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.textbutton:hover { color: var(--red); }

@media (prefers-reduced-motion: no-preference) {
  .button, .choice span, .field input { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
}
