/* GrownUp Portal -- and, via admin/admin.css, the Admin Portal too.
   Plain CSS, no build step -- same posture as web/provision.html. The people
   using this are tired parents on a phone at 9pm, so: big tap targets, high
   contrast, nothing that needs a second glance. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e3e6ea;
  --brand: #2f6df6;
  --brand-ink: #ffffff;
  --ok: #16a34a;
  --warn: #b45309;
  --danger: #dc2626;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1c1f25;
    --ink: #e9ecf1;
    --muted: #9aa3b0;
    --line: #2b2f37;
    --brand: #6d9bff;
    --brand-ink: #0d1017;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.hint { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.error { color: var(--danger); min-height: 1.4em; }
.ok { color: var(--ok); }

code {
  font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: 2px 6px;
  border-radius: 6px;
}
code.claim { font-size: 22px; letter-spacing: 2px; padding: 6px 12px; }

/* --- layout ------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
}
.logo { font-weight: 700; font-size: 18px; }

main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 80px; }

h2 { margin: 0 0 4px; font-size: 22px; }
h3 { margin: 0 0 12px; font-size: 16px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: baseline; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }

@media (max-width: 720px) {
  .cols { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
}

/* --- controls ----------------------------------------------------------- */

button {
  font: inherit;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 9px 14px;
  cursor: pointer;
  background: var(--line);
  color: var(--ink);
}
button.primary { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
button.secondary { background: transparent; border-color: var(--line); }
button.danger { background: var(--danger); color: #fff; }
button.link { background: none; border: none; color: var(--brand); padding: 6px 0; }
button:disabled { opacity: .5; cursor: default; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
}
label { display: block; font-weight: 600; font-size: 14px; }
label input, label select, label textarea { font-weight: 400; margin-top: 5px; }

/* Inputs default to full width, which is right inside a stacked <label> and
   wrong in an inline form row -- there they'd push the submit button onto its
   own line. Share the row instead. */
.row > input, .row > select { flex: 1 1 8em; width: auto; }

.tabs { display: flex; gap: 4px; }
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 12px;
  color: var(--muted);
}
.tab.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.tabs.small { margin: 16px 0; justify-content: center; }

/* --- auth --------------------------------------------------------------- */

.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; text-align: center; }
.auth-card form { text-align: left; }

/* --- yapyap cards ------------------------------------------------------- */

.yy {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.yy:hover { border-color: var(--brand); }
.yy h3 { margin-bottom: 2px; }
.yy .addr { font-size: 13px; color: var(--muted); }

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.pill.online { color: var(--ok); border-color: currentColor; }
.pill.pending { color: var(--warn); border-color: currentColor; }

/* --- lists -------------------------------------------------------------- */

.list { list-style: none; margin: 0 0 14px; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: none; }
.list .name { font-weight: 600; }
.list .sub { font-size: 13px; color: var(--muted); }
.list .grow { flex: 1; min-width: 0; }
.list.empty::after { content: "Nothing here yet."; color: var(--muted); font-size: 14px; }

/* --- hours grid --------------------------------------------------------- */

.hours {
  display: grid;
  grid-template-columns: 44px repeat(24, 1fr);
  gap: 2px;
  margin: 14px 0;
  user-select: none;
  overflow-x: auto;
}
.hours .lbl { font-size: 11px; color: var(--muted); align-self: center; }
.hours .hr {
  height: 26px;
  min-width: 12px;
  background: var(--line);
  border-radius: 3px;
  cursor: pointer;
}
.hours .hr.on { background: var(--ok); }
.hours .head { font-size: 10px; color: var(--muted); text-align: center; }

/* --- call log ----------------------------------------------------------- */

.log { width: 100%; border-collapse: collapse; background: var(--panel);
       border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.log th, .log td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.log th { font-size: 13px; color: var(--muted); font-weight: 600; }
.log tr:last-child td { border-bottom: none; }
.out-answered { color: var(--ok); }
.out-missed, .out-offline { color: var(--warn); }
.out-rejected-hours, .out-rejected-unknown-card,
.out-rejected-not-allowed, .out-rejected-self,
.out-failed { color: var(--danger); }

.danger-zone { display: flex; gap: 12px; align-items: center; }

/* --- feedback ----------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 999px;
  z-index: 20;
}

/* Styled in advance of anything using it: the card-enrollment dialog these
   rules were written for is gone (cards are mapped in the Admin Portal now),
   and the next modal shouldn't have to reinvent them. */
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 24px;
  max-width: 420px;
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }
