/* Conquest Team Portal */

:root {
  --navy:  #1B2A4E;
  --navy2: #14203C;
  --lime:  #C3D82F;
  --teal:  #08917A;   /* in progress - teal not green, so it separates from red for colourblind readers */
  --red:   #D0453B;   /* awaiting reply */
  --amber: #C27519;   /* stale */
  --ink:   #1B2A4E;
  --muted: #5C6884;
  --faint: #8A93A8;
  --line:  #E3E7ED;
  --line2: #EEF1F5;
  --bg:    #F7F8FA;
  --card:  #FFFFFF;
}

* { box-sizing: border-box; }

/* A flex parent will stretch an auto-width image and distort it.
   Never let that happen to the logo. */
img { align-self: center; flex-shrink: 0; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Poppins', 'Avenir Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ------------------------------------------------------------- top bar */

.topbar {
  height: 64px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}
.topbar-left { display: flex; align-items: center; gap: 34px; }
.brand { display: flex; align-items: center; }
.brand img { height: 30px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 21px 15px 19px;
  font-size: 14px;
  color: #A9B4CC;
  border-bottom: 3px solid transparent;
}
.nav a.on { color: #fff; font-weight: 600; border-bottom-color: var(--lime); }
.nav a.off { opacity: .55; cursor: default; }

/* An <a> since 29 Sep - it opens /sync, which says what Teresa2 actually did
   on that run. The look is unchanged; only the tag is different. */
.sync {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  text-decoration: none;
  background: rgba(255,255,255,.08);
  border-radius: 20px; padding: 7px 14px 7px 11px;
  font-size: 12.5px; color: #CBD4E4;
}
.dot-lime { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); display: block; }
/* Overdue check-in: she runs hourly, so a gap says something is wrong. */
.sync.late { background: rgba(224,158,58,.18); color: #F0C070; }
.sync.late .dot-lime { background: var(--amber); }
.sync:hover { background: rgba(255,255,255,.15); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--lime); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

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

.page { padding: 26px 32px 48px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
h1 { font-size: 25px; font-weight: 600; letter-spacing: -.3px; margin: 0 0 5px; }
.sub { font-size: 13.5px; color: var(--muted); }

.flash {
  background: #F1F8F5; border: 1px solid #CFE7DD; color: #0B6B58;
  border-radius: 10px; padding: 11px 16px; font-size: 13.5px; margin-bottom: 18px;
}

/* filters */
.filters { display: flex; align-items: center; gap: 10px; }
.filters a, .filters input {
  height: 38px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 13px; color: var(--muted);
  display: flex; align-items: center;
}
.filters a.on { border-color: var(--navy); color: var(--navy); font-weight: 500; }
.filters input { width: 210px; }
.filters input::placeholder { color: var(--faint); }

/* --------------------------------------------------------------- KPIs */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 17px 19px; display: flex; flex-direction: column; gap: 9px;
}
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kpi-num { display: flex; align-items: baseline; gap: 9px; }
.kpi-num b { font-size: 30px; font-weight: 600; line-height: 1; }
.kpi-num span { font-size: 12px; color: var(--faint); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: block; flex-shrink: 0; }
.dot.red { background: var(--red); }
.dot.teal { background: var(--teal); }
.dot.amber { background: var(--amber); }

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

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }

.row {
  display: grid;
  grid-template-columns: 200px minmax(0,1fr) 170px 84px 290px;
  gap: 16px; align-items: center;
  padding: 0 22px;
  border-left: 3px solid transparent;
}
.row.head {
  height: 42px; background: #FAFBFC; border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--faint);
}
/* Section headings on the Support board — "Client requests" / "Internal
   requests". Deliberately quieter than .row.head: this divides one list, it
   does not introduce a new table, and a second loud header row would read as
   a second table. It spans the whole width rather than sitting in the first
   grid column, because the heading is about everything to the right of it. */
.row.sect {
  display: block; padding: 16px 22px 9px;
  border-bottom: 1px solid var(--line2); background: #FCFDFE;
}
.row.sect b { font-size: 13px; font-weight: 700; color: var(--ink); }
.row.sect .sect-n {
  display: inline-block; min-width: 19px; padding: 1px 6px; margin-left: 7px;
  border-radius: 999px; background: var(--line2); color: var(--muted);
  font-size: 11px; font-weight: 700; text-align: center;
}
.row.sect .sect-note { margin-left: 10px; font-size: 12px; color: var(--faint); }
.sect-empty { padding: 14px 22px 16px; font-size: 13px; color: var(--faint);
              border-bottom: 1px solid var(--line2); }
@media (max-width: 760px) {
  .row.sect .sect-note { display: block; margin: 3px 0 0; }
}

.row.item { min-height: 68px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line2); }
.row.item:last-child { border-bottom: none; }
.row.item:hover { background: #FCFDFE; }
.row.flag-stale { border-left-color: var(--amber); }
.row.flag-urgent { border-left-color: var(--red); }

.status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status b { font-size: 13px; font-weight: 600; }
.status.awaiting b { color: var(--red); }
.status.in_progress b { color: var(--teal); }
.tag {
  font-size: 10.5px; font-weight: 600; border-radius: 4px; padding: 3px 6px; letter-spacing: .2px;
}
.tag.stale { color: var(--amber); background: #FBF1E3; }
.tag.urgent { color: #A2312A; background: #FBEBE9; }
.tag.snoozed { color: var(--muted); background: #EFF1F5; }
/* A question to the owner, not an accusation - so it reads calmer than STALE. */
.tag.done-q { color: #2F6F86; background: #E6F1F6; }

.subject { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.subject .client { font-size: 14px; font-weight: 600; }
.subject .what { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.owner { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pip {
  width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0;
  background: #E7EAF0; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600;
}
.pip.empty { background: none; border: 1px dashed #C6CEDA; color: #A6B0C2; font-weight: 400; }
.owner .who { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner .who.none { color: #A6B0C2; }
.owner .who small { display: block; font-size: 10.5px; color: var(--amber); }

.waiting { font-size: 13px; color: var(--faint); }
.waiting.late { color: var(--amber); font-weight: 600; }
.waiting.ok { color: var(--muted); font-weight: 600; }

/* Fixed widths, not content widths - otherwise a row whose Notes button has no
   badge comes out narrower and the whole group slides sideways against its
   neighbours. Every row's buttons must land on the same vertical lines. */
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.actions .btn { min-width: 82px; justify-content: center; padding: 0 12px; }
.actions .btn.notes { min-width: 96px; }
.actions .btn.ghost { min-width: 0; width: 30px; padding: 0; }

/* ------------------------------------------------------------ buttons */

.btn {
  height: 36px; padding: 0 15px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #C9D1DC; color: var(--ink); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #24365F; color: #fff; }
.btn.claim { background: var(--lime); border-color: var(--lime); color: var(--navy); font-weight: 600; }
.btn.claim:hover { background: #B8CD25; color: var(--navy); }
.btn.link { border: none; background: none; padding: 0 4px; color: var(--faint); }
.btn.link:hover { color: var(--ink); }

/* ------------------------------------------------------- resolved rail */

.resolved-head { display: flex; align-items: center; gap: 9px; margin: 24px 0 11px; }
.resolved-head b { font-size: 13px; color: var(--muted); }
.resolved-head span { font-size: 12px; color: #A6B0C2; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 13px;
  font-size: 12.5px;
}
.chip b { font-weight: 600; }
.chip span { color: var(--faint); }

.empty-state {
  padding: 54px 24px; text-align: center; color: var(--muted);
}
.empty-state b { display: block; font-size: 16px; margin-bottom: 6px; color: var(--ink); }

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

.detail { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 22px; align-items: start; }
.back { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.back:hover { color: var(--ink); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 14px; letter-spacing: .2px; }

.detail-title { font-size: 21px; font-weight: 600; letter-spacing: -.2px; margin: 0 0 6px; }
.detail-meta { font-size: 13px; color: var(--muted); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl {
  display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 14px;
  padding: 0 0 20px; position: relative;
}
.tl:last-child { padding-bottom: 0; }
.tl:not(:last-child)::before {
  content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--line2);
}
.tl-dot {
  width: 20px; height: 20px; border-radius: 50%; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; z-index: 1;
  background: #E7EAF0; color: var(--muted);
}
.tl-dot.client { background: #FBEBE9; color: #A2312A; }
.tl-dot.staff  { background: #E4F2EF; color: var(--teal); }
.tl-dot.system { background: #EEF1F5; color: var(--faint); }
.tl-body .tl-who { font-size: 13px; font-weight: 600; }
.tl-body .tl-when { font-size: 11.5px; color: var(--faint); font-weight: 400; margin-left: 8px; }
.tl-body .tl-text { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 4px; white-space: pre-wrap; }
.tl-body .tl-src { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }

.field { display: flex; flex-direction: column; gap: 8px; }
textarea {
  font: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px;
  min-height: 84px; resize: vertical; width: 100%;
}
textarea:focus { outline: none; border-color: #B9C3D4; }

.facts { display: flex; flex-direction: column; gap: 0; }
.fact { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.fact:last-child { border-bottom: none; }
.fact .k { color: var(--faint); }
.fact .v { color: var(--ink); font-weight: 500; text-align: right; }

.stack { display: flex; flex-direction: column; gap: 9px; }
.stack .btn { width: 100%; justify-content: center; height: 40px; }

/* -------------------------------------------------------------- signin */

.signin { min-height: 100vh; display: grid; grid-template-columns: 620px minmax(0,1fr); }
.signin-brand {
  background: radial-gradient(120% 90% at 18% 12%, #2B4173 0%, var(--navy) 52%, var(--navy2) 100%);
  padding: 62px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
/* align-self keeps the flex column from stretching the logo to panel width */
.signin-brand img.logo { height: 64px; width: auto; align-self: flex-start; flex-shrink: 0; }
.signin-pitch { font-size: 40px; font-weight: 600; line-height: 1.18; letter-spacing: -.8px; color: #fff; }
.rule { width: 62px; height: 4px; background: var(--lime); border-radius: 2px; margin: 22px 0; }
.signin-blurb { font-size: 15px; line-height: 1.65; color: #A9B4CC; max-width: 430px; }
.signin-foot { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #8593B0; }

.signin-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.signin-card {
  width: 428px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 44px 40px; display: flex; flex-direction: column; gap: 26px;
}
.signin-card h1 { font-size: 24px; margin: 0 0 8px; }
.ms-btn {
  height: 52px; border: 1px solid #D5DBE4; border-radius: 10px; background: #fff;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font: inherit; font-size: 14.5px; font-weight: 500; color: var(--navy); cursor: pointer; width: 100%;
}
.ms-btn:hover { border-color: #B9C3D4; }
.divider { display: flex; align-items: center; gap: 14px; }
.divider hr { flex-grow: 1; height: 1px; border: none; background: var(--line); }
.divider span { font-size: 11.5px; letter-spacing: .4px; color: #A6B0C2; }
.note {
  display: flex; align-items: flex-start; gap: 11px;
  background: #FAFBFC; border: 1px solid var(--line2); border-radius: 10px; padding: 15px 16px;
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
}
.err { background: #FBEBE9; border: 1px solid #F1CFCB; color: #A2312A; border-radius: 10px; padding: 12px 15px; font-size: 13px; }
.devbox { border: 1px dashed #C6CEDA; border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.devbox b { font-size: 12px; letter-spacing: .3px; color: var(--amber); text-transform: uppercase; }
.devbox select, .devbox button { font: inherit; font-size: 13px; height: 38px; border-radius: 8px; border: 1px solid var(--line); padding: 0 10px; }

@media (max-width: 1180px) {
  .row { grid-template-columns: 180px minmax(0,1fr) 150px 80px 250px; gap: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail { grid-template-columns: minmax(0,1fr); }
  .signin { grid-template-columns: minmax(0,1fr); }
  .signin-brand { display: none; }
}

/* ------------------------------------------------------------- phones
   The table stops being a table. Each request becomes a card: what it is
   first, then who owns it, then the same three buttons - Claim, Notes and
   Resolve have to be reachable on a phone, because the whole point is
   claiming something the moment you read about it. */

@media (max-width: 820px) {
  .page { padding: 18px 14px 40px; }

  .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-head h1 { font-size: 22px; }
  .filters { flex-wrap: wrap; }
  .filters input { width: 100%; order: 5; }

  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; }

  .card { border-radius: 12px; }
  .row.head { display: none; }

  .row.item {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 9px 12px;
    padding: 15px 16px;
    min-height: 0;
  }
  .row.item .subject  { order: 1; grid-column: 1 / -1; }
  .row.item .status   { order: 2; }
  .row.item .waiting  { order: 3; text-align: right; align-self: center; }
  .row.item .owner    { order: 4; grid-column: 1 / -1; }
  .row.item .actions  { order: 5; grid-column: 1 / -1; gap: 8px; }

  /* let the request actually say what it is - no ellipsis on a phone */
  .subject .what { white-space: normal; overflow: visible; line-height: 1.45; }
  .owner .who { overflow: visible; white-space: normal; }
  .owner .who select { max-width: 100%; }

  .actions .btn { flex: 1 1 0; min-width: 0; height: 40px; padding: 0 8px; }
  .actions .btn.notes { min-width: 0; }
  .actions .btn.ghost { flex: 0 0 40px; width: 40px; }

  .chips { gap: 7px; }
  .chip { max-width: 100%; }

  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { max-height: 86vh; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot textarea { min-height: 76px; }

  .topbar { padding: 0 16px; }
  .topbar-left { gap: 16px; }
  .brand img { height: 26px; }

  .detail-title { font-size: 19px; }
}

@media (max-width: 460px) {
  /* Keep the counts to two across - stacked, four tall cards push the actual
     list of requests below the fold, which is the only thing anyone opens
     this on a phone to see. */
  .kpis { gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi-num b { font-size: 21px; }
  .kpi-num span { font-size: 11px; }
  .page-head h1 { font-size: 20px; }

  /* The two placeholder tabs aren't going anywhere yet, and "My Work" was
     wrapping onto two lines and shoving the avatar off the bar. */
  .nav a.off { display: none; }
  .topbar { padding: 0 14px; }
  .topbar-left { gap: 14px; }
  /* Keep the sync time on a phone - "is this list current?" is exactly the
     question you have when checking the board from somewhere else. Drop the
     name to stop it wrapping onto two lines. */
  .sync { padding: 6px 10px; font-size: 11.5px; }
  .sync .sync-who { display: none; }
}

/* ------------------------------------------------- owner picker (assign) */

.owner-form { margin: 0; }
.owner .who select {
  font: inherit; font-size: 13px; color: var(--muted);
  border: 1px solid transparent; background: transparent;
  border-radius: 6px; padding: 2px 4px; margin-left: -4px;
  max-width: 100%; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.owner .who select:hover { border-color: var(--line); background: #fff; }
.owner .who select:focus { outline: none; border-color: #B9C3D4; background: #fff; }
.owner .who.none select { color: #A6B0C2; }

/* ------------------------------------------------------- notes + dismiss */

.note-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 17px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--navy); color: #fff;
  font-size: 10.5px; font-weight: 600;
}
/* Still occupies its slot when empty, so the button keeps the same width. */
.note-badge.none { visibility: hidden; }
.btn.ghost {
  border-color: transparent; background: none; color: #C0C8D4;
  padding: 0 8px;
}
.btn.ghost:hover { color: var(--red); border-color: #F1CFCB; background: #FDF6F5; }

/* -------------------------------------------------------------- modal */

/* [hidden] must beat display:flex, or the invisible modal eats every click */
.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(27,42,78,.42);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50;
}
.modal {
  width: 560px; max-width: 100%; max-height: 82vh;
  background: var(--card); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 18px 50px rgba(20,32,60,.28);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 600;
}
.modal-body { padding: 8px 22px 4px; overflow-y: auto; flex-grow: 1; }
.modal-empty { padding: 26px 0 30px; color: var(--faint); font-size: 13px; text-align: center; }
.modal-foot {
  padding: 16px 22px 20px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px; background: #FCFDFE;
}

.note { padding: 14px 0; border-bottom: 1px solid var(--line2); }
.note:last-child { border-bottom: none; }
.note-who { font-size: 13px; font-weight: 600; }
.note-who.bot { color: var(--teal); }
.note-when { font-size: 11.5px; color: var(--faint); margin-left: 8px; }
.note-body { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 4px; white-space: pre-wrap; }

/* --------------------------------------------- event lines in the popup */

.ev { padding: 11px 0; border-bottom: 1px solid var(--line2); }
.ev:last-child { border-bottom: none; }
.ev-head { font-size: 12.5px; color: var(--muted); }
.ev-head b { color: var(--ink); font-weight: 600; }
.ev-via {
  font-size: 10px; letter-spacing: .4px; color: var(--faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; margin-left: 6px;
}
.ev-body {
  font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-top: 5px;
  padding-left: 11px; border-left: 2px solid var(--line);
  white-space: pre-wrap;
}
.ev.in  .ev-head b { color: #A2312A; }
.ev.out .ev-head b { color: var(--teal); }
.ev.sys .ev-head { color: var(--faint); }

.note {
  background: #FBFCFD; border: 1px solid var(--line2); border-radius: 8px;
  padding: 12px 14px; margin: 11px 0;
}

/* --------------------------------------------------- undo on the chips */

.chip { gap: 6px; }
.chip a { display: flex; align-items: center; gap: 8px; }
.chip.muted { background: #FAFBFC; }
.chip.muted b { color: var(--muted); }
.chip.muted span { color: var(--faint); }
.chip-undo { margin: 0; display: flex; }
.chip-undo button {
  border: none; background: none; padding: 2px 3px; margin-left: 2px;
  color: #C0C8D4; cursor: pointer; display: flex; align-items: center;
}
.chip-undo button:hover { color: var(--teal); }

/* ------------------------------------------------------- projects (preview) */

.navtag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px;
  background: var(--lime); color: var(--navy); font-weight: 700;
  padding: 2px 5px; border-radius: 4px; margin-left: 6px; vertical-align: 1px;
}

.preview-note {
  background: #FCFBEC; border: 1px solid #E6E4C4; border-radius: 10px;
  padding: 11px 14px; margin-bottom: 18px; font-size: 12.5px; color: #6B6640;
}
.preview-note b { color: #55512F; }

.btn-refresh {
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--navy); color: #fff; border: 0;
  padding: 9px 16px; border-radius: 8px;
}
.btn-refresh:hover { background: var(--navy2); }

.empty-card { padding: 28px 26px; }
.empty-card p { margin: 0 0 8px; }
.empty-card .muted { color: var(--muted); max-width: 60ch; }

.dot.grey { background: var(--faint); }

/* the table */

.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable thead th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .6px;
  text-transform: uppercase; color: var(--faint);
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.ptable tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable tbody tr:hover { background: #FCFCFD; }

/* A row that needs a person should read as urgent before you parse any number. */
.ptable tr.s-over    { background: #FDF6F5; }
.ptable tr.s-over:hover { background: #FBF0EE; }
.ptable tr.s-stalled { background: #FDF9F3; }
.ptable tr.s-stalled:hover { background: #FBF4EA; }

.c-state { width: 74px; }
.c-name  { min-width: 260px; }
.c-meter { width: 230px; }
.c-month, .c-touch { width: 96px; white-space: nowrap; }
.c-out   { width: 180px; }
.c-lead  { width: 120px; white-space: nowrap; color: var(--muted); }

.pill {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.pill.over       { background: #F7DEDB; color: #8E2B23; }
.pill.close      { background: #F6E5CE; color: #7A4710; }
.pill.stalled    { background: #F6E5CE; color: #7A4710; }
.pill.unbudgeted { background: #E9ECF1; color: #5C6884; }
.pill.ok         { background: #D8EFEA; color: #05604F; }

.pclient { font-weight: 600; }
.pname   { color: var(--muted); margin-top: 1px; }
.ptags   { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.shape {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: #EEF1F5; color: var(--muted);
}
.shape.program, .shape.retainer { background: #E6F0FA; color: #2C5480; }
.code {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: #F2F3F6; color: var(--faint); font-weight: 600;
}
.code.warn { background: #F6E5CE; color: #7A4710; }

/* The meter has to be honest past 100%: the bar fills, then a darker
   overflow block grows beyond it, so "way over" never looks like "just done". */
.meter {
  position: relative; height: 7px; border-radius: 4px;
  background: #EDEFF3; overflow: hidden; display: flex;
}
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--teal); }
.meter.close i { background: var(--amber); }
.meter.over  i { background: var(--red); }
.meter.over  b { display: block; height: 100%; background: #8E2B23; }
.meter.empty { background: repeating-linear-gradient(90deg,#EDEFF3 0 4px,transparent 4px 8px); }

.mnum { margin-top: 6px; font-size: 12px; color: var(--muted); }
.mnum b { color: var(--ink); font-weight: 600; }
.mnum.muted b { color: var(--muted); }
.pct { margin-left: 5px; font-weight: 600; }
.pct.bad { color: var(--red); }

.dash { color: #C2C8D4; }
.quiet { color: var(--amber); font-weight: 600; }

.sub-line { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.sub-line b { color: var(--ink); }
.sub-line span { display: block; font-size: 10.5px; color: var(--faint); }

.board-note {
  margin-top: 20px; padding: 18px 20px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 12.5px; color: var(--muted); max-width: 82ch;
}
.board-note p { margin: 0 0 10px; color: var(--ink); }
.board-note ul { margin: 0; padding-left: 18px; }
.board-note li { margin-bottom: 7px; line-height: 1.55; }
.board-note code {
  background: #F2F3F6; padding: 1px 5px; border-radius: 4px; font-size: 11.5px;
}
.flash.err { background: #F7DEDB; color: #8E2B23; }

@media (max-width: 1100px) {
  .c-out, .c-lead { display: none; }
}
@media (max-width: 760px) {
  .c-month { display: none; }
  .ptable thead th, .ptable tbody td { padding: 10px 9px; }
}

/* --------------------------------- the queue tabs and their search bar
   One bar under the tabs, shared by every queue - see app/views/_queuenav.php.
   Lance: "if we add more it should go under there too", which only stays
   true if the bar belongs to the tabs rather than to a page.

   Lance, on the first cut: "These are crowded and do not look like tabs."
   They were in fact unstyled - the stylesheet was cache-pinned at ?v=3 and
   never reached him - but he was right about the target even so. These are
   bigger, further apart, and the active one is joined to the panel below it
   by a continuous white edge, which is the thing that makes a tab read as a
   tab rather than as a link with a box round it. */
.subtabs {
  display: flex; gap: 2px; margin: 20px 0 0;
  border-bottom: 1px solid var(--line);
}
.subtabs a {
  padding: 11px 22px; font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: none; border: 1px solid transparent; border-bottom: 0;
  border-radius: 10px 10px 0 0; margin-bottom: -1px; line-height: 1.2;
  white-space: nowrap;
}
.subtabs a:hover { color: var(--navy); background: rgba(18,40,76,.04); }
.subtabs a.on {
  color: var(--navy); background: var(--card);
  border-color: var(--line);
  /* The white strip that erases the panel border under the active tab. This
     single line is the whole difference between a tab strip and a row of
     buttons. */
  box-shadow: 0 1px 0 0 var(--card);
}

/* The bar sits on the panel the active tab opens onto, so it reads as part
   of that panel rather than as another row of controls floating above the
   page. */
.queuefind {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 12px 12px;
}
.queuefind input[type=search], .queuefind select {
  height: 42px; padding: 0 13px; font: inherit; font-size: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); box-sizing: border-box;
}
.queuefind input[type=search] { flex: 1 1 340px; min-width: 200px; }
.queuefind input[type=search]::placeholder { color: var(--faint); }
.queuefind input[type=search]:focus, .queuefind select:focus {
  outline: 2px solid var(--navy); outline-offset: -1px;
}
.queuefind select { flex: 0 1 auto; min-width: 150px; max-width: 230px;
                    color: var(--muted); cursor: pointer; }
.queuefind .btn { height: 42px; padding: 0 20px; }
.queueclear { font-size: 13px; color: var(--muted); }
.queuesel { display: contents; }

@media (max-width: 640px) {
  .subtabs a { padding: 11px 14px; font-size: 13.5px; }
  /* Billing grew a fourth tab (Team Pulse, 16 Oct): on a phone the row
     scrolls sideways instead of pushing the whole page wider. */
  .subtabs.billnav { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-top: 1px; }
  .subtabs.billnav::-webkit-scrollbar { display: none; }
  .subtabs.billnav a { padding: 10px 11px; font-size: 13px; }
  /* The box keeps the row to itself; the dropdowns share the next one.
     A 42px control is the minimum that can be hit reliably with a thumb. */
  .queuefind input[type=search] { flex: 1 1 100%; }
  .queuefind select { flex: 1 1 calc(50% - 5px); max-width: none; }
  .queuefind .btn { flex: 1 1 100%; }
}
