/* jobs.binx.ca — design tokens + app shell (build_spec §1)
 *
 * Identity adopted from ZenMaid (teal chrome, mint page, white cards) but
 * tightened: smaller type scale, hairline dividers, compact rows, slim badges.
 * Layered on top of Bootstrap 5.3. Anti-patterns to avoid: oversized stat
 * tiles, big-number heroes, thick coloured bands, chunky bubble pills.
 */

:root {
  /* Brand */
  --teal-900: #1F6B6B;   /* top bar / dark chrome */
  --teal-700: #178a8a;
  --teal-600: #159A9A;   /* primary action buttons */
  --teal-600-rgb: 21,154,154;
  --mint-50:  #EAF6F4;   /* page background */
  --mint-100: #def0ed;

  /* Surfaces */
  --card:        #FFFFFF;
  --card-radius: 10px;
  --hairline:    #e4ecec;
  --border:      #dbe6e5;
  --shadow-sm:   0 1px 2px rgba(31,107,107,.06), 0 1px 3px rgba(31,107,107,.04);

  /* Text */
  --ink:        #1f2a2a;
  --ink-soft:   #51635f;
  --ink-faint:  #849793;
  --ink-mute:   #8a9a98;

  /* Status dots (build_spec §1) */
  --st-amber: #e0922b;   /* one-time customer */
  --st-red:   #d2495f;   /* former customer */
  --st-blue:  #3b82c4;   /* lead */
  --st-green: #2fa36b;   /* active */

  /* Money */
  --money-good: #2fa36b;
  --money-bad:  #d2495f;

  /* Type scale — deliberately small/dense. Dropped one step 2026-08-05
     (Vanessa: "make the font 1 size smaller … so everything fits better on the
     page"). Changed here rather than per-component so the whole app steps down
     together; 10px is the floor, below that the calendar cards stop being
     readable at arm's length. */
  --fs-xs: 10px;
  --fs-sm: 11px;
  --fs-base: 12px;
  --fs-md: 13px;
  --fs-lg: 15px;
  --fs-xl: 18px;

  /* Spacing */
  --rail-w: 90px;
  --topbar-h: 52px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--mint-50);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.45;
}

a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App shell ─────────────────────────────────────────────────────────── */
.app-shell { min-height: 100vh; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--teal-900); color: #eafffb;
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-4); z-index: 1030;
}
.topbar .brand { font-weight: 600; font-size: var(--fs-lg); letter-spacing: .2px; color: #fff; white-space: nowrap; }
.topbar .brand small { color: #bfe7e2; font-weight: 400; font-size: var(--fs-sm); }
.topbar .global-search { flex: 1; max-width: 620px; margin: 0 auto; }
.topbar .global-search input {
  width: 100%; height: 34px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.14); color: #fff; padding: 0 12px; font-size: var(--fs-md);
}
.topbar .global-search input::placeholder { color: #cdeae6; }
.topbar .topbar-right { display: flex; align-items: center; gap: var(--space-3); }
.topbar .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--teal-600);
  color: #fff; display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 600;
}

.rail {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--rail-w);
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: var(--space-2) 0; z-index: 1020;
  overflow-y: auto;
}
.rail a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; color: var(--ink-soft); font-size: var(--fs-xs); text-align: center;
  text-decoration: none; border-left: 3px solid transparent;
}
.rail a svg { width: 20px; height: 20px; stroke-width: 1.6; }
.rail a:hover { background: var(--mint-50); text-decoration: none; }
.rail a.active { color: var(--teal-700); border-left-color: var(--teal-600); background: var(--mint-50); font-weight: 600; }

.main {
  margin-left: var(--rail-w); padding: calc(var(--topbar-h) + var(--space-4)) var(--space-5) var(--space-5);
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card-q {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--card-radius); box-shadow: var(--shadow-sm);
}
.card-q .card-q-head {
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between;
}
.card-q .card-q-head h2 { font-size: var(--fs-md); font-weight: 600; margin: 0; color: var(--ink); }
.card-q .card-q-body { padding: var(--space-3) var(--space-4); }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.page-head h1 { font-size: var(--fs-xl); font-weight: 600; margin: 0; }

/* ── Stat (quiet, not hero) ────────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: var(--space-3); }
.stat {
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--card-radius);
  padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-sm);
}
.stat .stat-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .6px; color: var(--ink-mute); }
.stat .stat-value { font-size: var(--fs-xl); font-weight: 600; color: var(--ink); margin-top: 2px; }
.stat .stat-note { font-size: var(--fs-sm); color: var(--ink-mute); }

/* ── Tables (hairline, compact) ────────────────────────────────────────── */
table.tbl-q { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
table.tbl-q thead th {
  text-align: left; font-weight: 600; color: var(--ink-soft); font-size: var(--fs-sm);
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl-q tbody td { padding: 7px 10px; border-bottom: 1px solid var(--hairline); }
table.tbl-q tbody tr:hover { background: var(--mint-50); }

/* ── Status dots & slim badges ─────────────────────────────────────────── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.dot.amber { background: var(--st-amber); }
.dot.red   { background: var(--st-red); }
.dot.blue  { background: var(--st-blue); }
.dot.green { background: var(--st-green); }

.badge-q {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.6;
  background: var(--mint-100); color: var(--teal-700);
}
.badge-q.muted { background: #eef1f1; color: var(--ink-mute); }

.money-good { color: var(--money-good); font-weight: 600; }
.money-bad  { color: var(--money-bad); font-weight: 600; }

/* Crew identity chips */
.crew-chip {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 10px; font-weight: 700; color: #fff; margin-left: -4px; border: 1.5px solid #fff;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn-q {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: 8px; border: 1px solid transparent; font-size: var(--fs-md); font-weight: 600;
  cursor: pointer; background: var(--teal-600); color: #fff;
}
.btn-q:hover { background: var(--teal-700); color: #fff; text-decoration: none; }
.btn-q.ghost { background: #fff; color: var(--teal-700); border-color: var(--border); }
.btn-q.ghost:hover { background: var(--mint-50); }

/* ── Auth ──────────────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--mint-50); }
.auth-card { width: 360px; background: #fff; border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 28px; }
.auth-card h1 { font-size: var(--fs-xl); margin: 0 0 4px; }
.auth-card .sub { color: var(--ink-mute); font-size: var(--fs-sm); margin-bottom: 18px; }
.auth-card label { font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 600; }
.auth-card input[type=email], .auth-card input[type=password] {
  width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px;
  margin: 4px 0 14px; font-size: var(--fs-md);
}
.alert-q { background: #fdecef; color: #a02a3d; border: 1px solid #f5c6cf; border-radius: 8px; padding: 9px 12px; font-size: var(--fs-sm); margin-bottom: 14px; }

/* Empty states direct the user to act */
.empty { text-align: center; color: var(--ink-mute); padding: 32px 16px; }
.empty p { margin: 6px 0 14px; }

/* ── Contact profile (mirrors ZenMaid, tightened) ──────────────────────── */
.profile-head { display: flex; gap: var(--space-4); padding: var(--space-4); align-items: flex-start; }
.profile-avatar {
  flex: none; width: 60px; height: 60px; border-radius: 50%;
  background: var(--mint-100); color: var(--teal-700);
  display: grid; place-items: center; font-size: var(--fs-xl); font-weight: 700;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.profile-id { flex: 1; min-width: 0; }
.profile-id h1 { font-size: var(--fs-xl); font-weight: 600; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-lines { display: flex; flex-direction: column; gap: 3px; }
.profile-line { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: var(--fs-md); }
.profile-line svg { width: 15px; height: 15px; flex: none; stroke: var(--ink-mute); }
/* Icons step down with the type scale (Vanessa, 2026-08-05) — an icon that
   stays put while the text shrinks starts to shout. */
svg.pico { width: 14px; height: 14px; flex: none; }
.stat-label svg.pico { width: 11px; height: 11px; vertical-align: -1px; }
.sec-icon svg.pico, .profile-line svg.pico { width: 13px; height: 13px; }
.profile-actions { flex: none; display: flex; gap: 8px; align-self: flex-start; }

/* Two-up detail cards with a coloured section icon */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 720px) { .detail-grid { grid-template-columns: 1fr; } }
.sec-head { display: flex; align-items: center; gap: 10px; }
.sec-icon { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--mint-100); color: var(--teal-700); display: grid; place-items: center; }
.sec-icon svg { width: 17px; height: 17px; }
.field-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .6px; color: var(--ink-mute); margin-bottom: 2px; }
.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: var(--space-4); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 1px; }

@media (max-width: 720px) {
  :root { --rail-w: 64px; }
  .topbar .brand small { display: none; }
}

/* ── Unread-SMS badge on the Messages rail item (pulses for attention) ───── */
.rail a { position: relative; }
.nav-badge {
  position: absolute; top: 4px; right: calc(50% - 22px);
  background: #e25555; color: #fff; border-radius: 10px;
  font-size: 10px; font-weight: 700; line-height: 16px;
  min-width: 16px; height: 16px; padding: 0 4px; text-align: center;
  animation: nav-badge-pulse 1.8s ease-in-out infinite;
}
@keyframes nav-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 85, 85, .55); }
  50%      { box-shadow: 0 0 0 7px rgba(226, 85, 85, 0); }
}

/* "Needs detail" count. Amber and still, not red and pulsing: an unread text
   is someone waiting on a reply, whereas a missing phone number has been
   missing for months and does not need to flash at anyone all day. */
.nav-badge-warn {
  background: #c07a1a;
  animation: none;
}
