/* BOVA Central — application layout & components. */

/* ------------------------------------------------------------------ */
/* Shell                                                               */
/* ------------------------------------------------------------------ */

.shell {
  display: grid;
  grid-template-columns: 216px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar — the brand lives here */

.side {
  background: var(--forest-950);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  color: #cfe0d5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 16px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--leaf-500);
  position: relative;
  flex: none;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -7px;
  top: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--forest-950);
}

.brand-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  color: #a7bcae;
  transition: background 120ms var(--ease), color 120ms var(--ease);
  width: 100%;
  text-align: left;
}

.nav-item svg {
  flex: none;
  opacity: 0.85;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e6efe9;
}

.nav-item[aria-current="page"] {
  background: var(--forest-700);
  color: #fff;
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--leaf-500);
  color: #06170d;
  font-size: 11px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.side-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 10px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-foot .who .nm {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.side-foot .who .em {
  font-size: 11.5px;
  color: #8ba695;
}

/* Main column */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.search {
  position: relative;
  width: 340px;
}

.search input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--paper);
  padding: 0 64px 0 34px;
  font-size: 13.5px;
  transition: border-color 120ms var(--ease), background 120ms var(--ease);
}

.search input::placeholder {
  color: var(--ink-400);
}

.search input:focus {
  background: var(--surface);
  border-color: var(--ink-400);
  outline: none;
}

.search > svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}

.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.search-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 70;
}

.search-pop .hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  font-size: 13.5px;
}

.search-pop .hit:hover,
.search-pop .hit.sel {
  background: var(--surface-2);
}

.search-pop .hit .kind {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-400);
}

.search-pop .none {
  padding: 14px;
  font-size: 13px;
  color: var(--ink-500);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink-900);
}

.icon-btn .ping {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--leaf-500);
  border: 2px solid var(--surface);
}

/* Notifications popover */

.notif-pop {
  position: absolute;
  top: 48px;
  right: 70px;
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 70;
  overflow: hidden;
}

.notif-pop .hd {
  padding: 12px 16px 8px;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
}

.notif-pop .it {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  align-items: baseline;
}

.notif-pop .it:hover {
  background: var(--surface-2);
}

.notif-pop .it .t {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-400);
  white-space: nowrap;
}

.notif-pop .it.new {
  box-shadow: inset 3px 0 0 var(--leaf-500);
}

/* Content area */

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 48px;
}

.content-inner {
  max-width: 1320px;
  margin: 0 auto;
}

.view-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.view-head h1 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.view-head .sub {
  font-size: 13px;
  color: var(--ink-500);
}

.view-head .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-400);
}

/* ------------------------------------------------------------------ */
/* KPI strip                                                           */
/* ------------------------------------------------------------------ */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  overflow: hidden;
}

.kpi {
  padding: 16px 20px 14px;
  border-right: 1px solid var(--line);
  text-align: left;
  transition: background 120ms var(--ease);
  border-radius: 0;
}

.kpi:hover {
  background: var(--surface-2);
}

.kpi:last-child {
  border-right: none;
}

.kpi .kpi-go {
  opacity: 0;
  color: var(--forest-700);
  transition: opacity 120ms var(--ease);
}

.kpi:hover .kpi-go {
  opacity: 1;
}

.kpi .lbl {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-400);
  margin-bottom: 5px;
}

.kpi .val {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.kpi .sub {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow-x: auto;
}

.panel table.board {
  min-width: 960px;
}

table.board {
  width: 100%;
  border-collapse: collapse;
}

table.board th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}

table.board th.sortable {
  cursor: pointer;
}

table.board th.sortable:hover {
  color: var(--ink-700);
}

table.board th .arr {
  font-size: 9px;
  margin-left: 3px;
}

table.board th.r,
table.board td.r {
  text-align: right;
}

table.board td {
  height: 56px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.board tbody tr:last-child td {
  border-bottom: none;
}

table.board tbody tr.rowbtn {
  cursor: pointer;
  transition: background 100ms var(--ease);
}

table.board tbody tr.rowbtn:hover {
  background: var(--surface-2);
}

table.board tbody tr.open-row {
  background: var(--surface-2);
}

.cp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-chev {
  color: var(--ink-400);
  display: inline-flex;
  flex: none;
  transform: rotate(-90deg);
  transition: transform 160ms var(--ease), color 120ms var(--ease);
}

.row-chev.is-open {
  transform: rotate(0deg);
  color: var(--forest-700);
}

tr.rowbtn:hover .row-chev {
  color: var(--ink-700);
}

.spark-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.spark-delta {
  font-size: 10.5px;
  font-weight: 650;
}

.cell-product .nm {
  font-weight: 600;
  font-size: 13.5px;
}

.cell-product .sp {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 1px;
}

.cell-ask .big {
  font-size: 14.5px;
  font-weight: 600;
}

.cell-ask .rng {
  font-size: 11.5px;
  color: var(--ink-400);
  margin-top: 1px;
}

.cell-dim {
  color: var(--ink-500);
  font-size: 13px;
}

.cell-sub {
  display: block;
  font-size: 11.5px;
  color: var(--ink-400);
  margin-top: 1px;
}

td.spark-cell {
  width: 84px;
}

.fresh-now {
  color: var(--forest-700);
  font-weight: 600;
}

/* Expanded row detail */

tr.expand > td {
  height: auto;
  padding: 0;
  background: var(--surface-2);
  white-space: normal;
}

.expand-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}

.expand-col {
  padding: 16px 20px 18px;
}

.expand-col + .expand-col {
  border-left: 1px solid var(--line);
}

.expand-col .hd {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  margin-bottom: 8px;
}

.qline {
  display: grid;
  grid-template-columns: 1.3fr auto auto auto auto;
  gap: 14px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.qline:last-child {
  border-bottom: none;
}

.qline .who {
  font-weight: 550;
}

.qline .who button {
  font-weight: 550;
}

.qline .who button:hover {
  color: var(--forest-700);
  text-decoration: underline;
}

.qline .px {
  font-weight: 600;
}

.qline .muted, .muted {
  color: var(--ink-500);
}

.qline.gone {
  color: var(--ink-400);
}

.qline.gone .px {
  text-decoration: line-through;
  font-weight: 400;
}

.qline.new {
  background: #eaf7ee;
  border-left: 3px solid var(--forest-700);
  padding-left: 8px;
  margin-left: -11px;
}

.qline.glow {
  animation: row-glow 1600ms var(--ease) 1;
}

.dline {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.dline:last-child {
  border-bottom: none;
}

.dline .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 550;
}

.dline .sub {
  color: var(--ink-500);
  font-size: 12.5px;
  margin-top: 1px;
}

/* ------------------------------------------------------------------ */
/* Signature moment                                                    */
/* ------------------------------------------------------------------ */

@keyframes row-glow {
  0% { background: transparent; }
  18% { background: #dff2e6; }
  100% { background: transparent; }
}

tr.glow {
  animation: row-glow 1600ms var(--ease) 1;
}

@keyframes bloom {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.bloom {
  animation: bloom 420ms var(--ease) 1;
}

@keyframes toast-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ------------------------------------------------------------------ */
/* Today dashboard                                                     */
/* ------------------------------------------------------------------ */

.dash-head h1 {
  font-size: 22px;
}

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}

.mode-switch button {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-500);
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.mode-switch button + button {
  border-left: 1px solid var(--line-2);
}

.mode-switch button[aria-pressed="true"] {
  background: var(--forest-700);
  color: #fff;
}

.dash-head .sub {
  margin-top: 2px;
}

.kpi.static {
  cursor: default;
}

.kpi.static:hover {
  background: var(--surface);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}

.dash-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  font-size: 13.5px;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}

.panel-ft {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-500);
  background: var(--surface-2);
}

/* Action queue */

.qitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.qitem:last-child {
  border-bottom: none;
}

.q-ic {
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  flex: none;
}

.q-ic.u-red {
  background: var(--red-100);
  border-color: #ecc5bc;
  color: var(--red-600);
}

.q-ic.u-amber {
  background: var(--amber-100);
  border-color: #ecd9b8;
  color: var(--amber-600);
}

.q-body {
  min-width: 0;
  flex: 1;
}

.q-text {
  font-size: 13.5px;
  font-weight: 550;
}

.q-due {
  font-size: 12px;
  color: var(--ink-400);
  margin-top: 1px;
}

.q-due.u-red {
  color: var(--red-600);
  font-weight: 600;
}

.q-due.u-amber {
  color: var(--amber-600);
  font-weight: 600;
}

/* Movers / mini pipeline rows */

.mover {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 100ms var(--ease);
}

.mover:hover {
  background: var(--surface-2);
}

.mover:last-of-type {
  border-bottom: none;
}

.mover > div:first-child {
  flex: 1;
  min-width: 0;
}

.mv-nm {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mv-sub {
  font-size: 12px;
  color: var(--ink-500);
}

.mv-val {
  font-weight: 650;
  color: var(--forest-700);
}

/* Desk leaderboard */

table.lb {
  width: 100%;
  border-collapse: collapse;
}

table.lb th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line);
}

table.lb th.r,
table.lb td.r {
  text-align: right;
}

table.lb td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

table.lb tr:last-child td {
  border-bottom: none;
}

table.lb tr.you {
  background: var(--leaf-100);
}

table.lb .strong {
  font-weight: 650;
}

.lb-who {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Commodity bars */

.bars {
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 52px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.bar-lbl {
  color: var(--ink-700);
  font-weight: 550;
}

.bar-track {
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--leaf-500);
}

.bar-val {
  text-align: right;
  color: var(--ink-500);
}

/* Missed money */

.miss {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.miss:last-of-type {
  border-bottom: none;
}

.miss-val {
  color: var(--red-600);
  font-weight: 650;
  flex: none;
}

/* Log a call */

.topbar .logcall {
  height: 34px;
  gap: 7px;
}

.recbtn.listening {
  border-color: var(--red-600);
  color: var(--red-600);
  animation: rec-pulse 900ms ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 58, 43, 0.25); }
  50% { box-shadow: 0 0 0 5px rgba(201, 58, 43, 0.12); }
}

.chchip.ch-call svg {
  color: var(--amber-600);
}

@media (max-width: 1000px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ */
/* Board match pill + quote CTA                                        */
/* ------------------------------------------------------------------ */

.matchpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 650;
  transition: border-color 120ms var(--ease), background 120ms var(--ease), transform 80ms var(--ease);
}

.matchpill.is-new {
  border-color: #b7dcc5;
  background: var(--leaf-100);
  color: var(--forest-700);
}

.matchpill:hover {
  border-color: var(--forest-700);
  transform: translateY(-1px);
}

.matchpill .mp-val {
  font-weight: 600;
  color: inherit;
  opacity: 0.75;
  border-left: 1px solid currentColor;
  padding-left: 6px;
  margin-left: 1px;
}

.quote-cta {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px dashed var(--line-2);
  background: none;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 550;
  transition: color 120ms var(--ease), border-color 120ms var(--ease), background 120ms var(--ease);
}

.quote-cta:hover {
  color: var(--forest-700);
  border-color: var(--forest-700);
  border-style: solid;
  background: var(--leaf-100);
}

/* ------------------------------------------------------------------ */
/* Channel provenance chips                                            */
/* ------------------------------------------------------------------ */

/* Provenance is secondary metadata: quiet outline chip, only the icon
   carries the channel color. Direction (offer/request) owns the tinted
   chip treatment so the two systems never compete. */
.chchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-500);
}

.chchip.ch-email svg { color: var(--sky-600); }
.chchip.ch-sms svg { color: #6d3fc4; }
.chchip.ch-wa svg { color: var(--leaf-500); }

/* Direction: the primary triage signal on every inbox card */

.kindchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid transparent;
}

.kindchip.kd-offer {
  background: var(--leaf-100);
  color: var(--forest-700);
  border-color: #bfe0cc;
}

.kindchip.kd-request {
  background: var(--sky-100);
  color: var(--sky-600);
  border-color: #cddcf8;
}

.msg-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.msg-meta .when {
  font-size: 12px;
  color: var(--ink-400);
  white-space: nowrap;
}

.fsep {
  width: 1px;
  align-self: stretch;
  background: var(--line-2);
  margin: 3px 4px;
}

.fchip.fk-offer[aria-pressed="true"] {
  background: var(--forest-700);
  border-color: var(--forest-700);
}

.fchip.fk-request[aria-pressed="true"] {
  background: var(--sky-600);
  border-color: var(--sky-600);
}

/* Inbox filters */

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-500);
  transition: all 120ms var(--ease);
}

.fchip:hover {
  border-color: var(--ink-400);
  color: var(--ink-900);
}

.fchip[aria-pressed="true"] {
  background: var(--forest-700);
  border-color: var(--forest-700);
  color: #fff;
}

.fchip .fcount {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 1px 6px;
}

.fchip[aria-pressed="true"] .fcount {
  background: rgba(255, 255, 255, 0.18);
}

/* Market filters */

.mfilters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.msel {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.msel select {
  height: 32px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-700);
  appearance: none;
  cursor: pointer;
  transition: border-color 120ms var(--ease);
}

.msel select:hover {
  border-color: var(--ink-400);
}

.msel select:focus {
  outline: none;
  border-color: var(--ink-400);
}

.msel svg {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}

.fglabel {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-right: 2px;
}

/* Inbox layout with sources rail */

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(0, 860px) 300px;
  gap: 20px;
  align-items: start;
}

.inbox-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 6px 0 8px;
}

.rail-hd {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  padding: 10px 16px 6px;
}

.srcline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  transition: background 120ms var(--ease);
}

.srcline:hover {
  background: var(--surface-2);
}

.srcline .src-ic {
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  flex: none;
}

.srcline .src-body {
  min-width: 0;
}

.srcline .src-nm {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srcline .src-sub {
  display: block;
  font-size: 11.5px;
  color: var(--ink-400);
}

.srcline .src-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.srcline .src-n {
  font-size: 11.5px;
  color: var(--ink-500);
}

.srcline .src-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leaf-500);
  box-shadow: 0 0 0 3px var(--leaf-100);
}

.attn {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 16px;
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.attn:first-of-type {
  border-top: none;
}

.attn.done {
  color: var(--forest-700);
  justify-content: flex-start;
  font-weight: 550;
}

/* ------------------------------------------------------------------ */
/* Inbox                                                               */
/* ------------------------------------------------------------------ */

.inbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 860px;
  min-width: 0;
}

.day-label {
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-400);
  margin: 10px 2px 2px;
}

.msg {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}

.msg.unread {
  border-color: #bfd8c9;
  box-shadow: 0 1px 0 rgba(31, 82, 55, 0.06);
}

.msg-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.msg-top .from {
  font-weight: 600;
  font-size: 13.5px;
}

.msg-top .co {
  color: var(--ink-500);
  font-size: 12.5px;
}

.msg-top .when {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-400);
  white-space: nowrap;
}

.msg-top .dot-unread {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leaf-500);
  flex: none;
}

.msg-subj {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 6px;
}

.msg-body {
  font-size: 13.5px;
  color: var(--ink-700);
  margin-top: 3px;
}

.msg-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.fieldchip {
  display: inline-flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 5px 10px 6px;
}

.fieldchip .k {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
}

.fieldchip .v {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.fieldchip.warn {
  border-color: #ecd9b8;
  background: var(--amber-100);
}

.fieldchip.warn .v {
  color: var(--amber-600);
}

.msg-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.msg-thread {
  margin-top: 6px;
}

.msg-thread-collapsed {
  display: flex;
  align-items: center;
  gap: 10px;
}

.thread-snip {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-snip .who {
  font-weight: 600;
  color: var(--ink-900);
}

.thread-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 12px;
  color: var(--ink-500);
  white-space: nowrap;
}

.thread-toggle:hover {
  color: var(--ink-900);
}

.msg-thread .thread-toggle {
  margin-top: 6px;
}

.msg-note {
  font-size: 12.5px;
  color: var(--ink-500);
}

.msg.revision {
  border-color: #a9cdb9;
  box-shadow: 0 8px 24px rgba(29, 82, 55, 0.09);
}

/* ------------------------------------------------------------------ */
/* Matches                                                             */
/* ------------------------------------------------------------------ */

.kpis.pipe {
  margin-bottom: 16px;
}

.kpis.pipe .kpi {
  cursor: default;
}

.kpis.pipe .kpi:hover {
  background: var(--surface);
}

.kpis.pipe .val {
  font-size: 20px;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}

.match-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 120ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
  text-align: left;
  display: block;
  width: 100%;
}

.match-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.match-card.hot {
  border-color: #a9cdb9;
}

.match-card .mc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.match-card .mc-prod {
  font-weight: 650;
  font-size: 14px;
}

.match-card .mc-when {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-400);
}

.match-card .mc-pair {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 12px;
}

.match-card .mc-nums {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.match-card .mc-spread {
  font-size: 21px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--forest-700);
}

.match-card .mc-detail {
  font-size: 12.5px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

/* Match detail (drawer) */

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.pair .pcard {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--paper);
}

.pair .pcard .role {
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-400);
}

.pair .pcard .nm {
  font-weight: 650;
  font-size: 13.5px;
  margin: 3px 0 6px;
}

.pair .pcard .ln {
  font-size: 12.5px;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}

.pair.pair-multi {
  grid-template-columns: 1fr;
}

.pair.pair-multi .supplier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.spreadbox {
  border: 1px solid #cfe6d9;
  background: var(--leaf-100);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.spreadbox .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}

.spreadbox .row.total {
  font-weight: 650;
  font-size: 14.5px;
  border-top: 1px solid #cfe6d9;
  margin-top: 6px;
  padding-top: 8px;
  color: var(--forest-700);
}

.tline {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
}

.tline .tdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
  margin-top: 6px;
  flex: none;
}

.tline:first-child .tdot {
  background: var(--leaf-500);
}

.tline .tw {
  color: var(--ink-400);
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Deals                                                               */
/* ------------------------------------------------------------------ */

.deals {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 860px;
}

.deal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.deal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.deal-head:hover {
  background: var(--surface-2);
}

.deal-main {
  min-width: 0;
  flex: 1;
}

.deal-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.deal-head .subj {
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-line2 {
  display: flex;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
  margin-top: 2px;
}

.deal-head .with {
  font-size: 12.5px;
  color: var(--ink-500);
  flex: none;
}

.deal-line2 .snip {
  font-size: 12px;
  color: var(--ink-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
  min-width: 92px;
}

.deal-val {
  font-weight: 650;
  font-size: 14.5px;
  color: var(--forest-700);
}

.deal-val.down {
  color: var(--red-600);
}

.deal-meta {
  font-size: 11.5px;
  color: var(--ink-400);
}

.deal-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font-size: 12px;
  color: var(--ink-400);
  white-space: nowrap;
}

/* Stage spine */

.spine {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.spine .sdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
}

.spine .sdot.on {
  background: var(--leaf-500);
}

.spine.lost {
  gap: 5px;
  font-size: 11px;
  font-weight: 650;
  color: var(--red-600);
}

/* Expanded deal: thread + facts */

.deal-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
}

.deal-thread {
  min-width: 0;
}

.deal-facts {
  border-left: 1px solid var(--line);
  padding: 12px 0 12px 20px;
  align-self: start;
}

.df-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
}

.df-k {
  color: var(--ink-500);
}

.df-v {
  font-weight: 600;
}

.df-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.df-actions .btn {
  justify-content: center;
}

@media (max-width: 800px) {
  .deal-body-grid {
    grid-template-columns: 1fr;
  }
  .deal-facts {
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }
}

.deal-body {
  border-top: 1px solid var(--line);
  padding: 6px 16px 12px;
}

.mail {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.mail:last-child {
  border-bottom: none;
}

.mail .mh {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 12.5px;
  margin-bottom: 5px;
}

.mail .mh .w {
  font-weight: 600;
}

.mail .mh .t {
  margin-left: auto;
  color: var(--ink-400);
  font-size: 11.5px;
}

.mail .mb {
  font-size: 13.5px;
  color: var(--ink-700);
  white-space: pre-wrap;
}

.deal.flash {
  animation: row-glow 1600ms var(--ease) 1;
}

.deal-actions {
  display: flex;
  gap: 8px;
  padding: 10px 0 6px;
}

.msg.glow {
  animation: row-glow 1600ms var(--ease) 1;
}

/* ------------------------------------------------------------------ */
/* Drawer                                                              */
/* ------------------------------------------------------------------ */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(22, 24, 21, 0.32);
  z-index: 80;
  animation: fade-in 160ms var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 96vw);
  background: var(--surface);
  z-index: 81;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: drawer-in 220ms var(--ease);
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0; }
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-size: 15.5px;
  font-weight: 650;
}

.drawer-head .sub {
  font-size: 12.5px;
  color: var(--ink-500);
}

.drawer-head .x {
  margin-left: auto;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 24px;
}

.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--paper);
}

/* Chart in product drawer */

.chartbox {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 14px 8px;
  margin-bottom: 16px;
  background: var(--paper);
}

.chartbox .cb-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.chartbox .cb-price {
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.chartbox .cb-delta {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chartbox .cb-range {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-400);
}

.sect {
  margin-bottom: 16px;
}

.sect .hd {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  margin-bottom: 6px;
}

/* Compose */

.compose label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  margin: 12px 0 4px;
}

.compose .field {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 8px 12px;
  font-size: 13.5px;
}

.compose .field:focus {
  border-color: var(--ink-400);
  outline: none;
}

.compose textarea.field {
  min-height: 360px;
  resize: vertical;
  line-height: 1.55;
  font-size: 13.5px;
}

.compose textarea.field.short {
  min-height: 160px;
}

.compose .to-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  font-size: 13.5px;
}

.compose .to-line .em {
  color: var(--ink-500);
  font-size: 12.5px;
}

.rfq-to {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
}

.rfq-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rfq-chip .chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: 0.65;
}

.rfq-chip .chip-x:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink-900);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: toast-in 220ms var(--ease);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(560px, 92vw);
}

.toast .ok {
  color: var(--leaf-500);
}

/* Empty states */

.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13.5px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 64px 1fr;
  }
  .side {
    padding: 14px 8px;
    align-items: center;
  }
  .brand-name,
  .nav-item span,
  .nav-badge,
  .side-foot .who {
    display: none;
  }
  .nav-item {
    justify-content: center;
    width: 44px;
  }
  .side-foot {
    justify-content: center;
    padding: 12px 0 2px;
  }
  .search {
    width: 240px;
  }
}

@media (max-width: 1100px) {
  .inbox-layout {
    grid-template-columns: 1fr;
  }
  .inbox-rail {
    position: static;
    flex-direction: row;
  }
  .inbox-rail .rail-card {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi:nth-child(2) {
    border-right: none;
  }
  .kpi:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .expand-inner {
    grid-template-columns: 1fr;
  }
  .expand-col + .expand-col {
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .pair {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 18px 16px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
