/* ------------------------------------------------------------------
   Staff availability board
   Palette borrowed from a school answer sheet: cool ruled paper, navy
   ink, and one red correction-pen accent reserved for the "now" marker.
------------------------------------------------------------------- */

:root {
  --paper:      #E7ECF1;
  --card:       #FFFFFF;
  --ink:        #10192A;
  --ink-soft:   #5C6B80;
  --rule:       #C6D1DD;
  --rule-soft:  #DDE4EC;

  --free:       #0B6E52;
  --free-tint:  #DCF0E7;
  --free-edge:  #9AD3BE;

  --busy-tint:  #EDF1F6;

  --pen:        #D93A2B;

  --radius:     10px;
  --shadow:     0 1px 0 var(--rule), 0 1px 3px rgba(16, 25, 42, .06);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body:    "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  background-image: linear-gradient(var(--rule-soft) 1px, transparent 1px);
  background-size: 100% 34px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
}

.sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- masthead ---------- */

.masthead {
  background: var(--ink);
  color: #F4F7FA;
  border-bottom: 3px solid var(--pen);
}

.masthead-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 22px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8FA3BC;
}

.brand h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 4.4vw, 40px);
  font-stretch: 92%;
  letter-spacing: -.02em;
  line-height: 1.02;
  margin: 6px 0 4px;
}

.brand-sub {
  margin: 0;
  color: #A9BAD0;
  font-size: 14px;
}

.clock {
  text-align: right;
  margin-left: auto;
}

.clock time {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(24px, 5vw, 34px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.clock span {
  font-size: 12.5px;
  color: #8FA3BC;
}

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 60px;
}

/* ---------- bell ruler (signature element) ---------- */

.ruler-block { margin-bottom: 22px; padding-top: 12px; }

.ruler {
  position: relative;
  height: 62px;
  border-bottom: 2px solid var(--rule);
}

.bell {
  position: absolute;
  top: 0;
  height: 46px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: var(--ink-soft);
  transition: background .15s, color .15s, transform .15s;
}

.bell:hover { background: #F7FAFD; transform: translateY(-2px); }
.bell:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.bell-no {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.bell-time {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .01em;
  white-space: nowrap;
}

.bell.is-now,
.bell.is-shown {
  background: var(--ink);
  border-color: var(--ink);
  color: #B9C9DD;
}

.bell.is-now .bell-no,
.bell.is-shown .bell-no { color: #fff; }

.marker {
  position: absolute;
  top: -6px;
  bottom: -8px;
  width: 2px;
  background: var(--pen);
  transition: left .6s linear;
  pointer-events: none;
}

.marker::after {
  content: "";
  position: absolute;
  left: -3px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pen);
}

.marker-flag {
  position: absolute;
  top: -15px;
  left: 5px;
  background: var(--pen);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ---------- status line ---------- */

.status {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.status h2 {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 90%;
  font-size: clamp(20px, 3.2vw, 27px);
  letter-spacing: -.015em;
  margin: 0;
}

.status p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.live-btn {
  margin-left: auto;
  font: 600 13px var(--body);
  background: var(--pen);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 17px;
  cursor: pointer;
}

.live-btn:hover { filter: brightness(1.07); }
.live-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

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

.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.tab {
  font: 500 14px var(--body);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 8px 13px;
  color: var(--ink-soft);
  cursor: pointer;
}

.tab:hover { background: #DCE4EC; color: var(--ink); }
.tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.tab.is-on {
  background: var(--ink);
  color: #fff;
}

.search {
  margin-left: auto;
  font: 400 14px var(--body);
  padding: 9px 13px;
  min-width: 190px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
}

.search:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

/* ---------- board ---------- */

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.col-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
}

.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-free { background: var(--free); }
.dot-busy { background: var(--ink-soft); }

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-soft);
  border-radius: var(--radius);
  padding: 11px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card.is-free {
  border-left-color: var(--free);
  background: var(--free-tint);
  border-color: var(--free-edge);
}

.card .name {
  font-weight: 600;
  font-size: 15.5px;
}

.card .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  text-align: right;
}

.card.is-free .meta { color: #2C7B62; }

.card .tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--busy-tint);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 8px;
  color: var(--ink);
}

.empty {
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
}

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

.sheet {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

thead th {
  position: sticky;
  top: 0;
  background: #F2F6FA;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  z-index: 1;
}

.teacher-table thead th { text-align: center; }
.teacher-table thead th:first-child { text-align: left; }

.th-no {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}

.th-time {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  font-weight: 400;
}

tbody th {
  text-align: left;
  font-weight: 600;
  padding: 9px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--card);
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft);
  border-left: 1px solid var(--rule-soft);
  vertical-align: middle;
}

tbody tr:hover th,
tbody tr:hover td { background: #F7FAFD; }

.teacher-table td { text-align: center; min-width: 108px; }

.teacher-table td.free { background: var(--free-tint); }
.teacher-table tr:hover td.free { background: #CFEBDE; }

.teacher-table .subj {
  display: block;
  font-weight: 600;
  font-size: 13px;
}

.teacher-table .sect {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}

/* Current period: two red rails down the column instead of a box per cell */
tbody td.is-shown {
  box-shadow: inset 1px 0 0 var(--pen), inset -1px 0 0 var(--pen);
}

tbody tr:last-child td.is-shown {
  box-shadow: inset 1px 0 0 var(--pen), inset -1px 0 0 var(--pen), inset 0 -1px 0 var(--pen);
}

thead th.is-shown {
  background: var(--ink);
  color: #fff;
  box-shadow: inset 0 3px 0 var(--pen);
}

thead th.is-shown .th-time { color: #A9BAD0; }

.grid-table .pair {
  display: block;
  font-size: 13.5px;
}

.grid-table .pair b {
  font-weight: 600;
  margin-right: 4px;
}

.grid-table .nil {
  color: var(--ink-soft);
  text-align: center;
}

.legend {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 12px 2px 0;
}

.swatch {
  display: inline-block;
  width: 22px; height: 11px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  vertical-align: -1px;
}

.swatch-free { background: var(--free-tint); border-color: var(--free-edge); }
.swatch-busy { background: var(--card); }

.foot {
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.view[hidden] { display: none; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; gap: 22px; }
  .clock { text-align: left; margin-left: 0; }
  .tabs { flex-wrap: wrap; }
  .tab { flex: 1 1 0; text-align: center; padding: 9px 6px; }
  .search { margin-left: 0; flex: 1 0 100%; width: 100%; order: 9; }
  .bell-time { display: none; }
  .card { flex-direction: column; gap: 3px; }
  .card .meta { text-align: left; }
  .card .tag { margin-left: 0; }
}

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