/* CricClue Admin. One stylesheet, no framework. Brand colours: assets/CricClue-Simple-Assets/colors.md */
:root {
  --ground: #f6f7f9;
  --surface: #ffffff;
  --active: #e9ebef;
  --border: #e4e6ea;
  --rule: #eff1f4;
  --control: #cfd3da;
  --text: #0b1840;          /* brand ink */
  --muted: #5a6275;
  --primary: #0a1a3f;       /* brand navy: the one filled button */
  --primary-hover: #1e3f8f; /* brand royal blue */
  --brand-green: #18a324;   /* brand Deep Green: 3.1:1 on the ground, so the wordmark stays large */
  --positive-bg: #dcfae5;  --positive-ink: #04250e;
  --negative: #c4242a;     --negative-bg: #ffedea;  --negative-ink: #831c1e;
  --warning-bg: #fffbeb;   --warning-ink: #92400e;
  --radius: 8px;  --radius-control: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--text); font: 14px/20px var(--font); }
a { color: var(--text); }
h1 { margin: 0 0 4px; font-size: 24px; line-height: 32px; font-weight: 650; letter-spacing: -0.01em; }
h2 { margin: 32px 0 12px; font-size: 16px; line-height: 24px; font-weight: 600; }
p { margin: 0 0 12px; }
.lead { color: var(--muted); margin-bottom: 24px; }
:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }

/* Wordmark: "Cric" in ink, "Clue" in green, as in the logo. */
.wordmark { font-weight: 900; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; }
.wordmark span { color: var(--brand-green); }
.wordmark small { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); }

/* Shell: labelled sidebar on the page ground, canvas beside it. */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; border-right: 1px solid var(--border); }
.nav .wordmark { padding: 0 10px 20px; }
.nav a, .nav button {
  display: block; width: 100%; padding: 6px 10px; border: 0; border-radius: var(--radius-control);
  background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--active); }
.nav a[aria-current="page"] { background: var(--active); font-weight: 600; }
.nav a.wordmark { padding: 0 10px 20px; font-weight: 900; font-size: 20px; }
.nav a.wordmark:hover { background: none; }
.nav .user { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.nav form { margin: 0; }
.canvas { min-width: 0; padding: 32px 40px 48px; max-width: 1200px; }

/* Panels and tables */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.table-frame { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 16px; font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.late { color: var(--negative); font-weight: 600; }
td.meta { color: var(--muted); }
td.action { text-align: right; width: 1%; white-space: nowrap; }
td form { margin: 0; }

/* Status pills: pale tint, dark text of the same hue. */
.pill { display: inline-block; flex: none; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--positive-bg); color: var(--positive-ink); }
.pill.warn { background: var(--warning-bg); color: var(--warning-ink); }
.pill.off { background: var(--active); color: var(--muted); }

/* Forms */
form.stack { display: grid; gap: 16px; max-width: 420px; }
label { display: grid; gap: 6px; font-weight: 500; }
input, select {
  height: 38px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 400;
}
input:focus, select:focus { border-color: var(--primary-hover); outline: 2px solid rgba(30, 63, 143, 0.2); outline-offset: 0; }
button, .button {
  height: 36px; padding: 0 16px; border: 1px solid var(--primary); border-radius: var(--radius-control);
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; justify-self: start;
}
button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.danger { height: 30px; padding: 0 12px; background: var(--surface); border-color: var(--control); color: var(--negative); font-weight: 500; }
button.danger:hover { background: var(--negative-bg); border-color: var(--negative); }
.notice { padding: 10px 14px; border-radius: var(--radius-control); background: var(--negative-bg); color: var(--negative-ink); }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
a.button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 24px; margin: 0 0 20px; padding: 0; list-style: none; font: 600 15px/22px ui-monospace, Consolas, monospace; }
.secret { display: inline-block; padding: 10px 14px; border-radius: var(--radius-control); background: var(--active); font: 600 16px/24px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }

/* Paging */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form, form.inline { margin: 0; }
form.inline { display: flex; align-items: end; gap: 8px; margin-bottom: 12px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
p.meta { color: var(--muted); margin-top: 8px; }
.notice[role="status"] { background: var(--active); color: var(--text); }
.pager { display: flex; justify-content: space-between; margin-top: 16px; }

/* Sign-in pages: one centred card, no nav. */
.signin { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.signin .panel { width: 100%; max-width: 400px; padding: 32px; }
.signin .wordmark { display: block; margin-bottom: 24px; font-size: 24px; }
.signin form.stack button { width: 100%; justify-self: stretch; }
.signin ol { margin: 0 0 16px; padding-left: 20px; }
.signin li { margin-bottom: 8px; }

/* Tablet and phone: the sidebar folds into a top bar. */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav a, .nav button { width: auto; min-height: 44px; display: inline-flex; align-items: center; }
  .nav a.wordmark { display: block; flex-basis: 100%; min-height: 0; padding: 0 0 8px; }
  th, td { padding-left: 10px; padding-right: 10px; }
  .nav .user { display: none; }
  .canvas { padding: 20px 16px 40px; }
  h1 { font-size: 22px; line-height: 28px; }
  .signin .panel { padding: 24px 20px; }
  .secret { font-size: 14px; padding: 8px 10px; }
}

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