/* ================================================================
   NADAC Championships — event/ pages, styled to match the NADAC
   Trial Secretary desktop app: flat theme, purple identity,
   green = good, amber = warning, red = problem. No gradients,
   no shadows — borders and solid fills only. Touch targets sized
   for ring-side tablets.
   ================================================================ */
:root {
  --purple: #534ab7;
  --purple-dark: #433ba0;
  --purple-soft: #ecebf7;
  --purple-softer: #f5f4fc;
  --green: #2e9e5b;
  --green-soft: #e6f4ec;
  --amber: #d99000;
  --amber-soft: #fbf1da;
  --red: #d64545;
  --red-soft: #fae9e9;
  --bg: #f4f4f8;
  --surface: #ffffff;
  --border: #e2e2ea;
  --border-strong: #cfcfdb;
  --text: #1d1d24;
  --text-muted: #6b6b78;
  --radius: 8px;
  --radius-sm: 6px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

header.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
header.bar h1 { font-size: 17px; margin-right: 8px; white-space: nowrap; color: var(--text); }
header.bar a.home {
  margin-left: auto; color: var(--purple-dark); background: var(--purple-soft);
  text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: var(--radius-sm);
}
header.bar select, header.bar input[type=search], header.bar input[type=text] {
  font-size: 15px; font-family: inherit; padding: 8px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
}
main { padding: 16px 14px; max-width: 1100px; margin: 0 auto; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
}
.card h2 { font-size: 15px; margin: 0 0 12px; }
.muted { color: var(--text-muted); font-size: 13px; }

button, .btn {
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--purple); color: #fff; cursor: pointer; touch-action: manipulation;
}
button:not(:disabled):hover, .btn:not(:disabled):hover { background: var(--purple-dark); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-green  { background: var(--green); }
.btn-green:not(:disabled):hover { background: #257f49; }
.btn-red    { background: var(--red); }
.btn-red:not(:disabled):hover { background: #bd3a3a; }
.btn-amber  { background: var(--amber); }
.btn-amber:not(:disabled):hover { background: #b87a00; }
.btn-ghost  { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:not(:disabled):hover { background: var(--bg); }
.btn-big    { font-size: 18px; padding: 14px 18px; width: 100%; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); padding: 6px 10px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.sel td { background: var(--purple-soft); }
table.list tr.break-row td { background: var(--purple-softer); font-style: italic; color: var(--text-muted); }
.tbl-wrap { overflow-x: auto; }

.pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; letter-spacing: .01em; white-space: nowrap;
}
.pill-open   { background: var(--green-soft); color: var(--green); }
.pill-taken  { background: var(--purple-softer); color: var(--text-muted); border: 1px solid var(--border); }
.pill-chute  { background: var(--amber-soft); color: var(--amber); }
.pill-absent { background: var(--red-soft); color: var(--red); }
.pill-ran    { background: var(--green-soft); color: var(--green); }

.grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .grid.cols2 { grid-template-columns: 1fr 1fr; } }

label.fld { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 10px 0 4px; }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; font-size: 15px; font-family: inherit; padding: 9px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft);
}
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row > * { flex: 1 1 140px; }
.row > .fit { flex: 0 0 auto; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 11px 20px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 99; max-width: 92vw;
}
#toast.show { opacity: .97; }
#toast.err { background: var(--red); }

/* Staff sign-in screen */
body.gate-body { display: grid; place-items: center; min-height: 100vh; }
.gate-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; width: min(380px, 92vw); text-align: center;
}
.gate-card h1 { font-size: 19px; margin: 0 0 6px; }
.gate-card p { color: var(--text-muted); font-size: 14px; }
.gate-card input { margin: 14px 0; text-align: center; }
.gate-card button { width: 100%; }
.gate-err { color: var(--red); font-weight: 600; }

/* Scoring fault pad */
.pad { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .pad { grid-template-columns: repeat(4, 1fr); } }
.pad button { font-size: 15px; padding: 13px 8px; line-height: 1.25; }
.pad button .pts { display: block; font-size: 12px; font-weight: 500; opacity: .85; }

/* Scoring sheet (full-screen focus while scoring one dog) */
.sheet-veil { position: fixed; inset: 0; z-index: 50; background: rgba(29,29,36,.5);
              display: none; overflow-y: auto; padding: 10px; }
.sheet-veil.open { display: block; }
.sheet { background: var(--bg); border: 1px solid var(--border-strong);
         border-radius: var(--radius); max-width: 720px; margin: 0 auto 24px; padding: 14px; }
.sheet-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.sheet-head h2 { margin: 0; font-size: 19px; flex: 1; }
.sheet-head .ord { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.time-big input { font-size: 30px; font-weight: 700; text-align: center; padding: 12px;
                  color: var(--purple-dark); }
.chips-line { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; align-items: center;
              background: var(--surface); border: 1px dashed var(--border-strong);
              border-radius: var(--radius-sm); padding: 8px; }
.chips-line .hint { color: var(--text-muted); font-size: 13px; padding-left: 4px; }
.fault-chip { display: inline-flex; align-items: center; gap: 7px;
              background: var(--red-soft); color: var(--red); border: 1px solid var(--red);
              border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.fault-chip .x { font-weight: 800; }
.fault-chip.bonus { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.sheet-total { display: flex; justify-content: space-between; align-items: center;
               font-size: 21px; font-weight: 700; margin: 12px 2px; }
.sheet-total .clean { color: var(--green); }
.btn-submit { width: 100%; font-size: 19px; padding: 15px; background: var(--green);
              border-radius: var(--radius-sm); }
.btn-submit:not(:disabled):hover { background: #257f49; }

/* "Up next" bar after a submit */
.nextbar { display: flex; align-items: center; gap: 12px;
           background: var(--purple-soft); border: 1px solid var(--purple);
           border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.nextbar b { font-size: 16px; color: var(--purple-dark); }
.nextbar .muted2 { color: var(--text-muted); font-size: 12px; font-weight: 600;
                   text-transform: uppercase; letter-spacing: .03em; }
.nextbar button { margin-left: auto; }

/* Hub menu */
.hub { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.hub a {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--text);
}
.hub a:hover { border-color: var(--purple); background: var(--purple-softer); }
.hub .emoji { font-size: 26px; display: block; margin-bottom: 8px; }
.hub b { font-size: 15px; font-weight: 600; }
.hub p { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; }
