/* ============================================================
   thesun — interface styles
   Teal and sand on a near white ground, the Zorixo palette.
   ============================================================ */

:root {
  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-2: #f0f6f3;
  --sidebar: #12201d;
  --sidebar-2: #1b2d29;
  --line: #e0eae5;
  --line-soft: #eef4f1;
  --ink: #12201d;
  --ink-2: #33473f;
  --soft: #556b63;
  --faint: #8aa096;
  --teal: #4ECDC4;
  --teal-deep: #1f8a7d;
  --teal-text: #14705f;
  --teal-soft: #e6f7f4;
  --sand: #FFE1A8;
  --sand-deep: #9a6b12;
  --sand-soft: #fff6e4;
  --red: #b3392a;
  --red-soft: #fbe9e6;
  --green: #1b7a45;
  --green-soft: #e8f7ee;
  --blue: #1d5fa8;
  --blue-soft: #eaf2fb;
  --purple: #6b3fa0;
  --purple-soft: #f2ecfb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 32, 29, .05), 0 12px 28px -20px rgba(18, 32, 29, .45);
  --display: 'Bricolage Grotesque', 'Archivo', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--faint); }
.soft { color: var(--soft); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
/* A grid or flex child does not shrink below its own content unless it
   is told to. Without this, one table too wide for a phone, the roster
   with its sleeve column, pushed the whole order page sideways instead
   of scrolling inside its own wrapper: 585px of page on a 375px screen,
   and every card on it dragged out to match. */
.grid > *, .stack, .stack > * { min-width: 0; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar); padding: 1.5rem; }
.login-card { background: #fff; border-radius: 18px; padding: 2.4rem; width: 400px; max-width: 100%; }
.login-card .logo { width: 52px; height: 52px; border-radius: 15px; background: var(--teal); color: var(--sidebar); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.login-card h1 { font-family: var(--display); font-size: 1.5rem; }
.login-card p.sub { color: var(--faint); margin-bottom: 1.4rem; }
.hint { background: var(--teal-soft); border: 1px solid #cdeee7; border-radius: 10px; padding: .8rem .9rem; font-size: .78rem; color: var(--ink-2); margin-top: 1.1rem; line-height: 1.6; }
.err { color: var(--red); font-size: .84rem; margin-top: .6rem; min-height: 1.1rem; font-weight: 600; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex-shrink: 0; background: var(--sidebar); color: #c3d2cc;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sb-brand { display: flex; gap: .7rem; align-items: center; padding: 1.1rem 1.2rem; border-bottom: 1px solid #27403a; }
.sb-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--teal); color: var(--sidebar); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-brand h1 { font-size: .95rem; color: #fff; font-family: var(--display); }
.sb-brand .sub { font-size: .6rem; letter-spacing: .1em; color: #7d938c; text-transform: uppercase; }
.sb-nav { flex: 1; padding: .8rem .7rem; }
.sb-group { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: #6f857e; margin: 1rem .6rem .3rem; font-weight: 700; }
.sb-link { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: 9px; font-size: .86rem; color: #bccac4; cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: inherit; }
.sb-link:hover { background: var(--sidebar-2); color: #fff; }
.sb-link.active { background: var(--teal); color: var(--sidebar); font-weight: 700; }
.sb-link .ic { width: 1.1rem; text-align: center; opacity: .9; }
.sb-foot { padding: .9rem 1.2rem; border-top: 1px solid #27403a; font-size: .76rem; color: #7d938c; }
.sb-foot b { color: #dce6e2; display: block; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 58px; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.6rem; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 8; }
.content { padding: 1.5rem 1.6rem 3rem; flex: 1; }

.eyebrow { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-text); font-weight: 700; }
.page-title { font-family: var(--display); font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.page-sub { color: var(--faint); margin-top: .15rem; margin-bottom: 1.2rem; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: .5rem .85rem; font-size: .84rem; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-teal { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
.btn-teal:hover { background: var(--teal-text); }
.btn-sm { padding: .3rem .6rem; font-size: .76rem; }
.btn-danger { color: var(--red); border-color: #f0d3ce; }
.btn-danger:hover { background: var(--red-soft); }
.btn-wide { width: 100%; padding: .7rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { border: none; background: none; color: var(--teal-text); font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; font-size: inherit; text-decoration: underline; }

/* ---------- cards, grids ---------- */
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.card.pad0 { padding: 0; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .95rem 1.2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-h h3 { font-family: var(--display); font-size: 1rem; font-weight: 700; }
.card-h .sub { font-size: .78rem; color: var(--faint); }
.card-b { padding: 1.2rem; }

.stat .v { font-family: var(--display); font-size: 1.7rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--faint); font-size: .8rem; margin-top: .2rem; }
.stat .d { font-size: .74rem; color: var(--soft); margin-top: .35rem; }
.stat.hot .v { color: var(--red); }
.stat.good .v { color: var(--green); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 99px; font-size: .71rem; font-weight: 700; white-space: nowrap; }
.pill.gray { background: #eef2f0; color: #566962; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--sand-soft); color: var(--sand-deep); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.teal { background: var(--teal-soft); color: var(--teal-text); }
.pill.purple { background: var(--purple-soft); color: var(--purple); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; padding: .65rem 1.2rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
tbody td { padding: .7rem 1.2rem; border-bottom: 1px solid var(--line-soft); font-size: .86rem; color: var(--ink-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafdfb; }
tbody tr.clickable { cursor: pointer; }
td.strong, th.strong { color: var(--ink); font-weight: 700; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.empty-row { padding: 2.6rem 1.2rem; text-align: center; color: var(--faint); }

/* ---------- filter bar (every list has one) ---------- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input, .filters select { border: 1px solid var(--line); border-radius: 9px; padding: .45rem .7rem; font-size: .84rem; font-family: inherit; background: #fff; color: var(--ink); }
.filters input[type="search"] { min-width: 230px; }
.filters .count { margin-left: auto; font-size: .78rem; color: var(--faint); }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; background: var(--surface-2); padding: .25rem; border-radius: 10px; }
.tab { border: none; background: none; padding: .38rem .7rem; border-radius: 8px; font-size: .8rem; font-weight: 600; color: var(--soft); cursor: pointer; font-family: inherit; }
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(18,32,29,.12); }
.tab .n { color: var(--faint); font-weight: 600; margin-left: .25rem; }

/* ---------- forms ---------- */
/* Every text box and dropdown looks the same, inside a .field or not:
   in tables, next to a search, in a one-line row. */
input:not([type]), input[type="text"], input[type="number"], input[type="email"], input[type="date"],
input[type="search"], input[type="password"], input[type="tel"], input[type="url"], select, textarea {
  border: 1px solid var(--line); border-radius: 9px; padding: .5rem .7rem;
  font-size: .86rem; font-family: inherit; background: #fff; color: var(--ink); max-width: 100%;
}
input:not([type]):focus, input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="date"]:focus,
input[type="search"]:focus, input[type="password"]:focus, input[type="tel"]:focus, input[type="url"]:focus, select:focus, textarea:focus {
  outline: 2px solid var(--teal); outline-offset: -1px; border-color: transparent;
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--soft); }
td input:not([type="checkbox"]):not([type="color"]):not([type="file"]), td select { padding: .38rem .6rem; font-size: .84rem; border-radius: 8px; }

.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .78rem; font-weight: 600; color: var(--soft); margin-bottom: .25rem; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: .6rem .75rem;
  font-size: .88rem; font-family: inherit; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: -1px; border-color: transparent; }
.field .help { font-size: .74rem; color: var(--faint); margin-top: .25rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .9rem; }
.form-grid .span2 { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .84rem; font-weight: 600; color: var(--ink-2); margin-bottom: .5rem; }
.check input { width: auto; accent-color: var(--teal-deep); }

.pager { display: flex; align-items: center; justify-content: center; gap: .9rem;
  padding: .7rem; border-top: 1px solid var(--line); font-size: .82rem; }
.pager .btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- the queue's filter panel ----------
   Five stacked rows of chips was a wall. Labels now sit in a fixed
   column so the eye runs down them, each row keeps to one line with the
   rest folded behind a count, and whatever is in force is said in words
   at the top with a way out. */
.filter-card { margin-bottom: 1rem; padding: .35rem 1rem .5rem; }
.filter-row { display: grid; grid-template-columns: 6rem 1fr; align-items: start;
  gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.filter-row:first-child, .filter-active + .filter-row { border-top: 0; }
.filter-row .eyebrow { padding-top: .3rem; }
.filter-active { display: grid; grid-template-columns: 6rem 1fr; align-items: start;
  gap: .5rem; padding: .5rem 0 .15rem; }
.filter-active .eyebrow { padding-top: .3rem; }
.filter-active .chip.on .x { margin-left: .15rem; opacity: .75; font-weight: 700; }
.chip-more { border-style: dashed; color: var(--ink-2); font-weight: 600; }
.chip .n { opacity: .55; margin-left: .3rem; font-variant-numeric: tabular-nums; flex: none; }
/* a fabric name can run to forty characters; the label gives way, the
   count never does, and the full name is on the tooltip */
.filter-row .chip { display: inline-flex; align-items: center; max-width: 21rem; }
.filter-row .chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-note { padding: .1rem 0 .5rem 6.5rem; font-size: .78rem; color: var(--ink-2); }
@media (max-width: 760px) {
  .filter-row, .filter-active { grid-template-columns: 1fr; gap: .2rem; }
  .filter-note { padding-left: 0; }
}

/* ---------- pick cards ----------
   The product tiles on the order form, and the category above them,
   which used to be chips and so looked like a different kind of choice
   when it is the same kind: pick one of these. One component now, so
   they cannot drift apart again.

   Kept to about the height of a text field. Square tiles were tidy and
   pushed the rest of the form off the screen, and the choice does not
   need that much room: a name and a number under it.

   The selected card keeps its 1px border and gains a ring inside it,
   rather than growing to 2px, which would shift everything beside it by
   a pixel each time somebody changed their mind. */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .5rem; }
.pick-card {
  display: flex; flex-direction: column; justify-content: center; gap: .1rem;
  min-height: 3.3rem; text-align: left; padding: .5rem .75rem; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: border-color .12s ease, background .12s ease;
}
.pick-card:hover:not(:disabled) { border-color: var(--teal); }
.pick-card.on { border-color: var(--teal-deep); box-shadow: inset 0 0 0 1px var(--teal-deep); background: var(--surface-2); }
.pick-card .nm { font-weight: 700; line-height: 1.2; font-size: .88rem; }
.pick-card .sub { font-size: .75rem; color: var(--ink-2); line-height: 1.25; }
.pick-card:disabled { opacity: .45; cursor: default; }
@media (max-width: 520px) {
  .pick-grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .4rem; }
}

/* ---------- colour lines on the order form ----------
   A colour and its own sizes, one line each. The size columns line up
   under one set of headings, so a reader compares down a column rather
   than counting along a row. */
.colour-lines { display: grid; gap: .3rem; margin-bottom: .6rem; }
.cl-head, .cl-line {
  display: grid; align-items: center; gap: .3rem;
  grid-template-columns: 11.5rem repeat(var(--sizes), minmax(2.6rem, 1fr)) 3rem 2rem;
}
.cl-head > span { font-size: .72rem; color: var(--ink-2); text-align: center; }
.cl-head > span:first-child { text-align: left; }
.cl-colour { display: flex; align-items: center; gap: .4rem; }
.cl-colour select { min-width: 0; }
.swatch { width: 18px; height: 18px; border-radius: 5px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.cl-line input[type="number"] { text-align: center; padding-left: .2rem; padding-right: .2rem; }
.cl-total { text-align: center; font-weight: 700; }
.cl-pantone { display: flex; align-items: center; gap: .5rem; margin: .1rem 0 .4rem 12rem; }
.cl-pantone label { font-size: .78rem; color: var(--ink-2); }
/* a line under its own colour's minimum: said beside that line, because
   the order total has nothing to do with it */
.cl-short { font-size: .78rem; color: var(--red); margin: .1rem 0 .5rem 12rem; overflow-wrap: anywhere; }
/* how one colour is finished: quiet when it matches every other colour,
   and in the ink when it does not, so a difference is seen without
   opening anything */
.cl-finish { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  font-size: .78rem; margin: .1rem 0 .5rem 12rem; }
.cl-finish .strong { font-weight: 700; color: var(--ink); }
.cl-panel { margin: .2rem 0 .8rem 12rem; padding: .8rem .9rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface-2); }
.cl-panel .field label { font-size: .78rem; }
.link-btn { border: none; background: none; padding: 0; font: inherit; color: var(--teal-deep);
  font-weight: 600; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--ink); }
.cl-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .2rem; }

/* on a phone the row becomes a block: the colour on its own line, the
   sizes wrapping underneath it */
@media (max-width: 860px) {
  .cl-head { display: none; }
  .cl-line { grid-template-columns: repeat(auto-fill, minmax(3.4rem, 1fr));
    padding: .5rem; border: 1px solid var(--line); border-radius: 10px; }
  .cl-colour { grid-column: 1 / -1; }
  .cl-line input[type="number"] { min-width: 0; }
  .cl-pantone { margin-left: 0; }
  .cl-short { margin-left: 0; }
  .cl-finish, .cl-panel { margin-left: 0; }
}

/* ---------- a person's picture ---------- */
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center;
  justify-content: center; flex: none; background: var(--line); }
.avatar-text { background: var(--teal-deep); color: #fff; font-weight: 700; letter-spacing: .02em; }

/* ---------- the role tree ---------- */
.role-group { padding: .45rem 0; border-top: 1px solid var(--line); }
.role-group:first-child { border-top: 0; padding-top: 0; }
.role-opt.parent { font-weight: 700; color: var(--ink); }
.role-opt.full { font-weight: 700; }
.role-kids { border-left: 2px solid var(--line); padding-left: .7rem; }
/* greyed out because something ticked above already includes it */
.role-opt.covered { opacity: .55; }
.role-opt.covered span { text-decoration: underline dotted var(--line); }

/* ---------- timeline ---------- */
.tl { position: relative; padding-left: 1.9rem; }
.tl::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: .5rem 0; }
.tl-dot { position: absolute; left: -1.55rem; top: .7rem; width: 17px; height: 17px; border-radius: 50%; border: 3px solid var(--bg); }
.tl-item .nm { font-weight: 600; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tl-item .meta { font-size: .76rem; color: var(--faint); margin-top: .1rem; }

/* ---------- key value list ---------- */
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line-soft); font-size: .86rem; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--faint); }
.kv .v { font-weight: 600; text-align: right; }

/* ---------- banners ---------- */
.banner { background: var(--sand-soft); border: 1px solid #edd6a4; border-radius: 10px; padding: .7rem 1rem; font-size: .85rem; color: var(--sand-deep); margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.banner.red { background: var(--red-soft); border-color: #f0cfc9; color: var(--red); }
.banner.green { background: var(--green-soft); border-color: #c4e6d1; color: var(--green); }
.banner.blue { background: var(--blue-soft); border-color: #cbdff5; color: var(--blue); }
.banner .grow { flex: 1; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(18, 32, 29, .45); display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1rem; z-index: 40; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 560px; max-width: 100%; box-shadow: var(--shadow); }
.modal.wide { width: 860px; }
.modal-h { display: flex; align-items: center; gap: .8rem; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-family: var(--display); font-size: 1.1rem; font-weight: 700; }
.modal-b { padding: 1.3rem; max-height: 65vh; overflow-y: auto; }
.modal-f { display: flex; gap: .5rem; justify-content: flex-end; padding: .9rem 1.3rem; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.icon-btn { border: none; background: none; font-size: 1.4rem; line-height: 1; color: var(--faint); cursor: pointer; padding: .1rem .3rem; }
.icon-btn:hover { color: var(--ink); }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 10px; font-size: .85rem; font-weight: 600; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; }
.toast.bad { background: var(--red); }

/* ---------- misc ---------- */
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal-deep); }
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: .2rem .65rem; font-size: .76rem; color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.thumb { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.file-row { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line-soft); font-size: .84rem; }
/* A filename is one long unbroken word as often as not, and a machine
   made one is always. Without this it refuses to wrap, pushes the row
   wider than the phone, and takes the page with it. */
.file-row .grow { min-width: 0; }
.file-row a, .file-row .muted { overflow-wrap: anywhere; }
.file-row:last-child { border-bottom: none; }
.loading { padding: 2.5rem; text-align: center; color: var(--faint); }

@media (max-width: 1100px) {
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* the menu button, only on a phone */
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1.1rem; line-height: 1; padding: .35rem .55rem; cursor: pointer; color: var(--ink); }

@media (max-width: 760px) {
  /* The floor works from a phone, so the work comes first and the menu
     folds away until it is asked for. */
  .app { flex-direction: column; }
  .menu-btn { display: inline-flex; }
  .sidebar { width: 100%; height: auto; position: static; display: none; }
  .app.menu-open .sidebar { display: block; }
  .sb-nav { display: flex; flex-wrap: wrap; gap: .3rem; }
  .sb-link { width: auto; }
  .sb-group { width: 100%; margin: .5rem .4rem .2rem; }
  .content { padding: 1rem .8rem 3rem; }
  .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { position: sticky; top: 0; z-index: 30; gap: .6rem; }
  .page-head { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .page-head .actions { width: 100%; display: flex; flex-wrap: wrap; gap: .4rem; }

  /* A table is unreadable at this width, so each row becomes a card and
     each cell says which column it is. */
  .table-wrap:not(.tight) { overflow: visible; }
  .table-wrap:not(.tight) table, .table-wrap:not(.tight) thead, .table-wrap:not(.tight) tbody,
  .table-wrap:not(.tight) tr, .table-wrap:not(.tight) td { display: block; width: 100%; }
  .table-wrap:not(.tight) thead { display: none; }
  .table-wrap:not(.tight) tbody tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: .6rem;
    padding: .2rem .1rem; background: var(--surface); }
  .table-wrap:not(.tight) tbody td { border: none; display: flex; justify-content: space-between;
    align-items: baseline; gap: 1rem; padding: .32rem .7rem; text-align: left !important; }
  .table-wrap:not(.tight) tbody td::before { content: attr(data-label); color: var(--soft); font-size: .74rem;
    text-transform: uppercase; letter-spacing: .04em; flex: 0 0 8.5rem; }
  .table-wrap:not(.tight) tbody td:empty { display: none; }
  .table-wrap:not(.tight) tbody tr[data-group] td::before { content: none; }
  .table-wrap.tight { overflow-x: auto; }
  .table-wrap.tight td, .table-wrap.tight th { padding: .4rem .5rem; font-size: .86rem; }
  .row-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
  .row-actions .btn { min-height: 2.1rem; }
  .empty-row { text-align: center !important; }
  .empty-row::before { content: none !important; }

  /* fingers, not a mouse */
  .btn, .chip, .tab { min-height: 2.2rem; }
  input, select, textarea { font-size: 16px; }   /* stops the phone zooming in */
  .filters { flex-wrap: wrap; }
  .filters input, .filters select { flex: 1 1 100%; }
}

/* an on/off switch, used for Published */
.switch { position: relative; display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--ink-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--teal-deep); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--teal-deep); outline-offset: 2px; }

/* a Delete in a modal footer sits on the left, away from Save */
.modal-f .btn-danger:first-child { margin-right: auto; }

/* a roster name or number: click to copy */
.copy-cell { cursor: copy; border-bottom: 1px dashed var(--line); }
.copy-cell:hover { color: var(--teal-deep, #0f6b63); border-bottom-color: currentColor; }

/* a size heading inside a roster or a grouped table */
tr[data-group] td { background: var(--surface-2); border-top: 1px solid var(--line); }
tr[data-group] td:first-child { letter-spacing: .04em; }

/* Every other size in a roster sits on a darker band, so the designer
   can see at a glance where one size finishes and the next starts. */
tr[data-band] td { background: var(--surface-2); }
