/* tasteskill / app.css
   A neutral foundation for app screens (dashboards, admin, settings, inboxes), set to the defaults
   measured in the study of real product screens (references/app-screens.md). Copy it into the project,
   replace the token values with the ones on the app sheet (draw.mjs --app), and build on top.
   Delete what you do not use. It has no brand of its own: neutral grounds, one quiet line, one accent. */

/* ---------- tokens (replace with the dealt style) ---------- */
:root {
  /* Framed sheet (seed 134794916), kept palette and type from the landing page.
     Its face: the frame tinted from the court's green surround, Rally blue on the booked courts. */
  --ground: #f2f4f1;          /* the L-frame: one low-chroma step of court green */
  --surface: #ffffff;         /* the sheet and its cards */
  --raised: #f6f7f5;          /* filled wells, hover rows */
  --active: #e6e9e4;          /* the active nav pill */
  --border: #e6e8e5;          /* sheet and card edges */
  --rule: #eff1ee;            /* row rules */
  --control: #cfd3cf;         /* inputs and outlined buttons */
  --text: #111111;
  --muted: #5c605d;           /* 6.2:1 on white */
  --faint: #676b68;           /* 5.5:1 on white, 5.0:1 on the frame */
  --accent: #1a4be0;          /* Rally blue: the booked courts, the now line, focus */
  --accent-tint: #e8eefd;     /* a booked slot */
  --primary: #1d1f20;
  --primary-ink: #ffffff;
  --positive: #247b50; --negative: #c4242a; --warning: #92400e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb; --pill-warning-ink: #92400e;
  --pill-neutral-bg: #eef0ed; --pill-neutral-ink: #3d403e;
  --chart-1: var(--accent); --chart-2: #8da7ee; --chart-3: #b08a2e; --chart-muted: #c9cec9;
  --chart-mark: var(--text);
  --chart-span: 0.06;
  --grid: #eceeeb;
  --axis-ink: var(--muted);
  --ink: var(--text);

  --font: "Stack Sans Text", "Helvetica Neue", Arial, sans-serif;
  --fs-title: 24px; --fs-section: 16px; --fs-kpi: 24px; --fs-body: 14px; --fs-small: 12px;

  /* grid arithmetic at 1440: sidebar 228 + sheet 1204 + inset 8 = 1440.
     Sheet 1204 − 2 × 24 padding = 1156 = main 756 + gap 16 + rail 384.
     Main row of two cards: 2 × 370 + 16 = 756. One gutter, 16, everywhere. */
  --sidebar-width: 228px;
  --topbar: 48px;
  --inset: 8px;
  --pad: 24px;
  --gap: 16px;
  --card-pad: 20px;
  --radius-sheet: 16px;
  --radius-card: 8px;
  --radius-control: 6px;
  --control-height: 32px;
  --row-height: 44px;
  --nav-row: 32px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 120ms; --t-hover: 150ms; --t-ui: 200ms;
}
/* dark: one true-neutral ground, elevation by lightness; two greys that read apart (not #aaa beside #969696) */
:root[data-theme="dark"] {
  --ground: #000000; --surface: #111111; --raised: #222222; --active: #222222;
  --border: #1a1a1a; --rule: #161616; --control: #444444;
  --text: #ffffff; --muted: #b4b4b4; --faint: #949494;
  --primary: #ffffff; --primary-ink: #000000;
  --positive: #3fc07a; --negative: #e5566f; --warning: #e5a93b;  /* a green or yellow-green accent is also --positive */
  --pill-positive-bg: #172a1d; --pill-positive-ink: #3fc07a;
  --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f;
  --pill-warning-bg: #2b2414; --pill-warning-ink: #e5a93b;
  --pill-neutral-bg: #222222; --pill-neutral-ink: #ffffff;
  --chart-muted: #4a4a4a; --grid: #2b2b2b;
  --chart-span: 0.12;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, table, .kpi-value { font-variant-numeric: tabular-nums; }

/* ---------- shell: sidebar + canvas ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; overflow: auto; }
.sidebar .group-label { margin: 20px 8px 6px; font-size: var(--fs-small); color: var(--faint); }
.nav-item { display: flex; align-items: center; gap: 10px; height: var(--nav-row); padding: 0 8px; border-radius: 8px; color: var(--muted); transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.nav-item svg { width: 16px; height: 16px; flex: none; stroke-width: 1.5; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--active); color: var(--text); }
.sidebar .bottom { margin-top: auto; }
.canvas { min-width: 0; padding: var(--pad); }

/* ---------- title block and filters ---------- */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.title-row h1 { font-size: var(--fs-title); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.title-row .sub { margin-top: 4px; color: var(--muted); }
.filters { display: flex; align-items: center; gap: 8px; margin-bottom: var(--gap); flex-wrap: wrap; }
.filters .spacer { flex: 1; }
.stamp { color: var(--faint); font-size: var(--fs-small); }

/* ---------- panels and grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel h2 { font-size: var(--fs-section); line-height: 1.3; font-weight: 600; }
.panel .meta { color: var(--faint); font-size: var(--fs-small); }
/* paired cards in one row: a card stretches to its neighbour only when it has content to fill. Otherwise it keeps
   its own height (add .top to the row), and only an action or a total may be pinned to a stretched card's bottom */
.grid.top { align-items: start; }

/* a chart's heading row: its title (and legend or period) with a fixed 8px to the svg */
.chart-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.chart-head h3 { font-size: var(--fs-body); line-height: 20px; font-weight: 500; }
.chart { position: relative; min-width: 0; }

/* a link at a card's foot or header ("Show all 7", "Sell-out history"): ink, a 12px chevron, an underline on hover,
   and no inline padding, so its text sits on the card's content edge */
.card-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--text); font-weight: 500; cursor: pointer; text-underline-offset: 3px; }
.card-link::after { content: ""; width: 12px; height: 12px; flex: none; background: currentColor; -webkit-mask: var(--chevron) center / 12px no-repeat; mask: var(--chevron) center / 12px no-repeat; }
.card-link:hover { text-decoration: underline; }
:root { --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 2.5 8 6l-3.5 3.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* list rows: a rule between rows and none above the first. A rule on a rounded box curls up at both ends, so a row
   that carries a rule has square corners */
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 0; }
.row + .row { border-top: 1px solid var(--rule); border-radius: 0; }

/* KPIs as one divided strip: a label above a number, no icons, no tiles */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.kpi { padding: 16px var(--card-pad); }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi-label { color: var(--muted); }
.kpi-value { margin-top: 6px; font-size: var(--fs-kpi); line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }
.kpi-value small { font-size: 0.55em; color: var(--muted); font-weight: 400; margin-left: 2px; }
.delta { margin-top: 4px; font-size: var(--fs-small); color: var(--muted); }
.delta .up { color: var(--positive); } .delta .down { color: var(--negative); }
/* KPIs as the chart's tabs: the selected one carries a 2px rule and an ink label; the others keep a grey label and
   their value in ink at a lighter weight (a grey value reads as disabled). When the tabs are the per-entity
   breakdown the brief asks for (takings by shop), add .entities: nothing changes but the rule */
.kpis[role="tablist"] .kpi { position: relative; cursor: pointer; }
.kpis[role="tablist"] .kpi[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); }
.kpis[role="tablist"]:not(.entities) .kpi[aria-selected="true"] .kpi-label { color: var(--text); }
.kpis[role="tablist"]:not(.entities) .kpi[aria-selected="false"] .kpi-value { color: var(--text); font-weight: 400; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 12px; text-align: left; font-weight: 400; font-size: var(--fs-small); color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
/* cells share one baseline, so a figure never sits 2px below the name beside it; the row height comes from padding */
td { padding: calc((var(--row-height) - 20px) / 2) 12px; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
tbody tr:last-child td { border-bottom: 0; }
/* no hover that changes the fill; a row that drives a detail pane takes the nav pill's fill when selected */
tbody tr[aria-selected="true"] td { background: var(--active); }
th.n, td.n { text-align: right; }
td .sub { display: block; font-size: var(--fs-small); color: var(--muted); }
.truncate { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* status pill: a pale tint with dark ink of the same hue, one per row */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-small); font-weight: 500; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 12px; border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--surface); font-weight: 500; cursor: pointer; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 500; }
.field .hint { color: var(--muted); font-size: var(--fs-small); }
.input, select.input { height: 38px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); }
.input::placeholder { color: var(--faint); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: var(--gap); }
.tabs a { position: relative; padding: 10px 0; color: var(--muted); transition: color var(--t-hover) ease; }
.tabs a[aria-selected="true"] { color: var(--text); }
.tabs a[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); }
/* as wide as its options; full width only on a narrow phone */
.segmented { display: inline-flex; width: max-content; max-width: 100%; padding: 2px; border-radius: 8px; background: var(--raised); }
.segmented button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.switch { appearance: none; width: 32px; height: 20px; border-radius: 999px; background: var(--control); position: relative; cursor: pointer; transition: background-color var(--t-ui) ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-ui) var(--ease-out); }
.switch:checked { background: var(--text); } .switch:checked::after { transform: translateX(12px); }

/* empty and loading states keep the frame; a loading value is a flat grey bar at its real size, with no shimmer */
.empty { display: grid; place-items: center; min-height: 96px; padding: 16px; border: 1px dashed var(--control); border-radius: var(--radius-control); color: var(--muted); text-align: center; }
.skeleton { background: var(--raised); border-radius: 4px; }

/* ---------- phone: the navigation folds away and the canvas takes the width ---------- */
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* the menu opens as a full-screen sheet */
  .sidebar { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; background: var(--surface); transform: translateX(-100%); transition: transform var(--t-ui) var(--ease-out); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .canvas { padding: 16px; }
  .grid > * { grid-column: 1 / -1 !important; }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .kpi:nth-child(2n) { border-left: 1px solid var(--border); }
  /* an odd count leaves no half-empty row: the last cell takes the full width */
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* KPI tabs in a 2-up grid: the selected cell takes a fill, never an underline floating mid-grid */
  .kpis[role="tablist"] .kpi[aria-selected="true"] { background: var(--active); }
  .kpis[role="tablist"] .kpi[aria-selected="true"]::after { content: none; }
  .title-row { flex-wrap: wrap; align-items: flex-start; }
}
@media (max-width: 480px) {
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; } }

/* an empty message spans the block it stands in, never one squeezed column */
.rows .empty, .grid > .empty, li > .empty { grid-column: 1 / -1; width: 100%; }

/* ======================= Rally: the framed sheet ======================= */
html { -webkit-font-smoothing: antialiased; }
body { font-variant-numeric: tabular-nums; }
.app { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: var(--topbar) minmax(0, 1fr); min-height: 100svh; }
.sidebar { grid-row: 1 / 3; grid-column: 1; height: 100svh; padding: 12px 12px 16px; gap: 1px; }
.topbar { grid-row: 1; grid-column: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 calc(var(--inset) + 16px) 0 16px; }
.sheet { grid-row: 2; grid-column: 2; margin: 0 var(--inset) var(--inset) 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sheet); min-width: 0; }
.canvas { padding: var(--pad); }

/* product and scope */
.brand { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.brand svg { width: 22px; height: 22px; flex: none; }
.club-switch { display: grid; grid-template-columns: 28px minmax(0, 1fr) 14px; align-items: center; gap: 10px; margin: 10px 0 14px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); text-align: left; cursor: pointer; transition: background-color var(--t-hover) ease; }
.club-switch:hover { background: var(--raised); }
.club-mark { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: #2e6a4c; color: #fff; font-size: 12px; font-weight: 600; }
.club-switch b { display: block; font-weight: 500; line-height: 18px; }
.club-switch span span { display: block; color: var(--faint); font-size: var(--fs-small); line-height: 16px; }
.club-switch svg { width: 14px; height: 14px; color: var(--faint); }
.nav-item .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: var(--fs-small); font-weight: 500; background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.nav-item .count.quiet { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.user-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; margin-top: 8px; }
.user-row b { display: block; font-weight: 500; line-height: 18px; }
.user-row span span { display: block; color: var(--faint); font-size: var(--fs-small); line-height: 16px; }

/* top bar: search centred on the window, help and account at the right */
.search { grid-column: 2; display: flex; align-items: center; gap: 8px; width: min(548px, 42vw); height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--faint); cursor: text; }
.search svg { width: 14px; height: 14px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.search kbd { font: inherit; font-size: var(--fs-small); color: var(--faint); padding: 0 6px; border-radius: 4px; background: var(--raised); }
.search:focus-within { border-color: var(--accent); }
.top-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background-color var(--t-hover) ease; }
.icon-btn:hover { background: var(--active); }
.icon-btn svg { width: 16px; height: 16px; }

/* people: a stable initial on a pale tint of their own hue */
.avatar { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: hsl(var(--h, 210) 55% 92%); color: hsl(var(--h, 210) 45% 26%); }

/* title row */
.title-row { margin-bottom: var(--gap); }
.title-row h1 { font-weight: 600; }
.title-row .sub { max-width: 80ch; color: var(--muted); font-size: 15px; line-height: 22px; }
.title-row .sub b { color: var(--text); font-weight: 500; }
.title-actions { display: flex; align-items: center; gap: 12px; flex: none; }

/* layout: main column and rail */
.board { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: var(--gap); align-items: start; }
.main, .rail { display: grid; gap: var(--gap); min-width: 0; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.rail-block { display: grid; gap: 8px; }
.rail-block > h2 { font-size: var(--fs-section); font-weight: 600; line-height: 24px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rail-block > h2 .meta { font-weight: 400; color: var(--faint); font-size: var(--fs-small); }
.panel h2 { font-weight: 600; }
.panel > header { margin-bottom: 12px; }
.lead-fig { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lead-fig .v { font-size: var(--fs-kpi); line-height: 30px; font-weight: 500; letter-spacing: -0.01em; }
.lead-fig .v small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 3px; letter-spacing: 0; }
.lead-fig .note { color: var(--muted); }
.lead-fig .good { color: var(--positive); font-weight: 500; }
.lead-fig .bad { color: var(--negative); font-weight: 500; }

/* ---------- the court sheet: 8 courts down, the opening hours across ---------- */
.cs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.cs-sub { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: var(--fs-small); }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.cs-scroll { overflow: visible; }
@media (max-width: 1100px) { .cs-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; } .cs-tip { display: none; } }
.cs { --label: 72px; --pitch: 32px; min-width: 640px; position: relative; }
.cs-hours { position: relative; height: 22px; margin-left: var(--label); color: var(--muted); font-size: var(--fs-small); }
.cs-corner { position: sticky; left: 0; z-index: 5; float: left; width: var(--label); height: 22px; margin-bottom: -22px; background: var(--surface); }
.cs-hours span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.cs-hours span:first-child { transform: none; }
.cs-hours span.end { transform: translateX(-100%); }
.cs-body { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); }
.cs-courts { display: grid; grid-auto-rows: var(--pitch); align-items: center; color: var(--muted); }
.cs-courts { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.cs-lanes { position: relative; }
.cs-lane { height: var(--pitch); border-top: 1px solid var(--rule); }
.cs-lane:last-child { border-bottom: 1px solid var(--rule); }
.cs-hour { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.cs-past { position: absolute; top: 0; bottom: 0; left: 0; background: var(--raised); }
.cs-now { position: absolute; top: -22px; bottom: 0; width: 1px; background: var(--accent); z-index: 3; }
.cs-now span { position: absolute; top: 0; left: 4px; padding: 0 4px; font-size: var(--fs-small); line-height: 18px; color: var(--text); background: var(--surface); white-space: nowrap; font-weight: 500; }
.bk { position: absolute; height: 24px; border-radius: 4px; padding: 0 6px; font-size: var(--fs-small); line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; transition: opacity var(--t-ui) ease, transform 600ms var(--ease-out); z-index: 1; }
.bk, .legend .k-booking { background: var(--accent-tint); color: #0f2a7a; }
.bk.k-open, .legend .k-open { background: var(--surface); box-shadow: inset 0 0 0 1px var(--control); color: var(--text); } /* taste-skill-ignore: an inset outline that draws a chart mark */
.bk.k-league, .legend .k-league { background: #e4e7e3; color: var(--text); }
.bk.k-ladder, .legend .k-ladder { background: #cfd4cf; color: var(--text); }
.bk.k-clinic, .legend .k-clinic { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); color: #0f2a7a; padding-left: 9px; } /* taste-skill-ignore: an inset outline that draws a chart mark */
.bk.k-free, .legend .k-free { background: var(--surface); outline: 1px dashed #9aa09b; outline-offset: -1px; color: var(--muted); border-radius: 4px; }
.bk.alert, .legend .k-alert { background: var(--pill-negative-bg); box-shadow: inset 0 0 0 1.5px var(--negative); color: var(--pill-negative-ink); } /* taste-skill-ignore: an inset outline that draws a chart mark */
.bk.done { background: var(--pill-positive-bg); box-shadow: inset 0 0 0 1px rgba(36, 123, 80, 0.35); color: var(--pill-positive-ink); } /* taste-skill-ignore: an inset outline that draws a chart mark */
.bk.past { opacity: 0.55; }
.bk.dim { opacity: 0.18; }
.bk:hover { z-index: 2; }
.cs-tip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); font-size: var(--fs-small); line-height: 17px; white-space: nowrap; opacity: 0; transition: opacity 120ms ease; } /* taste-skill-ignore: a floating tooltip or toast */
.cs-tip b { display: block; font-size: 13px; font-weight: 500; }

/* filter for the sheet */
.segmented button { font-size: 13px; }
.segmented button .n { color: var(--faint); margin-left: 4px; }
.segmented { background: var(--active); }

/* ---------- needs you ---------- */
.needs { padding: 4px var(--card-pad); }
.need { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 0; }
.need + .need { border-top: 1px solid var(--rule); }
.need-top { display: flex; align-items: baseline; gap: 10px; }
.need-top time { flex: none; width: 64px; color: var(--muted); font-size: 13px; }
.need-top b { font-weight: 500; }
.need p { margin-left: 74px; color: var(--muted); font-size: 13px; line-height: 19px; }
.need .acts { margin-left: 74px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.need.is-done .need-top b { color: var(--positive); }
.need .tick { width: 16px; height: 16px; color: var(--positive); flex: none; align-self: center; }
.need-top .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--negative); flex: none; align-self: center; margin-left: auto; }
.need.is-done .dot { background: var(--positive); }
.need.quiet .dot { background: var(--control); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.text { border: 0; background: none; padding: 0; height: auto; color: var(--text); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color var(--t-hover) ease; }
.btn.text:hover { background: none; text-decoration-color: currentColor; }
.btn.primary:hover { background: #000; }

/* ---------- waitlist ---------- */
.opening { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 12px 14px; margin-bottom: 4px; border-radius: 8px; background: var(--raised); }
.opening b { font-weight: 500; }
.opening span { color: var(--muted); font-size: 13px; }
.wl-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 52px; padding: 8px 0; }
.wl-row + .wl-row { border-top: 1px solid var(--rule); }
.wl-row b { display: block; font-weight: 500; line-height: 18px; }
.wl-row .s { display: block; color: var(--muted); font-size: 13px; line-height: 18px; }

/* ---------- check-ins ---------- */
.arrival { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 48px; }
.arrival + .arrival { border-top: 1px solid var(--rule); }
.arrival b { display: block; font-weight: 500; line-height: 18px; }
.arrival .s { display: block; color: var(--muted); font-size: 13px; line-height: 18px; }
.arrival .t { color: var(--muted); font-size: 13px; text-align: right; }
.arrival .t b { color: var(--text); font-weight: 400; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.btn.block { width: 100%; height: 30px; }

/* ---------- revenue and no-shows ---------- */
.legend-inline { display: flex; gap: 14px; color: var(--muted); font-size: var(--fs-small); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ns-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 0; }
.ns-row + .ns-row { border-top: 1px solid var(--rule); }
.ns-row .d { color: var(--muted); font-size: 13px; }
.ns-row b { font-weight: 500; }
.ns-row .s { color: var(--muted); font-size: 13px; }
.ns-row .fee { font-size: 13px; text-align: right; white-space: nowrap; }
.ns-row .fee.failed { color: var(--negative); }
.ns-row .fee.waived { color: var(--muted); }
.repeat { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--raised); display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 13px; }

/* ---------- next up table ---------- */
.next table td, .next table th { padding-left: 0; padding-right: 16px; }
.next table td:last-child, .next table th:last-child { padding-right: 0; }
.next .court { color: var(--muted); }
.next td .sub { margin-top: 2px; }
.next .act { text-align: right; width: 1%; white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; z-index: 30; padding: 10px 14px; border-radius: 8px; background: var(--primary); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); transition: opacity var(--t-ui) ease, transform var(--t-ui) var(--ease-out); pointer-events: none; } /* taste-skill-ignore: a floating tooltip or toast */
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tablet and phone ---------- */
.mobile-bar { display: none; }
@media (max-width: 1240px) {
  .board { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .topbar { display: none; }
  .mobile-bar { display: flex; grid-row: 1; grid-column: 1; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 12px; position: sticky; top: 0; z-index: 10; background: var(--ground); }
  .mobile-bar .brand { padding: 0; }
  .mobile-bar .spacer { flex: 1; }
  .sheet { grid-column: 1; margin: 0; border-radius: 0; border-width: 1px 0 0; }
  .sidebar { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; background: var(--ground); transform: translateX(-100%); transition: transform var(--t-ui) var(--ease-out); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-grid; }
  .board { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .canvas { padding: 16px; }
  .title-row { display: grid; gap: 12px; }
  .title-actions { justify-content: space-between; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .need p, .need .acts { margin-left: 0; }
  .need-top time { width: auto; }
  .next table thead { display: none; }
  .next table, .next tbody, .next tr, .next td { display: block; }
  .next tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .next tbody tr:last-child { border-bottom: 0; }
  .next td { padding: 0; border: 0; }
  .next td.c-time { grid-column: 1; grid-row: 1; font-weight: 500; }
  .next td.c-court { display: none; }
  .next td.c-book { grid-column: 1; grid-row: 2; }
  .next td.c-players { grid-column: 2; grid-row: 1; text-align: right; }
  .next td.c-paid { grid-column: 2; grid-row: 2; text-align: right; }
  .next td.act { grid-column: 1 / -1; text-align: left; width: auto; margin-top: 6px; }
  .next td.act:empty { display: none; }
  .btn, .segmented button { min-height: 36px; }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* outline icons: the symbols carry no paint of their own */
.nav-item svg, .icon-btn svg, .search svg, .club-switch svg, svg.tick { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.menu-toggle { display: none; }
@media (max-width: 1100px) {
  .menu-toggle { display: inline-grid; }
  .title-actions .btn.primary { display: none; }
  .board { display: grid; grid-template-columns: minmax(0, 1fr); }
  .main, .rail { display: contents; }
  .needs-block { order: 1; }
  #court-sheet { order: 2; }
  #waitlist { order: 3; }
  #check-ins { order: 4; }
  .pair { order: 5; }
  #bookings { order: 6; }
}

.menu-close[hidden] { display: none; }
@media (max-width: 860px) { .cs { min-width: 780px; } }
