/*
 * Classivo application styles.
 *
 * Hand-written rather than Tailwind, deliberately. The marketing site has a
 * build step because it is a dozen pages of varied layout; the application is
 * a handful of dense screens used all day by the same people, and a stylesheet
 * with no build step means a fix is one file edit and a reload. It also keeps
 * the app deploy free of a Node/Tailwind dependency.
 *
 * The palette is lifted from the marketing site so the two look like one
 * product. Keep them in step by eye — there is no shared token file, and
 * inventing one for eleven colours would be more machinery than it saves.
 */

:root {
  --ink-950: #0d1117; --ink-900: #161b22; --ink-700: #384252;
  --ink-600: #4b5565; --ink-500: #697586; --ink-400: #8b95a5;
  --ink-300: #b3bcc9; --ink-200: #dfe3e8; --ink-100: #eef1f4;
  --surface:  #f7f9fb;
  --brand-800: #0f5132; --brand-700: #15724a; --brand-600: #1a8d5b;
  --brand-100: #d5f0e2; --brand-50:  #eefaf3;
  --amber-700: #92610a; --amber-100: #fdf0d0; --amber-50: #fefaf0;
  --red-700:   #a5251f; --red-100:   #fadedd; --red-50:   #fdf1f0;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgb(13 17 23 / .06), 0 1px 3px rgb(13 17 23 / .04);
  --shadow-lift: 0 4px 12px rgb(13 17 23 / .08), 0 2px 4px rgb(13 17 23 / .04);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink-900);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.375rem; }
h2 { font-size: 1.0625rem; }

/* --- Chrome -------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .75rem 1.25rem;
  background: #fff; border-bottom: 1px solid var(--ink-200);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; letter-spacing: -.02em; color: var(--ink-950); text-decoration: none; }
.brand span { color: var(--brand-600); }
.nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: .4rem .7rem; border-radius: 8px; text-decoration: none;
  color: var(--ink-600); font-weight: 500; font-size: .9rem;
}
.nav a:hover { background: var(--ink-100); color: var(--ink-900); }
.nav a[aria-current] { background: var(--brand-50); color: var(--brand-800); }
.topbar .who { font-size: .82rem; color: var(--ink-500); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.sub { color: var(--ink-500); font-size: .9rem; margin: .25rem 0 0; }

/* --- Banners ------------------------------------------------------------- */

.banner { padding: .7rem 1rem; font-size: .86rem; border-bottom: 1px solid; }
.banner-warn { background: var(--red-50); border-color: var(--red-100); color: var(--red-700); }
.banner-warn strong { font-weight: 700; }

.note { border-radius: var(--radius); padding: .8rem 1rem; font-size: .88rem; margin-bottom: 1rem; }
.note-ok   { background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); }
.note-warn { background: var(--amber-50); color: var(--amber-700); border: 1px solid var(--amber-100); }
.note-bad  { background: var(--red-50); color: var(--red-700); border: 1px solid var(--red-100); }

/* --- Cards, tables, forms ------------------------------------------------ */

.card { background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.pad { padding: 1.1rem 1.25rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); font-weight: 600; padding: .6rem 1rem; border-bottom: 1px solid var(--ink-200); }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--ink-100); font-size: .9rem; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface); }

label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-700); margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; padding: .55rem .7rem; font: inherit; font-size: .9rem;
  border: 1px solid var(--ink-200); border-radius: 9px; background: #fff; color: var(--ink-900);
}
input:focus, select:focus { outline: 2px solid var(--brand-600); outline-offset: -1px; border-color: transparent; }
.field { margin-bottom: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-800); }
.btn-ghost { background: #fff; border-color: var(--ink-200); color: var(--ink-700); }
.btn-ghost:hover { border-color: var(--ink-300); color: var(--ink-900); }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }

.tag { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.tag-in  { background: var(--brand-100); color: var(--brand-800); }
.tag-out { background: var(--ink-100);  color: var(--ink-500); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--ink-500); }

/* --- The live board ------------------------------------------------------ */

.board { display: grid; grid-template-columns: 1fr 22rem; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }

.person {
  background: #fff; border: 1px solid var(--ink-200); border-left: 3px solid var(--brand-600);
  border-radius: var(--radius); padding: .85rem .95rem; box-shadow: var(--shadow-card);
  display: flex; gap: .7rem; align-items: center;
  animation: pop .35s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }

.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-800);
  font-weight: 700; font-size: .82rem; letter-spacing: .02em;
}
.person .nm { font-weight: 600; font-size: .92rem; line-height: 1.25; }
.person .mt { color: var(--ink-400); font-size: .76rem; margin-top: .1rem; }

.feed { max-height: 70vh; overflow: auto; }
.ev { display: flex; gap: .65rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--ink-100); animation: pop .35s ease-out; }
.ev:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-in  { background: var(--brand-600); }
.dot-out { background: var(--ink-300); }
.ev .nm { font-size: .88rem; font-weight: 500; }
.ev .mt { font-size: .74rem; color: var(--ink-400); }
.ev time { margin-left: auto; font-size: .74rem; color: var(--ink-400); white-space: nowrap; }

.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-400); font-size: .9rem; }

.stat { display: flex; gap: 1.5rem; }
.stat b { display: block; font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink-950); }
.stat span { font-size: .76rem; color: var(--ink-400); text-transform: uppercase; letter-spacing: .05em; }

.live { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--ink-400); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-600); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* --- Check-In Station ---------------------------------------------------- */

.station { min-height: 100vh; display: grid; place-items: center; background: var(--ink-950); color: #fff; padding: 2rem 1rem; }
.station-inner { width: 100%; max-width: 34rem; text-align: center; }
.station h1 { font-size: 1.5rem; color: #fff; }
.station .sub { color: var(--ink-400); }
.scan-input {
  width: 100%; margin-top: 1.75rem; padding: 1.1rem 1.25rem; font-size: 1.05rem;
  text-align: center; border-radius: 14px; border: 2px solid rgb(255 255 255 / .12);
  background: rgb(255 255 255 / .05); color: #fff;
}
.scan-input::placeholder { color: var(--ink-500); }
.scan-input:focus { outline: none; border-color: var(--brand-600); }

.result { margin-top: 1.75rem; border-radius: 16px; padding: 1.75rem 1.5rem; animation: pop .3s ease-out; }
.result-in  { background: var(--brand-600); }
.result-out { background: #29323f; }
.result-bad { background: var(--red-700); }
.result .big { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.result .small { opacity: .85; font-size: .9rem; margin-top: .25rem; }
