/* styles.css — AKL Prototype & Master Data System (demonstration build).
 *
 * Design tokens are the same set the AKL leads dashboard at akl.underwings.org
 * uses, so the two applications read as one system. Light theme only, on
 * purpose: `color-scheme: light` keeps native selects and scrollbars light for
 * viewers whose OS is in dark mode, rather than half-flipping the interface.
 *
 * Chart colours are NOT defined here — they live in js/charts.js because they
 * were validated as a palette, and splitting them across two files invites
 * someone to change one and not the other.
 */

:root {
  --ground: #FBFAF8;
  --surface: #FFFFFF;
  --surface-2: #F7F5F1;
  --ink: #201C17;
  --ink-2: #4A443C;
  --muted: #7A7268;
  --line: #ECE8E1;
  --line-2: #E3DED5;
  --accent: #A85D33;
  --accent-ink: #8A4A25;
  --accent-soft: #F4E9DF;
  --accent-soft-2: #EFE0D2;

  --ok: #2F7D4F;      --ok-bg: #E6F4EA;
  --info: #3F6CA8;    --info-bg: #EAF1FA;
  --warn: #B07A1E;    --warn-bg: #FAF1DE;
  --danger: #A6473A;  --danger-bg: #F8EAE7;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(32,28,23,.04), 0 1px 3px rgba(32,28,23,.04);
  --shadow-md: 0 4px 16px rgba(32,28,23,.08), 0 1px 3px rgba(32,28,23,.05);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

/* ---------- layout ---------- */

.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 28px 56px; flex: 1; max-width: 1280px; width: 100%; }
.foot {
  padding: 20px 28px 32px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.foot p { margin: 0; }

/* ---------- sidebar ---------- */

.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.brand {
  display: flex; gap: 10px; align-items: center;
  padding: 18px 16px; border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.brand-name { font-weight: 650; font-size: 13px; line-height: 1.25; }
.brand-sub { color: var(--muted); font-size: 11px; }

.nav { padding: 12px 10px; flex: 1; }
.nav-group {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); padding: 14px 8px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 1px;
  background: none; border: 0; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--ink-2); font-size: 13.5px;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-count {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.sidebar-foot { padding: 14px 14px 18px; border-top: 1px solid var(--line); }
.demo-note { color: var(--muted); font-size: 11px; margin: 12px 0 0; line-height: 1.45; }

/* ---------- topbar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 28px; background: rgba(251,250,248,.94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
/* The four §5 filters sit on their own row so they never crowd the role
   picker, and so the same set is visible on every screen. */
.filter-strip {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px dashed var(--line);
}
.select-wide { min-width: 168px; }
.input-date { width: auto; padding: 4px 8px; font-size: 12.5px; }
.topbar-filters { display: flex; gap: 14px; flex-wrap: wrap; }
.topbar-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-field { display: flex; flex-direction: column; gap: 3px; }
.role-hint { color: var(--muted); font-size: 12px; }
.menu-btn {
  display: none; background: none; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 5px 10px; cursor: pointer;
}

/* ---------- page head ---------- */

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 8px 0 20px;
}
.page-title { margin: 0; font-size: 24px; letter-spacing: -.015em; font-weight: 650; }
.page-sub { margin: 5px 0 0; color: var(--muted); max-width: 74ch; }
.head-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back {
  background: none; border: 0; padding: 0 0 6px; cursor: pointer;
  color: var(--muted); font-size: 12.5px;
}
.back:hover { color: var(--accent-ink); }
.code {
  font-family: var(--mono); font-size: 12px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
}
.section-heading {
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 650; margin: 32px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.scope-note { color: var(--muted); font-size: 12.5px; margin: -8px 0 16px; }
.hint, .footnote { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.footnote { margin: 0; }

/* ---------- cards ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 16px; overflow: hidden;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 14px 18px 0;
}
.card-title { margin: 0; font-size: 14px; font-weight: 650; }
.card-sub { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.card-body { padding: 14px 18px 18px; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.dash-grid .card { margin-bottom: 0; }
.rec-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.rec-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; align-items: start; }
.rec-grid > div > .card:last-child, .rec-panels > .card { margin-bottom: 16px; }
.new-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 16px; align-items: start; }
.prod-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px; align-items: start; }
.prod-grid .card-wide { grid-column: 1 / -1; }

/* ---------- stats ---------- */

.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow-sm);
}
.stat[role="button"] { cursor: pointer; }
.stat[role="button"]:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600;
}
.stat-value { font-size: 25px; font-weight: 650; letter-spacing: -.02em; margin-top: 3px; }
.stat-hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.stat-good .stat-value { color: var(--ok); }
.stat-warn .stat-value { color: var(--warn); }
.stat-late .stat-value { color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }
.card-body > .stat-row:last-child { margin-bottom: 0; }

/* ---------- charts ---------- */

.chart-host { width: 100%; }
.chart { display: block; overflow: visible; }
.c-label { font-size: 12px; fill: var(--ink-2); font-family: var(--sans); }
.c-value { font-size: 12px; fill: var(--ink); font-weight: 600; font-family: var(--sans); }
.bar-row:hover .c-value { fill: var(--accent-ink); }
.bar-clickable { cursor: pointer; }
.bar-clickable:hover .c-label { fill: var(--accent-ink); }
.bar-clickable:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.legend-dot { display: block; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 600;
  padding: 0 12px 8px 0; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .ta-right { text-align: right; padding-right: 0; }
.row-click { cursor: pointer; }
.row-click:hover td { background: var(--surface-2); }
.result-count { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.cell-name { display: flex; flex-direction: column; gap: 3px; }
.reason { color: var(--ink-2); }

.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent-ink); font-weight: 600; font-family: var(--mono);
  font-size: 12.5px; text-align: left;
}
.linkish:hover { text-decoration: underline; }

/* ---------- badges ---------- */

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  border-radius: 99px; padding: 2px 9px; white-space: nowrap;
}
.badge-in_progress { background: var(--info-bg); color: var(--info); }
.badge-in_master_data { background: var(--ok-bg); color: var(--ok); }
.badge-under_modification { background: var(--warn-bg); color: var(--warn); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }

.tag {
  display: inline-block; font-size: 11.5px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}
.age {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}
.age-ok { color: var(--muted); background: var(--surface-2); }
.age-warn { color: var(--warn); background: var(--warn-bg); }
.age-late { color: var(--danger); background: var(--danger-bg); }

.muted { color: var(--muted); }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.empty { color: var(--muted); margin: 4px 0; }

/* ---------- stepper ---------- */

.stepper {
  display: flex; list-style: none; margin: 0; padding: 4px 0 0;
  gap: 4px; overflow-x: auto;
}
.step { flex: 1 1 0; min-width: 62px; text-align: center; position: relative; }
.step::before {
  content: ""; position: absolute; top: 11px; left: -50%;
  width: 100%; height: 2px; background: var(--line-2); z-index: 0;
}
.step:first-child::before { display: none; }
.step-dot {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 24px; height: 24px; margin: 0 auto 5px; border-radius: 50%;
  font-size: 11px; font-weight: 650;
  background: var(--surface); border: 2px solid var(--line-2); color: var(--muted);
}
.step-label { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.step-done .step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-done::before { background: var(--ok); }
.step-current .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-current .step-label { color: var(--accent-ink); font-weight: 650; }
.step-stopped .step-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.step-stopped .step-label { color: var(--danger); font-weight: 650; }
.stage-blurb { color: var(--muted); margin: 14px 0 0; font-size: 12.5px; }

/* ---------- timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: 4px; top: 14px; bottom: 0;
  width: 2px; background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-mark {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 4px;
  flex: none; position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--surface);
}
.tl-ok { background: var(--ok); }
.tl-warn { background: var(--warn); }
.tl-danger { background: var(--danger); }
.tl-neutral { background: var(--line-2); }
.tl-body { min-width: 0; }
.tl-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-stage { color: var(--muted); font-size: 12px; }
.tl-meta { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.tl-comment {
  margin-top: 6px; padding: 8px 10px; background: var(--surface-2);
  border-left: 2px solid var(--line-2); border-radius: 0 6px 6px 0;
  font-size: 12.5px; color: var(--ink-2);
}
.tl-cycles {
  margin: 0 0 14px; font-size: 12.5px; color: var(--warn);
  background: var(--warn-bg); padding: 7px 10px; border-radius: var(--radius-sm);
}

/* ---------- field grid ---------- */

.fields { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 0; margin: 0; }
.fields dt {
  color: var(--muted); font-size: 12px; padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--line);
}
.fields dd {
  margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.fields dt:last-of-type, .fields dd:last-of-type { border-bottom: 0; }

/* ---------- forms ---------- */

.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filter { display: flex; flex-direction: column; gap: 4px; }
.filter-grow { flex: 1 1 220px; }
.filter-label, .field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600;
}
.input, .select, .textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 7px 10px; width: 100%; min-width: 0;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
.select-sm { padding: 5px 8px; width: auto; font-size: 13px; }
.textarea { resize: vertical; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-calc {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 7px 10px; justify-content: center;
}
.calc-value { font-size: 15px; font-weight: 650; }
.section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 650; margin: 18px 0 8px;
}
.card-body > .section-label:first-child { margin-top: 0; }
.carry-note { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.form-error { color: var(--danger); font-size: 12.5px; margin: 8px 0 0; min-height: 1em; }
.saved-note { color: var(--ok); font-size: 12.5px; align-self: center; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer;
  border: 1px solid transparent; font-size: 13.5px; font-weight: 600;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.btn-warn:hover { background: var(--warn); color: #fff; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.decision-hint { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.waiting-note, .terminal-note {
  margin: 0; padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface-2); color: var(--ink-2);
}
.terminal-confirmed { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.terminal-rejected { background: var(--danger-bg); color: var(--danger); font-weight: 600; }

/* ---------- product art & catalogue ---------- */

.art { display: block; width: 100%; border-radius: var(--radius-sm); background: var(--surface-2); }
.art-thumb { max-width: 56px; }
.art-card { max-width: 100%; }
.art-hero { max-width: 340px; margin: 0 auto; }
.art-caption {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  flex-wrap: wrap; margin-top: 10px; font-size: 12.5px;
}
.swatch { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); }
.swatch-dot { flex: none; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.prod-card {
  display: block; text-align: left; cursor: pointer; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.prod-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.prod-body { padding: 11px 13px 13px; }
.prod-code { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.prod-name { font-weight: 600; font-size: 13.5px; margin: 2px 0 7px; line-height: 1.3; }
.prod-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.prod-price { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; }
.margin { font-size: 11.5px; font-weight: 600; }
.new-preview { text-align: center; }
.preview-note { font-size: 11.5px; margin-top: 10px; text-align: left; }

/* ---------- activity ---------- */

.activity { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--line-2); }
.act-approve, .act-complete { background: var(--ok); }
.act-modify { background: var(--warn); }
.act-reject { background: var(--danger); }
.act-line { font-size: 13px; }
.act-meta { color: var(--muted); font-size: 11.5px; }
.act-comment { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; font-style: italic; }

/* ---------- mobile ---------- */

.scrim { display: none; }

@media (max-width: 940px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; width: 264px; height: 100vh;
    transform: translateX(-100%); transition: transform .18s ease;
  }
  body.menu-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-md); }
  body.menu-open .scrim {
    display: block; position: fixed; inset: 0; z-index: 30;
    background: rgba(32,28,23,.32);
  }
  .menu-btn { display: block; }
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 8px 16px; gap: 6px; }
  .filter-strip {
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .filter-strip > * { flex: none; }
  .topbar-right { width: 100%; margin-left: 0; justify-content: space-between; }
  .role-hint { display: none; }
  .rec-grid, .new-grid, .prod-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 20px; }
  .fields { grid-template-columns: 1fr; }
  .fields dt { padding-bottom: 0; border-bottom: 0; }
  .fields dd { padding-top: 2px; }
  /* The CEO approves from a phone: keep the decision buttons reachable. */
  .action-bar .btn { flex: 1 1 100%; padding: 11px 14px; }
  .stepper { gap: 2px; }
  .step { min-width: 54px; }
  .step-label { font-size: 9.5px; }
}

/* ---------- print: the product spec sheet ---------- */

@media print {
  .sidebar, .topbar, .foot, .head-actions, .scrim, .back { display: none !important; }
  body { background: #fff; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .prod-grid { display: block; }
  .prod-grid .card { margin-bottom: 12px; }
  .art-hero { max-width: 220px; }
  .stat-row { display: none; }
}

/* ---------- sortable table headers ---------- */

.th-sort {
  background: none; border: 0; padding: 0 0 8px; cursor: pointer;
  font: inherit; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
}
.th-sort:hover { color: var(--ink); }
.th-sort.is-sorted { color: var(--accent-ink); }
.ta-right .th-sort { justify-content: flex-end; width: 100%; }
/* The arrow is always rendered so the column width does not jump on sort. */
.th-arrow { opacity: .45; font-size: 10px; }
.th-sort.is-sorted .th-arrow { opacity: 1; }
.table th:has(.th-sort) { padding-bottom: 0; }

/* ---------- trend chart ---------- */

.c-axis { font-size: 11px; fill: var(--muted); font-family: var(--sans); }
.c-series-label { font-size: 11.5px; font-weight: 600; font-family: var(--sans); }
.c-tip-title { font-size: 11.5px; font-weight: 600; fill: #fff; font-family: var(--sans); }
.c-tip-row { font-size: 11.5px; fill: #F2EEE8; font-family: var(--sans); }

/* ---------- sign-in ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--ground); }
.login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 32px; width: 100%; max-width: 380px; text-align: center;
}
.login-card .brand-mark { margin: 0 auto 16px; }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-form .form-error:empty { display: none; }
.login-title { margin: 0; font-size: 19px; font-weight: 650; }
.login-sub { margin: 4px 0 24px; color: var(--muted); font-size: 13px; }

/* ---------- shell additions ---------- */
.who { margin-bottom: 10px; }
.who-name { font-size: 13px; font-weight: 600; }
.who-role { font-size: 11.5px; color: var(--muted); }
.crumb { font-size: 12.5px; color: var(--muted); }
.nav-soon { color: var(--muted); font-size: 12px; cursor: default; }
.nav-soon:hover { background: transparent; color: var(--muted); }
.card-wide { grid-column: 1 / -1; }
.plain-list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.55; }
.plain-list li + li { margin-top: 6px; }

/* ---------- users & activity ---------- */
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: var(--surface-2); color: var(--muted); }
.act-tag { font-family: var(--mono); font-size: 11.5px; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.act-ok { background: var(--ok-bg); color: var(--ok); }
.act-warn { background: var(--warn-bg); color: var(--warn); }
.act-danger { background: var(--danger-bg); color: var(--danger); }
.act-neutral { background: var(--surface-2); color: var(--ink-2); }
.mono-sm { font-family: var(--mono); font-size: 11.5px; }
.detail-cell { font-size: 11.5px; color: var(--ink-2); word-break: break-word; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin: 6px 0; }
.inline-form .field { min-width: 160px; }
.temp-pass {
  font-family: var(--mono); font-size: 14px; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent-ink);
  border-radius: var(--radius-sm); padding: 8px 12px; display: inline-block; user-select: all;
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 940px) {
  .login-card { padding: 24px 18px; }
  .row-actions .btn { min-height: 44px; }
  /* Sidebar nav items and the account/sign-out buttons were sized for a
   * mouse (~36px/~31px tall) and fell under a comfortable phone tap
   * target; match the .row-actions fix above. */
  .nav-item { min-height: 44px; }
  .sidebar-foot .btn-sm { min-height: 44px; }
  /* Same story for every text input/select and button, sign-in included
   * (~37px tall at the base padding). */
  .input, .select, .textarea { min-height: 44px; }
  .btn { min-height: 44px; }
}

/* ---------- [hidden] must win ---------- */
/* .btn sets its own `display`, which (same specificity, later author rule)
 * overrode the UA's [hidden] { display: none }, so activity.js's
 * `more.hidden = true` left the "Load more" button visible with 0 rows to
 * add. Force it. */
[hidden] { display: none !important; }

/* ---------- Plan 2: records, photos ---------- */
.thumb-img { object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }
.thumb-thumb { width: 44px; height: 36px; }
.thumb-card { width: 100%; aspect-ratio: 5 / 4; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-item { position: relative; margin: 0; }
.photo-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); display: block; }
.photo-item .photo-remove { position: absolute; top: 6px; right: 6px; }
.photo-item figcaption { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.photo-hero { width: 100%; max-height: 380px; object-fit: contain; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); display: block; }
.photo-ref-note { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.upload-row input[type=file] { font-size: 12.5px; }
.decision-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.btn-warn:hover { background: var(--warn); color: #fff; }
.next-note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.sidebar-foot .btn-primary { margin-bottom: 12px; }
@media (max-width: 940px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .decision-bar .btn { min-height: 44px; flex: 1 1 100%; }
}
.input-readonly { display: block; padding: 8px 10px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); font-size: 13.5px; }
.notice:empty { display: none; }
.notice { margin: 0 0 10px; }

/* ---------- Task 9 screenshot review fixes ---------- */
/* The New Prototype form's Material select ("Whole Grain Camel Leather")
 * was wide enough to be hard-clipped mid-word with no ellipsis. Closed
 * <select> text respects text-overflow in Chromium; give it one. */
.select { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
/* On phone the record stepper's single-word labels ("Submission",
 * "Production") were wider than the 54px step box and bled into the next
 * step's label with no gap to absorb them. The stepper already scrolls
 * horizontally (see .stepper overflow-x), so widen the step instead of
 * shrinking the text further. */
@media (max-width: 940px) {
  .step { min-width: 74px; }
}

/* ---------- Plan 3: master data ---------- */
.md-totals { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 4px; font-size: 13.5px; }
@media print {
  .head-actions, .btn, .back { display: none !important; }
  .stat-row, .rec-grid { break-inside: avoid; }
  .photo-hero { max-height: 260px; }
}
