/* =========================================================
   Cluster Desk — attendance for CBSE basketball clusters.
   Chrome reads like a scorer's table: dark board on top,
   bright paper below, numbers set big and condensed.
   ========================================================= */

:root {
  --ink:      #0F141B;
  --deck:     #171F2A;
  --deck-3:   #263141;
  --paper:    #E8EDF1;
  --card:     #FFFFFF;
  --rule:     #D2DAE2;
  --text:     #1B2430;
  --muted:    #5C6B7C;
  --ball:     #E2601A;
  --present:  #17795A;
  --absent:   #C0392B;
  --pending:  #6C7A89;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", var(--sans);
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow: 0 1px 0 rgba(16, 26, 38, .04), 0 6px 20px -12px rgba(16, 26, 38, .35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 15px/1.5 var(--sans);
}

a { color: #17557E; }
a:hover { color: var(--ball); }

:focus-visible {
  outline: 3px solid var(--ball);
  outline-offset: 2px;
}

/* ---------- scorer's table header ---------- */

.deck {
  background: var(--deck);
  background-image: linear-gradient(180deg, #1B2431 0%, #141C26 100%);
  color: #E9EEF3;
  border-bottom: 3px solid var(--ball);
  position: sticky;
  top: 0;
  z-index: 30;
}

.deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ball);
  position: relative;
  flex: none;
}
/* the seams */
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(15, 20, 27, .75);
}
.brand-mark::before { border-left-color: transparent; border-right-color: transparent; }
.brand-mark::after  { border-top-color: transparent;  border-bottom-color: transparent; }

.brand-text strong {
  display: block;
  font-family: var(--cond);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
}
.brand-text small {
  display: block;
  color: #93A3B4;
  font-size: 11.5px;
  letter-spacing: .04em;
  margin-top: 3px;
}

.marker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #93A3B4;
}
.marker label {
  font-family: var(--cond);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.marker input {
  background: #0D1219;
  border: 1px solid #33404F;
  color: #E9EEF3;
  border-radius: 3px;
  padding: 6px 9px;
  width: 150px;
  font: 500 13px var(--sans);
}
.marker button {
  background: #33404F;
  border: 0;
  color: #E9EEF3;
  border-radius: 3px;
  padding: 7px 11px;
  font: 600 12px var(--sans);
  cursor: pointer;
}
.marker button:hover { background: var(--ball); }

/* ---------- category tabs ---------- */

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 20px;
  max-width: 1280px;
  margin: 0 auto;
  scrollbar-width: thin;
}

.tab {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 16px 10px;
  color: #9EADBC;
  text-decoration: none;
  background: rgba(255, 255, 255, .04);
  border-radius: 4px 4px 0 0;
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.tab:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.tab-age    { font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.tab-gender { font-size: 14px; font-weight: 500; }
.tab-home   { font-size: 15px; font-weight: 600; align-items: center; }
.tab.is-on {
  color: var(--ink);
  background: var(--ball);
  border-bottom-color: var(--ball);
}

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

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 56px;
}

.page-title {
  font-family: var(--cond);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.lede { color: var(--muted); margin: 0 0 18px; max-width: 62ch; }

.eyebrow {
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}

.panel {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.panel-pad { padding: 20px; }
.panel + .panel { margin-top: 18px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

.team-mark { margin-left: auto; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- the board: signature scoreboard strip ---------- */

.board {
  background: var(--deck);
  color: #fff;
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  align-items: stretch;
  gap: 26px;
  flex-wrap: wrap;
  border: 1px solid #0B1017;
}

.board-id { min-width: 190px; }
.board-id .label {
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  color: #8FA0B2;
}
.board-id .value {
  font-family: var(--cond);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: .01em;
}

.board-figures { display: flex; gap: 22px; flex-wrap: wrap; }

.figure { min-width: 84px; }
.figure .n {
  font-family: var(--cond);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  display: block;
}
.figure .k {
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11.5px;
  color: #8FA0B2;
  display: block;
  margin-top: 4px;
}
.figure.present .n { color: #34D399; }
.figure.absent  .n { color: #FB8177; }
.figure.pending .n { color: #B6C2CF; }

.board-bar { flex: 1 1 220px; align-self: center; min-width: 200px; }
.segbar {
  display: flex;
  gap: 2px;
  height: 16px;
  margin-bottom: 7px;
}
.segbar i {
  flex: 1;
  background: #2C3847;
  border-radius: 1px;
}
.segbar i.on { background: var(--ball); }
.board-bar .cap {
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 12px;
  color: #8FA0B2;
}

/* ---------- dashboard cards ---------- */

.grid-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.catcard {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px 14px;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--ball);
}
.catcard:hover { border-color: var(--ball); }
.catcard h2 {
  font-family: var(--cond);
  font-size: 27px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 2px;
}
.catcard .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.catcard .nums { display: flex; gap: 18px; }
.catcard .nums .n {
  font-family: var(--cond);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.catcard .nums .k {
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
  color: var(--muted);
}
.catcard .track {
  height: 6px;
  background: #DDE4EA;
  border-radius: 3px;
  margin-top: 14px;
  overflow: hidden;
}
.catcard .track span { display: block; height: 100%; background: var(--present); }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; min-width: 0; max-width: 100%; }

table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.list th {
  text-align: left;
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 2px solid var(--rule);
  white-space: nowrap;
}
table.list td {
  padding: 11px 12px;
  border-bottom: 1px solid #EAEFF3;
  vertical-align: top;
}
table.list tbody tr:hover { background: #F6F9FB; }
table.list tr.row-present td:first-child { box-shadow: inset 3px 0 0 var(--present); }
table.list tr.row-absent  td:first-child { box-shadow: inset 3px 0 0 var(--absent); }
table.list td:first-child { min-width: 300px; }
table.list a.strong-name { color: var(--text); text-decoration: none; }
table.list a.strong-name:hover { color: var(--ball); text-decoration: underline; }
.num { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.strong-name { font-weight: 600; }
.sub-line { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.count-cell { font-family: var(--cond); font-size: 22px; font-weight: 700; }

/* ---------- pills, buttons ---------- */

.pill {
  display: inline-block;
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 3px;
  white-space: nowrap;
}
.is-present { background: #DCF2E9; color: var(--present); }
.is-absent  { background: #FBE3E1; color: var(--absent); }
.is-pending { background: #E7ECF1; color: var(--pending); }

.btn {
  display: inline-block;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--text);
  border-radius: 4px;
  padding: 7px 12px;
  font: 600 13px var(--sans);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { border-color: #9FB0C0; color: var(--text); }
.btn-primary { background: var(--ball); border-color: var(--ball); color: #fff; }
.btn-primary:hover { background: #C9520F; border-color: #C9520F; color: #fff; }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.btn-present.is-on { background: var(--present); border-color: var(--present); color: #fff; }
.btn-absent.is-on  { background: var(--absent);  border-color: var(--absent);  color: #fff; }
.btn-present:hover { border-color: var(--present); color: var(--present); }
.btn-absent:hover  { border-color: var(--absent);  color: var(--absent); }
.btn-present.is-on:hover, .btn-absent.is-on:hover { color: #fff; }

.btn-group { display: inline-flex; gap: 4px; }

/* ---------- filters ---------- */

.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.filters input[type="search"],
.filters input[type="text"],
.filters select {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 7px 10px;
  font: 400 14px var(--sans);
  background: #fff;
  color: var(--text);
}
.filters input[type="search"] { min-width: 230px; flex: 1 1 230px; }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 12px;
  font: 600 12.5px var(--sans);
  text-decoration: none;
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}
.chip:hover { border-color: #9FB0C0; color: var(--text); }
.chip.is-on { background: var(--deck); border-color: var(--deck); color: #fff; }

/* ---------- notes ---------- */

.note-edit { padding: 0 12px 14px; }
.note-edit textarea {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 9px 11px;
  font: 400 14px/1.45 var(--sans);
  resize: vertical;
  min-height: 62px;
  background: #FBFCFD;
}
.note-shown {
  margin-top: 6px;
  font-size: 13px;
  color: #4A5A6B;
  background: #FFF6EE;
  border-left: 3px solid var(--ball);
  padding: 6px 9px;
  border-radius: 0 3px 3px 0;
}

.notelog { list-style: none; margin: 0; padding: 0; }
.notelog li {
  padding: 12px 0;
  border-bottom: 1px solid #EAEFF3;
}
.notelog li:last-child { border-bottom: 0; }
.notelog .meta {
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 3px;
}
.notelog p { margin: 0; white-space: pre-wrap; }

/* ---------- misc ---------- */

.notice {
  border-radius: 5px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid;
}
.notice-good { background: #E4F5EE; border-color: #B4E0CE; color: #10604A; }
.notice-bad  { background: #FBE7E4; border-color: #F0BFB9; color: #8E271C; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; font-family: var(--cond); font-size: 22px; text-transform: uppercase; color: var(--text); margin-bottom: 4px; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 20px;
  margin-top: 4px;
}
.meta-grid dt {
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11.5px;
  color: var(--muted);
}
.meta-grid dd { margin: 2px 0 0; font-size: 14px; word-break: break-word; }

.pager { display: flex; gap: 8px; align-items: center; padding: 14px 16px; flex-wrap: wrap; }
.pager .status { color: var(--muted); font-size: 13px; }

.foot {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 34px;
  color: var(--muted);
  font-size: 12.5px;
}
.foot-sep { margin: 0 6px; }

code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #E7ECF1;
  padding: 1px 5px;
  border-radius: 3px;
}

@media (max-width: 620px) {
  .board { gap: 14px; padding: 14px; }
  .figure { min-width: 70px; }
  .figure .n, .board-id .value { font-size: 30px; }
  .marker input { width: 112px; }
  .brand-text strong { font-size: 20px; }
  .tab { padding: 7px 11px 8px; }
  .tab-age { font-size: 17px; }
  table.list td, table.list th { padding: 9px 8px; }
  table.list td:first-child { min-width: 165px; }
  .btn-sm { padding: 6px 8px; font-size: 11.5px; }
  /* the coloured row edge and the button state already show status */
  .list-schools th:nth-child(3), .list-schools td:nth-child(3),
  .list-players th:nth-child(2), .list-players td:nth-child(2),
  .list-players th:nth-child(4), .list-players td:nth-child(4) { display: none; }
  .filters { padding: 12px; }
  .filters input[type="search"] { min-width: 0; }
  .split { gap: 14px; }
  .wrap { padding: 16px 12px 44px; }
  .deck-top { padding: 10px 12px; }
  .tabs { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .deck, .foot, .filters, .btn, .note-edit { display: none !important; }
  .panel { box-shadow: none; }
}
