/* =====================================================================
   KARATURE Ops — internal production manifest
   Light, flat dashboard: white cards on a soft neutral canvas, no borders
   and no shadows (separation comes from fills, spacing and subtle zebra),
   sans UI on screen (serif is kept for the printed manifest only).
   ===================================================================== */
@font-face {
  font-family: 'Comforter';
  src: url('/fonts/comforter-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;

  /* Cool neutral palette (Shopify-flavoured) — separation by fill, no strokes/shadows. */
  --canvas:    oklch(0.970 0.0015 255);  /* page background */
  --surface:   #ffffff;                  /* cards, tables, panels */
  --surface-2: oklch(0.958 0.003 255);   /* subtle fill: inputs, chips, thead */
  --surface-3: oklch(0.926 0.004 255);   /* deeper fill: progress tracks */
  --hover:     oklch(0.949 0.004 255);   /* row / control hover */
  --zebra:     oklch(0.985 0.0015 255);  /* alternate table row */

  --ink:       oklch(0.27 0.005 265);
  --ink-soft:  oklch(0.505 0.008 265);
  --ink-faint: oklch(0.55 0.011 265);    /* darkened to clear WCAG AA on small labels */

  /* Primary action = near-black (Shopify "Create order" style). */
  --btn-primary:       oklch(0.28 0.004 265);
  --btn-primary-hover: oklch(0.37 0.006 265);

  /* Borderless form controls get a deeper fill so the field is still legible. */
  --field:        oklch(0.928 0.004 255);
  --field-strong: oklch(0.898 0.005 255);

  /* Accent = green (progress / completion / positive actions). */
  --accent:      #4f9d69;                 /* graphical: bars, gauges, dots */
  --accent-deep: #2f6a43;                 /* text/links on white + tints (AA) */
  --accent-tint: color-mix(in oklab, var(--accent) 13%, var(--surface));
  --on-accent:   #fff;
  --danger:      #b0472f;
  --amber:       #7d5820;                 /* jewellery chips (AA on --amber-tint) */
  --amber-tint:  color-mix(in oklab, var(--amber) 16%, var(--surface));

  /* Chart series (muted; the pipeline reads early → done). */
  --sc-todesign:     #b7bcc6;
  --sc-incad:        #8098ad;
  --sc-approved:     #c6a15f;
  --sc-sampling:     #d59460;
  --sc-photographed: #7fae8c;
  --sc-live:         #4f9d69;
  --sc-silver:       #9aa3ad;
  --sc-gold:         #c6a15f;

  /* Tokens the @media print block still resolves against. */
  --line: oklch(0.905 0.004 90);
  --line-soft: oklch(0.94 0.003 90);
  --cream: #f7f1e7;

  --font-serif: 'Palatino', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --font-sans: 'Jost', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-script: 'Comforter', cursive;

  --track: 0.14em;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --pad-x: clamp(16px, 3vw, 40px);

  /* Status palette (muted tints; foregrounds darkened to meet AA on their pill). */
  --st-todesign-bg: #ebedf1;    --st-todesign-fg: #5f6672;
  --st-incad-bg: #e5edf4;       --st-incad-fg: #46688a;
  --st-approved-bg: #f1e7d2;    --st-approved-fg: #785827;
  --st-sampling-bg: #f3e3d3;    --st-sampling-fg: #895526;
  --st-photographed-bg: #dfece4; --st-photographed-fg: #3d6250;
  --st-live-bg: #d6ecdd;        --st-live-fg: #2f6a43;
}

@supports (corner-shape: squircle) {
  :where(*, *::before, *::after) { corner-shape: squircle; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-deep); }

/* One clean, accessible focus ring everywhere (not a decorative stroke). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible { outline-offset: 2px; }

/* ---- App shell: left sidebar + main column ---- */
.app { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
  flex: none; width: 232px;
  background: var(--surface-2);
  padding: 20px 12px 24px;
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
}
.sidebar__brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 8px; }
.brand-wordmark { height: 19px; width: auto; display: block; color: var(--ink); }
.wordmark__sub {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); line-height: 1.5;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.navgroup { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.navgroup__label {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); padding: 6px 10px 4px;
}
.navitem {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: none; background: transparent; cursor: pointer;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-family: var(--font-sans); font-size: 13.5px; letter-spacing: 0.01em; color: var(--ink-soft);
  transition: background 140ms ease, color 140ms ease;
}
.navitem:hover { background: var(--hover); color: var(--ink); }
.navitem.is-active { background: var(--surface); color: var(--ink); font-weight: 500; }
.navitem--add { color: var(--accent-deep); }
.navitem__t { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navitem .ico { width: 16px; height: 16px; flex: none; opacity: 0.9; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--canvas); }

/* ---- Content top bar (title + actions) ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 12px 20px; padding: 16px var(--pad-x);
  background: var(--canvas);
}
.topbar__title { font-family: var(--font-sans); font-size: clamp(18px, 2vw, 23px); font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.topbar__actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 9px 16px; border-radius: var(--r-sm);
  cursor: pointer; border: none;
  transition: background 150ms ease, color 150ms ease;
}
.btn--solid { background: var(--btn-primary); color: var(--on-accent); }
.btn--solid:hover { background: var(--btn-primary-hover); }
.btn--ghost { background: var(--field); color: var(--ink-soft); }
.btn--ghost:hover { background: var(--field-strong); color: var(--ink); }
.btn--mini { font-size: 11px; padding: 6px 11px; text-transform: none; letter-spacing: 0.01em; }
.btn--danger { background: color-mix(in oklab, var(--danger) 12%, var(--surface)); color: var(--danger); margin-right: auto; }
.btn--danger:hover { background: color-mix(in oklab, var(--danger) 20%, var(--surface)); }

/* Small round icon button (edit pencils) */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border-radius: 999px; cursor: pointer;
  border: none; background: var(--surface-2); color: var(--ink-soft);
  font-size: 12px; line-height: 1; transition: color 140ms ease, background 140ms ease;
}
.iconbtn:hover { color: var(--accent-deep); background: var(--accent-tint); }

/* ---- Controls ---- */
.controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding: 6px var(--pad-x) 16px;
}
.controls__search {
  flex: 1 1 320px; min-width: 220px;
  padding: 11px 16px; border-radius: var(--r-pill);
  border: none; background: var(--field); color: var(--ink);
}
.controls__search::placeholder { color: var(--ink-faint); }
.controls__filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.minilabel {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint);
}
.minisel {
  border: none; background: var(--field);
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; text-transform: none; letter-spacing: 0;
  color: var(--ink); cursor: pointer;
}
.chip-toggle {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px;
  color: var(--ink-soft); cursor: pointer;
}
.chip-toggle input { accent-color: var(--accent-deep); }

/* ---- Overview (summary + charts) ---- */
.summary { padding: 8px var(--pad-x) 24px; display: flex; flex-direction: column; gap: 16px; }
.ov__kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(184px, 100%), 1fr)); gap: 14px; }
.ov__charts { display: flex; flex-direction: column; gap: 14px; }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 18px 20px; }
.stat__label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); font-family: var(--font-mono);
}
.stat__value {
  font-family: var(--font-sans); font-weight: 600; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.05;
  margin: 10px 0 4px; color: var(--ink); letter-spacing: -0.02em;
}
.stat__value small { font-size: 14px; font-weight: 400; color: var(--ink-faint); }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.bar__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.stat__sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; }

/* Chart panels */
.panel { background: var(--surface); border-radius: var(--r-md); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel__title { font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); }
.panel__meta { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-faint); text-transform: uppercase; }

/* Stacked bar (production pipeline / metal mix) */
.pipe { display: flex; gap: 2px; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.pipe__seg { min-width: 4px; }
.pipe__empty { flex: 1; }

.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 9px 18px; }
.legend__item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); }
.legend__item.is-zero { opacity: 0.4; }
.legend__dot { width: 9px; height: 9px; border-radius: 999px; corner-shape: round; flex: none; }
.legend__label { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend__val { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--ink); }
.legend__pct { color: var(--ink-faint); font-weight: 400; }

/* Per-collection progress bars */
.cprog { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px 28px; }
.cprog__row { display: grid; grid-template-columns: minmax(84px, 40%) 1fr auto; align-items: center; gap: 12px; }
.cprog__name { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cprog__bar { margin: 0; }
.cprog__pct { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--ink); min-width: 34px; text-align: right; }
.cprog__empty { font-size: 12px; color: var(--ink-faint); }

/* Chart series colours (segments + legend dots) */
.pipe__seg[data-st="To Design"], .legend__dot[data-st="To Design"] { background: var(--sc-todesign); }
.pipe__seg[data-st="In CAD"], .legend__dot[data-st="In CAD"] { background: var(--sc-incad); }
.pipe__seg[data-st="CAD Approved"], .legend__dot[data-st="CAD Approved"] { background: var(--sc-approved); }
.pipe__seg[data-st="Sampling"], .legend__dot[data-st="Sampling"] { background: var(--sc-sampling); }
.pipe__seg[data-st="Photographed"], .legend__dot[data-st="Photographed"] { background: var(--sc-photographed); }
.pipe__seg[data-st="Live"], .legend__dot[data-st="Live"] { background: var(--sc-live); }
.pipe__seg[data-metal="silver"], .legend__dot[data-metal="silver"] { background: var(--sc-silver); }
.pipe__seg[data-metal="gold"], .legend__dot[data-metal="gold"] { background: var(--sc-gold); }

/* ---- Manufacturing requirements ---- */
.mfg { padding: 0 var(--pad-x) 10px; }
.mfg details { background: var(--surface); border-radius: var(--r-md); padding: 4px 20px; }
.mfg summary {
  cursor: pointer; padding: 14px 0; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}
.mfg__bar { display: flex; justify-content: flex-end; padding: 2px 0 4px; }
.mfg__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px 26px; padding: 6px 0 18px; }
.mfg__t { font-family: var(--font-sans); font-weight: 600; font-size: 12px; letter-spacing: 0.03em; color: var(--ink); text-transform: uppercase; }
.mfg__d { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; line-height: 1.5; }
.mfg__cover-head { display: none; }

/* ---- Collections ---- */
.collections { padding: 10px var(--pad-x) 64px; }
.collection { margin: 30px 0 36px; }
.collection:first-child { margin-top: 8px; }
.collection__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  padding: 0 2px 14px; margin-bottom: 12px;
}
.collection__title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.collection__name { font-family: var(--font-sans); font-weight: 600; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.015em; }
.collection__sub { font-size: 12px; color: var(--ink-faint); font-style: normal; }
.collection__meta { display: flex; align-items: center; gap: 14px; }
.collection__count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; }
.collection__prog { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-soft); }
.collection__prog .bar { width: 120px; margin: 0; }
.collection__actions { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; }
.empty--collection { display: flex; align-items: center; justify-content: center; gap: 14px; }

/* ---- Item table ---- */
.tablewrap { overflow-x: auto; border-radius: var(--r-md); background: var(--surface); }
table.items { width: 100%; border-collapse: collapse; font-size: 13px; }
.items thead th {
  text-align: left; font-family: var(--font-mono); font-weight: 500;
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
  padding: 12px 12px; white-space: nowrap; background: var(--surface-2);
}
.items thead th:first-child { border-top-left-radius: var(--r-md); }
.items thead th:last-child { border-top-right-radius: var(--r-md); }
.items tbody td { padding: 13px 12px; vertical-align: top; }
.items tbody tr:nth-child(even) td { background: var(--zebra); }
.items tbody tr:hover td { background: var(--hover); }
.items tbody tr.is-live td { background: color-mix(in oklab, var(--st-live-bg) 45%, var(--surface)); }

.col-seq { width: 34px; color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; }
.col-seq .seqno { display: block; }
.rowedit { width: 24px; height: 24px; font-size: 11px; margin-top: 7px; }
.cell-codes { min-width: 168px; }
.code { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.01em; color: var(--ink-soft); white-space: nowrap; }
.code b { color: var(--ink); font-weight: 500; margin-right: 4px; }
.code + .code { margin-top: 3px; }
.cell-name { min-width: 210px; }
.item-name { font-family: var(--font-sans); font-weight: 500; font-size: 14px; color: var(--ink); line-height: 1.35; }
.name-tags { margin-top: 6px; }
.dia {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--amber); background: var(--amber-tint);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.item-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; line-height: 1.5; }
.item-meta b { color: var(--ink-soft); font-weight: 500; }
.metal-note { display: inline-block; margin-top: 5px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); background: var(--amber-tint); padding: 2px 7px; border-radius: 5px; }
.cell-qty { width: 62px; white-space: nowrap; }
.qty { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.qty span { color: var(--ink-faint); }

/* Status select styled as a pill */
.cell-status { width: 132px; }
.status-select {
  appearance: none; -webkit-appearance: none;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 7px 26px 7px 13px; font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M0 0l4 6 4-6z' fill='%23887'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  background-color: var(--st-todesign-bg); color: var(--st-todesign-fg);
}
.status-select[data-status="To Design"] { background-color: var(--st-todesign-bg); color: var(--st-todesign-fg); }
.status-select[data-status="In CAD"] { background-color: var(--st-incad-bg); color: var(--st-incad-fg); }
.status-select[data-status="CAD Approved"] { background-color: var(--st-approved-bg); color: var(--st-approved-fg); }
.status-select[data-status="Sampling"] { background-color: var(--st-sampling-bg); color: var(--st-sampling-fg); }
.status-select[data-status="Photographed"] { background-color: var(--st-photographed-bg); color: var(--st-photographed-fg); }
.status-select[data-status="Live"] { background-color: var(--st-live-bg); color: var(--st-live-fg); }

/* Media cells */
.cell-media { width: 132px; }
.media-stack { display: flex; flex-direction: column; gap: 7px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 5px; }
.thumb {
  position: relative; width: 48px; height: 48px; border-radius: var(--r-sm);
  overflow: hidden; background: var(--surface-2); cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .delimg {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; line-height: 14px;
  text-align: center; font-size: 12px; border: none; border-radius: 5px; cursor: pointer;
  background: rgba(24,26,32,0.62); color: #fff; padding: 0;
}
.thumb .delimg:hover { background: rgba(150,40,30,0.9); }
.addimg {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 11px; padding: 6px 11px; border-radius: var(--r-sm); cursor: pointer;
  border: none; background: var(--surface-2); color: var(--ink-soft);
  transition: background 140ms ease, color 140ms ease;
}
.addimg:hover { color: var(--accent-deep); background: var(--accent-tint); }
.tick {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; cursor: pointer;
  color: var(--ink-soft); user-select: none;
}
.tick input { width: 15px; height: 15px; accent-color: var(--accent-deep); cursor: pointer; }
.tick.is-checked { color: var(--st-live-fg); font-weight: 500; }
.print-check { display: none; }

.cell-notes { min-width: 170px; }
.notes-input {
  width: 100%; min-height: 44px; resize: vertical;
  border: none; border-radius: var(--r-sm); background: var(--field);
  padding: 8px 10px; font-size: 12px; color: var(--ink); font-family: var(--font-sans);
}

.empty { color: var(--ink-faint); font-size: 12px; padding: 34px; text-align: center; }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(20,22,28,0.84); padding: 30px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: var(--r-md); }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 70; background: var(--ink); color: #fff;
  padding: 11px 20px; border-radius: 999px; font-size: 12px; letter-spacing: 0.03em;
  opacity: 0; transition: opacity 200ms ease;
}
.toast.show { opacity: 1; }
.toast[hidden] { display: none; }

/* ---- Modal (item / collection / requirements editor) ---- */
.modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(20,22,28,0.46); padding: 24px; backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal__card {
  width: min(680px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-lg); overflow: hidden;
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px 14px;
}
.modal__title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.modal__x {
  border: none; background: transparent; cursor: pointer; color: var(--ink-faint);
  font-size: 24px; line-height: 1; width: 32px; height: 32px; border-radius: var(--r-sm);
}
.modal__x:hover { background: var(--surface-2); color: var(--ink); }
.modal__body { padding: 6px 22px 20px; overflow-y: auto; }
.modal__foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; background: var(--surface-2);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field__label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); font-family: var(--font-mono);
}
.inp {
  width: 100%; border: none; border-radius: var(--r-sm);
  background: var(--field); padding: 10px 12px; font-size: 13px; color: var(--ink);
  font-family: var(--font-sans);
}
.inp--mono { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.01em; }
.inp--area { resize: vertical; min-height: 46px; line-height: 1.45; }
.form-hint { font-size: 11.5px; color: var(--ink-faint); margin: 16px 0 0; }

.reqs-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.reqs-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 10px; align-items: start; }
.reqs-row .req-title { align-self: stretch; }
.modal--wide .modal__card { width: min(820px, 100%); }

/* ---- Order header ---- */
.orderhead { padding: 14px var(--pad-x) 0; }
.orderhead__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px 18px;
  background: var(--surface); border-radius: var(--r-md); padding: 20px;
}
.orderhead .field--full { grid-column: 1 / -1; }
.orderhead__foot { display: flex; align-items: center; gap: 16px; padding: 14px 2px 0; }
.orderhead__hint { font-size: 11.5px; color: var(--ink-faint); }

/* ---- Order line table ---- */
.items--order .cell-orderqty { width: 118px; }
.oq { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); letter-spacing: 0.06em; }
.oq + .oq { margin-top: 5px; }
.inp--qty { width: 66px; padding: 6px 7px; font-size: 12px; text-align: center; font-family: var(--font-mono); }
.cell-remove { width: 30px; text-align: center; }
.status-pill {
  display: inline-block; border-radius: 999px; padding: 5px 13px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em; white-space: nowrap;
  background: var(--st-todesign-bg); color: var(--st-todesign-fg);
}
.status-pill[data-status="To Design"] { background: var(--st-todesign-bg); color: var(--st-todesign-fg); }
.status-pill[data-status="In CAD"] { background: var(--st-incad-bg); color: var(--st-incad-fg); }
.status-pill[data-status="CAD Approved"] { background: var(--st-approved-bg); color: var(--st-approved-fg); }
.status-pill[data-status="Sampling"] { background: var(--st-sampling-bg); color: var(--st-sampling-fg); }
.status-pill[data-status="Photographed"] { background: var(--st-photographed-bg); color: var(--st-photographed-fg); }
.status-pill[data-status="Live"] { background: var(--st-live-bg); color: var(--st-live-fg); }
.thumbs--ro { margin-top: 7px; }
.thumb--sm { width: 40px; height: 40px; cursor: zoom-in; }

/* ---- Piece picker ---- */
.pick-list { margin-top: 14px; max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.pick-group__h {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); padding: 4px 0; display: flex; gap: 10px; align-items: baseline;
  position: sticky; top: 0; background: var(--surface);
}
.linklike { border: none; background: none; color: var(--accent-deep); cursor: pointer; font-size: 11px; text-transform: none; letter-spacing: 0; padding: 0; }
.linklike:hover { text-decoration: underline; }
.pick-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--r-sm); cursor: pointer;
}
.pick-row:hover { background: var(--surface-2); }
.pick-row input { width: 15px; height: 15px; accent-color: var(--accent-deep); }
.pick-name { flex: 1 1 auto; font-size: 13px; color: var(--ink); }
.pick-code { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }

/* ---- "What's missing" report ---- */
.gaps { margin-top: 14px; display: flex; flex-direction: column; gap: 22px; }
.gaps-sec__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 8px;
}
.gaps-sec__title { font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 9px; }
.gaps-count {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent-deep);
  background: var(--accent-tint); border-radius: 999px; padding: 2px 9px;
}
.gaps-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.gaps-list li {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 9px; border-radius: var(--r-sm);
}
.gaps-list li:nth-child(even) { background: var(--surface-2); }
.gaps-name { flex: 1 1 auto; font-size: 13px; color: var(--ink); }
.gaps-code { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }
.gaps-col {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); flex: 0 0 auto;
}
.gaps-print { display: none; } /* only rendered for print, see @media print */

/* =====================================================================
   API rate-limit dashboard (the "API Limits" section)
   ===================================================================== */
body:is(.mode-dashboard, .mode-api, .mode-shoots, .mode-photographers, .mode-models) :is(
  .controls, #summary, #manufacturing, #collections, #orderhead, .topbar__actions
) { display: none !important; }

.apihealth { padding: 16px var(--pad-x) 64px; }

.rl-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px;
  flex-wrap: wrap; margin: 4px 0 22px;
}
.rl-heading { font-family: var(--font-sans); font-weight: 600; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -0.015em; }
.rl-sub { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }
.rl-toolbar__controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rl-updated { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-faint); text-transform: uppercase; }

.rl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }

.rl-card {
  display: flex; flex-direction: column; gap: 11px;
  background: var(--surface); border-radius: var(--r-md); padding: 18px 20px;
}
.rl-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rl-card__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rl-card__label { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-dot { width: 9px; height: 9px; border-radius: 999px; corner-shape: round; flex: none; background: var(--ink-faint); }
.rl-badge {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-deep); background: var(--accent-tint);
  padding: 3px 8px; border-radius: 999px; white-space: nowrap; flex: none;
}
.rl-statusline { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }

.rl-gauge { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rl-gauge__fill { height: 100%; border-radius: 999px; background: var(--ink-faint); transition: width 400ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.rl-figure { display: flex; align-items: baseline; gap: 6px; }
.rl-figure__pct { font-family: var(--font-sans); font-weight: 600; font-size: 30px; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.rl-figure__unit { font-size: 11px; color: var(--ink-faint); }
.rl-figure--na .rl-figure__pct { color: var(--ink-faint); }

.rl-meta { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.rl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rl-row dt { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.rl-row dd { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.rl-row dd b { color: var(--ink); font-weight: 600; }
.rl-warntext { color: #96622f; font-weight: 500; }
.rl-note { font-size: 11.5px; color: var(--ink-faint); }
.rl-note--bad { color: var(--danger); }
.rl-note--warn { color: #96622f; }

.rl-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.rl-hostname { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-cardactions { display: inline-flex; align-items: center; gap: 6px; flex: none; }

/* Status colours */
.rl-dot--ok, .rl-gauge__fill--ok { background: var(--st-live-fg); }
.rl-dot--warn, .rl-gauge__fill--warn { background: #b98a3e; }
.rl-dot--critical, .rl-gauge__fill--critical { background: #c05a41; }
.rl-dot--throttled, .rl-gauge__fill--throttled { background: #8a4b83; }
.rl-dot--reachable { background: var(--st-incad-fg); }
.rl-dot--error { background: var(--danger); }
.rl-dot--unknown { background: var(--ink-faint); }
.rl-statusline--ok { color: var(--st-live-fg); }
.rl-statusline--warn { color: #96622f; }
.rl-statusline--critical, .rl-statusline--error { color: var(--danger); }
.rl-statusline--throttled { color: #8a4b83; }
.rl-statusline--reachable { color: var(--st-incad-fg); }
/* Flag a card that needs attention with a soft tint instead of a stroke. */
.rl-card--critical, .rl-card--error { background: color-mix(in oklab, var(--danger) 6%, var(--surface)); }
.rl-card--throttled { background: color-mix(in oklab, #8a4b83 6%, var(--surface)); }
.rl-card--warn { background: color-mix(in oklab, #b98a3e 7%, var(--surface)); }

/* Skeleton while the first load is in flight */
.rl-card--skeleton {
  min-height: 190px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%; animation: rl-shimmer 1.3s ease infinite;
}
@keyframes rl-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* The QuickBooks card has no styles of its own: it is built from the .rl-card
   pieces above, so the Integrations and Rate limits sections stay one design.
   Only this remains, for the "(~93d)" note beside the login expiry. */
.qb-muted { color: var(--ink-faint); }
/* A link styled as a button still needs its underline removed. */
.rl-cardactions .btn--solid { text-decoration: none; }

/* QuickBooks-driven "Paid" cell on shoot payment rows */
.oq--paid { flex: none; }
.paid-linked { display: inline-flex; align-items: center; gap: 6px; }
.paid-linked__amt { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink); letter-spacing: 0; }
.paid-unlinked { color: var(--ink-faint); font-weight: 400; cursor: help; }
.paid-unmatch { color: var(--ink-faint); font-size: 14px; line-height: 1; }
.paid-unmatch:hover { color: var(--danger); }
.qb-match { white-space: nowrap; }
.qb-badge {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; white-space: nowrap;
  color: var(--st-live-fg); background: color-mix(in oklab, var(--st-live-fg) 14%, var(--surface));
  padding: 2px 6px; border-radius: 999px;
}

/* QuickBooks expense picker (stacks above the shoot modal) */
.qbpicker {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(20,22,28,0.5); backdrop-filter: blur(4px);
}
.qbpicker[hidden] { display: none; }
.qbpicker__card {
  background: var(--surface); border-radius: var(--r-lg); width: min(560px, 100%);
  max-height: min(80vh, 720px); display: flex; flex-direction: column; padding: 20px 22px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.45);
}
.qbpicker__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qbpicker__title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.qbpicker__hint { font-size: 12px; color: var(--ink-faint); margin: 3px 0 0; }
.qbpicker__search { margin: 14px 0 12px; width: 100%; }
.qbpicker__list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.qbpick {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--surface-2); border: none; border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer;
}
.qbpick:hover:not([disabled]) { background: var(--accent-tint); }
.qbpick[disabled] { opacity: 0.5; cursor: not-allowed; }
.qbpick__amt { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--ink); min-width: 76px; flex: none; }
.qbpick__mid { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.qbpick__vendor { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbpick__sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbpick__tag { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); flex: none; }

/* Section label inside the API Limits view */
.rl-sectionlabel { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 24px 0 12px; }
.rl-sectionlabel:first-of-type { margin-top: 6px; }

/* QuickBooks read-usage meter */
.qb-meter { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.qb-meter__head { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.qb-meter__val { color: var(--ink); letter-spacing: 0; }
.qb-meter__foot { font-size: 11px; color: var(--ink-faint); }

/* Unified dashboard (home) */
.dashboard { padding: 16px var(--pad-x) 64px; }
.dash-head { margin: 4px 0 22px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.dash-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  background: var(--surface); border: none; border-radius: var(--r-md); padding: 20px; cursor: pointer;
  transition: background 120ms ease;
}
.dash-card:hover { background: var(--hover); }
.dash-card__top { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.dash-card__top .ico { width: 20px; height: 20px; flex: none; opacity: 0.85; }
.dash-card__title { font-size: 13px; font-weight: 500; }
.dash-card__go { margin-left: auto; color: var(--ink-faint); font-size: 15px; }
.dash-card__big { font-family: var(--font-sans); font-size: 34px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.15; min-height: 40px; }
.dash-card__sub { font-size: 12px; color: var(--ink-faint); }
.dash-card--ok .dash-card__big { color: var(--st-live-fg); }
.dash-note {
  margin-top: 16px; font-size: 12.5px; color: #96622f;
  background: color-mix(in oklab, #b98a3e 8%, var(--surface)); padding: 10px 14px; border-radius: var(--r-sm);
}

/* Header editor rows in the endpoint modal */
.rl-hdr-block { margin-top: 18px; }
.rl-hdrs { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.rl-hdr-row { display: grid; grid-template-columns: minmax(110px, 0.8fr) 1fr auto; gap: 8px; align-items: center; }
.form-hint code { font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--accent-deep); }

@media (prefers-reduced-motion: reduce) {
  .rl-card--skeleton { animation: none; }
  .rl-gauge__fill { transition: none; }
}

/* Narrow screens: sidebar collapses to a top strip of pills. */
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; padding: 12px var(--pad-x); gap: 10px; }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .navgroup { flex-direction: row; flex-wrap: wrap; align-items: center; margin-top: 0; gap: 4px; }
  .navgroup__label { display: none; }
  .topbar__actions { margin-left: 0; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .reqs-row { grid-template-columns: 1fr auto; }
  .reqs-row .req-detail { grid-column: 1 / -1; }
}

.print-only { display: none; }

/* =====================================================================
   PRINT: Letter landscape, one collection per page, branded + colored.
   (Kept from the original — the printed manifest keeps its serif display.)
   ===================================================================== */
@media print {
  @page { size: letter landscape; margin: 0.42in 0.5in; }
  html, body { background: #fff; }
  body { font-size: 9px; }
  .app, .main { display: block; }
  *, *::before, *::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .screen-only, .topbar, .controls, .summary, .addimg, .thumb .delimg,
  .notes-input:focus, #lightbox, #toast, #file-input, #modal, .iconbtn, .rowedit,
  .collection__actions, .mfg__bar, .empty { display: none !important; }
  .print-only { display: block; }

  /* Manufacturing requirements become the branded cover page */
  .mfg { padding: 0; break-after: page; }
  .mfg__cover-head { display: block; text-align: center; margin: 8% 0 5%; }
  .mfg__cover-head .cv-wordmark { width: 340px; max-width: 66%; height: auto; margin: 0 auto; display: block; }
  .mfg__cover-head .cv-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent-deep); margin-top: 20px; }
  .mfg__cover-head .cv-rule { width: 90px; height: 2px; background: var(--accent); margin: 18px auto; }
  .mfg__cover-head .cv-reqs-title { font-family: var(--font-serif); font-weight: 400; font-size: 17px; color: var(--ink); margin-top: 34px; letter-spacing: 0.02em; }
  .mfg__print { display: block; max-width: 8.5in; margin: 0 auto; }
  .mfg__grid { break-inside: avoid; grid-template-columns: 1fr 1fr; gap: 16px 40px; }
  .mfg__t { color: var(--accent-deep); }
  .mfg__d { color: var(--ink-soft); }

  .collections { padding: 0; }
  .collection { margin: 0; break-after: page; break-inside: avoid; }
  .collection:last-child { break-after: auto; }
  .collection__head {
    border-bottom: 2px solid var(--accent);
    padding: 4px 0 6px; margin-bottom: 6px; position: relative;
  }
  .collection__head::before {
    content: ""; position: absolute; right: 0; top: 3px; width: 104px; height: 15px;
    background: url("/wordmark.svg") right center / contain no-repeat;
  }
  .collection__name { font-family: var(--font-serif); font-weight: 400; font-size: 19px; letter-spacing: 0.02em; }
  .collection__count, .collection__prog { color: var(--ink-soft); }
  .collection__prog .bar { box-shadow: 0 0 0 1px var(--line); }

  .tablewrap { overflow: visible; border-radius: 0; }
  table.items { font-size: 8.4px; }
  .items thead th { background: var(--cream); color: var(--accent-deep); padding: 4px 5px; font-size: 7.4px; }
  .items tbody td { padding: 4px 5px; border-top: 1px solid var(--line); background: transparent !important; }
  .items tbody tr { break-inside: avoid; }
  .items tbody tr.is-live td { background: var(--st-live-bg) !important; }

  .item-name { font-family: var(--font-serif); font-weight: 400; font-size: 10px; }
  .item-meta { font-size: 7.6px; }
  .code { font-size: 7.2px; }
  .status-select { appearance: none; background-image: none; padding: 3px 8px; font-size: 8px; }
  .status-pill { padding: 2px 7px; font-size: 8px; }

  /* Order cover banner + order-line quantities */
  .mfg__cover-head .cv-order { margin-top: 20px; }
  .cv-order__name { font-family: var(--font-serif); font-size: 22px; color: var(--ink); letter-spacing: 0.02em; }
  .cv-order__meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ink-soft); margin-top: 6px; }
  .items--order .inp--qty { border: none; background: transparent; text-align: left; padding: 0; font-size: 8.4px; width: auto; font-family: var(--font-mono); }
  .items--order .oq { display: inline-flex; gap: 4px; }
  .items--order .oq + .oq { margin-top: 2px; }

  /* Compact media for print: small thumb + printed check glyph */
  .cell-media { width: auto; }
  .thumbs { gap: 3px; }
  .thumb { width: 34px; height: 34px; cursor: default; }
  .tick input { display: none; }
  .tick { font-size: 8px; color: var(--ink-soft); }
  .print-check { display: inline-block; font-weight: 700; margin-right: 3px; }
  .tick.is-checked .print-check { color: var(--st-live-fg); }
  .tick:not(.is-checked) .print-check { color: var(--ink-faint); }

  .cell-notes { min-width: 0; }
  .notes-input { border: none; background: transparent; padding: 0; min-height: 0; font-size: 8px; line-height: 1.25; resize: none; max-height: 3.4em; overflow: hidden; }

  /* ---- "What's missing" report → own portrait sheet ---- */
  @page gaps-page { size: letter portrait; margin: 0.55in 0.6in; }
  body.printing-gaps { page: gaps-page; font-size: 10px; }
  body.printing-gaps .mfg,
  body.printing-gaps .collections { display: none !important; }
  body.printing-gaps #gaps-print { display: block; }

  #gaps-print .gp-cover { text-align: center; margin: 2% 0 9%; break-after: avoid; }
  #gaps-print .gp-wordmark { width: 300px; max-width: 70%; height: auto; margin: 0 auto; display: block; }
  #gaps-print .gp-rule { width: 84px; height: 2px; background: var(--accent); margin: 16px auto; }
  #gaps-print .gp-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent-deep); }
  #gaps-print .gp-date { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ink-soft); margin-top: 8px; }

  #gaps-print .gp-sec { break-inside: avoid; margin-bottom: 22px; }
  #gaps-print .gp-sec__title { font-family: var(--font-serif); font-weight: 400; font-size: 15px; color: var(--ink); border-bottom: 2px solid var(--accent); padding-bottom: 5px; margin-bottom: 9px; }
  #gaps-print .gp-count { font-family: var(--font-mono); font-size: 10px; color: var(--accent-deep); margin-left: 6px; }
  #gaps-print .gp-list { list-style: none; margin: 0; padding: 0; columns: 3in; column-gap: 26px; }
  #gaps-print .gp-row { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; border-bottom: 0.5px solid var(--line-soft); break-inside: avoid; }
  #gaps-print .gp-name { flex: 1 1 auto; font-size: 10px; color: var(--ink); }
  #gaps-print .gp-code { font-family: var(--font-mono); font-size: 8px; color: var(--ink-faint); }
  #gaps-print .gp-col { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
  #gaps-print .gp-none { font-size: 10px; color: var(--st-live-fg); }
}

/* =====================================================================
   Studio: Photoshoots + Models
   ===================================================================== */
.studio { padding: 16px var(--pad-x) 64px; }

.chip {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-soft); background: var(--surface-2);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.chip--warn { color: var(--amber); background: var(--amber-tint); }

.type-badge {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap; flex: none;
  color: var(--accent-deep); background: var(--accent-tint);
}
.type-badge--model { color: var(--sc-gold); background: var(--amber-tint); }
.type-badge--campaign { color: var(--st-live-fg); background: var(--st-live-bg); }

.shoot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.shoot-card {
  display: flex; flex-direction: column; gap: 12px; cursor: pointer;
  background: var(--surface); border-radius: var(--r-md); padding: 18px 20px;
  border: 1px solid transparent; transition: border-color 0.15s, background 0.15s;
}
.shoot-card:hover { border-color: var(--line); background: var(--surface-2); }
.shoot-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.shoot-card__name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.shoot-card__date { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); margin-top: 3px; letter-spacing: 0.04em; }
.shoot-card__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink-soft); }
.shoot-card__meta b { font-weight: 500; color: var(--ink-faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 3px; }
.shoot-card__foot { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.shoot-card__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.shoot-card__money { display: flex; gap: 20px; border-top: 1px solid var(--line-soft); padding-top: 11px; }
.shoot-stat__label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); }
.shoot-stat__val { font-family: var(--font-mono); font-size: 14px; font-weight: 500; margin-top: 2px; }
.is-owed { color: var(--amber); }
.is-clear { color: var(--ink-faint); }

.model-list { display: flex; flex-direction: column; gap: 10px; }
.model-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; cursor: pointer;
  background: var(--surface); border-radius: var(--r-md); padding: 14px 18px;
  border: 1px solid transparent; transition: border-color 0.15s, background 0.15s;
}
.model-row:hover { border-color: var(--line); background: var(--surface-2); }
.model-row__id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.model-avatar {
  width: 34px; height: 34px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 14px;
  color: var(--accent-deep); background: var(--accent-tint);
}
.model-row__name { font-size: 15px; font-weight: 600; }
.model-row__handle { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.model-row__stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.model-money { font-size: 12px; color: var(--ink-soft); }
.model-money b { font-weight: 500; color: var(--ink-faint); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px; }

.modal-sub {
  display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint);
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
}
.modal-sub__hint { text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--ink-faint); }
.piece-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.piece-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: var(--surface-2); border-radius: 999px; padding: 4px 6px 4px 12px;
}
.piece-chip__code { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }
.piece-chip__x { border: none; background: none; cursor: pointer; color: var(--ink-faint); font-size: 15px; line-height: 1; padding: 0 4px; }
.piece-chip__x:hover { color: var(--danger); }

.pay-list { display: flex; flex-direction: column; gap: 8px; }
.pay-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 14px;
}
.pay-row__who { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 150px; }
.pay-row__label { font-size: 13px; font-weight: 500; }
.pay-row__sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }
.pay-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--ink-faint); }
.pay-dot--photographer { background: var(--accent); }
.pay-dot--studio { background: var(--sc-sampling); }
.pay-dot--model { background: var(--amber); }
.pay-row .oq { flex: none; }
.pay-row .inp--qty { width: 66px; }
.pay-bal { font-family: var(--font-mono); font-size: 13px; font-weight: 500; text-align: right; min-width: 62px; flex: none; }
.pay-del { color: var(--ink-faint); flex: none; }
.pay-del:hover { color: var(--danger); }
.pay-del-gap { width: 24px; flex: none; }
.pay-addmodel { margin-top: 10px; }
.pay-addmodel .inp { max-width: 320px; }

/* sub-shoot (segment) panel */
.segment { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; }
.segment__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.segment__loc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.segment__type { flex: 0 0 130px; }
.segment__name { flex: 1 1 200px; }
.segment__kind { flex: 0 0 120px; }
.segment__location { flex: 1 1 200px; }
.segment .pay-list:empty { display: none; }
.segment .pay-list { gap: 6px; }
.segment .pay-row { background: var(--surface); }
.seg-del { flex: none; }
.seg-del:hover { color: var(--danger); }
.shoot-card__types { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-sub { color: var(--ink-faint); font-size: 11px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table th, .mini-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.mini-table thead th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); font-weight: 500; }
.mini-table .num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.mini-table tfoot th { font-family: var(--font-mono); border-top: 1px solid var(--line); border-bottom: none; }

/* ---- Sign-in gate ---------------------------------------------------------- */
/* Covers the whole app until a session is confirmed. Uses the same tokens as the
   rest of the UI so it reads as one product, not a bolted-on login. */
.login {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--canvas);
}
.login[hidden] { display: none; }
.login__card {
  width: min(360px, calc(100vw - 40px));
  background: var(--surface);
  border-radius: var(--r-md, 10px);
  padding: 32px 28px;
  display: flex; flex-direction: column;
}
.login__brand {
  font-family: var(--font-sans); font-weight: 500;
  letter-spacing: 0.22em; font-size: 18px; color: var(--ink);
}
.login__sub {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 6px; margin-bottom: 24px;
}
.login__label {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 6px;
}
.login__input {
  font-family: var(--font-sans); font-size: 14px; color: var(--ink);
  background: var(--field); border: none; border-radius: var(--r-sm, 6px);
  padding: 10px 12px; margin-bottom: 16px;
}
.login__input:focus { outline: 2px solid var(--accent-deep); outline-offset: 1px; }
.login__btn {
  font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 11px 16px; border-radius: var(--r-sm, 6px);
  border: none; cursor: pointer; margin-top: 8px;
  background: var(--btn-primary); color: var(--on-accent);
  transition: background 150ms ease;
}
.login__btn:hover:not(:disabled) { background: var(--btn-primary-hover); }
.login__btn:disabled { opacity: 0.6; cursor: default; }
.login__error {
  margin: 14px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--danger);
}
.login__error[hidden] { display: none; }

/* ---- Sidebar account footer ------------------------------------------------ */
.sidebar__account {
  margin-top: auto; padding-top: 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
}
.account__email {
  font-size: 11.5px; color: var(--ink-faint);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account__role {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber);
}
.account__role[hidden] { display: none; }
.account__signout {
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-soft);
  background: none; border: none; padding: 4px 0; cursor: pointer;
}
.account__signout:hover { color: var(--ink); text-decoration: underline; }
