/* The operations desk. TCC's brand tokens come from member/app.css; this adds a working tool's
   density: a sidebar, a top bar, tables and panels, laptop first and usable on a tablet. */

body.desk { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
.desk-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 100vh; }
.desk-side { background: var(--obsidian); color: #FCFCFC; padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; }
.desk-side .brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.desk-side .brand img { height: 26px; width: auto; filter: invert(1); }
.desk-side .brand span { font-family: var(--serif); font-size: 18px; }
.desk-side nav { display: flex; flex-direction: column; gap: 2px; }
.desk-side nav a { color: #C9CED4; text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); }
.desk-side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.desk-side nav a[aria-current="page"] { background: rgba(237,216,153,.14); color: var(--gold); }
.desk-side nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.desk-main { display: flex; flex-direction: column; min-width: 0; }
.desk-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.desk-top .who { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.role { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-sunk); color: var(--ink-2); }
.role-admin { background: var(--gold-tint); color: var(--gold-deep); }
.top-actions { display: flex; align-items: center; gap: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--gold-deep); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.feed-btn { font: inherit; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px; cursor: pointer; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.feed-btn:focus-visible, .link:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.badge { background: var(--ink); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; }

.desk-content { padding: 24px 28px 48px; max-width: 1180px; width: 100%; box-sizing: border-box; display: grid; gap: 24px; }
/* A wide table scrolls inside its own frame; it never widens the page. */
.desk-content > * { min-width: 0; }
.desk-content h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 0; letter-spacing: -.01em; }
.desk-content h2 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.lede { color: var(--ink-2); margin: 4px 0 0; max-width: 70ch; }

/* The work queue */
.work-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.work-group { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.work-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.work-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.work-list li:first-child { border-top: 0; }
.work-list .n { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 18px; text-align: right; color: var(--ink); }
.work-list .what { min-width: 0; }
.work-list .what a { color: var(--ink); }
.work-list .since { display: block; color: var(--muted); font-size: 12px; }
.all-clear { background: var(--ok-tint); color: var(--ok); border-radius: var(--radius); padding: 16px 18px; }

/* Record pages: panels in a grid */
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }
.panel p { margin: 0; }
.panel > * { min-width: 0; }
.mono-h { font-family: var(--mono) !important; font-size: 26px !important; letter-spacing: 0 !important; }
.mono-ref { font-family: var(--mono); font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-left: 8px; vertical-align: middle; white-space: nowrap; }
.contact { color: var(--ink-2); }
.masked { color: var(--muted); font-style: italic; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-danger { background: var(--stop); border-color: var(--stop); }
.btn-danger-quiet { color: var(--stop); }
.inline-form { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-sunk); }
.inline-form label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.inline-form label.check { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select, .inline-form textarea { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); min-width: 0; }
.inline-form input[type="checkbox"] { padding: 0; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.flags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.small { font-size: 12px; color: var(--muted); }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.plain li { overflow-wrap: anywhere; }

/* Figures: a label, a number, and where it came from */
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.figure { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.figure .label { font-size: 12px; color: var(--muted); }
.figure .value { font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 600; overflow-wrap: anywhere; }
.figure .value.unknown { color: var(--muted); font-weight: 500; font-size: 16px; }
.figure.break { border-color: var(--warn); background: var(--warn-tint); }
.figure .from { font-size: 12px; color: var(--muted); }
.day-picker { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.day-picker label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.day-picker input, .day-picker select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.breaks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.breaks li { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warn-tint); color: var(--warn); overflow-wrap: anywhere; }

/* A row's inline form sits in its own table row, invisible until used */
.desk-table tr.row-form td { padding: 0 14px; border-top: 0; }
.desk-table tr.row-form td:not(:empty) { padding: 0 14px 14px; }

/* Status pills: colour plus words, never colour alone */
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: var(--ok-tint); color: var(--ok); }
.pill-warn { background: var(--warn-tint); color: var(--warn); }
.pill-stop { background: var(--stop-tint); color: var(--stop); }
.pill-muted { background: var(--surface-sunk); color: var(--ink-2); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.desk-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.desk-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.desk-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.desk-table tbody tr:first-child td { border-top: 0; }
.desk-table tr.clickable { cursor: pointer; }
.desk-table tr.clickable:hover td { background: var(--surface-sunk); }
.mono { font-family: var(--mono); font-size: 13px; }

/* Filters and tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { font: inherit; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .n { font-variant-numeric: tabular-nums; margin-left: 4px; opacity: .75; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.filters input, .filters select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); min-width: 0; }
.filters input[type="search"] { width: min(320px, 100%); }
.btn { font: inherit; font-weight: 600; border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn:disabled { opacity: .5; cursor: default; }
.row-end { display: flex; justify-content: center; padding: 12px; }

/* Panel states: four different looks, never confused with each other or with data */
.state { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); color: var(--ink-2); }
.state strong { font-weight: 600; color: var(--ink); }
.state-loading { border-style: solid; border-color: var(--line); color: var(--muted); }
.state-empty { background: var(--surface-sunk); }
.state-failed { background: var(--stop-tint); border: 1px solid var(--stop); color: var(--stop); }
.state-failed strong { color: var(--stop); }
.state-unconfigured { background: var(--warn-tint); border: 1px solid var(--warn); color: var(--warn); }
.state-unconfigured strong { color: var(--warn); }

/* The news feed */
.feed { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; z-index: 20; }
.feed[hidden] { display: none; }
.feed header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.feed header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.feed-list { list-style: none; margin: 0; padding: 8px 10px; overflow: auto; display: grid; gap: 2px; align-content: start; }
.feed-list li a { display: grid; gap: 2px; padding: 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.feed-list li a:hover { background: var(--surface-sunk); }
.feed-list li.unread a { background: var(--gold-tint); }
.feed-list span { color: var(--ink-2); }
.feed-list time { color: var(--muted); font-size: 12px; }
.feed-close { font: inherit; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

/* Toasts */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 30; width: min(560px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; justify-content: space-between; align-items: start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; box-shadow: var(--shadow-lift); }
.toast-error { background: var(--stop); }
.toast-x { background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; line-height: 1; }

/* Finance reads the desk: anything marked admin-only is not shown to it */
body[data-role="finance"] .admin-only { display: none !important; }

/* The menu button exists only on narrow screens (below). */
.menu-btn { display: none; }
.tab { white-space: nowrap; }

/* PHONES AND SMALL TABLETS (UI/UX audit, 6 Nov 2026). Paul and Rishin run the desk from their
   phones. Before this, the menu was one sideways row with seven of ten links off-screen, the
   Money and Members tables pushed their buttons off the edge, and the filter pills squashed into
   ovals. Now: a Menu button, tables that become one card per row, a scrolling filter strip, and
   44px tap targets. */
@media (max-width: 860px) {
  .desk-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .desk-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 10px; }
  .menu-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; font: inherit; font-weight: 600; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-sm); cursor: pointer; }
  .desk-side nav { display: none; flex-basis: 100%; flex-direction: column; gap: 2px; padding-bottom: 6px; }
  .desk-side.open nav { display: flex; }
  .desk-side nav a { min-height: 44px; display: flex; align-items: center; }
  .desk-top, .desk-content { padding-left: 16px; padding-right: 16px; }

  /* Tap targets: 44px, Apple's minimum, for everything a finger presses. */
  .btn, .tab, .feed-btn, .desk-top .link, .filters input, .filters select,
  .inline-form input, .inline-form select, .copy-btn { min-height: 44px; }
  .btn { padding: 10px 16px; }
  .desk-top a.link { display: inline-flex; align-items: center; }

  /* Filter pills: one scrolling strip instead of squashed ovals. */
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .tab { flex: 0 0 auto; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters label:has(input[type="search"]) { grid-column: 1 / -1; }
  .filters input[type="search"] { width: 100%; }
}

/* Tables become one card per row on phones. Each cell is labelled with its column heading
   (desk.js stackTables copies the <th> text into data-label), so nothing is lost: the action
   buttons that sat off-screen are now inside the card. */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; border: 0; }
  .desk-table, .desk-table tbody, .desk-table tr, .desk-table td { display: block; width: 100%; }
  .desk-table thead { display: none; }
  .desk-table tr { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 6px 12px; margin-bottom: 10px; }
  /* The label sits in a left gutter, so a cell's own content (text, a pill, a line break and a
     note) flows normally on the right. */
  .desk-table td { position: relative; border: 0 !important; padding: 6px 0 6px 38% !important; min-height: 30px; text-align: left !important; overflow-wrap: anywhere; }
  .desk-table td::before { content: attr(data-label); position: absolute; left: 0; top: 7px; width: calc(38% - 10px); color: var(--muted); font-size: 12px; font-weight: 500; }
  .desk-table td[data-label=""], .desk-table td:not([data-label]) { padding-left: 0 !important; }
  .desk-table td[data-label=""]::before, .desk-table td:not([data-label])::before { content: none; }
  .desk-table td:empty { display: none; }
  .desk-table tr.row-form { border: 0; padding: 0; background: none; }
  .desk-table td .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Money page: the member's name after their reference (16 Nov 2026). */
.member-name { font-weight: 600; white-space: nowrap; }

/* "Paid by" for card loads with no deposit behind them (16 Nov 2026). */
.paid-part { border: 0; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.paid-part label { flex: 1 1 12rem; }
.paid-part .tx-field { flex-basis: 100%; }

/* November 2026 redesign, Linen: a light sidebar and pill buttons. The dark themes restyle the
   desk in /shared/theme.css. */
html:not(.theme-dark) .desk-side { background: var(--surface); color: var(--ink); border-right: 1px solid var(--line); }
html:not(.theme-dark) .desk-side .brand img { filter: none; }
html:not(.theme-dark) .desk-side nav a { color: var(--muted); border-radius: 12px; }
html:not(.theme-dark) .desk-side nav a:hover { background: var(--track); color: var(--ink); }
html:not(.theme-dark) .desk-side nav a[aria-current="page"] { background: var(--gold-tint); color: var(--gold-deep); font-weight: 600; }
html:not(.theme-dark) .menu-btn { color: var(--ink); background: transparent; border-color: var(--line-strong); }
.desk-top { background: var(--topbar-bg); }
.btn, .tab, .feed-btn { border-radius: 999px; }
.table-wrap, .work-group, .panel { border-radius: var(--radius); }
.desk-content h1 { font-weight: 300; letter-spacing: -.03em; font-size: 40px; }
