/* Beacon Sales — brand-native UI
   charcoal #2F2E2C · yellow #F8CE3C · orange #F5941F · "The Seasons" wordmark */

@font-face {
  font-family: 'The Seasons';
  src: url('/fonts/The Seasons.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'The Seasons';
  src: url('/fonts/The Seasons Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #2f2e2c;
  --ink-2: #45433f;
  --ink-3: #6b6862;
  --muted: #8f8b83;
  --yellow: #f8ce3c;
  --yellow-soft: #fdf3d0;
  --orange: #f5941f;
  --orange-soft: #fdead3;
  --paper: #faf9f6;
  --card: #ffffff;
  --line: #e9e5dd;
  --line-2: #d8d3c9;
  --green: #2f9e73;
  --green-soft: #e0f2ea;
  --red: #d4564f;
  --red-soft: #fbe6e5;
  --blue: #4a7fb5;
  --blue-soft: #e5eef7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(47, 46, 44, .06), 0 4px 14px rgba(47, 46, 44, .05);
  --shadow-lg: 0 10px 40px rgba(47, 46, 44, .16);
  --rail: 68px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; }

.wordmark {
  font-family: 'The Seasons', Georgia, serif;
  font-weight: 400;
  letter-spacing: .01em;
}

/* ------------------------------------------------------------------ login */
.login {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  height: 100%;
}
.login-brand {
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 72px;
  position: relative;
  overflow: hidden;
}
.login-brand::after {
  content: '';
  position: absolute;
  right: -160px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(248, 206, 60, .22), transparent 65%);
}
.login-brand h1 {
  font-family: 'The Seasons', Georgia, serif;
  font-size: 68px;
  font-weight: 400;
  margin: 0;
  color: var(--orange);
  line-height: 1;
}
.login-brand .tagline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0 4px;
  font-family: 'The Seasons', Georgia, serif;
  font-size: 22px;
  color: #fff;
}
.login-brand .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--yellow);
}
.login-brand p.sub {
  margin-top: 46px;
  max-width: 340px;
  color: rgba(255, 255, 255, .62);
  line-height: 1.65;
  font-size: 14px;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card { width: 100%; max-width: 340px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .hint { color: var(--muted); margin: 0 0 26px; }
.login-card label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  margin: 0 0 6px;
}
.login-card input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
.login-error {
  background: var(--red-soft);
  color: var(--red);
  padding: 9px 12px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
}
.login-note {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 9px 12px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
}
.login-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
}

/* Slack asks that its button stay recognisably theirs, so this is white with
   their mark rather than the Beacon yellow. */
.btn-slack {
  width: 100%;
  justify-content: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 16px;
}
.btn-slack:hover { background: var(--paper); }

.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--ink-3);
}
.login-or::before,
.login-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ------------------------------------------------------------------ shell */
.shell { display: flex; height: 100%; }

.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 6px;
}
.rail-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-family: 'The Seasons', Georgia, serif;
  font-size: 25px;
  line-height: 1;
  margin-bottom: 16px;
  user-select: none;
}
.rail-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .55);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
}
.rail-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.rail-btn.active { background: rgba(248, 206, 60, .16); color: var(--yellow); }
.rail-btn svg { width: 19px; height: 19px; }
.rail-btn .tip {
  position: absolute;
  left: 52px;
  background: var(--ink);
  color: #fff;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity .12s, transform .12s;
  z-index: 60;
  box-shadow: var(--shadow);
}
.rail-btn:hover .tip { opacity: 1; transform: translateX(0); }
.rail-spacer { flex: 1; }
.rail-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  border: 2px solid transparent;
}
.rail-avatar:hover { border-color: rgba(255, 255, 255, .35); }

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

.topbar {
  height: 60px;
  flex: 0 0 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 650; }
.topbar .spacer { flex: 1; }
.search {
  position: relative;
  width: 280px;
}
.search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  outline: none;
  background: var(--paper);
}
.search input:focus { border-color: var(--orange); background: #fff; }
.search svg {
  position: absolute;
  left: 10px;
  top: 9px;
  width: 15px;
  height: 15px;
  color: var(--muted);
}

/* Elements below set their own display, which otherwise beats the browser's
   default rule for the hidden attribute and leaves them on screen. */
[hidden] { display: none !important; }

.btn {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 8px;
  padding: 8px 13px;
  cursor: pointer;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--paper); border-color: var(--ink-3); }
.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.btn-primary:hover { background: #e2861a; border-color: #e2861a; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--paper); border-color: var(--line); }
.btn-danger { color: var(--red); border-color: var(--line-2); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ------------------------------------------------------------------- kpis */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px 20px 0;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  box-shadow: var(--shadow);
}
.kpi .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
}
.kpi .value { font-size: 23px; font-weight: 680; margin-top: 5px; letter-spacing: -.01em; }
.kpi .sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.kpi.alert { border-color: var(--red); background: var(--red-soft); }
.kpi.alert .value { color: var(--red); }
.kpi.accent { border-left: 3px solid var(--orange); }

/* -------------------------------------------------------------- filterbar */
.filterbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 20px;
}
.filterbar select,
.filterbar input[type="text"] {
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  outline: none;
}
.filterbar select:focus { border-color: var(--orange); }
.seg {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 7px 13px;
  cursor: pointer;
  font-weight: 550;
  color: var(--ink-3);
}
.seg button.active { background: var(--ink); color: #fff; }
.chip-toggle {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 20px;
  padding: 6px 13px;
  cursor: pointer;
  font-weight: 550;
}
.chip-toggle.on { background: var(--red-soft); border-color: var(--red); color: var(--red); }

/* ------------------------------------------------------------------ board */
.content { flex: 1; overflow: auto; padding: 0 20px 24px; }

.board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 60vh;
}
.col {
  flex: 0 0 265px;
  background: #f3f1ec;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 230px);
}
.col.dragover { background: var(--yellow-soft); border-color: var(--yellow); }
.col-head { padding: 11px 13px 9px; border-bottom: 1px solid var(--line); }
.col-head .row1 { display: flex; align-items: center; gap: 7px; }
.col-head .name { font-weight: 650; font-size: 13px; }
.col-head .count {
  background: var(--line-2);
  color: var(--ink-2);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 650;
}
.col-head .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.col-head .mrr { font-size: 12px; color: var(--ink-2); font-weight: 600; margin-top: 5px; }
.col-body { padding: 9px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.col-empty {
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(47, 46, 44, .05);
  transition: box-shadow .12s, transform .12s, border-color .12s;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--line-2); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .45; transform: rotate(1.5deg); }
.card .co { font-weight: 640; line-height: 1.3; }
.card .meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.card .mrr { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.card .mrr small { font-weight: 500; font-size: 11px; color: var(--muted); }
.card .foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.card .foot .spacer { flex: 1; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.tag-va { background: var(--yellow-soft); border-color: #f0dfa6; color: #8a6b07; }
.tag-support { background: var(--orange-soft); border-color: #f4d3ac; color: #9a5a08; }
.tag-mixed { background: var(--blue-soft); border-color: #c8dbee; color: #2f5f8f; }
.tag-won { background: var(--green-soft); border-color: #bfe3d2; color: #1d7a55; }
.tag-lost { background: var(--red-soft); border-color: #f2c9c7; color: var(--red); }

.avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  flex: 0 0 25px;
}
.avatar.sm { width: 21px; height: 21px; font-size: 9px; flex-basis: 21px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; flex-basis: 56px; }
/* A photo has to fill its circle rather than letterbox inside it. */
img.avatar { object-fit: cover; background: var(--paper); }

.photo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.slack-rows { display: flex; flex-direction: column; gap: 4px; }
.slack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.slack-row:last-child { border-bottom: 0; }

.due {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-3);
  white-space: nowrap;
}
.due.today { background: var(--yellow-soft); border-color: var(--yellow); color: #8a6b07; }
.due.over { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.due.none { background: transparent; border-style: dashed; color: var(--muted); }

/* ------------------------------------------------------------------ table */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--paper); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.strong { font-weight: 640; }
.dim { color: var(--muted); }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .big { font-size: 16px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }

/* ----------------------------------------------------------------- drawer */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(47, 46, 44, .32);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  z-index: 80;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 94vw;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1);
  z-index: 90;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}
.drawer-head .row { display: flex; align-items: flex-start; gap: 10px; }
.drawer-head h2 { margin: 0; font-size: 18px; font-weight: 660; line-height: 1.3; }
.drawer-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 40px; }
.drawer-tabs { display: flex; gap: 2px; padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.drawer-tabs button.active { color: var(--ink); border-bottom-color: var(--orange); }
.close-x {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
}
.close-x:hover { background: var(--paper); color: var(--ink); }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.panel h3 {
  margin: 0 0 11px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 650;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
.field textarea { resize: vertical; min-height: 64px; }

.calcbox {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.calcbox .line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.calcbox .line span:first-child { color: rgba(255, 255, 255, .6); }
.calcbox .big {
  font-size: 26px;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: -.02em;
}
.calcbox hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .14); margin: 9px 0; }

.log-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-item:last-child { border-bottom: 0; }
.log-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12px;
}
.log-body { flex: 1; min-width: 0; }
.log-body .top { display: flex; align-items: baseline; gap: 7px; }
.log-body .kind { font-weight: 640; font-size: 13px; }
.log-body .when { font-size: 11px; color: var(--muted); }
.log-body .text { margin-top: 2px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; }

.composer { display: flex; flex-direction: column; gap: 9px; }
.composer .kinds { display: flex; gap: 5px; flex-wrap: wrap; }
.kind-btn {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.kind-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------------------------------------------------------------- reports */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.rcard h3 { margin: 0 0 3px; font-size: 14px; font-weight: 650; }
.rcard .note { color: var(--muted); font-size: 12px; margin: 0 0 14px; }
.rcard.wide { grid-column: 1 / -1; }

.funnel-row { margin-bottom: 11px; }
.funnel-row .top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.funnel-row .bar { height: 26px; background: var(--paper); border-radius: 6px; overflow: hidden; }
.funnel-row .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  border-radius: 6px;
  min-width: 2px;
  transition: width .3s;
}

.spark { display: flex; align-items: flex-end; gap: 5px; height: 130px; }
.spark .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.spark .bar {
  width: 100%;
  background: var(--ink);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height .3s;
}
.spark .b:last-child .bar { background: var(--orange); }
.spark .lab { font-size: 10px; color: var(--muted); white-space: nowrap; }
.spark .val { font-size: 10px; font-weight: 650; }

.bar-mini { height: 7px; background: var(--paper); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar-mini > div { height: 100%; background: var(--orange); border-radius: 4px; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 200;
  font-weight: 550;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

/* ---------------------------------------------------------------- modal */
.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: 520px;
  max-width: 94vw;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s, transform .16s;
}
.modal-card.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal-head {
  padding: 16px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
}
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px; }
.modal-foot {
  padding: 13px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #fff;
  border-radius: 0 0 14px 14px;
}

/* ----------------------------------------------------------------- quotes */
.quote-actions { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.quote-actions .btn { text-decoration: none; }
.quote-actions select {
  padding: 5px 8px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
}

/* ---------------------------------------------------------- import wizard */
.modal-card.wide { width: min(760px, 94vw); }
.modal-head .step-dots { margin-left: auto; display: flex; gap: 6px; }
.step-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.step-dots i.on { background: var(--orange); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 30px 18px;
  border: 2px dashed var(--line-2);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--orange); background: var(--orange-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: #f1f8f5; }
.dropzone strong { font-size: 14px; }
.dropzone span { font-size: 12px; }

.map-table { max-height: 300px; overflow-y: auto; }
.map-table select { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--orange); }
.modal-body .kpi { padding: 12px 14px; }

/* ------------------------------------------------------------------ today */
.rail-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.task-group { margin-bottom: 22px; }
.task-group-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 9px;
}
.task-group-head h3 { margin: 0; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.task-group-head .count {
  background: var(--line);
  color: var(--ink-2);
  border-radius: 9px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}
.task-group-head .note { color: var(--muted); font-size: 12px; }
.task-group.overdue .task-group-head h3 { color: var(--red); }
.task-group.overdue .task-group-head .count { background: #fae3e1; color: var(--red); }
.task-group.today .task-group-head .count { background: var(--yellow-soft); color: #8a6b00; }

.task-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.task {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--paper); }
.task.done { opacity: .45; }
.task.done .task-title { text-decoration: line-through; }

.task-check {
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: border-color .12s, background .12s;
}
.task-check:hover { border-color: var(--green); }
.task-check::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid var(--green);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}
.task-check:hover::after { opacity: .4; }
.task-check.on { background: var(--green); border-color: var(--green); }
.task-check.on::after { opacity: 1; border-color: #fff; }

.prio { flex: none; width: 4px; height: 26px; border-radius: 2px; background: var(--line-2); }
.prio-high { background: var(--red); }
.prio-normal { background: var(--yellow); }
.prio-low { background: var(--line-2); }

.task-main { flex: 1; min-width: 0; }
.task-title {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-3);
}
.task-sub .co { font-weight: 600; color: var(--ink-2); }
.tag-step { background: var(--orange-soft); color: #8a4f00; }
.task .due { flex: none; }
.task .avatar { flex: none; }

/* clients */
.health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.health i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.drawer-head .health { font-weight: 600; }
.churn-note { border-color: var(--red); background: var(--red-soft); }
.churn-note h3 { color: var(--red); }

/* ------------------------------------------------------------- find leads */
/* one tab per saved search, then one per business category within it */
.lead-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 14px 20px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.lead-tab {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: none;
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.lead-tab:hover { color: var(--ink); background: var(--paper); }
.lead-tab.active {
  margin-bottom: -1px;
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 2px 0 var(--orange);
}
.lead-tab svg { width: 17px; height: 17px; flex: none; }
/* Only the open search is named; the others are the icon and the count, which
   is what lets eleven of them sit on one row. */
.lead-tab .lead-tab-name { display: none; }
.lead-tab.active .lead-tab-name { display: inline; }
.lead-tab .n {
  padding: 1px 6px;
  border-radius: 7px;
  background: var(--line);
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.lead-tab.active .n { background: var(--orange-soft); color: var(--orange); }
.lead-tab.add { font-size: 15px; padding: 8px 12px; }

/* which saved search found this lead - only present in the combined view */
.leadtable .lead-from {
  font-size: 12px;
  color: var(--ink-3);
  max-width: 170px;
}
.leadtable .lead-from svg { width: 14px; height: 14px; vertical-align: -3px; margin-right: 5px; }

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px 0;
  /* Across all searches at once there are sixty-odd categories, which wrapped
     into a wall of chips that pushed the leads off the screen. */
  max-height: 96px;
  overflow-y: auto;
}
.cat-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.cat-tab:hover { border-color: var(--ink-3); color: var(--ink); }
.cat-tab.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.cat-tab .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-tab.active .n { color: rgba(255, 255, 255, .7); }

.lead-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 0;
}
.lead-head .spacer { flex: 1; }
.lead-pick { display: flex; align-items: center; gap: 6px; }
.btn-ghost.danger { color: var(--red); }
.btn-ghost.danger:hover { background: var(--red-soft); border-color: #f2c9c7; }
.cost {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 1px 6px;
  margin-left: 5px;
}

.lead-brief { padding: 8px 20px 0; font-size: 13px; color: var(--ink-2); }

.runbox {
  margin: 12px 20px 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: 8px;
  background: var(--card);
}
.runbox.running { border-left-color: var(--orange); background: var(--orange-soft); }
.runbox.done { border-left-color: var(--green); }
.runbox.err { border-left-color: var(--red); background: var(--red-soft); }
.run-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}
.run-log {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.spin {
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid rgba(47, 46, 44, .18);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.rangelbl {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-2);
}
.rangelbl input[type="range"] { width: 110px; accent-color: var(--orange); }

.tier {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: var(--line);
  color: var(--ink-3);
}
.tier-A { background: var(--green); color: #fff; }
.tier-B { background: var(--green-soft); color: #1d7a55; }
.tier-C { background: var(--yellow-soft); color: #8a6b07; }
.tier-D { background: var(--line); color: var(--ink-3); }
.tier-E { background: var(--paper); color: var(--muted); }

.sigs { max-width: 260px; }
.sig {
  display: inline-block;
  margin: 1px 3px 1px 0;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 11px;
  color: var(--ink-3);
}

/* Deep research, shown in a row that opens under the lead it belongs to. */
.linkbtn {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: var(--orange);
  cursor: pointer;
}
.leadtable tr.researchrow > td { background: var(--paper); padding: 12px 14px; }
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 18px;
}
.research-grid .dim { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.research-grid > div > div { font-size: 13px; }
.research-fit { margin-top: 10px; font-size: 13px; }
.research-foot { margin-top: 8px; font-size: 11px; }

.leadtable td.pick, .leadtable th.pick { width: 34px; padding-right: 0; }
.leadtable input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--orange); }
.leadtable tr.picked { background: var(--orange-soft); }
.leadtable tr.picked:hover { background: var(--orange-soft); }

/* Flags are what an account manager scans for when leads are split by country, so
   they sit slightly larger than the text they label. */
.flag { font-size: 15px; line-height: 1; margin-right: 6px; }

/* Who covers what, on the team page. Flags run close together so a rep with six
   markets stays one glanceable block rather than a spread-out row. */
.teamtable td.cov { white-space: nowrap; }
.teamtable td.cov .flag { margin-right: 2px; }
.teamtable td.cov .tag { font-size: 10px; padding: 1px 5px; }

/* Ticking markets and languages. A wrapping row of boxes beats a multi-select:
   everything on offer is visible, and what is chosen stays readable. */
/* No inner scroller: capped, it clipped a row of markets in half and the next
   label sat on top of it. The modal body already scrolls when it needs to. */
.picks { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; margin-bottom: 4px; }
.pickbox {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; cursor: pointer; user-select: none; background: #fff;
}
.pickbox:hover { border-color: var(--ink-3); }
.pickbox.on { background: var(--orange-soft); border-color: var(--orange); }
.pickbox input { width: 13px; height: 13px; accent-color: var(--orange); }

/* How many leads the filters actually landed on, next to the country picker. */
.matchcount { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.bulkbar {
  position: fixed;
  left: 50%;
  bottom: -70px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 380px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  opacity: 0;
  transition: bottom .18s ease, opacity .18s ease;
  z-index: 40;
}
.bulkbar.show { bottom: 22px; opacity: 1; }
.bulkbar .spacer { flex: 1; }
.bulkbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }
.bulkbar .btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }

.modal-body .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

@media (max-width: 900px) {
  .report-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}

/* --------------------------------------------------------------- settings */
.settings { display: grid; gap: 16px; max-width: 960px; padding-top: 16px; }
.settings .rcard h3 { font-size: 15px; margin-bottom: 10px; }

.settings-me { display: flex; align-items: center; gap: 12px; }
.settings-me .dim { font-size: 12px; }

.teamtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.teamtable th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 0 10px 8px 0;
  border-bottom: 1px solid var(--line);
}
.teamtable td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* The name cell stays a real table cell - making it a flex container knocks the
   row out of alignment the moment a neighbouring cell wraps onto two lines. */
.teamtable td .who { display: inline-flex; align-items: center; gap: 8px; }
.teamtable td:first-child { min-width: 170px; }
.teamtable td.right { text-align: right; white-space: nowrap; }
.teamtable td.right .linkbtn + .linkbtn { margin-left: 12px; }
/* A disabled account stays listed so its deals still have a name on them. */
.teamtable tr.off td { opacity: .45; }

.tag.role-owner { background: var(--orange-soft); border-color: #f4d3ac; color: #9a5a08; }
.tag.role-manager { background: var(--blue-soft); border-color: #c8dbee; color: #2f5f8f; }
.tag.role-rep { background: var(--paper); border-color: var(--line-2); color: var(--ink-3); }
.linkbtn.danger { color: var(--red); }
