/* Bravery Details — back office (/admin) and crew screen (/crew).
   Loaded after site.css and built from its tokens. Same rules as the rest of
   the site: ruled rows, dotted leaders, flush-right tabular numbers. No cards,
   no pills, no shadows, no radius. */

[hidden] { display: none !important; }

.office { padding-block: var(--s6) var(--s8); }
.office h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); }
.office h2 { font-size: clamp(1.35rem, 3.6vw, 1.9rem); }
.office h3 { font-size: 1.05rem; letter-spacing: .03em; }

.office-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--s2) var(--s5);
  padding-bottom: var(--s4); border-bottom: 2px solid var(--gold);
}
.office-head p { font-size: .88rem; color: var(--dim); }
.office-head p strong { color: var(--paper); font-weight: 500; }

/* a button that reads as a link */
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); text-decoration: underline; text-decoration-color: var(--rule-gold);
  text-underline-offset: .22em; font-size: inherit;
}
.linkbtn:hover { color: var(--paper); text-decoration-color: var(--gold); }

/* --- tabs: printed like the nav, gold rule under the current one --------- */
.tabs {
  display: flex; gap: var(--s5); overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--rule); margin-bottom: var(--s6);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex-shrink: 0; padding: var(--s4) 0 var(--s3);
  font-family: var(--display); font-size: .86rem; font-weight: 500;
  letter-spacing: .11em; text-transform: uppercase; white-space: nowrap;
  color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--paper); border-bottom-color: var(--rule-hi); }
.tabs a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }

.tab > h2 { margin-bottom: var(--s2); }
.tab > .lede, .tab > .fine { margin-bottom: var(--s5); }

/* --- toolbars ------------------------------------------------------------ */
.bar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3); margin-bottom: var(--s5); }
.bar .field { min-width: 0; }
.bar .field + .field { margin-top: 0; }
.bar .field input, .bar .field select { padding-block: var(--s1); }
.bar__spacer { flex: 1 1 auto; }
.bar .btn, .seg button { min-height: 44px; }
.bar .field input { min-height: 44px; }
.seg { display: inline-flex; border: 1px solid var(--rule-hi); }
.seg button {
  background: none; border: 0; padding: var(--s2) var(--s4); cursor: pointer;
  font-family: var(--display); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--rule-hi); }
.seg button[aria-pressed="true"] { color: var(--ink); background: var(--gold); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--paper); }

/* --- ruled key / value rows with a dotted leader ------------------------- */
.kvs { border-top: 1px solid var(--rule-hi); }
.kv {
  display: flex; align-items: baseline; gap: var(--s3);
  padding: var(--s2) 0; border-bottom: 1px solid var(--rule);
  font-size: .94rem;
}
.kv__k {
  flex-shrink: 0; font-family: var(--display); font-size: .74rem; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase; color: var(--dim);
}
.kv__lead { flex: 1 1 auto; min-width: var(--s4); border-bottom: 1px dotted var(--rule-hi); transform: translateY(-.3em); }
.kv__v { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.kv--total .kv__k { color: var(--paper); }
.kv--total .kv__v { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--gold); line-height: 1.1; }
.kv--stack { flex-direction: column; align-items: stretch; gap: var(--s1); }
.kv--stack .kv__v { text-align: left; white-space: pre-wrap; color: var(--muted); }

.ok { color: var(--green); }
.bad { color: var(--red); }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* status / flag words: set in the label face, never a chip */
.flag {
  font-family: var(--display); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--dim); white-space: nowrap;
}
.flag--act { color: var(--gold); }
.flag--bad { color: var(--red); }
.flag--ok { color: var(--green); }

/* --- messages ------------------------------------------------------------ */
.msg { font-size: .88rem; margin-top: var(--s3); }
.msg:empty { display: none; }
.msg--err { color: var(--red); }
.msg--ok { color: var(--green); }
.msg--info { color: var(--muted); }
.loading { color: var(--dim); font-size: .9rem; padding: var(--s4) 0; }

/* --- job rows (schedule, requests, lists) -------------------------------- */
.jobs { list-style: none; padding: 0; border-top: 1px solid var(--rule-hi); }
.jobs > li { border-bottom: 1px solid var(--rule); max-width: none; }
.job {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline;
  gap: var(--s1) var(--s3); width: 100%; text-align: left;
  padding: var(--s3) 0 var(--s3) var(--s3); background: none; border: 0; cursor: pointer;
  position: relative;
}
.job::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--rule-hi); }
.job:hover::before { width: 3px; background: var(--chrome); }
.job--act::before { width: 3px; background: var(--gold); }
.job--dead { opacity: .55; }
.job--dead .job__name { text-decoration: line-through; text-decoration-color: var(--rule-hi); }
.job__time { font-family: var(--display); font-weight: 600; font-size: .95rem; letter-spacing: .03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.job__name { display: block; font-family: var(--display); font-weight: 500; font-size: .98rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1.2; }
.job__note { display: block; font-size: .8rem; color: var(--dim); margin-top: 2px; }
.job__side { text-align: right; }
.job__amt { display: block; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }

.empty { color: var(--dim); font-size: .9rem; padding: var(--s3) 0; }

/* --- schedule: day view columns ------------------------------------------ */
.cols { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .cols { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s5); } }
.col__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  padding: 0 0 var(--s2) var(--s3); position: relative;
}
.col__head::before { content: ""; position: absolute; left: 0; top: .1em; bottom: var(--s2); width: 3px; background: var(--c, var(--rule-hi)); }
.col__head h3 { font-size: 1rem; }
.col--off .jobs { border-top-color: var(--rule); }
.col--off .col__head h3 { color: var(--dim); }

.swatch { display: inline-block; width: .7em; height: .7em; background: var(--c, var(--rule-hi)); margin-right: .4em; vertical-align: .02em; }

/* --- schedule: week table ------------------------------------------------ */
.week { width: 100%; border-collapse: collapse; min-width: 880px; font-size: .85rem; }
.week th, .week td { border-bottom: 1px solid var(--rule); padding: var(--s2); vertical-align: top; text-align: left; }
.week td + td, .week th + th { border-left: 1px solid var(--rule); }
.week thead th {
  font-family: var(--display); font-weight: 500; font-size: .74rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--dim); border-bottom-color: var(--rule-hi);
}
.week thead th button { background: none; border: 0; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-hi); text-underline-offset: .25em; }
.week thead th button:hover { color: var(--gold); }
.week thead th.is-today { color: var(--gold); }
.week tbody th { font-family: var(--display); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; border-left: 3px solid var(--c, var(--rule-hi)); }
.week td.is-off { color: var(--dim); }
.wk { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 2px 0; cursor: pointer; line-height: 1.35; }
.wk:hover { color: var(--gold); }
.wk .num { font-weight: 600; }
.wk--act { color: var(--gold); }
.wk--dead { color: var(--dim); text-decoration: line-through; }

/* --- side panel (dialog) ------------------------------------------------- */
.panel {
  margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--rule-hi);
  width: min(100%, 640px); max-width: 100%; height: 100%; max-height: 100%;
  background: var(--ink-2); color: var(--paper);
  overflow-y: auto; overscroll-behavior: contain;
}
.panel::backdrop { background: rgba(6, 6, 9, .72); }
.panel__bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) var(--gutter); background: var(--ink-2); border-bottom: 1px solid var(--rule-hi);
}
.panel__bar .field-label { color: var(--muted); }
.panel__body { padding: var(--s5) var(--gutter) var(--s8); }
.panel__body > h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
.panel__sub { margin-top: var(--s2); color: var(--muted); font-size: .92rem; }
.psec { margin-top: var(--s6); }
.psec > h3 { margin-bottom: var(--s3); }
.acts { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
.acts--top { margin-top: var(--s5); padding-bottom: var(--s5); border-bottom: 1px solid var(--rule); }

/* --- forms inside the office -------------------------------------------- */
.office .field textarea { min-height: 96px; }
.office .field > span.field-label { margin-bottom: var(--s2); }
.office select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: var(--s6) !important; }
.inline { display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 560px) { .inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.inline .field + .field { margin-top: 0; }
.inline .btn { width: 100%; }

fieldset.group { border: 0; padding: 0; min-width: 0; }
fieldset.group > legend { padding: 0; margin-bottom: var(--s2); }
.checks-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.check {
  display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer;
  min-height: 44px; font-size: .92rem;
}
.check input { width: 20px; height: 20px; accent-color: var(--gold); flex-shrink: 0; margin: 0; }
.check small { color: var(--dim); font-size: .78rem; }
.check--dim { color: var(--dim); }

.office input[type="color"] { width: 64px; height: 44px; padding: 2px; background: var(--surface); border: 1px solid var(--rule-hi); cursor: pointer; }

/* --- rows in lists (time off, team, customers) --------------------------- */
.rows { border-top: 1px solid var(--rule-hi); }
.row { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.row__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s4); }
.row__title { font-family: var(--display); font-weight: 500; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; }
.row__meta { font-size: .85rem; color: var(--dim); margin-top: var(--s1); }
.row__body { margin-top: var(--s3); }
.row--edge { padding-left: var(--s4); position: relative; }
.row--edge::before { content: ""; position: absolute; left: 0; top: var(--s4); bottom: var(--s4); width: 3px; background: var(--c, var(--rule-hi)); }
.rowbtn { display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; padding: 0; }
.rowbtn:hover .row__title { color: var(--gold); }

.sub { margin-top: var(--s7); }
.sub > h3 { margin-bottom: var(--s3); }

/* --- photos, signatures, QR ---------------------------------------------- */
.photos { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.photos a { display: block; border: 1px solid var(--rule); background: var(--surface); }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.sigimg { background: #fff; border: 1px solid var(--rule-hi); max-width: 360px; width: 100%; }

.qr { background: #fff; padding: var(--s3); width: min(100%, 300px); }
.qr svg { width: 100%; height: auto; }
.qr--big { width: min(100%, 340px); margin-inline: auto; }
.payurl { display: block; margin-top: var(--s3); font-size: .85rem; overflow-wrap: anywhere; color: var(--muted); }

.warnline { border-left: 3px solid var(--red); padding: var(--s2) 0 var(--s2) var(--s3); color: var(--paper); font-size: .92rem; }
.warnline strong { color: var(--red); font-weight: 600; }
.noteline { border-left: 3px solid var(--gold); padding: var(--s2) 0 var(--s2) var(--s3); font-size: .92rem; color: var(--muted); }

/* --- settings ------------------------------------------------------------ */
.setgroup + .setgroup { margin-top: var(--s7); padding-top: var(--s6); border-top: 1px solid var(--rule); }
.setgroup > h3 { margin-bottom: var(--s2); }
.setgroup > p.fine { margin-bottom: var(--s4); }
.slotgrid { display: grid; gap: 0 var(--s3); grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.office .field input.pct { max-width: 10rem; }

/* ============================================================== crew ==== */
.crew .btn--big { width: 100%; min-height: 60px; font-size: 1.05rem; }
.crew .btn { min-height: 48px; }
.crew .job { padding-block: var(--s4); }
.crew .job__time { font-size: 1.1rem; }
.crew .job__name { font-size: 1.1rem; }
.crew .jobs + h2, .crew .empty + h2 { margin-top: var(--s7); }
.crew .kv { font-size: 1rem; padding-block: var(--s3); }
.crew .kv__v a { color: var(--paper); }

.jobhead { padding-bottom: var(--s4); border-bottom: 1px solid var(--rule-hi); }
.jobhead h2 { margin-top: var(--s3); }
.jobhead .flag { font-size: .8rem; }
.back { min-height: 44px; display: inline-flex; align-items: center; }

.bigrow { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; margin-top: var(--s4); }
.bigrow .btn { width: 100%; padding-inline: var(--s3); }

/* the flow: numbered steps, the ticket's own checkbox square marks done */
.steps { list-style: none; padding: 0; margin-top: var(--s6); border-top: 1px solid var(--rule-hi); counter-reset: step; }
.step { border-bottom: 1px solid var(--rule); padding: var(--s4) 0; max-width: none; }
.step__head { display: flex; align-items: center; gap: var(--s3); }
.step__box { flex-shrink: 0; width: 20px; height: 20px; border: 1px solid var(--rule-hi); position: relative; }
.step--done .step__box { border-color: var(--gold); }
.step--done .step__box::after { content: ""; position: absolute; inset: 4px; background: var(--gold); }
.step--now .step__box { border: 2px solid var(--gold); }
.step__name { font-family: var(--display); font-weight: 500; font-size: 1.05rem; letter-spacing: .05em; text-transform: uppercase; }
.step--later .step__name { color: var(--dim); }
.step__count { margin-left: auto; font-family: var(--display); font-variant-numeric: tabular-nums; color: var(--muted); }
.step__body { margin-top: var(--s4); }

.filepick { position: relative; display: block; }
.filepick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.filepick input:focus-visible + .btn { outline: 2px solid var(--gold); outline-offset: 3px; }

.sig { margin-top: var(--s2); }
.sig canvas { display: block; width: 100%; height: 200px; background: #fff; border: 1px solid var(--rule-hi); touch-action: none; }
.sig__bar { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--s2); }

.pay { text-align: center; padding: var(--s5) 0; }
.pay__amt { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 12vw, 3.6rem); color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; margin: var(--s3) 0 var(--s5); }
.pay .payurl { font-size: 1rem; color: var(--paper); }
.pay .fine { margin: var(--s4) auto 0; }

.radios { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.radio { display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 56px; border: 1px solid var(--rule-hi); cursor: pointer; font-family: var(--display); letter-spacing: .1em; text-transform: uppercase; }
.radio input { width: 20px; height: 20px; accent-color: var(--gold); margin: 0; }
.radio:has(input:checked) { border-color: var(--gold); color: var(--gold); }

/* Square appointments in the schedule: same row as a job, but not a button,
   marked blue, and managed in Square. */
.sub--square { margin-bottom: var(--s6); }
.job--square { cursor: default; border-left: 3px solid var(--blue); padding-left: var(--s3); }
.job__end { display: block; font-family: var(--body); font-weight: 400; font-size: .76rem; color: var(--dim); letter-spacing: 0; }
.job__tel { display: inline-block; margin-top: 2px; font-size: .84rem; color: var(--blue); text-decoration: none; }
.job__tel:hover { text-decoration: underline; }
.flag--sq { color: var(--blue); display: block; }
.wk--square { color: var(--blue); }
