/* F1 shared shell, Workbench, Clients. Loads after tokens.css and style.css. */
:root { --bg: var(--c-canvas); --panel: var(--c-surface); --ink: var(--c-text-primary); --muted: var(--c-text-secondary);
  --line: var(--c-border); --accent: var(--c-forest-700); --warn: var(--c-caution); --warn-soft: var(--c-surface-warning);
  --bad: var(--c-negative); --bad-soft: #FCE9E6; --wrap: min(calc(100vw - 40px), var(--size-content-max)); }
body { background: var(--c-canvas); color: var(--c-text-primary); font-family: var(--font-family); }
a { color: var(--c-forest-700); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.small, .badge, .stat .x { font-size: 12px; }

/* Nav: one 52px photographic band; below 1680px the global utilities move to a compact 36px row above it
   (implementation plan v1.0: "compact utility row of up to 36 px where needed at laptop width"). */
header.top { width: var(--wrap); margin: 8px auto 0; height: auto; padding: 0; gap: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) auto; background: none; color: var(--c-text-primary); }
header.top .band { grid-area: 1 / 1 / 2 / 3; display: flex; align-items: center; gap: 14px; min-width: 0; height: var(--size-nav-height);
  padding: 0 12px; border-radius: var(--radius-nav); box-shadow: var(--shadow-nav); color: #FFFDF7; background-color: #1B3C28;
  background-image: linear-gradient(90deg, rgba(18,57,36,.94) 0%, rgba(22,66,44,.89) 52%, rgba(21,58,38,.75) 100%), url(backgrounds/wheat-nav-backdrop.jpg);
  background-position: center, right center; background-size: cover; background-repeat: no-repeat; }
header.top .brand { display: flex; align-items: center; gap: 8px; flex: none; }
header.top .brand img { width: 230px; max-height: 34px; height: auto; display: block; }
header.top nav { display: flex; gap: 2px; min-width: 0; }
header.top nav a, header.top nav a.on { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 7px 9px; border: 0; border-radius: 8px;
  color: #FFFDF7; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
header.top nav a:hover { background: rgba(255,253,247,.14); text-decoration: none; }
header.top nav a.on { background: var(--c-gold-300); color: var(--c-forest-900); }
header.top nav .count { margin-left: 2px; }
header.top .band :focus-visible { outline-color: #FFFDF7; }
.nav-util { grid-area: 1 / 2 / 2 / 3; align-self: center; padding-right: 10px; display: flex; align-items: center; gap: 8px; white-space: nowrap; color: #FFFDF7; }
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search .icon { position: absolute; left: 8px; color: var(--c-text-secondary); pointer-events: none; }
.nav-search input { width: 190px; height: 32px; padding-left: 30px; font-size: 12.5px; }
.nav-util .btn, .nav-util button { height: 32px; font-size: 12.5px; }
.nav-user { font-size: 12px; line-height: 1.2; text-align: right; }
.nav-user span { display: block; opacity: .85; }
header.top form.inline { flex-wrap: nowrap; align-items: center; }
.provenance { width: var(--wrap); margin: 8px auto 0; padding: 6px 12px; border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-surface-warning); color: var(--c-caution); font-size: 12.5px; }
@media (max-width: 1679px) {
  header.top { grid-template-rows: auto auto; }
  .nav-util { grid-area: 1 / 1 / 2 / 3; justify-self: end; height: 36px; padding: 0 0 4px; color: var(--c-text-primary); }
  .nav-util .nav-search .icon { color: var(--c-text-secondary); }
  .nav-user { display: flex; gap: 4px; align-items: baseline; }
  .nav-user span { display: inline; opacity: 1; color: var(--c-text-secondary); }
  header.top .band { grid-area: 2 / 1 / 3 / 3; }
}

/* Page */
main { width: var(--wrap); max-width: none; margin: 0 auto; padding: 14px 0 48px; }
h1 { font-size: 23px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h1 .icon { width: 22px; height: 22px; color: var(--c-forest-700); }
.page-head { align-items: center; margin-bottom: 4px; }
.sub { font-size: 13px; margin-bottom: 10px; }
.panel { background: var(--c-surface); border-color: var(--c-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); margin-bottom: 12px; }
.panel > h2 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.panel > h2 .icon { width: 20px; height: 20px; color: var(--c-forest-700); }
.count { background: var(--c-surface-warning); color: var(--c-forest-900); font-weight: 600; padding: 0 7px; }
a.more { display: inline-block; margin-top: 8px; font-size: 12.75px; font-weight: 600; }
.empty { font-style: normal; }
.unavailable { background: var(--c-surface-warning); color: var(--c-caution); border-radius: 8px; }
.overdue { color: var(--c-negative); }
.overdue .icon { width: 14px; height: 14px; }

/* Controls */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--size-control-height); padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--radius-control); background: var(--c-gold-300); color: var(--c-forest-900); font-weight: 600; white-space: nowrap; }
.btn:hover { text-decoration: none; }
button:hover, .btn:hover { filter: brightness(.96); }
.btn.secondary, button.secondary { background: var(--c-surface); border-color: var(--c-border); color: var(--c-text-primary); }
button.small { height: 30px; }
input, select, textarea { border-color: var(--c-border); border-radius: var(--radius-control); background: #fff; color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { height: var(--size-control-height); }
form label { font-weight: 600; margin-bottom: 2px; }
.flash { border-left: 4px solid var(--c-text-secondary); border-radius: 8px; background: var(--c-surface-alt); }
.flash.error { background: #FCE9E6; color: var(--c-negative); border-color: var(--c-negative); }
.flash.ok, .flash.success { background: #E5F3EA; color: var(--c-positive); border-color: var(--c-positive); }
.flash.warn, .flash.warning { background: var(--c-surface-warning); color: var(--c-caution); border-color: var(--c-caution); }

/* Tables */
table { background: var(--c-surface); }
th, td { border-color: var(--c-border); }
th { background: var(--c-surface-alt); font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--c-text-secondary); }
tbody tr:hover td { background: var(--c-surface-alt); }
.table-wrap { border-color: var(--c-border); border-radius: var(--radius-card); background: var(--c-surface); box-shadow: var(--shadow-card); }
.crop { display: inline-flex; align-items: center; gap: 5px; }
.crop img { width: 18px; height: 18px; }

/* Workbench: follow-ups left (spanning), positions over conversations in the middle, market intelligence right;
   quotes and the pin slot beneath. Cards that have nothing to show stay compact (align-self: start). */
.wb-grid { grid-template-columns: minmax(0,1fr) minmax(0,1.15fr) minmax(0,.85fr); align-items: start; margin-bottom: 12px;
  grid-template-areas: "fu pos mkt" "fu conv mkt" "q q pin"; }
.wb-followups { grid-area: fu; }
.wb-followups.is-list { align-self: stretch; contain: size; min-height: 260px; }   /* fills the middle column's height, scrolls inside */
.wb-positions { grid-area: pos; } .wb-conversations { grid-area: conv; } .wb-market { grid-area: mkt; }
.wb-quotes { grid-area: q; } .wb-pins { grid-area: pin; }
.wb-grid .panel { margin: 0; display: flex; flex-direction: column; min-width: 0; padding: 12px 14px; }
.wb-grid .panel > h2 { margin-bottom: 8px; }
.wb-scroll { max-height: 262px; overflow: auto; }
.wb-followups .wb-scroll { max-height: none; flex: 1 1 0; min-height: 0; }
.wb-grid table { font-size: 12.75px; }
.wb-grid th, .wb-grid td { padding: 5px 6px; }
.card-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-top: 6px; }
.card-foot a.more { margin-top: 0; }
.fu-list li { display: grid; grid-template-columns: 24px minmax(0,1fr) 8.4em 6.6em; gap: 2px 10px;
  align-items: center; padding: 5px 0; font-size: 12.75px; }
.fu-main { min-width: 0; line-height: 1.3; }
.fu-main a { font-weight: 600; }
.fu-title { display: block; color: var(--c-text-secondary); font-size: 12.25px; }
.fu-due, .fu-owner { line-height: 1.3; }
.fu-due .od { display: block; }
.fu-owner { text-align: right; overflow-wrap: anywhere; }
button.chk { width: 24px; height: 24px; padding: 0; border-radius: 6px; }
button.chk .icon { width: 14px; height: 14px; }
table.positions tr.has-note td { border-bottom: 0; }
tr.pos-note td { padding: 0 6px 6px; font-size: 12px; line-height: 1.35; }
tr.pos-note .flag { display: inline-flex; gap: 4px; align-items: baseline; color: var(--c-caution); font-weight: 600; margin-right: 10px; }
tr.pos-note .flag .icon { width: 13px; height: 13px; align-self: center; }
tr.pos-note .proposed { color: var(--c-text-secondary); }
tbody tr.has-note:hover td, tbody tr.has-note:hover + tr.pos-note td { background: var(--c-surface-alt); }
.wb-conversations h3 { margin-top: 0; font-size: 12.75px; color: var(--c-text-secondary); }
.wb-conversations li { font-size: 12.75px; line-height: 1.35; }
.wb-conversations li .small { display: block; }
.wb-pins .unavailable { display: flex; gap: 8px; align-items: flex-start; background: none; border: 1.5px dashed var(--c-border); color: var(--c-text-secondary); padding: 14px; }
.flash { display: flex; gap: 8px; align-items: flex-start; }
.flash .icon { margin-top: 2px; }
@media (max-width: 900px) {
  .wb-grid { grid-template-columns: 1fr; grid-template-areas: "fu" "pos" "conv" "mkt" "q" "pin"; }
  .wb-followups.is-list { contain: none; } .wb-followups .wb-scroll { max-height: 320px; }
  header.top .band { height: auto; flex-wrap: wrap; padding: 8px 12px; }
}

/* Clients */
.filters { padding: 10px 14px; gap: 10px; }
.filters .q { position: relative; }
.filters .q .icon { position: absolute; left: 9px; bottom: 9px; color: var(--c-text-secondary); }
.filters .q input { padding-left: 32px; }
.directory { font-size: 12.75px; }
.directory th { font-size: 12px; font-weight: 600; white-space: nowrap; }
.directory td { height: var(--size-row-height); vertical-align: middle; }
.directory td > div { height: 22px; line-height: 22px; white-space: nowrap; }
.directory td:first-child { min-width: 11em; }
.list-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.list-foot p { margin: 0; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.pager a, .pager .pg { margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 6px; font-weight: 600; }
.pager .pg.on { background: var(--c-gold-300); color: var(--c-forest-900); }
.pager .pg.gap { min-width: 16px; padding: 0; color: var(--c-text-secondary); }
.panel.empty { text-align: center; padding: 32px 16px; }
.panel.empty > .icon { display: block; width: 28px; height: 28px; margin: 0 auto 8px; }
