/* Admin pages (/admin and /admin/login). Uses the shared tier-2 tokens from
   tokens.css; monochrome like the public pages, which now use Manrope. */

/* Match the public landing pages: Manrope everywhere, replacing the Plex faces
   from tokens.css. manrope.woff2 resolves through core/static like the rest. */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope.woff2") format("woff2");
}
:root {
  --np-sans:      "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--np-sans);
  --font-body:    var(--np-sans);
  --font-num:     var(--np-sans);
}

*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto !important; }
}
html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body.adm {
  margin: 0; background: var(--surface); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;   /* Manrope is proportional; keep number columns aligned */
}
a { color: var(--text); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
p { margin: 0; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius);
}
.mono { font-family: var(--font-num); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Icons ---------- */
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ico .fill { fill: currentColor; stroke: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1; text-decoration: none; cursor: pointer;
  padding: .7rem 1.05rem; border-radius: 6px; border: 1px solid transparent; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn.sm { padding: .5rem .75rem; font-size: .85rem; }
.btn.primary { background: var(--brand); color: var(--brand-text); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 84%, var(--surface)); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.btn.icon-only { padding: .5rem; color: var(--text-muted); }
.btn.icon-only:hover { color: var(--text); }
.btn.danger:hover { color: var(--text); border-color: var(--text); }

/* ---------- Sidebar ----------
   The admin's navigation: logo (with the site picker) on top, the sections
   with their sub-pages, and the account bits at the foot. Fixed on the left
   on wide screens; on phones a slim top bar's menu button slides it in. */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30;
  display: flex; flex-direction: column; gap: 1.5rem; padding: 1.25rem 1rem 1.25rem 1.25rem;
  background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand img { height: 44px; width: auto; display: block; }
/* The wordmark is white ink; light mode swaps in the black one. */
.logo-black { display: none; }
.theme-light .logo-white { display: none; }
.theme-light .logo-black { display: block; }
.side-nav { display: grid; gap: .25rem; }
.grp summary, .side-link {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none;
  padding: .55rem .7rem; border-radius: 6px; font-size: .92rem; font-weight: 600; color: var(--text); text-decoration: none;
}
.grp summary::-webkit-details-marker { display: none; }
.grp summary:hover, .side-link:hover { background: var(--surface-raised); }
.grp-chev { width: 12px; height: 12px; color: var(--text-muted); transition: transform .15s ease; }
.grp[open] .grp-chev { transform: rotate(180deg); }
.grp a {
  display: block; margin: .1rem 0 .1rem .7rem; padding: .45rem .7rem; border-left: 1px solid var(--border);
  font-size: .9rem; color: var(--text-muted); text-decoration: none;
}
.grp a:hover { color: var(--text); }
.grp a[aria-current], .side-link[aria-current] { color: var(--text); background: var(--surface-raised); }
.grp a[aria-current] { border-left-color: var(--text); border-radius: 0 6px 6px 0; }
.side-foot { margin-top: auto; display: grid; gap: .5rem; justify-items: start; }
.side-foot form { margin: 0; }
.email { color: var(--text-muted); font-size: .82rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbar, .side-scrim { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .mbar {
    display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 20;
    min-height: 64px; padding-inline: 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .mbar .brand img { height: 30px; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 85vw); height: auto;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .5);
  }
  .side .brand img { height: 36px; }
  body.nav-open .side { transform: none; }
  .side-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .55); }
  body.nav-open { overflow: hidden; }
}

/* ---------- Site picker ----------
   The logo opens a menu to switch between the two faces of Null. Same markup and CSS on both sites and here. */
.site-pick { position: relative; flex: none; }
.site-pick summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .45rem;
  padding: .3rem .45rem .3rem 0; border-radius: var(--radius); color: var(--text-muted);
  transition: color .15s ease;
}
.site-pick summary::-webkit-details-marker { display: none; }
.site-pick summary:hover, .site-pick[open] summary { color: var(--text); }
.site-pick summary svg { width: 12px; height: 12px; flex: none; transition: transform .15s ease; }
.site-pick[open] summary svg { transform: rotate(180deg); }
.site-pick-menu {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; min-width: 13.5rem;
  display: grid; padding: .35rem; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.site-pick-menu a {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .75rem; border-radius: var(--radius);
  font-size: .95rem; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap;
}
.site-pick-menu a:hover { background: var(--surface-raised); }
.site-pick-menu svg { width: 14px; height: 14px; flex: none; visibility: hidden; }
.site-pick-menu a[aria-current] svg { visibility: visible; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 16px 5rem; display: grid; gap: 3.25rem; align-content: start; }
@media (min-width: 960px) { .wrap { padding-inline: var(--gutter); } }
.sec { display: grid; gap: 1.1rem; min-width: 0; }
.sec-head h2 { font-size: 1.45rem; font-weight: 600; letter-spacing: -.015em; margin: 0 0 .3rem; }
.hint { color: var(--text-muted); font-size: .9rem; max-width: 72ch; }
.hint .ico { width: 14px; height: 14px; vertical-align: -2px; }
.hint.tight { font-size: .82rem; }
.sub-h {
  font-family: var(--font-num); font-weight: 500; font-size: .78rem; color: var(--text-muted);
  margin: .6rem 0 -.3rem; display: flex; align-items: center; gap: .6rem;
}
.sub-h::before { content: ""; width: 1.25rem; height: 1px; background: var(--border-strong); }
.stack { display: grid; gap: .75rem; }
.card {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem 1.2rem; min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.empty { color: var(--text-muted); font-size: .9rem; padding: 1rem 1.2rem; border: 1px dashed var(--border); border-radius: 10px; }
.pill {
  display: inline-block; font-family: var(--font-body); font-size: .72rem; font-weight: 600; line-height: 1;
  padding: .28rem .45rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-muted);
  vertical-align: 1px;
}

/* ---------- Form fields ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; align-items: end; }
@media (max-width: 640px) { .fields { grid-template-columns: minmax(0, 1fr); } }
.f { display: grid; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--text-muted); min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f.grow { flex: 1; }
.fh { display: none; }   /* field hints are hidden in the UI */
input[type=text], input[type=search], input[type=number], input[type=url], input[type=email], input[type=date], input[type=time], input[type=datetime-local], input[type=password], input[type=file], select, .menu-btn, textarea {
  font: inherit; font-size: .92rem; font-weight: 400; color: var(--text); width: 100%; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .6rem .7rem;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: color-mix(in srgb, var(--text-muted) 70%, transparent); }
input:hover { border-color: var(--border-strong); }
input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 14%, transparent); }
/* a required field left empty (marked when Save is tried; clears as it's filled in) */
.is-invalid, .is-invalid:focus { border-color: var(--ul-red, #FF1E3C) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ul-red, #FF1E3C) 22%, transparent) !important; }
textarea { resize: vertical; line-height: 1.5; }
input[type=file] { padding: .45rem .5rem; font-size: .85rem; color: var(--text-muted); }
.drop-item { margin-top: .75rem; background: var(--surface); }
.drop-item .ev-img { object-fit: contain; background: var(--surface-raised); }
.prod-top { display: grid; gap: 1rem; }
.prod-pics { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); gap: 1rem; margin-bottom: .6rem; }
.prod-card { display: grid; gap: 0; padding: 0; background: var(--surface); }
.prod-card .gallery-admin { margin-top: 0; }
.prod-card > * { padding: 1.1rem 1.2rem; }
.prod-card > .drop-item { margin-top: 0; }
.prod-sec { border-top: 1px solid var(--border); display: grid; gap: .6rem; align-content: start; }
.prod-card > .prod-row { padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--border); }
.prod-row > .prod-sec { padding: 1.1rem 1.2rem; border-top: 0; }
.prod-row > .prod-sec + .prod-sec { border-left: 1px solid var(--border); }
@media (max-width: 900px) {
  .prod-card > .prod-row { grid-template-columns: minmax(0, 1fr); }
  .prod-row > .prod-sec + .prod-sec { border-left: 0; border-top: 1px solid var(--border); }
}
.prod-card > .prod-foot { border-top: 1px solid var(--border); margin-top: 0; }
.sq-side { display: flex; align-items: center; gap: .5rem .6rem; flex-wrap: wrap; min-width: 0; }
.sq-side .sq-status { margin-right: .4rem; }
.sq-side select, .sq-side .menu-btn { max-width: 16rem; }
.pic-slot .pic-pick { position: relative; justify-self: start; cursor: pointer; }
.pic-slot .pic-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pic-slot .pic-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.prod-pics figure { margin: 0; display: grid; gap: .3rem; }
.prod-pics .ev-img { aspect-ratio: 1; object-fit: contain; background: var(--surface-raised); }
.prod-pics figcaption { font-size: .78rem; color: var(--text-muted); }
@media (max-width: 640px) { .prod-pics { grid-template-columns: 1fr 1fr; } }
.drop-products { margin-top: .9rem; display: grid; gap: .5rem; }
.prod-card .drop-products { margin-top: 0; }
.dp-list { display: grid; gap: .5rem; }
.dp-row { display: flex; align-items: center; gap: .8rem; padding: .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: grab; user-select: none; }
.dp-row .drag-handle { margin-right: -.3rem; }
.dp-row img, .dp-noimg { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: var(--surface-raised); flex: none; }
.dp-name { flex: 1; min-width: 0; font-weight: 600; }
.dp-name a { color: var(--text); }
.dp-name .mono { color: var(--text-muted); font-weight: 400; margin-left: .4rem; }
.add-product { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.add-product select, .add-product .menu-btn { flex: 1 1 260px; width: auto; }
.in-drops { margin: .3rem 0 0; }
.crumbs { margin: 0 0 .4rem; font-size: 1.2rem; font-weight: 500; color: var(--text); }
.crumbs a { color: var(--text); }
.cat-list { display: grid; gap: .5rem; }
.cat-row.drop-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.drop-thumbs { display: flex; }
.drop-thumbs > * { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: var(--surface); border: 2px solid var(--surface-raised); }
.drop-thumbs > * + * { margin-left: -24px; }
.cat-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto auto; align-items: center; gap: 1rem;
  padding: .6rem .9rem .6rem .6rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-raised); color: var(--text); text-decoration: none;
}
.cat-row:hover { border-color: var(--border-strong); }
.cat-row img, .cat-row .dp-noimg { width: 56px; height: 56px; }
.cat-main { display: grid; gap: .15rem; min-width: 0; }
.cat-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-meta { font-size: .82rem; color: var(--text-muted); }
.cat-price { color: var(--text-muted); font-size: .85rem; }
@media (max-width: 640px) {
  .cat-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .cat-row > .cat-meta, .cat-row > .cat-price { display: none; }
  .cat-row.drop-row { grid-template-columns: auto minmax(0, 1fr) auto; }
}
.square-admin { margin-top: .9rem; display: grid; gap: .6rem; }
.size-rows { display: grid; gap: .4rem; }
form.sizes { display: grid; gap: .6rem; }
.size-row { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 7rem) 16px auto; gap: .5rem; align-items: center; justify-content: start; }
.add-size { justify-self: start; }
.size-del { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 0; border-radius: var(--radius); background: none; color: var(--text-muted); cursor: pointer; }
.size-del:hover { color: var(--ul-red, #FF1E3C); background: var(--surface-raised); }
.size-del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sq-mark { width: 20px; height: 20px; flex: none; fill: var(--text-muted); opacity: .55; }
.sq-mark.on { fill: #3FCF6E; opacity: 1; }   /* green: linked to Square */
.size-row .sq-mark { width: 16px; height: 16px; display: block; }
.size-row > span { display: grid; place-items: center; height: 100%; }
.sq-status { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-muted); }
.sq-link { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.sq-link select, .sq-link .menu-btn { flex: 1 1 260px; width: auto; }
.flash { margin: 0 0 1rem; padding: .7rem 1rem; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-raised); font-size: .9rem; }
.flash.bad { border-color: var(--text); }
.gallery-admin { margin-top: .6rem; display: grid; gap: .6rem; }
.gallery-admin .row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.gallery-admin input[type=file] { flex: 1 1 240px; }
.thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.thumbs li { display: grid; gap: .3rem; justify-items: center; cursor: grab; padding: .25rem; border-radius: 8px; }
.thumbs li:active { cursor: grabbing; }
.thumbs img { width: 104px; height: 104px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.thumbs li { position: relative; }
.thumb-x { position: absolute; top: .55rem; right: .55rem; margin: 0; }
.thumb-x button { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgb(0 0 0 / .65); box-shadow: 0 0 0 1px rgb(255 255 255 / .25); }
.thumb-x button:hover { background: var(--ul-red, #FF1E3C); }
.thumb-x button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.thumb-x .ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
fieldset { border: 0; margin: 0 0 1.4rem; padding: 0; min-width: 0; }
legend { font-weight: 600; font-size: .95rem; margin-bottom: .8rem; padding: 0; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.foot.end { justify-content: flex-end; }
.acts { display: flex; align-items: center; gap: .35rem; }

/* Toggle switch (a styled checkbox; still a checkbox to forms and screen readers) */
.switch { display: inline-flex; align-items: center; gap: .55rem; font-size: .88rem; font-weight: 600; color: var(--text); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong); transition: background-color .15s, border-color .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); transition: transform .15s, background-color .15s;
}
.switch input:checked + .track { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--brand-text); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Clicks: KPI row ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; display: grid; gap: .35rem; align-content: start; min-width: 0; }
.kpi-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.kpi-value { font-family: var(--font-num); font-weight: 500; font-size: 2rem; line-height: 1.1; letter-spacing: -.02em; }
.kpi-value.kpi-text { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
.kpi-sub { font-size: .8rem; color: var(--text-muted); }

/* ---------- Clicks: table (a grid of rows, readable on phones) ---------- */
.crow {
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 6.5rem); gap: 1rem; align-items: start;
  padding: .8rem 1.2rem; border-top: 1px solid var(--border);
}
.chead { border-top: 0; padding-block: .7rem; font-family: var(--font-num); font-size: .75rem; color: var(--text-muted); }
.chead span:not(:first-child), .cnum { text-align: right; }
.cgroup {
  font-family: var(--font-num); font-size: .75rem; color: var(--text-muted);
  padding: 1rem 1.2rem .45rem; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 35%, transparent);
}
.rec-filter { margin: 0 0 .8rem; }
.rec-filter input { max-width: 22rem; }
.inv-sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-num); font-size: .75rem; color: var(--text-muted);
  padding: .8rem 1.2rem; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 35%, transparent);
}
.inv-sec:first-child > summary { border-top: 0; }
.inv-sec > summary::-webkit-details-marker { display: none; }
.inv-sec > summary:hover { color: var(--text); }
.inv-sec .grp-chev { transform: rotate(-90deg); }
.inv-sec[open] > summary .grp-chev { transform: rotate(0); }
.inv-sec .inv-count { margin-left: auto; }
.inv-empty { padding: 1.2rem; margin: 0; }
.cname { display: grid; gap: .15rem; min-width: 0; }
.cl { font-weight: 600; overflow-wrap: anywhere; }
.cn { font-size: .8rem; color: var(--text-muted); }
/* Share of 30-day clicks, relative to the busiest link. One neutral bar. */
.bar { display: block; height: 4px; margin-top: .45rem; border-radius: 999px; background: var(--border); max-width: 320px; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--text-muted); min-width: 0; }
.cnum { display: grid; gap: .1rem; }
.cnum .n { font-family: var(--font-num); font-weight: 500; font-size: 1.05rem; }
.cnum .p { font-size: .75rem; color: var(--text-muted); }
.cnum .z { color: var(--text-muted); }
@media (max-width: 640px) {
  .crow { grid-template-columns: minmax(0, 1fr) repeat(3, 3.6rem); gap: .6rem; padding-inline: .9rem; }
  .cgroup { padding-inline: .9rem; }
  .chead { font-size: .7rem; }
  .cnum .n { font-size: .95rem; }
  .cnum .p { font-size: .68rem; }
}

/* ---------- Events ---------- */
.ev { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.ev-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.ev-date { display: grid; place-content: center; text-align: center; font-family: var(--font-num); line-height: 1.05; }
.ev-date span { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; }
.ev-date b { font-size: 2.2rem; font-weight: 500; }
.ev-main { min-width: 0; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .8rem; color: var(--text-muted); margin-bottom: .3rem; }
.ev-title { display: inline-block; font-weight: 600; font-size: 1.05rem; text-decoration: none; margin-bottom: .9rem; overflow-wrap: anywhere; }
.ev-title:hover { text-decoration: underline; }
.ev.is-off .ev-img, .ev.is-off .ev-title { opacity: .55; }
@media (max-width: 640px) {
  .ev { grid-template-columns: 1fr; gap: .9rem; }
  .ev img.ev-img { aspect-ratio: 21 / 9; }
  .ev-date { aspect-ratio: auto; padding: .6rem; grid-auto-flow: column; gap: .5rem; justify-content: start; align-items: baseline; }
  .ev-date b { font-size: 1.4rem; }
}

/* "Add …" disclosures */
details.add > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .9rem; color: var(--text-muted);
}
details.add > summary::-webkit-details-marker { display: none; }
details.add > summary:hover { color: var(--text); }
details.add.card { border-style: dashed; background: transparent; }
details.add.card[open] { border-style: solid; background: var(--surface-raised); }
details.add.card[open] > summary { margin-bottom: 1rem; color: var(--text); }
details.add.inline { margin-top: .4rem; padding: .7rem 0 0; }
details.add.inline[open] > summary { margin-bottom: .6rem; color: var(--text); }

/* ---------- Links ---------- */
.group { padding-bottom: .9rem; }
.group-head { margin-bottom: .6rem; }
.group-title { font-size: 1.05rem; margin: 0; }
.sec-title { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.title-input {
  flex: 1 1 220px; font-weight: 600 !important; font-size: 1.05rem !important;
  background: transparent !important; border-color: transparent !important; padding-left: .4rem !important; margin-left: -.4rem;
}
.title-input:hover { border-color: var(--border) !important; }
.title-input:focus { background: var(--surface) !important; border-color: var(--text) !important; }

.link-list { display: grid; }
.link-list.is-empty { min-height: 3.2rem; border: 1px dashed var(--border-strong); border-radius: 8px; margin: .3rem 0; }
.lrow {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; align-items: center;
  padding: .6rem 0; border-top: 1px solid var(--border);
}
.lrow.new { border-top: 0; padding-top: 0; grid-template-columns: minmax(0, 1fr); }
.lrow .drag-body { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: .5rem; align-items: center; min-width: 0; }
.lacts { display: flex; align-items: center; gap: .75rem; }
.lacts.end { justify-content: flex-end; }
.lrow.is-off input { color: var(--text-muted); }
@media (max-width: 760px) {
  .lrow { align-items: start; }
  .lrow .drag-body { grid-template-columns: minmax(0, 1fr); }
  .lacts { justify-content: space-between; }
}

/* Drag to reorder */
.drag-handle {
  touch-action: none; cursor: grab; display: grid; place-items: center; width: 30px; height: 38px;
  border: 0; border-radius: 6px; color: var(--text-muted); background: transparent; padding: 0;
}
.drag-handle .ico { width: 18px; height: 18px; }
.drag-handle:hover { color: var(--text); background: var(--surface-hover); }
.drag-handle:active { cursor: grabbing; }
.drag-title { display: none; }
body.dragging .drag-body { display: none; }
body.dragging .drag-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
body.dragging .lrow { padding: .35rem 0; align-items: center; }
.drag-ghost { opacity: .3; }
.drag-chosen { background: var(--surface-hover); border-radius: 6px; }
.drag-float { opacity: .95 !important; background: var(--surface-hover); border-radius: 8px; box-shadow: 0 10px 30px rgb(0 0 0 / .55); }

.add-sec { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; border-style: dashed; background: transparent; }

/* ---------- Confirm dialog (ours, not the browser's) ---------- */
.adm-dialog {
  width: min(26rem, calc(100vw - 32px)); padding: 1.25rem; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface-raised); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.adm-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.adm-dialog p { margin: 0 0 1.25rem; font-size: .98rem; line-height: 1.5; }
.adm-dialog .acts { display: flex; justify-content: flex-end; gap: .5rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 1rem); margin: 0; z-index: 30;
  padding: .6rem 1rem; border-radius: 999px; background: var(--brand); color: var(--brand-text);
  font-size: .88rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  width: max-content; max-width: calc(100vw - 2rem); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Sign-in page ---------- */
.login { max-width: 480px; margin: 12vh auto 0; padding: 0 16px; display: grid; gap: 1.75rem; justify-items: center; text-align: center; }
.login .brand { margin: 0; width: 100%; }
.login .brand img { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
.login .back { width: 100%; justify-content: center; padding: .8rem 1rem; font-size: .95rem; margin-top: -.75rem; }
.login .card { width: 100%; display: grid; gap: 1.5rem; padding: 2rem 1.75rem 1.75rem; }
.error { color: var(--text); border-left: 2px solid var(--text); padding: .1rem 0 .1rem .7rem; text-align: left; font-size: .9rem; }
.btn.google { width: 100%; background: var(--text); color: var(--surface); padding: .8rem 1rem; font-size: .95rem; }
.btn.google:hover { background: color-mix(in srgb, var(--text) 86%, var(--surface)); }
.btn.google svg { width: 20px; height: 20px; }

/* ---------- Rich text (Trix) in the dark admin ---------- */
trix-editor.rich {
  min-height: 9rem; max-height: 30rem; overflow-y: auto;
  background: var(--surface); color: var(--text); font-size: .95rem; font-weight: 400; line-height: 1.55;
  border: 1px solid var(--border); border-radius: 6px; padding: .6rem .75rem;
}
trix-editor.rich:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 14%, transparent); }
trix-editor.rich a { color: var(--text); }
trix-toolbar .trix-button-group { border-color: var(--border); background: var(--surface-raised); margin-bottom: .4rem; }
trix-toolbar .trix-button { border-color: var(--border) !important; }
trix-toolbar .trix-button--icon::before { filter: invert(1); opacity: .75; }
trix-toolbar .trix-button.trix-active { background: var(--surface-hover); }
trix-toolbar .trix-button:disabled::before { opacity: .25; }
trix-toolbar .trix-button-group--file-tools { display: none; }   /* no attachments */
trix-toolbar .trix-dialog { background: var(--surface-raised); border-color: var(--border); color: var(--text); box-shadow: 0 8px 24px rgb(0 0 0 / .5); }
trix-toolbar .trix-input--dialog { background: var(--surface); color: var(--text); border-color: var(--border); }


/* Jump links (Events, Links) land below the phone top bar. */
.sec { scroll-margin-top: 1rem; }
@media (max-width: 860px) { .sec { scroll-margin-top: 80px; } }

/* ---------- Merch overview ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .75rem; }
.flt { display: grid; gap: .3rem; font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.flt select, .flt .menu-btn, .flt input, .flt-multi summary {
  font: inherit; font-size: .9rem; font-weight: 500; color: var(--text); background: var(--surface-raised);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: .5rem .7rem; min-height: 2.4rem;
}
.flt-dates { display: contents; }
.flt-dates[hidden] { display: none; }
.flt-multi { position: relative; align-self: flex-end; }
.flt-multi summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.flt-multi summary::-webkit-details-marker { display: none; }
.flt-menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 16rem; display: grid; gap: .1rem;
  padding: .5rem; background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.flt-menu label { display: flex; gap: .55rem; align-items: center; padding: .45rem .5rem; border-radius: 6px; font-size: .9rem; font-weight: 500; color: var(--text); cursor: pointer; }
.flt-menu label:hover { background: var(--surface-hover); }
.flt-menu .btn { margin-top: .4rem; justify-self: end; }
.flt-sum { margin: -.4rem 0 0; }
.card-h { margin: 0 0 1rem; font-size: .95rem; font-weight: 600; }
.card-h.pad { margin: 0; padding: 1rem 1.2rem .6rem; }

/* Item sales chart: one neutral series, thin bars anchored to the baseline
   with 4px rounded tops and a 2px gap; recessive dashed gridlines. */
.chart { position: relative; height: 240px; margin-top: .25rem; }
.chart-grid, .chart-bars { position: absolute; top: 0; right: 0; bottom: 1.6rem; left: 3.6rem; }
.gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); }
.gl:first-child { border-top: 1px solid var(--border-strong); }
.gl span { position: absolute; right: calc(100% + .5rem); transform: translateY(-50%); font-family: var(--font-num); font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.chart-bars { display: flex; align-items: stretch; gap: 2px; }
.bcol { flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; min-width: 0; cursor: default; outline: none; }
.bfill { width: 100%; max-width: 36px; background: var(--text-muted); border-radius: 4px 4px 0 0; transition: background-color .1s; }
.bcol:hover .bfill, .bcol.on .bfill, .bcol:focus-visible .bfill { background: var(--text); }
.chart-x { position: absolute; left: 3.6rem; right: 0; bottom: 0; height: 1.3rem; display: flex; gap: 2px; }
.chart-x span { flex: 1 1 0; min-width: 0; text-align: center; font-family: var(--font-num); font-size: .7rem; color: var(--text-muted); white-space: nowrap; overflow: visible; }
.chart-x span:first-child { text-align: left; }
.chart-x span:last-child { text-align: right; }   /* end labels stay inside the chart */
.chart-tip {
  position: absolute; top: 0; transform: translate(-50%, calc(-100% - 6px)); pointer-events: none; z-index: 5;
  display: grid; gap: .1rem; padding: .5rem .7rem; border-radius: 8px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: .82rem;
}
.chart-tip[hidden] { display: none; }
.chart-tip .v { font-family: var(--font-num); font-size: 1rem; }
.chart-tip .m { color: var(--text-muted); font-size: .78rem; }
.chart-table { margin-top: 1rem; font-size: .85rem; }
.chart-table summary { cursor: pointer; color: var(--text-muted); }
.chart-table table { width: 100%; margin-top: .6rem; border-collapse: collapse; }
.chart-table th, .chart-table td { text-align: right; padding: .35rem .5rem; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th { font-weight: 600; color: var(--text-muted); }
.crow.prow { grid-template-columns: minmax(0, 1fr) 5rem 7rem; }
.crow.orow { grid-template-columns: 6rem minmax(0, 1fr) 6rem; }
.orow .cname > span { overflow-wrap: anywhere; }
.chead.orow span:nth-child(2) { text-align: left; }
@media (max-width: 640px) {
  .crow.prow { grid-template-columns: minmax(0, 1fr) 3rem 5rem; }
  .crow.orow { grid-template-columns: 4.5rem minmax(0, 1fr) 4.5rem; }
  .chart-grid, .chart-bars { left: 3rem; } .chart-x { left: 3rem; }
}

/* ---------- Fulfillment ---------- */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; align-self: flex-end; }
.seg a { padding: .5rem .85rem; font-size: .9rem; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--border-strong); }
.seg a:hover { color: var(--text); }
.seg a[aria-current] { color: var(--surface); background: var(--text); }
.crow.make-row { grid-template-columns: minmax(0, 1fr) 5rem; align-items: center; }
.make-row .sizes { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.sz { font-family: var(--font-num); font-size: .82rem; padding: .15rem .5rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); }
.sz b { color: var(--text); font-weight: 500; }
.order { display: grid; gap: .9rem; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.order-head .pill { white-space: nowrap; flex: none; }
.order-who { margin: 0 0 .2rem; font-weight: 600; font-size: 1.02rem; }
.order-head .cn a { color: var(--text-muted); }
.order-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 16rem); gap: 1rem; }
.order-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.order-items .q { font-family: var(--font-num); color: var(--text-muted); }
.order-items b { font-family: var(--font-num); font-weight: 500; font-size: .85rem; margin-left: .2rem; }
.order-addr { font-style: normal; font-size: .9rem; line-height: 1.5; margin: 0; }
.order-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .9rem; border-top: 1px solid var(--border); }
.order-acts input { flex: 1 1 10rem; min-width: 0; }
.order-acts .btn { margin-left: auto; }
.order-acts .btn + .btn { margin-left: 0; }
.order-track { margin: 0; font-family: var(--font-num); }
@media (max-width: 640px) { .order-body { grid-template-columns: 1fr; } }

.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.foot.end .btn + .btn { margin-left: .5rem; }
/* Price boxes: no spinner arrows (typing a price is quicker than clicking). */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Dropdowns: our own menu (same control as the size picker on /merch).
   The real <select> stays in the form, hidden, and holds the value. ---------- */
select.menu-sel { display: none; }
.menu-btn {
  display: block; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 2.2rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23A1A1A6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 12px;
}
.flt .menu-btn { width: auto; min-width: 9rem; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { border-color: var(--border-strong); }
.menu-btn[aria-expanded="true"] { border-color: var(--text); }
.menu-btn.is-empty { color: var(--text-muted); }
.menu-list {
  position: fixed; z-index: 60; margin: 0; padding: .3rem 0; list-style: none;
  max-height: 18rem; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .45); font-size: .92rem;
}
.menu-list[hidden] { display: none; }
.menu-list li { padding: .6rem .8rem; cursor: pointer; }
.menu-list li.on { background: var(--surface-hover, var(--surface-raised)); }
.menu-list li[aria-selected="true"] { font-weight: 600; }

/* ---------- Gigs (Google Calendar) ---------- */
.gig-connect { display: grid; gap: 1rem; justify-items: start; max-width: 60ch; }
.gig-pick { max-width: 60ch; }
.gig-cal { display: flex; gap: .6rem; align-items: center; cursor: pointer; }
.gig-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.gig-actions form { margin: 0; }
.crow.gig-row { grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: center; }
.gig-date { display: grid; gap: .1rem; }
.gig-dow { font-size: .75rem; color: var(--text-muted); }
.gig-day { font-family: var(--font-num); font-weight: 500; }
.gig-row .pill { vertical-align: 1px; margin-left: .3rem; }
@media (max-width: 640px) {
  .crow.gig-row { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
}
.gig-row .cname { gap: .3rem; }
/* Gigs list as a table: Date · Status · Name · Client */
.gig-table .crow { grid-template-columns: 8rem 9rem minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: center; }
.gig-table .chead span:not(:first-child), .gig-table .gcell { text-align: left; }
.gig-table .gcell { min-width: 0; overflow-wrap: anywhere; }
.gig-table .gcell.cl { font-weight: 600; }
.gig-table .gdate { font-family: var(--font-num); white-space: nowrap; }
.gig-table .gstatus { font-size: .85rem; color: var(--text-muted); }
.gig-table .gstatus.st-confirmed, .gig-table .gstatus.st-awaiting_payment, .gig-table .gstatus.st-done { color: var(--text); }
.gig-table .gstatus.st-lost, .gig-table .gstatus.st-cancelled { text-decoration: line-through; }
.gig-table .gclient { color: var(--text-muted); }
@media (max-width: 640px) {
  .gig-table .crow { grid-template-columns: 5rem 6rem minmax(0, 1fr); gap: .6rem; padding-inline: .9rem; }
  .gig-table .col-client { display: none; }
}
.crew-table .crow { grid-template-columns: minmax(0, 1.3fr) minmax(0, 9rem) minmax(0, 1.4fr) 8rem 4rem; }
@media (max-width: 640px) {
  .crew-table .crow { grid-template-columns: minmax(0, 1fr) 6rem 3.5rem; gap: .6rem; padding-inline: .9rem; }
  .crew-table .col-email, .crew-table .col-phone { display: none; }
}
.clients-table .crow { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.4fr) 8rem 4rem; }
@media (max-width: 640px) {
  .clients-table .crow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3.5rem; gap: .6rem; padding-inline: .9rem; }
  .clients-table .col-email, .clients-table .col-phone { display: none; }
}
.crew { display: flex; flex-wrap: wrap; gap: .3rem .4rem; }
.who { font-size: .82rem; }
.who:not(:last-child)::after { content: ","; color: var(--text-muted); }
.who.declined { text-decoration: line-through; color: var(--text-muted); }
.who.needsAction, .who.tentative { color: var(--text-muted); }
.month-nav { display: flex; align-items: center; gap: .4rem; }
.month-name { font-weight: 600; min-width: 9.5rem; text-align: center; }

/* Month grid. On phones it becomes a list of the days that have gigs. */
.gcal { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-raised); }
.gcal-head, .gcal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gcal-head span { padding: .5rem .6rem; font-size: .72rem; color: var(--text-muted); font-family: var(--font-num); }
.gcal-day { min-height: 6.5rem; padding: .4rem; border-top: 1px solid var(--border); border-left: 1px solid var(--border); display: grid; gap: .3rem; align-content: start; min-width: 0; }
.gcal-day:first-child { border-left: 0; }
.gcal-day.other { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.gcal-day.other .gcal-num { color: var(--text-muted); opacity: .6; }
.gcal-num { font-family: var(--font-num); font-size: .78rem; color: var(--text-muted); }
.gcal-day.today .gcal-num { color: var(--surface); background: var(--text); border-radius: 999px; padding: 0 .4rem; justify-self: start; }
.gcal-dow, .gcal-mon { display: none; }
.gcal-gig { display: grid; gap: .15rem; padding: .3rem .4rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; min-width: 0; }
.gcal-gig:hover { border-color: var(--border-strong); }
.gcal-title { font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcal-meta { font-size: .7rem; color: var(--text-muted); }
.gcal-flags { display: flex; gap: .2rem; align-items: center; flex-wrap: wrap; }
.flag { font-family: var(--font-num); font-size: .62rem; width: 1.1rem; height: 1.1rem; display: inline-grid; place-items: center; border-radius: 4px; border: 1px dashed var(--border); color: var(--text-muted); }
.flag.on { border: 1px solid var(--text-muted); color: var(--text); }
.gcal-crew { font-size: .68rem; color: var(--text-muted); margin-left: .2rem; }
@media (max-width: 760px) {
  .gcal-head { display: none; }
  .gcal-week { display: block; }
  .gcal-day { min-height: 0; border-left: 0; padding: .6rem .8rem; }
  .gcal-day.empty { display: none; }
  .gcal-dow, .gcal-mon { display: inline; }
  .gcal-title { white-space: normal; }
}

/* ---------- Productions: rows that are links ---------- */
a.crow { color: inherit; text-decoration: none; }
a.crow:hover { background: var(--surface-hover); }
.crow.gig-row { grid-template-columns: 5.5rem minmax(0, 1fr); }
.crow.rec-row { grid-template-columns: minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: auto; align-items: center; }
.rec-row .cnum { min-width: 4.5rem; }
.st-lost, .st-cancelled { opacity: .55; }
.gcal-gig.st-draft { border-style: dashed; }
.gig-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.5rem; }
.gig-side .kpi-label { margin-bottom: .4rem; }
.f.pick { align-content: end; }
.f.pick input[hidden] { display: none; }
/* time picker: looks like a field; opens hour / minutes (5s) / AM-PM columns */
.tp { position: relative; }
.tp-val { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.tp-btn {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%;
  font: inherit; font-size: .92rem; font-weight: 400; color: var(--text); text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .6rem .7rem;
  transition: border-color .15s, box-shadow .15s; font-variant-numeric: tabular-nums;
}
.tp-btn:hover { border-color: var(--border-strong); }
.tp-btn:focus-visible, .tp-btn[aria-expanded="true"] { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 14%, transparent); }
.tp-btn svg { flex: none; color: var(--text-muted); }
.tp-empty { color: color-mix(in srgb, var(--text-muted) 70%, transparent); }
.tp-pop {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; padding: .35rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .45);
}
.tp-pop[hidden] { display: none; }
.tp-cols { display: flex; gap: .25rem; }
.tp-col { display: grid; align-content: start; gap: 2px; width: 3.4rem; max-height: 14rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.tp-col button {
  font: inherit; font-size: .9rem; font-weight: 400; color: var(--text); background: none; border: 0;
  border-radius: 5px; padding: .45rem 0; cursor: pointer; font-variant-numeric: tabular-nums;
}
.tp-col button:hover { background: var(--surface-raised); }
.tp-col button[aria-pressed="true"] { background: var(--text); color: var(--surface); font-weight: 600; }
.tp-foot { display: flex; justify-content: space-between; gap: .5rem; margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--border); }

/* ---------- Gigs: gear, crew ---------- */
.flags { display: flex; flex-wrap: wrap; gap: .3rem; }
.flag-pill { font-size: .72rem; font-weight: 600; padding: .12rem .45rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); }
.flag-pill.warn { border-color: var(--text); color: var(--text); }
.flag.warn { border: 1px solid var(--text); color: var(--text); width: auto; padding: 0 .25rem; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.checks li { padding-left: 1.1rem; position: relative; font-size: .9rem; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--text-muted); }
.checks li.warn::before { content: "!"; color: var(--text); font-weight: 700; }
.checks li .cn { margin-left: .35rem; }
.pre { white-space: pre-line; }
.check { display: inline-flex; gap: .5rem; align-items: center; font-weight: 500; color: var(--text); cursor: pointer; }
.gear-grid { display: grid; margin: 0 -1.2rem; }
.gear-grid .cgroup { margin: 0; }
.gear-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .8rem; align-items: center; padding: .45rem 1.2rem; border-top: 1px solid var(--border); font-size: .9rem; }
.gear-row.too-many { box-shadow: inset 3px 0 0 var(--clash); background: color-mix(in srgb, var(--clash) 10%, transparent); }
.gear-row.too-many input { border-color: var(--clash); }
.gear-row.too-many .cn { color: var(--clash); }
.gear-err { margin: 0 auto 0 0; color: var(--clash); font-size: .85rem; font-weight: 600; }
.gear-row input { text-align: right; }
@media (max-width: 640px) { .gear-grid { margin: 0 -.9rem; } .gear-row { padding-inline: .9rem; } }
.power { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.power legend { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; padding: 0; }
.f input[hidden], .f.subcat[hidden] { display: none; }
.gear-filters { margin-bottom: .9rem; }
.gear-filters .flt:first-child { flex: 1 1 14rem; }
.gear-row[hidden], .gear-grid .cgroup[hidden] { display: none; }
.gear-grid #gear-none { padding: .8rem 1.2rem; border-top: 1px solid var(--border); }
/* Crew on a gig's page */
.crew-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; }
.crew-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .6rem;
                padding: .5rem 0; border-bottom: 1px solid var(--border); }
.crew-list li:first-child { padding-top: 0; }
.crew-list form { margin: 0; }
.crew-who { display: grid; gap: .05rem; min-width: 0; }
.crew-who .who { font-size: .92rem; color: var(--text); }
.crew-who .who::after { content: none; }
.crew-who .cn { font-size: .78rem; }
.crew-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.crew-add { display: flex; gap: .4rem; flex: 1 1 14rem; }
.crew-add input { flex: 1; min-width: 0; }
/* Gear sections fold */
.gear-sec[hidden] { display: none; }
.gear-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; user-select: none; }
.gear-sec > summary::-webkit-details-marker { display: none; }
.gear-sec > summary::before {
  content: ""; width: .45rem; height: .45rem; flex: none; margin-right: .15rem;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.gear-sec[open] > summary::before { transform: rotate(45deg); }
.gear-sec > summary .cn { font-weight: 500; }
.gear-sec > summary:hover { color: var(--text); }
/* − / + on gear quantities */
.stepper { display: inline-flex; align-items: center; gap: .3rem; }
.stepper input { width: 3.6rem; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .step { width: 2.1rem; height: 2.1rem; padding: 0; justify-content: center; font-size: 1.05rem; line-height: 1; }
.stepper .step:disabled { opacity: .35; cursor: default; }
/* A gig's page: details and gear are one form, saved from the bar at the bottom */
.gig-form { display: grid; gap: 1.1rem; min-width: 0; }
.save-bar { position: sticky; bottom: .75rem; z-index: 5; display: flex; align-items: center; gap: .75rem; padding: .7rem 1.2rem; box-shadow: 0 6px 24px rgb(0 0 0 / .25); }
.save-bar .acts { margin-left: auto; display: flex; gap: .5rem; }
.crew-role .menu-btn, .crew-role select { font-size: .8rem; padding: .25rem .5rem; min-height: 0; min-width: 6.5rem; }

/* Red for the one thing that must stop you: more gear than you own. */
:root { --clash: #ef5350; }
.theme-light { --clash: #c62828; }
/* A gig's quick facts under its name */
.gig-facts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0; font-size: .88rem; color: var(--text-muted); }
.gig-facts .warn { color: var(--text); font-weight: 600; }
/* Quote builder */
.quote-card { display: grid; gap: .5rem; }
.quote-card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }
.quote-card-head .card-h { margin: 0; }
.gear-summary { margin: 0; font-size: .88rem; }
.q-step { display: grid; gap: .6rem; }
.q-step-h { margin: 0; font-weight: 700; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; cursor: default; }
details.q-step > summary.q-step-h { cursor: pointer; list-style: none; }
details.q-step > summary::-webkit-details-marker { display: none; }
.q-step-n { margin-left: auto; }
/* closed: just the header (the grid gap otherwise leaves a gap under it for the hidden content) */
details.q-step:not([open]) { display: block; }
.q-ext-n { margin-left: auto; font-weight: 500; }
.norate { color: var(--clash); }
.q-lines { display: grid; gap: .5rem; }
.q-line { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; gap: .5rem; }
.q-price { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: end; }
.q-sug { display: grid; gap: .25rem; }
@media (max-width: 640px) { .q-price { grid-template-columns: 1fr; } }
.q-break { width: 100%; margin-top: 1rem; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.q-break th, .q-break td { padding: .4rem .5rem; border-bottom: 1px solid var(--border); text-align: right; font-weight: 400; }
.q-break th:first-child, .q-break td:first-child { text-align: left; padding-left: 0; }
.q-break th:last-child, .q-break td:last-child { padding-right: 0; }
.q-break thead th { color: var(--text-muted); font-size: .75rem; font-weight: 600; }
.q-break td:nth-child(2) { width: 3rem; }
.q-break td:nth-child(3), .q-break td:last-child { width: 6.5rem; }
.q-break tfoot th, .q-break tfoot td { font-weight: 600; border-bottom: 0; }
.qv-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.qv-acts { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.qv-accept { display: flex; gap: .4rem; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Gig expenses ---------- */
.exp-card { display: grid; gap: .75rem; }
.exp-card .kpi-label { margin: .5rem 0 0; }
.exp-crew, .exp-lines { display: grid; gap: .5rem; }
.exp-crow { display: grid; grid-template-columns: minmax(0, 1fr) 7rem 10rem 8.5rem; gap: .5rem; align-items: center; }
.exp-line { display: grid; grid-template-columns: 10rem minmax(0, 1fr) 7rem 9.5rem auto auto; gap: .5rem; align-items: center; }
.exp-line[hidden] { display: none; }
.exp-receipt { display: flex; gap: .5rem; align-items: center; font-size: .85rem; white-space: nowrap; }
.exp-foot { display: flex; gap: .75rem; align-items: center; margin: .75rem 0 0; }
.exp-totals { display: grid; gap: .2rem; margin: .5rem 0 0; max-width: 22rem; margin-left: auto; font-size: .9rem; font-variant-numeric: tabular-nums; }
.exp-totals div { display: flex; justify-content: space-between; gap: 1rem; }
.exp-totals dt { color: var(--text-muted); }
.exp-totals dd { margin: 0; }
.exp-totals .tot { border-top: 1px solid var(--border); padding-top: .3rem; font-weight: 600; }
.exp-totals .tot dt { color: var(--text); }
@media (max-width: 760px) {
  .exp-crow { grid-template-columns: 1fr 1fr; }
  .exp-crow .crew-who { grid-column: 1 / -1; }
  .exp-line { grid-template-columns: 1fr 1fr; }
  .exp-line input[name$="_desc"] { grid-column: 1 / -1; order: -1; }
}
.q-substep { border-top: 1px solid var(--border); }
.q-substep:first-of-type { margin-top: .5rem; }
.q-substep > .gear-grid { padding-bottom: .6rem; }
.q-sub { display: flex; align-items: baseline; gap: .6rem; padding: .6rem 0; cursor: pointer; list-style: none;
         font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.q-sub::-webkit-details-marker { display: none; }
.q-sub::before, .q-break-sec > summary span:first-child::before {
  content: ""; display: inline-block; width: .45em; height: .45em; margin-right: .15em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; align-self: center;
}
.q-substep[open] > .q-sub::before, .q-break-sec[open] > summary span:first-child::before { transform: rotate(45deg); }
.q-sub .q-step-n { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: auto; }

/* ---------- Quote builder: builder on the left, price + sending in a panel that stays in view ---------- */
.q-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.1rem; align-items: start; }
.q-main { min-width: 0; }
.q-side { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.q-panel { display: grid; gap: .9rem; }
.q-panel .kpi-label { margin: 0; }
.q-panel .q-sug .kpi-value { font-size: 1.6rem; }
.q-break-wrap > summary, .q-earlier > summary { cursor: pointer; font-size: .82rem; list-style: none; display: flex; align-items: center; gap: .45em; }
.q-break-wrap > summary::-webkit-details-marker, .q-earlier > summary::-webkit-details-marker { display: none; }
.q-break-wrap > summary::before, .q-earlier > summary::before {
  content: ""; width: .38em; height: .38em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.q-break-wrap[open] > summary::before, .q-earlier[open] > summary::before { transform: rotate(45deg); }
.q-break-secs { display: grid; align-content: start; margin-top: .5rem; font-size: .82rem;
                max-height: max(6rem, min(22rem, calc(100vh - 42rem))); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.q-break-sec { border-top: 1px solid var(--border); }
.q-break-sec > summary { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; cursor: pointer; list-style: none; font-variant-numeric: tabular-nums; }
.q-break-sec > summary::-webkit-details-marker { display: none; }
.q-break-sec > summary span:first-child::before { color: var(--text-muted); margin: 0 .45em .1em .1em; }
.q-break-sec .q-break { margin: 0 0 .4rem; font-size: .78rem; color: var(--text-muted); }
.q-break-sec .q-break td { padding: .1rem 0 .1rem .4rem; border: 0; width: auto; }
.q-break-sec .q-break td:first-child { padding-left: .9rem; }
.q-break-sec .q-break td:nth-child(2) { width: 2.5rem; white-space: nowrap; padding-right: .6rem; text-align: right; }
.q-break-sec .q-break td:last-child { white-space: nowrap; text-align: right; }
.q-break-tot { display: flex; justify-content: space-between; margin: 0; padding-top: .35rem; border-top: 1px solid var(--border); font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.q-acts { display: grid; gap: .5rem; }
.q-import { display: grid; gap: .4rem; }
.q-import select, .q-import .btn { width: 100%; justify-content: center; }
.q-acts > .btn { width: 100%; justify-content: center; }
.q-acts-row { display: flex; gap: .5rem; }
.q-acts-row .btn { flex: 1; justify-content: center; }
.qv { display: grid; gap: .3rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.qv-latest { padding: 0 0 .9rem; border-top: 0; border-bottom: 1px solid var(--border); }
.qv-latest .qv-top .cl { font-weight: 600; }
.q-earlier { border-top: 1px solid var(--border); padding-top: .6rem; }
.q-earlier summary { cursor: pointer; font-size: .82rem; }
.q-earlier .qv { margin-top: .7rem; }
.qv-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.qv .cn { font-size: .8rem; }
.qv-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .35rem; }
.qv-acts form { display: contents; }
.qv-acts .btn { width: 100%; justify-content: center; text-align: center; }
@media (max-width: 1000px) {
  .q-layout { grid-template-columns: minmax(0, 1fr); }
  .q-side { position: static; }
}
.q-missing { margin: 0; font-size: .82rem; color: var(--clash); }
.q-missing a { color: inherit; }
.q-travel { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: .9rem; }
.q-travel .cn { margin-left: .35rem; }
.q-quote-tot { font-weight: 500; color: var(--text-muted); border-top: 0; padding-top: .15rem; }
.exp-open .who { color: var(--text-muted); }
.exp-open .exp-open-pay { grid-column: 2 / -1; color: var(--text-muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.exp-h { margin: .6rem 0 0; font-size: 1rem; font-weight: 700; color: var(--text); }
.quote-card-acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.q-panel > .btn { width: 100%; justify-content: center; }
.q-panel .side-del { margin-top: .4rem; }
.gig-main { display: grid; gap: 1.1rem; }
.pnl-side { gap: .5rem; }
.pnl-side .exp-totals { margin: 0; max-width: none; }
.pnl-side .tot dd { font-size: 1.05rem; }
.pnl-side .neg { color: var(--clash); }
.side-form { display: grid; margin: 0; }
.side-form .btn { width: 100%; justify-content: center; }
.side-acts { gap: .5rem; }
.side-row { display: flex; gap: .5rem; }
.side-save { margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.side-save .btn.primary { flex: 2 1 0; }
.side-row > * { flex: 1 1 0; min-width: 0; }
.side-row .btn { width: 100%; justify-content: center; }

/* ---------- Collapsible section (macro csec in _admin_macros.html) ---------- */
.card.csec { padding: 0; display: block; }
.csec-h { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: .6rem;
          padding: 1rem 1.2rem; font-weight: 700; }
.csec-h::-webkit-details-marker { display: none; }
.csec-h::before {
  content: ""; width: .45rem; height: .45rem; flex: none; margin-right: .1rem;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.csec[open] > .csec-h::before { transform: rotate(45deg); }
.csec-meta { margin-left: auto; font-weight: 400; text-align: right; }
.csec-body { display: grid; gap: .75rem; min-width: 0; padding: 0 1.2rem 1.2rem; }
@media (max-width: 640px) { .csec-h { padding: .9rem; } .csec-body { padding: 0 .9rem .9rem; } }
.side-quote { gap: .5rem; }
.side-quote .pill { font-size: .7rem; }
.crew-add { display: flex; gap: .4rem; flex: 1 1 14rem; }
.side-save .side-trash { flex: 0 0 auto; width: auto; padding-inline: .8rem; }
/* ---------- Invoices ---------- */
.inv-lines { display: grid; gap: .5rem; }
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem 8rem auto; gap: .5rem; align-items: center; }
.inv-line[hidden] { display: none; }
.inv-head { font-size: .75rem; }
.inv-line input[name=line_qty], .inv-line input[name=line_rate] { text-align: right; }
.inv-pay { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .75rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.inv-pay form { margin: 0; }
.inv-amt { font-variant-numeric: tabular-nums; }
.inv-pay-add { display: grid; grid-template-columns: 10rem 8rem 9rem minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
@media (max-width: 760px) { .inv-pay-add { grid-template-columns: 1fr 1fr; } .inv-line { grid-template-columns: 1fr 4rem 6rem auto; } }
/* gig details: four across (name takes two), the four times on one row */
.gig-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem .9rem; }
.gig-fields .gf-name { grid-column: span 2; }
.gig-fields .wide { grid-column: 1 / -1; }
.gig-fields .gf-row { grid-column-start: 1; }   /* the four times start their own row */
@media (max-width: 900px) { .gig-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .gig-fields { grid-template-columns: minmax(0, 1fr); } .gig-fields .gf-name { grid-column: auto; } }
.q-lock { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 1.1rem; }
.q-lock:disabled .stepper .btn, .q-lock:disabled input { opacity: .55; }
.q-locked { margin: 0; font-size: .82rem; }
.gig-title { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.gig-status { font-size: 1rem; font-weight: 700; padding: .3rem .8rem; letter-spacing: .02em; }
.gig-status.st-confirmed, .gig-status.st-awaiting_payment, .gig-status.st-done { background: var(--text); color: var(--surface); border-color: var(--text); }
.gig-status.st-lost, .gig-status.st-cancelled { text-decoration: line-through; }

/* Invoice: Square card-payment link */
.pay-link { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .2rem 0 .4rem; }
.pay-url { flex: 1 1 16rem; min-width: 0; font-family: var(--font-num); font-size: .82rem; }
.pay-acts { display: flex; gap: .5rem; margin-top: .6rem; }
.pay-acts form { margin: 0; }
.cn.bad { color: var(--clash); }

