/* YRT Workshop Hub: eGooroo portal design with YRT colours.
   Per-client theming is the three variables below plus the logo. */
:root {
  --brand-blue: #A03A26;   /* PRIMARY: YRT rust (name kept for template compatibility) */
  --brand-green: #30302E;  /* ACCENT: YRT charcoal, used for hover */
  --light-bg: #F7F3F1;     /* page background, warm tint of the primary */

  --brand-dark: #7E2C1C;
  --brand-tint: #F6E7E3;
  --ink: #2A2A28;
  --muted: #6E6A67;
  --line: #E7E0DC;
  --card: #fff;
  --ok: #0b6b3a;   --ok-bg: #e6f4ea;
  --warn: #856404; --warn-bg: #fff3cd;
  --bad: #b71c1c;  --bad-bg: #fdecea;
  --info: #1f5f99; --info-bg: #e7f0f8;
  --pie-filled: #1fbf75;
  --pie-free: #ef4444;
  --shadow: 0 8px 30px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--light-bg); color: var(--ink);
  font: 15px/1.5 Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand-blue); }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.01em; }

/* ---------- Top bar ---------- */
.eg-topbar {
  position: sticky; top: 0; z-index: 1030; height: 64px; background: var(--brand-blue); color: #fff;
  display: flex; align-items: center; gap: 1.25rem; padding: 0 1.25rem; box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.eg-brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; flex: none; }
.eg-brand:hover { color: #fff; }
.eg-brand img { height: 36px; }
.eg-title { font-weight: 700; font-size: 1.05rem; padding-left: .75rem; border-left: 1px solid rgba(255,255,255,.35); white-space: nowrap; }
.eg-nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.eg-nav::-webkit-scrollbar { display: none; }
.eg-nav a {
  color: rgba(255,255,255,.88); text-decoration: none; padding: .45rem .75rem; border-radius: 50px; white-space: nowrap;
  font-weight: 600; font-size: .9rem; display: flex; gap: .4rem; align-items: center; transition: background .2s;
}
.eg-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.eg-nav a.active { background: #fff; color: var(--brand-blue); }
.eg-user { display: flex; align-items: center; gap: .55rem; flex: none; }
.eg-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.eg-user-name { line-height: 1.1; font-weight: 600; font-size: .88rem; }
.eg-user-name small { display: block; opacity: .75; font-weight: 500; font-size: .75rem; }
.eg-switch { color: #fff; opacity: .85; font-size: 1.1rem; padding: .25rem .4rem; border-radius: 8px; }
.eg-switch:hover { color: #fff; opacity: 1; background: rgba(255,255,255,.14); }
@media (max-width: 1100px) { .eg-nav a span { display: none; } .eg-nav a { padding: .5rem .65rem; font-size: 1.05rem; } }
@media (max-width: 640px) {
  .eg-topbar { gap: .6rem; padding: 0 .75rem; }
  .eg-title, .eg-user-name { display: none; }
  .eg-brand img { height: 30px; }
}

.demo-ribbon {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--brand-green); color: #f1ece9;
  font-size: .82rem; padding: .4rem 1.25rem;
}
.demo-ribbon i { color: #f3a46b; }
.ribbon-btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 50px; padding: .15rem .7rem; font-size: .8rem; }
.ribbon-btn:hover { background: rgba(255,255,255,.12); }

.eg-main { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.eg-footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 1rem; }

/* ---------- Sheets, headings, toolbars ---------- */
.eg-sheet { background: var(--card); border-radius: 1rem; box-shadow: var(--shadow); padding: 1.25rem 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; color: var(--ink); }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.sheet-title { color: var(--brand-blue); font-size: 1.15rem; margin: 0 0 .75rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: 1rem; }
.toolbar .grow { flex: 1; }
.tb-group { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.tb-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.pill-btn {
  border: 0; border-radius: 50px; padding: .5rem 1.1rem; font-weight: 600; background: var(--brand-blue); color: #fff;
  transition: all .2s; display: inline-flex; gap: .4rem; align-items: center; text-decoration: none; font-size: .9rem; white-space: nowrap;
}
.pill-btn:hover:not(:disabled) { background: var(--brand-green); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 15px rgba(0,0,0,.1); }
.pill-btn:disabled { opacity: .45; cursor: not-allowed; }
.pill-btn.secondary { background: #fff; color: var(--brand-blue); box-shadow: inset 0 0 0 2px var(--brand-blue); }
.pill-btn.secondary:hover:not(:disabled) { background: var(--brand-tint); color: var(--brand-dark); }
.pill-btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.pill-btn.ghost:hover:not(:disabled) { background: #f3efed; color: var(--ink); box-shadow: inset 0 0 0 1px #d6ccc6; }
.pill-btn.sm { padding: .3rem .75rem; font-size: .82rem; }
.icon-btn { border: 0; background: #f3efed; color: var(--ink); width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; }
.icon-btn:hover { background: #e9e2de; }

/* Filter chips */
.chip-filter {
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 50px; padding: .3rem .8rem;
  font-weight: 600; font-size: .84rem; display: inline-flex; align-items: center; gap: .4rem; transition: all .15s; white-space: nowrap;
}
.chip-filter:hover { border-color: #cbbfb8; }
.chip-filter.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-filter .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #999); }
.chip-filter.on .dot { box-shadow: 0 0 0 2px #fff; }

.eg-select { border: 1px solid var(--line); border-radius: 50px; padding: .35rem 2rem .35rem .85rem; font-weight: 600; font-size: .86rem; background-color: #fff; }

/* Segmented control */
.seg { display: inline-flex; background: #f1ece9; border-radius: 50px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 50px; padding: .3rem .85rem; font-weight: 600; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Big switch (fill rates) */
.big-switch { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; cursor: pointer; user-select: none; padding: .25rem .85rem .25rem .3rem; border-radius: 50px; background: #f1ece9; }
.big-switch input { display: none; }
.big-switch .track { width: 44px; height: 26px; border-radius: 50px; background: #cfc6c1; position: relative; transition: .2s; }
.big-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.big-switch input:checked + .track { background: var(--pie-filled); }
.big-switch input:checked + .track::after { transform: translateX(18px); }
.big-switch .mini-pie { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--pie-filled) 0 70%, var(--pie-free) 0); }

/* Status chips */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 50px; font-size: .76rem; font-weight: 700; white-space: nowrap; line-height: 1.5; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.muted { background: #f3f4f6; color: #555; }
.chip.brand { background: var(--brand-tint); color: var(--brand-dark); }

/* Summary tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem .8rem 1.15rem; }
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tile-colour, #bbb); }
.tile[data-status=green] { --tile-colour: #1fbf75; }
.tile[data-status=red] { --tile-colour: #ef4444; }
.tile[data-status=amber] { --tile-colour: #f59e0b; background: #fffaf0; }
.tile[data-status=brand] { --tile-colour: var(--brand-blue); }
.tile-name { font-size: .8rem; font-weight: 600; color: var(--muted); }
.tile-value { font-size: 1.7rem; font-weight: 800; line-height: 1.2; }
.tile-caption { font-size: .75rem; color: var(--muted); }

/* ---------- Calendar: month (bars) ---------- */
.cal-nav { display: flex; align-items: center; gap: .5rem; }
.cal-nav h2 { font-size: 1.35rem; margin: 0 .35rem; min-width: 190px; text-align: center; }
@media (max-width: 640px) {
  .cal-nav { flex-wrap: wrap; }
  .cal-nav h2 { min-width: 0; font-size: 1.15rem; }
  .tile-value { font-size: 1.4rem; }
  .eg-sheet { padding: 1rem .85rem 1.15rem; }
  .page-head h1 { font-size: 1.35rem; }
}
.cal { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: #faf7f5; border-bottom: 1px solid var(--line); }
.cal-head div { padding: .45rem .6rem; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal-week { position: relative; min-height: 118px; border-bottom: 1px solid var(--line); }
.cal-week:last-child { border-bottom: 0; }
.cal-days { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { border-right: 1px solid #f0ebe8; padding: .3rem .45rem; }
.cal-day:last-child { border-right: 0; }
.cal-day .num { font-size: .82rem; font-weight: 700; color: var(--muted); display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50px; padding: 0 .3rem; }
.cal-day.other { background: #fcfbfa; }
.cal-day.other .num { color: #c3bbb6; }
.cal-day.weekend { background: #fbf8f6; }
.cal-day.today .num { background: var(--brand-blue); color: #fff; }
.cal-events { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-flow: row dense; row-gap: 3px; padding: 32px 0 8px; pointer-events: none; }
.cal-ev {
  pointer-events: auto; margin: 0 4px; border-radius: 6px; padding: 2px 6px 2px 7px; font-size: .76rem; line-height: 1.35;
  background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 4px solid var(--c); color: var(--ink);
  display: flex; align-items: center; gap: 5px; cursor: pointer; min-width: 0; text-align: left; border-top: 0; border-right: 0; border-bottom: 0;
  transition: transform .1s, box-shadow .1s;
}
.cal-ev:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.cal-ev .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.cal-ev .t small { font-weight: 500; color: var(--muted); }
.cal-ev .who { flex: none; font-size: .66rem; font-weight: 800; background: rgba(0,0,0,.08); border-radius: 50px; padding: 0 .35rem; }
.cal-ev .who.tbc { background: #fdecea; color: var(--bad); }
.cal-ev .fill { flex: none; font-size: .68rem; font-weight: 700; color: var(--muted); }
.cal-ev.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-ev.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.cal-ev.past { opacity: .6; }
.cal-more { pointer-events: auto; margin: 0 6px; font-size: .72rem; font-weight: 700; color: var(--muted); background: none; border: 0; text-align: left; }
@media (max-width: 760px) {
  .cal-ev .t small, .cal-ev .fill { display: none; }
  .cal-ev { font-size: .68rem; padding: 1px 4px; margin: 0 2px; }
  .cal-head div { padding: .35rem .3rem; font-size: .65rem; }
}

/* ---------- Calendar: fill-rate grid (TAA huddle style) ---------- */
.fill-grid { border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: #fff; }
.fill-grid table { width: 100%; border-collapse: collapse; min-width: 760px; }
.fill-grid th { background: #faf7f5; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: .5rem; text-align: left; border-bottom: 1px solid var(--line); }
.fill-grid td { border: 1px solid #f0ebe8; vertical-align: top; padding: .5rem; width: 16%; }
.fill-grid td.wk { width: 34px; padding: .5rem .25rem; background: #fcfaf9; }
.week-label { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; color: var(--muted); font-size: .75rem; white-space: nowrap; margin: auto; }
.fill-grid .daynum { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: .35rem; }
.fill-grid td.today .daynum span { background: var(--brand-blue); color: #fff; border-radius: 50px; padding: .05rem .45rem; }
.fill-grid td.other { background: #fcfbfa; }
.chart-box {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 10px; padding: .55rem .5rem .5rem;
  margin-bottom: .5rem; text-align: center; cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.chart-box:hover { box-shadow: 0 6px 16px rgba(0,0,0,.1); transform: translateY(-1px); }
.chart-box h4 { margin: 0; font-size: .8rem; line-height: 1.25; }
.chart-box p { margin: .1rem 0 .35rem; font-size: .7rem; color: var(--muted); line-height: 1.3; }
.chart-box .pie-wrap { width: 100%; max-width: 84px; margin: 0 auto; position: relative; }
.chart-box .fill-line { margin-top: .3rem; font-size: .74rem; font-weight: 700; display: flex; justify-content: center; gap: .35rem; align-items: center; flex-wrap: wrap; }
.fill-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.band-full { background: #0b8f4d; } .band-good { background: #1fbf75; } .band-fair { background: #f59e0b; } .band-low { background: #ef4444; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* List view */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { position: sticky; top: 0; z-index: 1; background: var(--brand-blue); color: #fff; text-align: left; padding: .6rem .75rem; white-space: nowrap; font-weight: 600; }
.data-table td { padding: .55rem .75rem; border-bottom: 1px solid #f1ece9; vertical-align: middle; }
.data-table tbody tr:nth-child(even) td { background: #fdfbfa; }
.data-table tbody tr:hover td { background: #faf1ee; }
.data-table tr.clickable { cursor: pointer; }
.course-tag { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; }
.course-tag::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.minibar { width: 90px; height: 8px; border-radius: 8px; background: #f3d6d3; overflow: hidden; display: inline-block; vertical-align: middle; }
.minibar i { display: block; height: 100%; background: var(--pie-filled); }
.cpie { width: 26px; height: 26px; border-radius: 50%; display: inline-block; vertical-align: middle; background: conic-gradient(var(--pie-filled) 0 calc(var(--p) * 1%), var(--pie-free) 0); flex: none; }

/* ---------- Modal ---------- */
.modal-content { border: 0; border-radius: 1rem; overflow: hidden; }
.modal-header.brand { background: var(--c, var(--brand-blue)); color: #fff; border: 0; }
.modal-header.brand .btn-close { filter: invert(1); opacity: .9; }
.modal-backdrop.show { opacity: .4; }
.ws-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem 1rem; margin-bottom: 1rem; }
.ws-meta div small { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ws-meta div { font-weight: 600; }
.trainer-opt { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .4rem; }
.trainer-opt.available { border-color: #bfe5cd; background: #f5fbf7; }
.trainer-opt.current { box-shadow: inset 0 0 0 2px var(--brand-blue); }
.trainer-opt .why { font-size: .78rem; color: var(--muted); }
.trainer-opt .grow { flex: 1; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: .75rem; color: #fff; background: var(--c, #888); flex: none; }

/* ---------- Availability matrix ---------- */
.matrix-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.matrix th, .matrix td { border-bottom: 1px solid #f1ece9; border-right: 1px solid #f1ece9; }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: #faf7f5; padding: .35rem .2rem; text-align: center; min-width: 46px; font-weight: 700; color: var(--muted); }
.matrix thead th.wkend { background: #f3eeeb; }
.matrix thead th.today { background: var(--brand-blue); color: #fff; }
.matrix thead th .dow { display: block; font-size: .66rem; text-transform: uppercase; }
.matrix thead th .dnum { display: block; font-size: .9rem; color: var(--ink); }
.matrix thead th.today .dnum { color: #fff; }
.matrix thead th.month-start { border-left: 2px solid #d9cfc9; }
.matrix th.who { position: sticky; left: 0; z-index: 3; background: #fff; text-align: left; padding: .4rem .7rem; min-width: 210px; }
.matrix thead th.who { z-index: 4; background: #faf7f5; }
.matrix td { padding: 2px; height: 46px; text-align: center; }
.matrix td.wkend { background: #faf7f5; }
.mcell { height: 100%; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; line-height: 1.1; font-size: .7rem; cursor: default; }
.mcell.free { background: #eaf7ef; color: #2e8b57; }
.mcell.free::after { content: "✓"; font-size: .8rem; }
.mcell.off { background: repeating-linear-gradient(135deg, #fde3e1 0 6px, #fbd2ce 6px 12px); color: var(--bad); }
.mcell.job { background: var(--c); color: #fff; cursor: pointer; }
.mcell.job small { font-weight: 600; opacity: .9; font-size: .62rem; }
.mcell.clash { background: var(--c); color: #fff; box-shadow: inset 0 0 0 3px #b71c1c; cursor: pointer; position: relative; }
.mcell.clash::before { content: "!"; position: absolute; top: -5px; right: -4px; background: #b71c1c; color: #fff; width: 15px; height: 15px; border-radius: 50%; font-size: .65rem; display: grid; place-items: center; }
.mcell.na { background: transparent; color: #c9c0bb; font-weight: 400; }
.who-name { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.who-sub { font-size: .72rem; color: var(--muted); font-weight: 500; }
.needs-list .item { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; margin-bottom: .6rem; background: #fff; }
.needs-list .item .grow { flex: 1; min-width: 0; }
.opt-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.opt-chip { border: 1px solid var(--line); border-radius: 50px; padding: .2rem .6rem .2rem .25rem; font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; background: #fff; }
.opt-chip .avatar { width: 22px; height: 22px; font-size: .6rem; }
.opt-chip.available { border-color: #9fd8b5; background: #f2fbf5; }
.opt-chip.unavailable, .opt-chip.busy { opacity: .7; }
.opt-chip button { border: 0; background: var(--brand-blue); color: #fff; border-radius: 50px; font-size: .72rem; font-weight: 700; padding: .05rem .55rem; margin-left: .15rem; }
.opt-chip button:hover { background: var(--brand-green); }

/* ---------- Trainer's own calendar ---------- */
.my-cal { user-select: none; -webkit-user-select: none; }
.my-cal .cal-day { cursor: pointer; transition: background .15s; }
.my-cal .cal-day:hover { background: #fbf3f0; }
.my-cal .cal-day.off { background: repeating-linear-gradient(135deg, #fdecea 0 8px, #fbe0dc 8px 16px); }
.my-cal .cal-day.off .reason { display: block; font-size: .68rem; font-weight: 700; color: var(--bad); margin-top: 2px; }
.my-cal .cal-day.past { cursor: default; background: #fcfbfa; }
.my-cal .cal-day.past .num { color: #c3bbb6; }
.my-cal .cal-day.selected { box-shadow: inset 0 0 0 2px var(--brand-blue); }
.my-cal .cal-week { min-height: 96px; }
.upcoming .u-item { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid #f1ece9; align-items: center; }
.upcoming .u-item:last-child { border-bottom: 0; }
.u-date { width: 52px; flex: none; text-align: center; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, #fff); border-top: 4px solid var(--c); padding: .25rem 0; }
.u-date b { display: block; font-size: 1.25rem; line-height: 1.1; }
.u-date small { font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.off-list li { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px dashed #eee5e1; }

/* ---------- Daily overview ---------- */
.day-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.day-nav h2 { margin: 0 .25rem; font-size: 1.35rem; }
.day-strip { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.day-strip a { flex: none; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: .3rem .55rem; text-align: center; min-width: 54px; background: #fff; }
.day-strip a small { display: block; font-size: .66rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.day-strip a b { font-size: 1rem; }
.day-strip a i { display: block; font-style: normal; font-size: .62rem; color: var(--muted); }
.day-strip a.on { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.day-strip a.on small, .day-strip a.on i { color: rgba(255,255,255,.85); }
.day-strip a.none { opacity: .45; }

.ws-card { background: #fff; border-radius: 1rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; overflow: hidden; border-top: 6px solid var(--c); }
.ws-card-head { padding: 1rem 1.25rem .75rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.ws-card-head h3 { font-size: 1.2rem; margin: 0; }
.ws-card-head .sub { color: var(--muted); font-size: .88rem; margin-top: .15rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.ws-card-head .sub i { color: var(--c); }
.ws-stats { display: flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.ws-stat { background: #faf7f5; border-radius: 10px; padding: .3rem .7rem; text-align: center; min-width: 74px; }
.ws-stat b { display: block; font-size: 1.15rem; line-height: 1.2; }
.ws-stat small { font-size: .68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.ws-stat.alert { background: var(--warn-bg); } .ws-stat.alert b { color: var(--warn); }
.briefing { margin: 0 1.25rem 1rem; background: #fff8ec; border: 1px solid #f5dfb4; border-radius: 12px; padding: .75rem 1rem; font-size: .9rem; }
.briefing h4 { font-size: .9rem; margin: 0 0 .35rem; color: #8a5a00; display: flex; gap: .4rem; align-items: center; }
.briefing ul { margin: 0; padding-left: 1.1rem; }
.ws-tools { display: flex; gap: .5rem; padding: 0 1.25rem .75rem; flex-wrap: wrap; align-items: center; }

.att-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.att-table th { background: #faf7f5; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: .5rem .75rem; text-align: left; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.att-table td { padding: .6rem .75rem; border-bottom: 1px solid #f1ece9; vertical-align: top; }
.att-table tr.flagged td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.att-table tr.absent td { background: #fff7f6; }
.learner { font-weight: 700; }
.learner small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.issue { display: flex; gap: .35rem; align-items: flex-start; font-size: .82rem; margin-bottom: .2rem; }
.issue i { color: #d97706; margin-top: .1rem; }
.llnd-row { display: flex; gap: .25rem; flex-wrap: wrap; }
.llnd-pill { font-size: .68rem; font-weight: 800; border-radius: 6px; padding: .1rem .35rem; letter-spacing: .02em; cursor: help; }
.llnd-pill.ok { background: var(--ok-bg); color: var(--ok); }
.llnd-pill.some { background: var(--warn-bg); color: var(--warn); }
.llnd-pill.needs { background: var(--bad-bg); color: var(--bad); }
.tips-row td { background: #fffbf3 !important; padding-top: 0; }
.tips { border-left: 3px solid #f59e0b; padding: .5rem .85rem; margin: 0 0 .25rem; font-size: .86rem; }
.tips p { margin: 0 0 .25rem; }
.tips ul { margin: 0; padding-left: 1.1rem; }
.tips li { margin-bottom: .15rem; }
.tips-toggle { border: 0; background: none; color: #a16207; font-weight: 700; font-size: .78rem; padding: 0; margin-top: .25rem; }

/* Attendance buttons */
.att-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 50px; overflow: hidden; background: #fff; }
.att-seg button { border: 0; background: transparent; padding: .35rem .65rem; font-size: .8rem; font-weight: 700; color: var(--muted); min-width: 44px; min-height: 36px; }
.att-seg button + button { border-left: 1px solid var(--line); }
.att-seg button.on[data-v=present] { background: #1fbf75; color: #fff; }
.att-seg button.on[data-v=late] { background: #f59e0b; color: #fff; }
.att-seg button.on[data-v=absent] { background: #ef4444; color: #fff; }
.att-meta { display: block; font-size: .68rem; color: var(--muted); margin-top: .2rem; }

/* ID sighted toggle */
.id-toggle { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; user-select: none; font-weight: 700; font-size: .8rem; color: var(--muted); }
.id-toggle input { display: none; }
.id-toggle .track { width: 46px; height: 26px; border-radius: 50px; background: #e5e7eb; box-shadow: inset 0 0 0 1px #cbd5e1; position: relative; transition: .2s; flex: none; }
.id-toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.id-toggle input:checked + .track { background: #a7f3d0; box-shadow: inset 0 0 0 1px #10b981; }
.id-toggle input:checked + .track::after { transform: translateX(20px); }
.id-toggle input:checked ~ .lbl { color: var(--ok); }

@media (max-width: 860px) {
  .att-table thead { display: none; }
  .att-table, .att-table tbody, .att-table tr, .att-table td { display: block; width: 100%; }
  .att-table tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .att-table tr[data-e] { display: grid; grid-template-columns: 1fr 1fr; }
  .att-table tr[data-e] td[data-label="Learner"], .att-table tr[data-e] td[data-label="Told us"] { grid-column: 1 / -1; }
  .att-table td.no-issues { display: none; }
  .att-seg button { padding: .35rem .5rem; min-width: 40px; }
  .att-table td { border: 0; padding: .3rem 1rem; }
  .att-table td[data-label]::before { content: attr(data-label); display: block; font-size: .66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .att-table tr.flagged td:first-child { box-shadow: none; }
  .att-table tr.flagged { box-shadow: inset 4px 0 0 #f59e0b; }
  .tips-row { padding-top: 0 !important; }
  .ws-stats { margin-left: 0; }
}

/* ---------- Outbox ---------- */
.sms-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .9rem; }
.sms-card { border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem; background: #fff; display: flex; flex-direction: column; gap: .5rem; }
.sms-card .to { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--muted); }
.sms-card .to b { color: var(--ink); }
.bubble { background: #e9e9eb; border-radius: 18px 18px 18px 4px; padding: .6rem .85rem; font-size: .88rem; line-height: 1.4; word-break: break-word; }
.bubble a { word-break: break-all; }
.sms-card .actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; }
.eg-toast { background: var(--ink); color: #fff; border-radius: 12px; padding: .65rem 1rem; font-size: .88rem; font-weight: 600; display: flex; gap: .55rem; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); transform: translateY(12px); opacity: 0; transition: .25s; max-width: 380px; }
.eg-toast.show { transform: none; opacity: 1; }
.eg-toast.ok i { color: #5ee0a0; } .eg-toast.warn i { color: #fbbf24; } .eg-toast.bad i { color: #f87171; }

/* ---------- Portal home (sign-in) ---------- */
body.portal { background: var(--light-bg); }
.portal-hero { background: var(--brand-blue); padding: 2rem 1rem 5.5rem; text-align: center; color: #fff; position: relative; overflow: hidden; }
.portal-hero::after { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 120%; background: radial-gradient(closest-side, rgba(255,255,255,.12), transparent); pointer-events: none; }
.portal-hero img { max-height: 66px; max-width: 80%; }
.portal-hero h1 { font-size: 1.5rem; margin: 1rem 0 0; }
.portal-hero p { margin: .25rem 0 0; opacity: .9; }
.portal-card { width: 100%; max-width: 620px; margin: -4rem auto 1.5rem; background: #fff; border-radius: 1rem; box-shadow: 0 8px 30px rgba(0,0,0,.1); overflow: hidden; animation: egFade .6s ease; position: relative; z-index: 1; }
.portal-card-body { padding: 1.75rem; }
.portal-card h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.portal-card .lead { color: var(--muted); font-size: .95rem; }
.eg-pill { display: flex; align-items: center; gap: .75rem; width: 100%; margin: .5rem 0; padding: .85rem 1.1rem; border: 0; border-radius: 50px; background: var(--brand-blue); color: #fff; font-weight: 600; text-decoration: none; transition: all .25s ease; text-align: left; }
.eg-pill:hover, .eg-pill:focus-visible { background: var(--brand-green); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,.1); }
.eg-pill .bi { font-size: 1.15rem; }
.eg-pill small { margin-left: auto; opacity: .85; font-weight: 500; }
.eg-pill.light { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.eg-pill.light:hover { background: #faf4f2; color: var(--ink); box-shadow: inset 0 0 0 1px #dccfc9, 0 6px 15px rgba(0,0,0,.06); }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .5rem; }
.who-btn { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; width: 100%; transition: .15s; }
.who-btn:hover { border-color: var(--brand-blue); background: #fdf7f5; transform: translateY(-1px); }
.who-btn b { display: block; font-size: .92rem; }
.who-btn small { color: var(--muted); font-size: .76rem; }
.divider-label { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 1.25rem 0 .5rem; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@keyframes egFade { from { transform: translateY(10px); } to { transform: none; } }

.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty i { font-size: 2rem; display: block; margin-bottom: .5rem; color: #cdbfb8; }
.muted { color: var(--muted); }
.small-muted { color: var(--muted); font-size: .8rem; }
