/* TWT prototype - calm, readable, practical. Larger text for a 50+ audience.
   Brand colours (Training with Tyson):
     Warm Ivory    #F5F1E8  main page background
     Soft Charcoal #222626  main text / headings / nav
     Evergreen     #244736  brand accent / buttons / active links
     Muted Sage    #D8E1D6  soft section backgrounds / dividers
     Muted Bronze  #B97943  tiny details only
   Status colours (green / amber / red) stay separate so warnings remain obvious. */

/* Poppins (same as trainingwithtyson.net), stored inside the app so visitors' browsers never
   contact Google just to load a font. Free font under the SIL Open Font License. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-400.9212f6f9860f.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500.a09f2fccfee3.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-600.72993dddf88a.woff2") format("woff2"); }
:root {
  --ivory: #f5f1e8; --charcoal: #222626; --evergreen: #244736; --evergreen-dark: #1a3427;
  --sage: #d8e1d6; --sage-light: #eef2ec; --bronze: #b97943;
  --ink: var(--charcoal); --muted: #565e5b; --line: var(--sage); --field-line: #9aa89c;
  --bg: var(--ivory); --card: #fff; --brand: var(--evergreen); --accent: var(--evergreen);
  --warn: #7a4a1c; --warn-bg: #f7ead9; --bad: #a12a2a; --bad-bg: #fbe6e3;
  --good: var(--evergreen); --good-bg: #dfe8dc; --info-bg: var(--sage-light);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 17px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--evergreen-dark); }

/* Top bar: ivory with the evergreen logo, like the website header */
header.top { background: var(--ivory); color: var(--ink); padding: 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; border-bottom: 3px solid var(--evergreen); }
header.top .brand { display: flex; align-items: center; gap: 10px; padding: 8px 0; margin-right: 12px; font-weight: 600; color: var(--evergreen); text-decoration: none; }
header.top .brand img { height: 48px; width: 48px; display: block; }
header.top nav a { color: var(--ink); text-decoration: none; padding: 12px 6px; display: inline-block; font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -3px; }
header.top nav a:hover { color: var(--evergreen); border-bottom-color: var(--sage); }
header.top nav a[aria-current="page"] { color: var(--evergreen); font-weight: 600; border-bottom-color: var(--evergreen); }
header.top .who { margin-left: auto; font-size: 14px; display: flex; gap: 10px; align-items: center; color: var(--muted); }
/* Drop-down menus in the top bar (owner: Clients, Billing, More; everyone: their name). */
header.top details.dd { position: relative; display: inline-block; }
header.top details.dd > summary { list-style: none; cursor: pointer; color: var(--ink); padding: 12px 6px; font-size: 15px;
  font-weight: 400; border-bottom: 3px solid transparent; margin: 0 0 -3px; white-space: nowrap; }
header.top details.dd > summary::-webkit-details-marker { display: none; }
header.top details.dd > summary::after { content: " \25BE"; font-size: 12px; color: var(--muted); }
header.top details.dd > summary:hover { color: var(--evergreen); border-bottom-color: var(--sage); }
header.top details.dd > summary.current { color: var(--evergreen); font-weight: 600; border-bottom-color: var(--evergreen); }
header.top .menu { position: absolute; top: 100%; left: 0; z-index: 40; min-width: 200px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
header.top .menu.end { left: auto; right: 0; }
header.top nav .menu a, header.top .menu a { display: block; padding: 9px 10px; margin: 0; border-bottom: none; border-radius: 6px; }
header.top .menu a:hover, header.top .menu a[aria-current="page"] { background: var(--sage-light); color: var(--evergreen); }
header.top .menu-note { padding: 6px 10px; font-size: 13px; color: var(--muted); }
header.top .menu form { margin: 4px 0 0; }
header.top .who .menu .menu-logout { width: 100%; text-align: left; }
header.top .count { display: inline-block; margin-left: 6px; min-width: 18px; padding: 1px 6px; border-radius: 9px;
  background: var(--bronze); color: #fff; font-size: 12px; font-weight: 600; line-height: 16px; text-align: center; }
header.top .bell { position: relative; display: inline-flex; align-items: center; color: var(--ink); padding: 6px; }
header.top .bell:hover { color: var(--evergreen); }
header.top .bell .count { position: absolute; top: -2px; right: -8px; margin: 0; }
header.top .who details.dd > summary { font-size: 14px; color: var(--ink); }
header.top .who button { background: transparent; border: 1px solid var(--evergreen); color: var(--evergreen); padding: 3px 12px; }
header.top .who button:hover { background: var(--evergreen); color: var(--ivory); }
/* The Refresh button only shows in the home-screen app, which has no browser bar or reload button. */
header.top .who .refresh-btn { display: none; }
@media (display-mode: standalone) { header.top .who .refresh-btn { display: inline-block; } }
.standalone header.top .who .refresh-btn { display: inline-block; }
.simbar { background: var(--warn-bg); border-bottom: 1px solid var(--bronze); padding: 6px 20px; font-size: 14px; }

main { max-width: 1150px; margin: 0 auto; padding: 24px 20px; }
h1, h2, h3 { color: var(--charcoal); line-height: 1.3; }
h1 { font-size: 26px; font-weight: 600; margin: 4px 0 18px; }
h1::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 8px; background: var(--bronze); border-radius: 2px; }
h2 { font-size: 20px; font-weight: 600; margin: 26px 0 10px; }
h3 { font-size: 17px; font-weight: 600; margin: 14px 0 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--evergreen); border-radius: 10px; padding: 12px 14px; }
.stat .label { color: var(--muted); font-size: 14px; }
.stat .value { font-size: 22px; font-weight: 600; color: var(--evergreen); }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 14px; color: var(--charcoal); font-weight: 600; background: var(--sage-light); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 14px; }

.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--sage-light); color: var(--ink); white-space: nowrap; }
.pill.CURRENT, .pill.APPROVED, .pill.PAID, .pill.BOOKED, .pill.ATTENDED, .pill.AVAILABLE, .pill.PROMOTED { background: var(--good-bg); color: var(--good); }
.pill.PAYMENT_DUE, .pill.REQUESTED, .pill.OPEN, .pill.HELD, .pill.WAITING, .pill.NOTIFIED { background: var(--warn-bg); color: var(--warn); }
.pill.ATTENDANCE_BLOCKED, .pill.SPOT_AT_RISK, .pill.SPOT_RELEASED, .pill.CANCELLED, .pill.NO_SHOW, .pill.DENIED, .pill.full { background: var(--bad-bg); color: var(--bad); }
.pill.MAKEUP, .pill.EXTRA, .pill.ADMIN_ADD, .pill.DROP_IN, .pill.FLEXIBLE { background: var(--sage); color: var(--evergreen); }

.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; }
.msg.success { background: var(--good-bg); color: var(--good); }
.msg.error { background: var(--bad-bg); color: var(--bad); }
.msg.info, .msg.warning { background: var(--info-bg); color: var(--brand); }
/* After a button press that keeps your place on the page, its message pops up at the top of the screen. */
main .messages.toast { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(640px, calc(100% - 24px)); cursor: pointer; }
main .messages.toast .msg { margin: 0 0 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
main .messages.toast.closed { display: none; }
/* Inquiry page: the three next steps (assessment, drop-in, sign up), one under another. */
.next-step .option { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
.next-step .option h3 { margin: 0 0 4px; }
.banner { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.banner.warn { background: var(--warn-bg); border-color: #e2c39c; }
.banner.bad { background: var(--bad-bg); border-color: #e9a9a9; }

form.inline { display: inline; }
form.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 6px 0; }
form.row label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
input, select, textarea, button { font: inherit; font-size: 15px; padding: 6px 9px; border: 1px solid var(--field-line); border-radius: 6px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--sage); outline-offset: 1px; border-color: var(--evergreen); }
button { cursor: pointer; background: var(--brand); color: var(--ivory); border-color: var(--brand); font-weight: 500; }
button:hover { background: var(--evergreen-dark); border-color: var(--evergreen-dark); }
button.secondary { background: #fff; color: var(--brand); }
button.secondary:hover { background: var(--sage-light); }
button.danger { background: #fff; color: var(--bad); border-color: #d39b9b; }
button.danger:hover { background: var(--bad-bg); }
button.small { font-size: 13px; padding: 2px 9px; }
details > summary { cursor: pointer; color: var(--brand); margin: 6px 0; font-weight: 500; }

/* One colour per type of session (the left edge), the same on Today, the Calendar and the Weekly
   timetable: Standard green, 50+ bronze, every Premium group (Duo, Trio, Quad) plum, initial
   assessments blue. Templates add class="type-<service type code>". */
:root { --type-standard: var(--evergreen); --type-fifty: var(--bronze); --type-premium: #6b4a7e; --type-assessment: #3d7ea6; }
.type-STANDARD { --type-color: var(--type-standard); }
.type-FIFTY_PLUS { --type-color: var(--type-fifty); }
.type-PREMIUM_DUO, .type-PREMIUM_TRIO, .type-PREMIUM_QUAD { --type-color: var(--type-premium); }
.type-INITIAL_ASSESSMENT { --type-color: var(--type-assessment); }
.type-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.type-key span::before { content: ""; display: inline-block; width: 4px; height: 14px; margin-right: 6px; vertical-align: -2px;
  border-radius: 2px; background: var(--type-color); }
.card.session { border-left: 4px solid var(--type-color, var(--accent)); }  /* Today page (not the grid cells, also named "session") */
.card.session.cancelled { border-left-color: var(--bad); opacity: .85; }
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; overflow-x: auto; }
.week .day { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 120px; }
.week .slot, .week-grid .slot { font-size: 13px; padding: 4px 6px; border-radius: 6px; background: var(--sage-light); margin-bottom: 5px;
  border-left: 4px solid var(--type-color, var(--evergreen)); }
.week .slot.full, .week-grid .slot.full { background: var(--warn-bg); }
.week .slot.cancelled, .week-grid .slot.cancelled { background: var(--bad-bg); text-decoration: line-through; }

/* Your week beside the assessment booking form */
.book-week { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.book-week .day { min-height: 0; }
.book-week .day button { width: 100%; margin-bottom: 6px; }
.book-week .day.picked { border: 2px solid var(--evergreen); background: var(--sage-light); }
.book-week .day.picked button { background: var(--evergreen); color: var(--ivory); }

.agreement-body { white-space: pre-wrap; background: #fffdf8; border: 1px solid var(--line); padding: 14px; border-radius: 8px; max-height: 420px; overflow-y: auto; }
fieldset.card { border: 1px solid var(--line); }
/* Keep each section's title inside its white box instead of sitting on the border line. */
fieldset.card > legend { float: left; width: 100%; padding: 0; margin: 0 0 6px; font-size: 17px; }
fieldset.card > legend + * { clear: both; }
fieldset.card .section-note { margin: 0 0 4px; }
.step-label { margin: 0; color: var(--bronze, #B97943); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; font-size: 13px; }
button.big { font-size: 17px; padding: 12px 22px; }
.consent-q { border-bottom: 1px solid var(--line); padding: 6px 0 10px; }
.consent-q p { margin: 0 0 4px; }
.consent-q label { margin-right: 22px; font-size: 17px; }
.consent-q input { width: 20px; height: 20px; vertical-align: -3px; }
.check-big { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check-big input { width: 22px; height: 22px; margin-top: 3px; flex: none; }
table.confirm-change td:first-child { width: 34%; }
.q { margin: 10px 0; }
.q > label { display: block; font-weight: 600; margin-bottom: 4px; }
.q textarea, .q input:not([type=radio]) { width: 100%; max-width: 640px; }
.q .yesno label { margin-right: 18px; }
.req { color: var(--bad); }
.sig-pad { border: 2px dashed var(--field-line); border-radius: 8px; background: #fff; touch-action: none; max-width: 100%; cursor: crosshair; }
img.sig { max-width: 320px; border-bottom: 1px solid var(--ink); }
.script { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 24px; }
.email-body { white-space: pre-wrap; font: 15px/1.5 "Poppins", system-ui, sans-serif; background: #fffdf8; border: 1px solid var(--line); padding: 14px; border-radius: 8px; }
.celebrate { border-left: 4px solid var(--bronze); }
@media print { header.top, .simbar, .noprint { display: none; } body { background: #fff; } .card { border: none; } }

/* Weekly timetable and calendar: days side by side with one row per start time, so 9:00 lines up
   across every day. Each day's cells sit on a white card (.day-bg) that spans all the rows. */
.tt-scroll { overflow-x: auto; }
.tt-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(150px, 1fr)); column-gap: 10px; row-gap: 6px; }
.week-grid.tt-grid { grid-template-columns: repeat(var(--cols), minmax(110px, 1fr)); column-gap: 8px; }
.tt-grid .day { display: contents; }
.tt-grid .day > * { grid-column: var(--col); }
.tt-grid .day-bg { grid-row: 1 / -1; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.tt-grid .day-head { grid-row: 1; margin: 0; padding: 8px 8px 2px; }
.tt-grid .cell { display: flex; flex-direction: column; gap: 6px; margin: 0 8px; min-width: 0; }
.tt-grid .cell:last-child { margin-bottom: 8px; }
.tt-grid .cell > .slot { flex: 1 1 auto; margin: 0; }
.timetable .slot { font-size: 14px; padding: 6px 8px; border-radius: 6px; margin-bottom: 6px; background: var(--sage-light); border-left: 4px solid var(--type-color, var(--evergreen)); }
/* Free time between sessions (e.g. Wednesday 8:00), so the day doesn't look back to back. */
.timetable .slot.gap, .week-grid .slot.gap { background: transparent; border: 2px dashed var(--field-line); color: var(--muted); }
.timetable .slot form { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: end; }
.timetable .slot label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.timetable .slot form.tt-change > strong, .timetable .slot form.tt-change > .muted { flex-basis: 100%; }
.timetable .slot form.tt-change > .muted { font-size: 12px; }
.timetable .slot form.tt-change + form.tt-change { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }

button.billed { background: var(--good); border-color: var(--good); font-size: 16px; padding: 8px 14px; }
table.bill td { vertical-align: middle; }
.big-amount { font-size: 19px; font-weight: 600; }
table.done td { color: var(--good); }
.banner.just-billed { background: var(--good-bg); border-color: #a9c3a6; color: var(--good); font-size: 17px; }
.steps ol { margin: 6px 0; }

.login { max-width: 400px; margin: 50px auto; text-align: center; }
.login .login-logo { width: 120px; height: 120px; max-width: 100%; display: block; margin: 0 auto 6px; }
.login h1::after { margin-left: auto; margin-right: auto; }
.login form { text-align: left; }
.login p { margin: 8px 0; }
.login input { width: 100%; }
.login button { width: 100%; padding: 9px; font-size: 16px; }

/* Attended / No-show on the Today page: big enough to tap quickly on the iPad. */
td.attend-cell { white-space: nowrap; }
td.attend-cell form { margin-left: 4px; }
button.attend-btn { min-width: 108px; min-height: 44px; font-size: 16px; padding: 8px 14px; }
.pager a { display: inline-block; padding: 8px 2px; }
select { max-width: 100%; }
form.row label { max-width: 100%; }

/* iPad on its side (1024–1180px): slightly tighter table spacing so wide lists like Clients fit. */
@media (max-width: 1180px) { th, td { padding: 7px 6px; } }

/* iPad and phones (touch screens), and any narrow window: everything you tap is at least
   44px tall, the size Apple recommends for fingers. */
@media (pointer: coarse), (max-width: 1024px) {
  button, select, input:not([type=checkbox]):not([type=radio]):not([type=hidden]) { min-height: 44px; }
  button.small { font-size: 15px; padding: 8px 14px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; vertical-align: -4px; }
  details > summary { padding: 10px 0; }
  .pager a { padding: 10px 4px; }
  /* Calendar: all seven days fit across an iPad held upright. */
  .week { grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 6px; }
  .week .day { padding: 6px; }
  .week-grid.tt-grid { grid-template-columns: repeat(var(--cols), minmax(92px, 1fr)); column-gap: 6px; }
  .week-grid .cell { margin: 0 6px; }
}

@media (max-width: 640px) {
  header.top { padding: 0 12px; }
  .week { grid-template-columns: 1fr; }  /* phone: one day under another */
  .week .day { min-height: 0; }
  /* Top bar on a phone: the five main menu items fit on one line under the logo. */
  header.top nav a, header.top details.dd > summary { padding: 10px 5px; font-size: 14px; }
  header.top nav { margin-left: -5px; }
  /* Timetable and calendar on a phone: one day under another again (time rows can't fit side by side). */
  .tt-grid { display: block; }
  .tt-grid .day { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
                  padding: 8px; margin-bottom: 10px; }
  .tt-grid .day-bg, .tt-grid .cell.blank { display: none; }
  .tt-grid .day-head { display: block; padding: 0 0 6px; }
  .tt-grid .cell { margin: 0 0 6px; }
  table:not(:has(th)) td.attend-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; }
  td.attend-cell form { margin-left: 0; }
  td.num, th.num { white-space: nowrap; overflow-wrap: normal; }  /* keep "$40.00" in one piece */
  header.top .brand img { height: 40px; width: 40px; }
  main { padding: 18px 14px; }
  .card { padding: 14px 12px; }
  /* Nothing may stick out past the edge of the screen or a white box. */
  input, select, textarea { max-width: 100%; }
  td, th, .card, p, li { overflow-wrap: anywhere; }
  form.row label { max-width: 100%; }
  /* Lists without column headings (e.g. who's booked in a session): each row wraps onto
     extra lines, so the buttons drop underneath the name instead of off the screen. */
  table:not(:has(th)) tr { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center;
                           padding: 8px 0; border-bottom: 1px solid var(--line); }
  table:not(:has(th)) td { display: block; padding: 0; border: none; }
  table:not(:has(th)) td:empty { display: none; }
  /* Tables with a row of column headings: each row becomes its own little card, with the
     heading written beside each value (base.html copies the headings in). */
  table.stacked, table.stacked tbody, table.stacked tr, table.stacked td { display: block; }
  table.stacked tr:first-child { display: none; }
  table.stacked tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.stacked td { display: flex; gap: 10px; align-items: baseline; border: none; padding: 3px 0; text-align: left; overflow-wrap: break-word; }
  table.stacked td[data-label]::before { content: attr(data-label); flex: 0 0 34%; color: var(--muted); font-size: 14px; }
  table.stacked td:empty { display: none; }
  /* Other tables with headings (e.g. heading in the first column): swipe sideways inside the box. */
  table:has(th):not(.stacked) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 6px 8px; }
  button.small { padding: 5px 10px; font-size: 14px; }  /* easier to tap */
}
