/* =============================================================================
   Westfield Sales Configuration — v2 design system
   =============================================================================
   Plain CSS. No build step, no preprocessor, no framework. Served directly by
   Flask from web/v2/, so this source IS the deployed artifact.

   DESIGN INTENT
   A dense, quiet admin tool. Reps live in this all day, so the priorities are
   legibility, information density and calm — not decoration.

   Colour discipline: the Westfield brown is an ACCENT, never a large fill. Big
   saturated slabs read cheap and fight the content. Brown appears on the active
   nav marker, links, focus rings and small emphasis only. Primary buttons are
   near-black, which reads more premium against warm neutrals.
   ============================================================================= */

:root {
  --bg:          #FBFAF8;
  --surface:     #FFFFFF;
  --surface-alt: #F7F5F1;

  --ink:         #171614;
  --ink-soft:    #3D3A34;
  --muted:       #6E6A61;
  --muted-soft:  #98938A;

  --line:        #EBE8E1;
  --line-strong: #DCD8CF;

  --accent:      #8B6F47;
  --accent-dark: #6B5435;
  --accent-tint: #F5F0E6;

  --success:     #2F7D4F;
  --success-bg:  #EDF6F0;
  --warning:     #A66A08;
  --warning-bg:  #FDF4E5;
  --danger:      #B4322C;
  --danger-bg:   #FCEEED;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;

  --sidebar-w: 232px;
  --max-w:     1320px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

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

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-tint); }

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

.wf-shell { display: flex; min-height: 100vh; }

.wf-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.wf-brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px; }
.wf-brand-mark {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 6px;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: -.02em;
}
.wf-brand-name { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
.wf-brand-sub { font-size: 11.5px; color: var(--muted-soft); line-height: 1.2; }

.wf-nav { padding: 6px 10px 14px; flex: 1; overflow-y: auto; }
.wf-nav-group {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted-soft); padding: 14px 8px 5px;
}
.wf-nav a {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: 13.5px; line-height: 1.3;
}
.wf-nav a:hover { background: var(--surface-alt); text-decoration: none; color: var(--ink); }
.wf-nav a[aria-current="page"] {
  background: var(--accent-tint); color: var(--accent-dark); font-weight: 600;
}
.wf-nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 0 2px 2px 0; background: var(--accent);
}
.wf-nav svg { width: 15px; height: 15px; flex: 0 0 15px; opacity: .62; }
.wf-nav a[aria-current="page"] svg { opacity: 1; }

/* Unread buyer-messages count on "Customer feedback". Accent brown, not red:
   a buyer asking a question is work to do, not an alarm. */
.wf-nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
}

/* Identity moved to the top-right account popover; the sidebar footer now
   only carries the escape hatch back to the v1 app. */
.wf-userbox { border-top: 1px solid var(--line); padding: 12px 16px; font-size: 12px; }
.wf-userbox a { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------- account popover ---- */

.wf-usermenu { position: relative; display: flex; align-items: center; }

.wf-avatar {
  appearance: none; cursor: pointer; font: inherit;
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: 1px solid rgba(0,0,0,.08);
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  display: flex; align-items: center; justify-content: center;
  transition: filter .14s ease, box-shadow .14s ease;
}
.wf-avatar:hover { filter: brightness(1.07); }
.wf-avatar:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }
.wf-avatar.lg {
  width: 46px; height: 46px; flex: 0 0 46px; font-size: 15px; cursor: default;
}

.wf-userpop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 288px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(20,19,15,.14);
}
.wf-userpop[hidden] { display: none; }

.wf-userpop-head { display: flex; align-items: center; gap: 12px; }
.wf-userpop-id { min-width: 0; }
.wf-userpop-id strong {
  display: block; font-size: 14.5px; font-weight: 650; line-height: 1.25;
  color: var(--ink);
}
.wf-userpop-id span {
  display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px;
  overflow-wrap: anywhere;
}

.wf-rolebadge {
  display: inline-block; margin-top: 12px;
  padding: 3px 9px; border-radius: 6px;
  background: var(--accent-tint); color: var(--accent-dark);
  border: 1px solid #E6DBC5;
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase;
}

.wf-userpop-sep {
  height: 1px; background: var(--line); margin: 14px 0 12px;
}
.wf-userpop-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted-soft);
}

.wf-conn { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.wf-conn-text { font-size: 13px; color: var(--ink-soft); }
.wf-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px;
  background: var(--muted-soft);
}
.wf-dot.ok   { background: var(--success); }
.wf-dot.warn { background: var(--warning); }
.wf-dot.bad  { background: var(--danger); }
.wf-dot.checking { background: var(--muted-soft); animation: wf-pulse 1.1s ease infinite; }
@keyframes wf-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.wf-userpop-actions {
  display: flex; gap: 8px; margin-top: 16px;
}
.wf-userpop-actions > * { flex: 1; justify-content: center; }

@media (max-width: 640px) {
  .wf-userpop { width: min(288px, calc(100vw - 32px)); }
}

.wf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.wf-topbar {
  background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0 28px; height: 56px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.wf-topbar h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.wf-eyebrow {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted-soft); font-weight: 600; line-height: 1;
}
.wf-spacer { flex: 1; }
.wf-topbar-actions { display: flex; align-items: center; gap: 8px; }

.wf-content { padding: 22px 28px 56px; max-width: var(--max-w); width: 100%; flex: 1; }

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

.wf-cols { display: grid; gap: 16px; }
.wf-cols.two { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); }
@media (max-width: 1040px) { .wf-cols.two { grid-template-columns: minmax(0,1fr); } }

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

.wf-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
}
.wf-card-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; min-height: 46px;
}
.wf-card-head h2 {
  margin: 0; font-size: 13px; font-weight: 650; letter-spacing: -.005em;
}
.wf-card-head .wf-count {
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.wf-card-body { padding: 16px; }
.wf-card-body.flush { padding: 0; }
.wf-card-foot {
  padding: 10px 16px; border-top: 1px solid var(--line);
  background: var(--surface-alt); font-size: 12.5px;
}

/* --------------------------------------------------------------- metrics ---- */

.wf-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(0,1fr)); gap: 12px; }
.wf-metric {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; min-width: 0;
  display: block; color: inherit;
}
a.wf-metric:hover { border-color: var(--line-strong); background: #fff; text-decoration: none; }
.wf-metric-label {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wf-metric-value {
  font-size: 26px; font-weight: 600; letter-spacing: -.025em;
  line-height: 1.15; margin-top: 3px; font-variant-numeric: tabular-nums;
}
.wf-metric-value.zero { color: var(--muted-soft); font-weight: 500; }
.wf-metric-note { font-size: 11.5px; color: var(--muted-soft); margin-top: 1px; }
.wf-metric.flag { border-color: #E7D6B4; background: var(--warning-bg); }
.wf-metric.flag .wf-metric-value { color: var(--warning); }

/* ----------------------------------------------------------------- table ---- */

.wf-table-wrap { overflow-x: auto; }
table.wf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wf-table th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-soft);
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-alt); white-space: nowrap;
}
.wf-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.wf-table tbody tr:last-child td { border-bottom: 0; }
.wf-table tbody tr.clickable { cursor: pointer; }
.wf-table tbody tr.clickable:hover { background: var(--surface-alt); }
.wf-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wf-strong { font-weight: 600; }
.wf-sub { color: var(--muted); font-size: 12px; }
.wf-mono { font-family: var(--mono); font-size: 11.5px; color: var(--muted-soft); }
.wf-truncate { max-width: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ list rows ----- */

.wf-list { list-style: none; margin: 0; padding: 0; }
.wf-list li {
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.wf-list li:last-child { border-bottom: 0; }
.wf-list .wf-list-main { flex: 1; min-width: 0; }
.wf-list .wf-list-title {
  font-size: 13px; font-weight: 550;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wf-list .wf-list-sub { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- pieces ---- */

.wf-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.wf-pill.pending  { background: var(--warning-bg); color: var(--warning); border-color: #EFDFC2; }
.wf-pill.approved { background: var(--success-bg); color: var(--success); border-color: #CDE6D8; }
.wf-pill.rejected { background: var(--danger-bg);  color: var(--danger);  border-color: #F2D4D2; }
.wf-pill.revision { background: var(--accent-tint); color: var(--accent-dark); border-color: #E6DBC5; }
.wf-pill.neutral  { background: var(--surface-alt); color: var(--muted); border-color: var(--line-strong); }

.wf-src {
  display: inline-block; padding: 1px 5px; border-radius: 4px; margin-left: 7px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .05em; vertical-align: 1px;
}
.wf-src.pkg { background: var(--accent-tint); color: var(--accent-dark); }
.wf-src.upg { background: var(--success-bg); color: var(--success); }
.wf-src.ovr { background: var(--ink); color: #fff; }

.wf-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 550;
  padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.wf-btn:hover { background: var(--surface-alt); border-color: var(--muted-soft); text-decoration: none; }
.wf-btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.wf-btn.primary:hover { background: #000; border-color: #000; }
.wf-btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.wf-btn.accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.wf-btn.danger { color: var(--danger); border-color: #E7C7C4; }
.wf-btn.danger:hover { background: var(--danger-bg); }
.wf-btn.sm { padding: 5px 10px; font-size: 12px; }
.wf-btn:disabled { opacity: .45; cursor: not-allowed; }
.wf-btn-block { width: 100%; justify-content: center; padding: 10px 14px; font-size: 14px; }

.wf-chip {
  appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 550;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
}
.wf-chip:hover { background: var(--surface-alt); }
.wf-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.wf-filters { display: flex; flex-wrap: wrap; gap: 6px; }

.wf-input, .wf-select {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.wf-input:focus, .wf-select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,111,71,.13);
}
.wf-input::placeholder { color: var(--muted-soft); }
.wf-field { display: block; margin-bottom: 12px; }
.wf-field-label {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--muted);
  margin-bottom: 4px;
}
.wf-field-hint { font-size: 11.5px; color: var(--muted-soft); margin-top: 3px; }

/* --------------------------------------------------------------- notices ---- */

.wf-note {
  border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 11px 14px; font-size: 13px; color: var(--ink-soft);
}
.wf-note.error   { border-left-color: var(--danger);  background: var(--danger-bg);  border-color: #F0D6D4; }
.wf-note.warn    { border-left-color: var(--warning); background: var(--warning-bg); border-color: #EFE0C4; }
.wf-note.success { border-left-color: var(--success); background: var(--success-bg); border-color: #CFE7DA; }
.wf-note strong { font-weight: 650; }

.wf-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.wf-empty-title { font-weight: 600; color: var(--ink); margin-bottom: 3px; font-size: 14px; }

.wf-skeleton {
  height: 11px; border-radius: 4px; display: block;
  background: linear-gradient(90deg, #EEEBE4 25%, #F6F4EF 37%, #EEEBE4 63%);
  background-size: 400% 100%; animation: wf-shimmer 1.3s ease infinite;
}
@keyframes wf-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ------------------------------------------------------- auth / centered ---- */

body.wf-centered {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; background: var(--bg);
}
.wf-authcard {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px;
}
.wf-authbrand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.wf-authhint { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; text-align: center; }
.wf-authdivider { height: 1px; background: var(--line); margin: 22px 0 12px; }
.wf-authcard code {
  font-family: var(--mono); font-size: 11px; background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; word-break: break-all;
}

/* ------------------------------------------------------------ page bits ----- */

.wf-lede { font-size: 13.5px; color: var(--muted); max-width: 64ch; margin: 0 0 18px; }
.wf-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted-soft); margin: 22px 0 9px;
}
.wf-section-label:first-child { margin-top: 0; }
.wf-row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.wf-choices { display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.wf-choice {
  appearance: none; text-align: left; width: 100%; cursor: pointer; font: inherit;
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px;
  transition: border-color .12s ease;
}
.wf-choice:hover { border-color: var(--accent); }
.wf-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px;
  background: var(--accent-tint); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 14px;
}
.wf-choice-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wf-choice-title { font-size: 14px; font-weight: 600; }
.wf-choice-sub { font-size: 12px; color: var(--muted); }
.wf-choice-chevron { color: var(--muted-soft); font-size: 17px; line-height: 1; }

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

.wf-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.wf-form-grid .wf-field.wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .wf-form-grid { grid-template-columns: 1fr; } }
.wf-req { color: var(--danger); font-weight: 700; }

/* ------------------------------------------------------------ package grid -- */

.wf-pkg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 620px) { .wf-pkg-grid { grid-template-columns: 1fr; } }
.wf-pkg {
  appearance: none; cursor: pointer; font: inherit; text-align: left;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 13px;
  transition: border-color .12s ease, background .12s ease;
}
.wf-pkg:hover { border-color: var(--line-strong); background: var(--surface-alt); }
.wf-pkg.on { border-color: var(--accent); background: var(--accent-tint); }
.wf-pkg-top { display: flex; align-items: center; gap: 8px; }
.wf-pkg-name { font-size: 13.5px; font-weight: 650; flex: 1; }
.wf-pkg-tick { color: var(--accent-dark); font-weight: 700; }
.wf-pkg-tiers {
  font-size: 11px; color: var(--muted-soft); letter-spacing: .03em;
  text-transform: uppercase; font-weight: 600;
}
.wf-pkg-bits {
  font-size: 11.5px; color: var(--muted); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.wf-selected-pkg { font-size: 16px; font-weight: 650; }
.wf-price-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.wf-price { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wf-upglist { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.wf-upgrow {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; padding: 3px 0;
}
.wf-upgrow > span:first-child { color: var(--muted); }

/* ------------------------------------------------------------- total bar ---- */

.wf-totalbar {
  position: sticky; top: 56px; z-index: 15;
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 13px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.wf-totalbar-left { flex: 1; min-width: 0; }
.wf-totalbar-pkg { font-size: 14px; font-weight: 650; }
.wf-totalbar-sub { font-size: 12px; opacity: .68; }
.wf-totalbar-right { display: flex; align-items: center; gap: 18px; }
.wf-totalbar-figs {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 11.5px; opacity: .72; line-height: 1.45;
}
.wf-totalbar-figs .wf-warn-text { color: #F0C674; opacity: 1; }
.wf-totalbar-figs .wf-sub { color: rgba(255,255,255,.6); }
.wf-totalbar-grand {
  font-size: 24px; font-weight: 650; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- accordions --- */

.wf-acc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); margin-bottom: 10px; overflow: hidden;
}
.wf-acc-head {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 12px 16px; list-style: none; user-select: none;
}
.wf-acc-head::-webkit-details-marker { display: none; }
.wf-acc-head:hover { background: var(--surface-alt); }
.wf-acc-title { font-size: 13px; font-weight: 650; }
.wf-acc[open] .wf-acc-head { border-bottom: 1px solid var(--line); }
.wf-acc-body { padding: 0; }

.wf-item {
  appearance: none; cursor: pointer; font: inherit; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 14px;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}
.wf-item:last-child { border-bottom: 0; }
.wf-item:hover:not(:disabled) { background: var(--surface-alt); }
.wf-item.locked { background: #FCFBF8; cursor: default; }
.wf-item:disabled { cursor: default; }
.wf-item-main { flex: 1; min-width: 0; }
.wf-item-label { display: block; font-size: 12.5px; color: var(--muted); }
.wf-item-value {
  display: block; font-size: 13.5px; font-weight: 550; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wf-item.filled .wf-item-value { color: var(--ink); }
.wf-item-right { flex: 0 0 auto; }
.wf-item-price {
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 3px 8px; border-radius: var(--radius-sm);
}
.wf-item-price.brix { background: var(--surface-alt); color: var(--ink); }
.wf-item-price.rep  { background: var(--accent); color: #fff; }
.wf-item-kind {
  font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 8px;
}

/* ------------------------------------------------------------- edit sheet --- */

.wf-sheet-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(23,22,20,.4);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* A class selector outranks the UA stylesheet's [hidden] { display: none },
   so `display: flex` above would keep the backdrop visible and grey out the
   whole page. This restores the hidden attribute. Applies to every screen
   that uses a sheet. */
.wf-sheet-back[hidden] { display: none; }
.wf-sheet {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 520px; max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.wf-sheet-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.wf-sheet-body { padding: 18px; overflow-y: auto; }
.wf-sheet-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface-alt);
}
.wf-optlist { display: flex; flex-direction: column; gap: 4px; }
.wf-opt {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px;
}
.wf-opt:hover { background: var(--surface-alt); }
.wf-opt.on, .wf-opt:has(input:checked) {
  border-color: var(--accent); background: var(--accent-tint);
}
.wf-locked-price {
  font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; flex-wrap: wrap;
}
.wf-locked-price .wf-field-hint { flex: 1 0 100%; font-weight: 400; }

/* --------------------------------------------------------- detail sheet ----- */

.wf-dmeta { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .wf-dmeta { grid-template-columns: 1fr; } }
.wf-dmeta-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.wf-dmeta-row > span:first-child { color: var(--muted); }
.wf-dmeta-row > span:last-child { font-weight: 550; text-align: right; }

.wf-dlist { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wf-drow {
  display: flex; align-items: baseline; gap: 12px;
  padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.wf-drow:last-child { border-bottom: 0; }
.wf-drow-k { flex: 0 0 46%; color: var(--muted); }
.wf-drow-sec {
  display: block; font-size: 10px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted-soft);
}
.wf-drow-v { flex: 1; font-weight: 550; }

/* -------------------------------------------------------- photo gallery ----- */

.wf-swatch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px; padding: 14px 16px;
}
.wf-swatch {
  appearance: none; cursor: pointer; font: inherit; text-align: left; padding: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.wf-swatch:hover { border-color: var(--accent); }
.wf-swatch-img, .wf-swatch-col, .wf-swatch-none {
  display: block; width: 100%; height: 84px; object-fit: cover;
  background: var(--surface-alt);
}
.wf-swatch-none {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--muted-soft);
  background: repeating-linear-gradient(45deg, #F5F3EE, #F5F3EE 6px, #EFEDE6 6px, #EFEDE6 12px);
}
.wf-swatch-label {
  padding: 8px 9px; font-size: 12px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.wf-swatch-flag {
  padding: 0 9px 8px; font-size: 10.5px; color: var(--accent-dark); font-weight: 600;
}
.wf-swatch-preview { margin-bottom: 16px; }
.wf-swatch-preview img, .wf-swatch-preview > span {
  display: block; width: 100%; height: 160px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line);
}
.wf-swatch-line {
  display: block; font-size: 11.5px; color: var(--muted-soft); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ------------------------------------------------------- section editor ----- */

.wf-opts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.wf-optchip {
  font-size: 11px; background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; color: var(--muted);
}
.wf-warn-inline { color: var(--warning); font-weight: 600; }
.wf-acc-head .wf-mono { flex: 0 0 auto; }

/* ------------------------------------------------------------ chat thread --- */

.wf-msg { margin-bottom: 12px; max-width: 88%; }
.wf-msg.rep { margin-left: auto; }
.wf-msg-who {
  font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted-soft); margin-bottom: 3px;
}
.wf-msg.rep .wf-msg-who { text-align: right; }
.wf-msg-body {
  font-size: 13px; line-height: 1.5; padding: 9px 12px;
  border-radius: var(--radius); background: var(--surface-alt);
  border: 1px solid var(--line); white-space: pre-wrap;
}
.wf-msg.rep .wf-msg-body { background: var(--ink); color: #fff; border-color: var(--ink); }
.wf-msg.ai .wf-msg-body { background: var(--accent-tint); border-color: #E6DBC5; }
.wf-msg-time { font-size: 11px; color: var(--muted-soft); margin-top: 3px; }
.wf-msg.rep .wf-msg-time { text-align: right; }

/* ---------------------------------------------------------------- phases ---- */

.wf-phases { display: flex; flex-direction: column; gap: 8px; }
.wf-phase {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px;
}
.wf-phase-dot {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 650;
  background: var(--surface-alt); color: var(--muted); border: 1px solid var(--line-strong);
}
.wf-phase-main { flex: 1; min-width: 0; }
.wf-phase-name { font-size: 13px; font-weight: 550; }
.wf-phase-sel { width: auto; min-width: 128px; flex: 0 0 auto; }
.wf-phase.in_progress { border-color: #EFDFC2; background: var(--warning-bg); }
.wf-phase.in_progress .wf-phase-dot {
  background: var(--warning); color: #fff; border-color: var(--warning);
}
.wf-phase.complete { border-color: #CDE6D8; background: var(--success-bg); }
.wf-phase.complete .wf-phase-dot {
  background: var(--success); color: #fff; border-color: var(--success);
}

/* ------------------------------------------------------------------- pre ---- */

.wf-pre {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; margin: 0;
  max-height: 200px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ tabs ---- */

.wf-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
  overflow-x: auto;
}
.wf-tab {
  appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 550;
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 9px 14px; color: var(--muted); white-space: nowrap;
}
.wf-tab:hover { color: var(--ink); }
.wf-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.wf-tab .wf-tabcount {
  display: inline-block; margin-left: 6px; font-size: 11px;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 6px;
}
.wf-tab[aria-selected="true"] .wf-tabcount {
  background: var(--accent-tint); border-color: #E6DBC5; color: var(--accent-dark);
}

/* ------------------------------------------------------------- documents ---- */
/* Submission attachments (WF.docs). In the SHARED stylesheet, unlike the
   photo/appliance styles scoped inside timeline.html, because two screens
   render this block — the review-queue sheet and the timeline detail. */

.wf-doc {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
/* Shared files get the success accent — same visual language as the
   approved pill, and clearly different from the internal default. */
.wf-doc.is-shared { border-color: #CDE6D8; background: var(--success-bg); }
.wf-doc-main { flex: 1; min-width: 0; }
.wf-doc-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  overflow-wrap: anywhere;
}
.wf-doc-name .wf-pill { margin-left: 6px; vertical-align: 1px; }
.wf-doc-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.wf-doc-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.wf-doc-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px;
}
.wf-doc-status { font-size: 11px; color: var(--muted); }
@media (max-width: 640px) {
  .wf-doc { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------------------------------------------------------- closing form ---- */
/* Orientation + closing editor (WF.closing). Two columns on a desk, one on a
   phone — a construction manager fills this in from the site as often as from
   the office. */

.wf-cl-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.wf-cl-grid .wf-field { margin: 0; }
@media (max-width: 720px) { .wf-cl-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------ reschedule request -- */
/* A buyer's request to move their orientation, shown to the CM under the
   closing form. Tinted so it reads as an inbound message rather than another
   field on the form. */

.wf-rq {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--accent-tint);
}
/* Past the SLA. Warning, not alarm — the CM is busy, not negligent, and this
   is a nudge rather than an accusation. */
.wf-rq.is-overdue { border-left-color: var(--danger); background: var(--danger-bg); }
.wf-rq-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-rq-head strong { font-size: 13px; }
.wf-rq-head .wf-pill { margin-left: auto; }
/* The buyer's own words. Italic so it reads as quoted, not as UI copy. */
.wf-rq-reason {
  margin-top: 8px; font-size: 13px; font-style: italic; color: var(--ink-soft);
  line-height: 1.45;
}
.wf-rq-meta { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.wf-rq-label {
  margin-top: 12px; margin-bottom: 6px;
  font-size: 11px; font-weight: 650; letter-spacing: .03em;
  text-transform: uppercase; color: var(--muted);
}
.wf-rq-slots { display: flex; gap: 6px; flex-wrap: wrap; }
.wf-rq-offered {
  font-size: 12.5px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- toasts ---- */

.wf-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 550;
  padding: 9px 16px; border-radius: var(--radius); z-index: 200;
  transition: opacity .3s ease, transform .3s ease;
}
.wf-toast.success { background: var(--success); }
.wf-toast.error   { background: var(--danger); }
.wf-toast.out     { opacity: 0; transform: translateX(-50%) translateY(6px); }

/* ------------------------------------------------------------ responsive ---- */

@media (max-width: 1100px) {
  .wf-content { padding: 18px 20px 48px; }
  .wf-topbar { padding: 0 20px; }
}

@media (max-width: 900px) {
  .wf-shell { flex-direction: column; }
  .wf-sidebar {
    width: 100%; flex: none; height: auto; position: static;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .wf-nav { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px; overflow: visible; }
  .wf-nav-group { display: none; }
  .wf-nav a { font-size: 13px; padding: 6px 11px; }
  .wf-nav a[aria-current="page"]::before { display: none; }
  .wf-userbox { border-top: 0; padding: 10px 16px; }
  .wf-metrics { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

@media (max-width: 600px) {
  .wf-metric-value { font-size: 22px; }
  .wf-table th, .wf-table td { padding: 9px 11px; }
}

@media print {
  .wf-sidebar, .wf-topbar, .wf-filters, .wf-btn { display: none !important; }
  body { background: #fff; }
  .wf-card { border-color: #ccc; }
}
