/* Admin. Ordinary screen sizes, not a television. */

:root {
  --green: #144733;
  --gold: #a19562;
  --ink: #23272a;
  --muted: #5f6a65;
  --line: #e2e5e3;
  --paper: #f7f7f5;
  --danger: #ba0d2e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 "Segoe UI", -apple-system, Helvetica, Arial, sans-serif;
}

a { color: var(--green); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 24px 72px; }

header.bar {
  background: var(--green);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header.bar a { color: rgba(255, 255, 255, 0.86); text-decoration: none; margin-left: 18px; }
header.bar a:hover { color: #fff; }
header.bar .brand { font-family: Georgia, serif; font-size: 19px; }
header.bar nav { display: flex; align-items: center; flex-wrap: wrap; }
header.bar .who {
  margin-left: 22px; padding-left: 18px; border-left: 1px solid rgba(255,255,255,0.3);
  color: #fff; font-size: 14px;
}
header.bar .signout { display: inline; margin: 0 0 0 14px; }
header.bar .signout button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: rgba(255,255,255,0.86); font: inherit;
}
header.bar .signout button:hover { color: #fff; text-decoration: underline; }

h1 { font-family: Georgia, serif; font-weight: 600; font-size: 28px; margin: 0 0 6px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--green); margin: 34px 0 12px; }
.lede { color: var(--muted); margin: 0 0 24px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.card.tight { padding: 12px 16px; }

.row { display: flex; align-items: center; gap: 14px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }

label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

input[type=text], input[type=date], input[type=password], input[type=file], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cfd4d1;
  border-radius: 7px;
  font: inherit;
  background: #fff;
}

input:focus, select:focus { outline: 2px solid rgba(20, 71, 51, 0.35); outline-offset: 1px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 7px;
  padding: 10px 16px;
  font: 600 14px/1 inherit;
  cursor: pointer;
  text-decoration: none;
}

.btn.ghost { background: #fff; color: var(--green); border: 1px solid #cfd4d1; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #edd0d6; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.notice { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.notice.good { background: #eaf4ef; border: 1px solid #c3ded0; color: #14503a; }
.notice.warn { background: #fdf6e6; border: 1px solid #ecdcb4; color: #6d5514; }
.notice.bad  { background: #fcecef; border: 1px solid #f0cdd5; color: #8d1029; }
.notice ul { margin: 8px 0 0 18px; padding: 0; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------ slot picker */

.slot {
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}

.slot.podium { border-left: 4px solid var(--gold); }

.slot-rank {
  font: 700 19px/1 Georgia, serif;
  color: var(--green);
  background: #eef3f0;
  border-radius: 8px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}

.picker { position: relative; }

.picker-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #cfd4d1;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
  max-height: 290px;
  overflow-y: auto;
  display: none;
}

.picker-results.open { display: block; }

.picker-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f2;
  width: 100%;
  text-align: left;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  font: inherit;
}

.picker-option:hover, .picker-option:focus { background: #f2f7f4; }
.picker-option:last-child { border-bottom: 0; }
.picker-option .who { font-weight: 600; }
.picker-option .where { font-size: 12.5px; color: var(--muted); }
.picker-option .inactive { color: var(--danger); font-size: 12px; font-weight: 600; }

.thumb {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; background: #e7e9e7; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font: 700 12px/1 Georgia, serif; color: var(--muted);
}

.chosen {
  display: flex; align-items: center; gap: 11px;
  background: #f2f7f4; border: 1px solid #cfe0d7;
  border-radius: 8px; padding: 8px 11px;
}

.chosen .who { font-weight: 600; }
.chosen .where { font-size: 12.5px; color: var(--muted); }
.chosen button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; }
.chosen button:hover { color: var(--danger); }

.suggest-line { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.suggest-line button {
  background: none; border: 0; color: var(--green); cursor: pointer;
  font: inherit; text-decoration: underline; padding: 0 2px;
}

/* ---------------------------------------------------------------- preview */

.preview-frame {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0e3324;
  position: relative;
}

.preview-scaler { transform-origin: top left; }

.pill {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; padding: 4px 9px; border-radius: 20px;
}
.pill.live { background: #eaf4ef; color: #14503a; }
.pill.draft { background: #f1f1ef; color: var(--muted); }
.pill.old { background: #fdf6e6; color: #6d5514; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --------------------------------------------------------------- calendar */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 4px; flex-wrap: wrap; }
.tabs a {
  padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a.on { color: var(--green); border-bottom-color: var(--green); }
.tabs a.attention .count { background: #fdf6e6; color: #6d5514; }
.tabs .count { font-size: 12px; background: #eef1ef; border-radius: 10px; padding: 2px 8px; margin-left: 4px; }

table.calendar td { vertical-align: top; }
table.calendar td.when { width: 92px; white-space: nowrap; }
table.calendar td.tags { width: 1%; white-space: nowrap; }
table.calendar td.tags .pill { margin-left: 4px; }
tr.holiday-row td { background: #faf6ea; color: #6d5514; font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
tr.cancelled td { opacity: 0.55; }
tr.cancelled a strong { text-decoration: line-through; }

.warnings { margin: 5px 0 0; padding: 0; list-style: none; }
.warnings li { font-size: 12.5px; color: #7a5a00; }
.warnings li::before { content: "! "; font-weight: 700; }

.catdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.board-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.board-preview-item { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.datechip-small {
  width: 44px; height: 44px; border-radius: 8px; background: var(--green); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.datechip-small b { font-size: 17px; }
.datechip-small span { font-size: 10px; letter-spacing: 1px; margin-top: 2px; }

.split.three { grid-template-columns: 2fr 1fr 1fr; }
label.inline { display: inline-flex; align-items: center; gap: 7px; margin-right: 16px; font-size: 14px; }
label.inline input { width: auto; }
fieldset.field { border: 0; padding: 0; margin: 0 0 12px; }
fieldset.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
label.move { display: flex; margin-top: 4px; color: var(--green); }
table.import select { min-width: 190px; }

.swatch { display: inline-block; margin-right: 6px; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: inline-block; width: 24px; height: 24px; border-radius: 50%; border: 3px solid transparent; }
.swatch input:checked + span { border-color: #23272a; }
.swatch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

details.inline-edit { display: inline-block; text-align: left; }
details.inline-edit > summary { list-style: none; }
details.inline-edit > summary::-webkit-details-marker { display: none; }
details.inline-edit[open] > form { position: absolute; right: 24px; z-index: 30; width: 380px; box-shadow: 0 12px 30px rgba(0,0,0,.14); }

/* ------------------------------------------------------------ attendance */

.figures { display: flex; gap: 22px; }
.figures div { text-align: right; }
.figures b { display: block; font-size: 24px; font-family: Georgia, serif; color: var(--green); line-height: 1.1; }
.figures span { font-size: 12px; color: var(--muted); }
table.attendance tr.unmatched td { background: #fffaf0; }
table.attendance .picker-input { max-width: 260px; }
table.attendance .match-form { min-width: 240px; }
button.linkish { background: none; border: 0; padding: 0 0 0 6px; color: var(--green); cursor: pointer; font: inherit; text-decoration: underline; }
ul.plain { list-style: none; padding: 0; margin: 10px 0 0; columns: 2; }
ul.plain li { padding: 2px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-grid .card { margin: 0; }
.stat-grid b { display: block; font-size: 26px; font-family: Georgia, serif; color: var(--green); }
.stat-grid span { font-size: 13px; color: var(--muted); }
form.range { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
form.range label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 820px) {
  /* Wide tables scroll inside their card rather than widening the page. */
  .card.tight, .table-scroll { overflow-x: auto; }
  .row { flex-wrap: wrap; }
  table.attendance .match-form { min-width: 200px; }
  .figures { gap: 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  ul.plain { columns: 1; }

  .board-preview { grid-template-columns: 1fr; }
  .split.three { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .slot { grid-template-columns: 44px 1fr; }
}
