/* ==========================================================================
   Momentum: sales pipeline and lead management
   MiniBytez product demonstration

   Visual language: charcoal frame, white board, coral for action and attention.
   No sidebar anywhere. The board is full-bleed and never leaves the screen.
   Numbers are the loudest thing on any surface, because this is a numbers job.
   ========================================================================== */

:root {
  --char:      #17181a;
  --char-2:    #24262a;
  --char-3:    #34373d;
  --ink:       #17181a;
  --ink-2:     #43474e;
  --muted:     #6d7278;
  --faint:     #9aa0a6;
  --line:      #e3e5e8;
  --line-soft: #eef0f2;
  --board:     #f4f5f7;
  --card:      #ffffff;

  --coral:     #e8552d;
  --coral-2:   #c8401b;
  --coral-soft:#fdeee9;
  --green:     #1f7a4d;
  --green-soft:#e9f5ee;
  --amber:     #b57400;
  --red:       #c23b2e;

  --top: 54px;
  --ff: "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }

body {
  margin: 0; height: 100%;
  background: var(--board);
  color: var(--ink);
  font: 400 13.5px/1.5 var(--ff);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--coral-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; border-radius: 3px; }

/* Numerals carry this product. They are set larger and heavier than their labels. */
.n { font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -0.02em; }

.skip { position: absolute; left: -9999px; background: var(--char); color: #fff; padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* --- Top strip: the only chrome in this product --------------------------- */

.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--char); color: #fff;
  display: flex; align-items: center; gap: 4px;
  height: var(--top); padding: 0 16px;
}
.top__mark {
  font-size: 16px; font-weight: 700; letter-spacing: -0.03em; margin-right: 14px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.top__mark i { width: 9px; height: 16px; background: var(--coral); border-radius: 1px; display: inline-block; }
.top a.nav {
  color: #b6bbc2; text-decoration: none; padding: 6px 11px; border-radius: 4px;
  font-size: 13.5px; white-space: nowrap;
}
.top a.nav:hover { color: #fff; background: var(--char-2); text-decoration: none; }
.top a.nav[aria-current="page"] { color: #fff; background: var(--char-3); font-weight: 600; }
.top a.nav .badge {
  margin-left: 6px; background: var(--coral); color: #fff; border-radius: 8px;
  padding: 0 6px; font-size: 11px; font-variant-numeric: tabular-nums;
}
.top__gap { flex: 1; }
.top select {
  height: 30px; background: var(--char-2); color: #fff; border: 1px solid var(--char-3);
  border-radius: 4px; font: inherit; font-size: 13px; padding: 0 8px;
}
.top select:focus { border-color: var(--coral); outline: none; }

.btn-go {
  height: 30px; padding: 0 13px; border: 0; border-radius: 4px;
  background: var(--coral); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.btn-go:hover { background: var(--coral-2); }

/* --- Demo banner ---------------------------------------------------------- */

.demobar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 5px 16px; background: var(--char-2); color: #9aa0a6;
  font-size: 11.5px; border-bottom: 1px solid var(--char-3);
}
.demobar strong { color: #dfe3e7; font-weight: 600; }
.demobar .gap { flex: 1; }
.demobar button, .demobar a {
  background: none; border: 1px solid var(--char-3); border-radius: 3px;
  padding: 1px 8px; font-size: 11.5px; color: #b6bbc2; cursor: pointer; text-decoration: none;
}
.demobar button:hover, .demobar a:hover { border-color: var(--coral); color: #fff; text-decoration: none; }

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

.boardwrap { display: flex; flex-direction: column; height: calc(100vh - var(--top) - 26px); }

.boardbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.boardbar h1 { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
.boardbar .totals { display: flex; gap: 26px; margin-left: auto; }
.boardbar .totals div { text-align: right; }
.boardbar .totals b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; font-weight: 680; letter-spacing: -0.03em; }
.boardbar .totals span { font-size: 11.5px; color: var(--muted); }

.board {
  flex: 1; display: flex; gap: 12px; padding: 14px 16px 20px;
  overflow-x: auto; overflow-y: hidden; align-items: stretch;
}

.col {
  flex: 0 0 268px; display: flex; flex-direction: column; min-height: 0;
  background: transparent;
}
.col__head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 0 4px 9px; border-bottom: 2px solid var(--line);
  margin-bottom: 10px;
}
.col__head h2 {
  margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2);
}
.col__head .count { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.col__head .sum { margin-left: auto; font-size: 14px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.col__body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 4px 40px; }
.col--over .col__body { background: var(--coral-soft); border-radius: 6px; outline: 2px dashed #f0b8a5; }

/* The deal card is the atom of this product. */
.deal {
  background: var(--card); border: 1px solid var(--line); border-radius: 5px;
  padding: 11px 12px 0; cursor: grab; position: relative; text-align: left; width: 100%;
  display: block; font: inherit; color: inherit;
}
.deal:hover { border-color: #c9ccd1; }
.deal:active { cursor: grabbing; }
.deal--dragging { opacity: .4; }
.deal__co { font-size: 13.5px; font-weight: 640; letter-spacing: -0.01em; margin-bottom: 1px; }
.deal__title { font-size: 12.5px; color: var(--muted); margin-bottom: 9px; }
.deal__value { font-size: 19px; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.deal__row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.deal__next {
  font-size: 12px; color: var(--ink-2); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.deal__next.due { color: var(--red); font-weight: 550; }
.deal__who {
  width: 22px; height: 22px; border-radius: 50%; background: var(--char); color: #fff;
  font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none;
}

/* Ageing bar: a thin rule along the bottom edge that fills as the deal goes cold.
   Solid colour, stepped by how stale the deal is. A gradient would look like decoration
   and would say nothing the length of the bar does not already say. */
.deal__age { height: 3px; margin: 10px -12px 0; background: var(--line-soft); border-radius: 0 0 4px 4px; overflow: hidden; }
.deal__age i { display: block; height: 100%; background: #e2a03f; }
.deal__age--warm i { background: var(--coral); }
.deal__age--cold i { background: var(--red); }

.col__empty {
  border: 1px dashed var(--line); border-radius: 5px; padding: 22px 12px;
  text-align: center; color: var(--faint); font-size: 12.5px;
}

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

.scrim { position: fixed; inset: 0; background: rgba(23,24,26,.34); z-index: 60; }
.scrim[hidden] { display: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  background: #fff; z-index: 61; display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(23,24,26,.18);
}
.drawer[hidden] { display: none; }
.drawer__head { padding: 16px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer__head .co { font-size: 12.5px; color: var(--muted); }
.drawer__head h2 { margin: 2px 0 8px; font-size: 19px; font-weight: 660; letter-spacing: -0.025em; }
.drawer__value { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.drawer__value small { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 9px; }
.drawer__close {
  position: absolute; top: 12px; right: 14px; background: none; border: 0;
  font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px;
}
.drawer__close:hover { color: var(--ink); }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px 30px; }
.drawer__foot { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 8px; }

.stagepick { display: flex; gap: 2px; margin: 14px 0 0; }
.stagepick button {
  flex: 1; background: var(--board); border: 0; padding: 7px 2px; cursor: pointer;
  font-size: 10.5px; font-weight: 600; color: var(--muted); border-bottom: 3px solid var(--line);
}
.stagepick button:first-child { border-radius: 4px 0 0 0; }
.stagepick button:last-child { border-radius: 0 4px 0 0; }
.stagepick button[aria-pressed="true"] { background: #fff; color: var(--ink); border-bottom-color: var(--coral); }
.stagepick button:hover { color: var(--ink); }

.dl { display: grid; gap: 10px; margin: 0 0 18px; }
.dl .row { display: grid; grid-template-columns: 106px minmax(0, 1fr); gap: 12px; font-size: 13px; align-items: baseline; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; }

.sechead {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); margin: 20px 0 9px; display: flex; justify-content: space-between; align-items: center;
}
.sechead button { background: none; border: 0; color: var(--coral-2); cursor: pointer; font-size: 11.5px; letter-spacing: 0; text-transform: none; font-weight: 600; }

.acts { list-style: none; margin: 0; padding: 0; }
.acts li { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.acts li:last-child { border-bottom: 0; }
.acts .kind { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--coral-2); }
.acts .when { font-size: 11.5px; color: var(--faint); float: right; }
.acts .note { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

/* --- Generic page (inbox, follow-ups, team, sources) ----------------------- */

.page { padding: 22px 16px 60px; max-width: 1180px; }
.page__head { margin-bottom: 20px; }
.page__head h1 { font-size: 24px; font-weight: 680; letter-spacing: -0.035em; margin: 0; }
.page__head p { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; }

.strip { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 5px; background: #fff; margin-bottom: 22px; flex-wrap: wrap; }
.strip > div { flex: 1 1 150px; padding: 12px 15px; border-right: 1px solid var(--line-soft); }
.strip > div:last-child { border-right: 0; }
.strip dt { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.strip dd { margin: 0; font-size: 21px; font-weight: 690; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }

.lead {
  background: #fff; border: 1px solid var(--line); border-radius: 5px;
  padding: 14px 16px; margin-bottom: 10px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: start;
}
.lead h3 { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -0.02em; }
.lead .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.lead .note { font-size: 13px; color: var(--ink-2); margin: 9px 0 0; max-width: 70ch; }
.lead .acts2 { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lead .fleet { font-size: 20px; font-weight: 690; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; text-align: right; }
.lead .fleet span { display: block; font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--muted); }

.btn {
  height: 30px; padding: 0 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 4px; font-size: 13px; cursor: pointer; color: var(--ink-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: #c9ccd1; color: var(--ink); }
.btn--go { background: var(--coral); border-color: var(--coral); color: #fff; font-weight: 600; }
.btn--go:hover { background: var(--coral-2); border-color: var(--coral-2); color: #fff; }
.btn--sm { height: 26px; padding: 0 9px; font-size: 12.5px; }

.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 5px; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .big { font-size: 15px; font-weight: 680; letter-spacing: -0.02em; }

/* Rep load bars, not a leaderboard table. */
.rep { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 15px 17px; margin-bottom: 10px; }
.rep__top { display: flex; align-items: baseline; gap: 12px; }
.rep__top h3 { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -0.02em; }
.rep__top .r { margin-left: auto; font-size: 17px; font-weight: 690; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.rep__sub { font-size: 12.5px; color: var(--muted); }
.meter { height: 22px; background: var(--board); border-radius: 3px; margin-top: 11px; position: relative; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--coral); }
.meter i.over { background: var(--green); }
.meter b {
  position: absolute; left: 9px; top: 0; line-height: 22px; font-size: 11.5px; color: #fff;
  font-weight: 650; font-variant-numeric: tabular-nums; text-shadow: 0 0 3px rgba(0,0,0,.25);
}
.meter .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--char); }
.load { display: flex; gap: 3px; margin-top: 11px; }
.load i { flex: 1; height: 7px; border-radius: 1px; background: var(--line); }
.load i.on { background: var(--char-3); }
.load i.over { background: var(--red); }

.empty { background: #fff; border: 1px dashed var(--line); border-radius: 5px; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.empty p { margin: 0 auto; max-width: 46ch; font-size: 13px; }

/* --- Modal and toast ------------------------------------------------------ */

.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(23,24,26,.4); display: flex; align-items: flex-start; justify-content: center; padding: 9vh 20px 20px; overflow-y: auto; }
.overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: 6px; width: 100%; max-width: 480px; box-shadow: 0 18px 46px rgba(23,24,26,.28); }
.modal__head { padding: 17px 20px 13px; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: 17px; font-weight: 660; letter-spacing: -0.02em; }
.modal__head p { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.modal__body { padding: 17px 20px; display: grid; gap: 13px; }
.modal__foot { padding: 13px 20px 17px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line-soft); }
.field { height: 32px; padding: 0 9px; font: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 4px; width: 100%; background: #fff; color: var(--ink); }
textarea.field { height: auto; padding: 8px 9px; resize: vertical; }
.field:focus { border-color: var(--coral); outline: none; }
.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 7px; }
.toast { background: var(--char); color: #fff; font-size: 13px; padding: 9px 15px; border-radius: 4px; box-shadow: 0 6px 22px rgba(23,24,26,.3); display: flex; gap: 13px; align-items: center; }
.toast button { background: none; border: 0; color: #f3a184; cursor: pointer; font-size: 12.5px; }

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

@media (max-width: 900px) {
  .top { overflow-x: auto; scrollbar-width: none; }
  .top::-webkit-scrollbar { display: none; }
  .top__mark span { display: none; }
  .boardbar .totals { margin-left: 0; width: 100%; gap: 20px; }
  .boardbar .totals div { text-align: left; }
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead .fleet { text-align: left; }
  .lead .acts2 { justify-content: flex-start; }
}

/* The board becomes a stage switcher: one column at a time, not a squeezed grid. */
@media (max-width: 720px) {
  .stageswitch { display: flex; gap: 5px; overflow-x: auto; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .stageswitch::-webkit-scrollbar { display: none; }
  .stageswitch button {
    flex: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 16px;
    background: #fff; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  }
  .stageswitch button[aria-pressed="true"] { background: var(--char); border-color: var(--char); color: #fff; font-weight: 600; }
  .board { display: block; overflow-x: hidden; padding: 12px 16px 40px; }
  .col { display: none; }
  .col--active { display: flex; flex: 1 1 auto; width: 100%; }
  .col__body { overflow: visible; }
  .boardwrap { height: auto; min-height: calc(100vh - var(--top)); }
  .drawer { width: 100%; }
}
@media (min-width: 721px) { .stageswitch { display: none; } }

/* Wide tables scroll inside themselves rather than pushing the page sideways. */
@media (max-width: 760px) {
  table.tbl { display: block; overflow-x: auto; white-space: nowrap; }
  table.tbl thead, table.tbl tbody { display: table; width: 100%; min-width: 560px; }
  .page { padding-left: 14px; padding-right: 14px; }
  .strip > div { flex-basis: 50%; border-bottom: 1px solid var(--line-soft); }
}

@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
