/* Sally — design tokens & layout, in HABI Controls brand colors */
:root {
  color-scheme: light;
  --page: #FAF7F1;
  --surface: #FFFFFF;
  --ink: #241C14;
  --ink-2: #6b5d4f;
  --muted: #9a8d7c;
  --grid: #EFE7D6;
  --baseline: #E0D2B2;
  --border: rgba(36, 28, 20, 0.10);
  --series-1: #F4A259;   /* HABI Default (orange) */
  --series-2: #F7C436;   /* HABI Accent (yellow-gold) */
  --series-1-track: #FBE3C7;
  --good: #2F9E52;
  --good-text: #1f7a3d;
  --critical: #EC221F;
  --accent: #F4A259;
  --accent-strong: #DB8A3E;
  --badge-contacted-text: #7a5c00;
  --badge-proposal-text: #8a4b0f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(36,28,20,.05), 0 4px 14px rgba(36,28,20,.06);
}
/* Theme: data-theme on <html> — "auto" (default, follows the system), "light", "dark" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #17130e;
    --surface: #211b14;
    --ink: #f7f1e6;
    --ink-2: #cbb99f;
    --muted: #93856f;
    --grid: #33291d;
    --baseline: #443626;
    --border: rgba(255,255,255,0.10);
    --series-1: #F4A259;
    --series-2: #F7C436;
    --series-1-track: #4a3722;
    --good: #38b464;
    --good-text: #4fce7a;
    --critical: #ff6157;
    --accent: #F4A259;
    --accent-strong: #f7b877;
    --badge-contacted-text: #ffe58f;
    --badge-proposal-text: #ffcf9e;
    --shadow: none;
  }
  :root:not([data-theme="light"]) body {
    /* a faint warm glow at the top so the page feels lit, not black */
    background:
      radial-gradient(1100px 540px at 78% -12%, color-mix(in srgb, var(--accent) 10%, transparent), transparent),
      radial-gradient(800px 400px at 4% 112%, color-mix(in srgb, var(--accent) 5%, transparent), transparent),
      var(--page);
    background-attachment: fixed;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #17130e;
  --surface: #211b14;
  --ink: #f7f1e6;
  --ink-2: #cbb99f;
  --muted: #93856f;
  --grid: #33291d;
  --baseline: #443626;
  --border: rgba(255,255,255,0.10);
  --series-1: #F4A259;
  --series-2: #F7C436;
  --series-1-track: #4a3722;
  --good: #38b464;
  --good-text: #4fce7a;
  --critical: #ff6157;
  --accent: #F4A259;
  --accent-strong: #f7b877;
  --badge-contacted-text: #ffe58f;
  --badge-proposal-text: #ffcf9e;
  --shadow: none;
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 540px at 78% -12%, color-mix(in srgb, var(--accent) 10%, transparent), transparent),
    radial-gradient(800px 400px at 4% 112%, color-mix(in srgb, var(--accent) 5%, transparent), transparent),
    var(--page);
  background-attachment: fixed;
}

* { box-sizing: border-box; }

/* ---------- brand scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; } /* Firefox */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-strong); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }

/* ---------- shell ---------- */
/* Flex column so the footer always sits at the true bottom of the page —
   pushed down by main's flex:1 when a view is short, and simply following
   the normal document flow (scrolling with the page) when a view is tall. */
.shell { display: none; min-height: 100vh; }
.shell.visible { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 28px; height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand-dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--series-1), var(--accent-strong));
  display: inline-flex; align-items: center; justify-content: center;
  color: #33281f; font-size: 13px; font-weight: 800;
}
nav.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  background: none; border: 0; padding: 8px 14px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; white-space: nowrap;
}
nav.tabs button:hover { background: var(--page); color: var(--ink); }
nav.tabs button.active { background: var(--page); color: var(--ink); font-weight: 650; }
.topbar .who { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 13.5px; }

/* ---------- global search ---------- */
.global-search { position: relative; width: 210px; flex-shrink: 0; }
.global-search input {
  width: 100%; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--grid); background: var(--page); font-size: 13px; color: var(--ink);
}
.global-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent);
}
.gs-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); max-height: 60vh; overflow-y: auto; padding: 6px;
}
.gs-results.visible { display: block; }
.gs-group-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px 2px; }
.gs-row { display: block; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink); }
.gs-row:hover { background: var(--page); }
.gs-row .sub { color: var(--muted); font-size: 11.5px; }
.gs-empty { padding: 10px; color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .global-search { display: none; } }

/* ---------- searchable project combo (New/Edit task modal) ---------- */
.proj-combo { position: relative; }
.static-field {
  padding: 9px 11px; border-radius: 9px; border: 1px solid var(--grid);
  background: var(--page); color: var(--ink-2); font-size: 15px;
}

/* ---------- settings ---------- */
#btn-settings { color: var(--accent-strong); font-weight: 650; }
#btn-settings:hover { color: var(--accent-strong); background: var(--page); border-color: var(--baseline); }

main { max-width: 1220px; margin: 0 auto; padding: 28px; width: 100%; flex: 1 0 auto; }
.view { display: none; }
.view.visible { display: block; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
h2 { font-size: 15px; font-weight: 650; margin: 0 0 14px; }

/* ---------- cards & grid ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.dash { grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 900px) { .grid.two, .grid.dash { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }

/* ---------- stat tiles ---------- */
.tile .label { color: var(--ink-2); font-size: 13px; margin-bottom: 6px; }
.tile .value { font-size: 30px; font-weight: 650; letter-spacing: -0.01em; }
.tile .hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  border-radius: 10px; padding: 10px 20px; font-weight: 650;
  background: var(--page); color: var(--ink); border: 1px solid var(--grid);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1.2; cursor: pointer;
}
.btn:hover { border-color: var(--baseline); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.small { padding: 5px 10px; font-size: 12.5px; font-weight: 550; }
.btn.ghost { background: none; border: 1px solid var(--grid); color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); }
/* Native <select> dropdowns (e.g. the stage/fulfillment quick-pickers on the
   customer detail view) fall back to the browser's own popup-list colors
   unless the select itself has an explicit background+text color — with
   `.btn.ghost`'s `background: none` that popup list was rendering pale
   text on the OS's default (light) background in dark mode. Setting both
   explicitly here fixes contrast in both themes. */
select.btn.ghost { background-color: var(--surface); color: var(--ink); }
select.btn.ghost option { background-color: var(--surface); color: var(--ink); }
.btn.danger-ghost { background: none; border: 1px solid var(--grid); color: var(--critical); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; color: var(--muted); font-weight: 550; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 8px 10px; border-bottom: 1px solid var(--grid);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
td { padding: 9px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--baseline); }
/* Scrolls vertically once the list outgrows a comfortable viewport height,
   instead of pushing the footer far off-screen; header row stays pinned
   via the sticky `th` rule above. */
.table-scroll { overflow-x: auto; overflow-y: auto; max-height: 64vh; }
#view-history .table-scroll { padding-right: 14px; }
/* Dashboard "Recent activity" widget — scrolls in place instead of growing
   the card (and the page) without bound as more activity is logged. */
#recent-activity { max-height: 380px; overflow-y: auto; padding-right: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--page); }

/* ---------- badges / avatars ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em; white-space: nowrap;
}
.badge.role-admin { background: color-mix(in srgb, var(--series-1) 18%, var(--surface)); color: var(--accent-strong); }
.badge.role-product_owner { background: color-mix(in srgb, var(--series-2) 22%, var(--surface)); color: var(--badge-contacted-text); }
.badge.role-sales { background: var(--page); color: var(--ink-2); border: 1px solid var(--grid); }
.badge.member { background: var(--page); color: var(--ink-2); border: 1px solid var(--grid); }
.badge.archived, .badge.off { background: var(--page); color: var(--muted); border: 1px solid var(--grid); }
.badge.stage-lead { background: var(--page); color: var(--ink-2); border: 1px solid var(--grid); }
.badge.stage-contacted { background: color-mix(in srgb, var(--series-2) 22%, var(--surface)); color: var(--badge-contacted-text); }
.badge.stage-qualified { background: color-mix(in srgb, var(--series-1) 20%, var(--surface)); color: var(--accent-strong); }
.badge.stage-proposal { background: color-mix(in srgb, var(--series-1) 38%, var(--surface)); color: var(--badge-proposal-text); }
.badge.stage-won { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--good-text); }
.badge.stage-lost { background: color-mix(in srgb, var(--critical) 12%, var(--surface)); color: var(--critical); }
.badge.overdue { background: color-mix(in srgb, var(--critical) 14%, var(--surface)); color: var(--critical); }
.badge.delivery-pending { background: var(--page); color: var(--ink-2); border: 1px solid var(--grid); }
.badge.delivery-started { background: color-mix(in srgb, var(--series-1) 20%, var(--surface)); color: var(--accent-strong); }
.badge.delivery-partial { background: color-mix(in srgb, var(--series-2) 22%, var(--surface)); color: var(--badge-contacted-text); }
.badge.delivery-full { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--good-text); }
.badge.invoice-not_invoiced { background: var(--page); color: var(--ink-2); border: 1px solid var(--grid); }
.badge.invoice-partial { background: color-mix(in srgb, var(--series-2) 22%, var(--surface)); color: var(--badge-contacted-text); }
.badge.invoice-full { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--good-text); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: color-mix(in srgb, var(--series-1) 20%, var(--surface));
  color: var(--accent-strong); font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.person { display: flex; align-items: center; gap: 10px; }

/* ---------- charts ---------- */
.hbar-row { display: grid; grid-template-columns: 130px 1fr 70px; align-items: center; gap: 10px; padding: 5px 0; }
.hbar-row .name { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 14px; border-radius: 4px; background: none; position: relative; }
.hbar-fill {
  height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1);
  min-width: 2px; transition: width .35s ease;
}
.hbar-row .val { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.viz-tip {
  position: fixed; z-index: 50; pointer-events: none; display: none;
  background: var(--ink); color: var(--page);
  padding: 6px 10px; border-radius: 8px; font-size: 12.5px;
}

/* ---------- funnel chart (Pipeline view) ---------- */
.funnel { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 4px; }
.funnel-row { width: 100%; display: flex; justify-content: flex-start; }
.funnel-bar {
  height: 42px; border-radius: 9px; color: #fff; font-weight: 650; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 18px; min-width: 220px; max-width: 100%;
  transition: width .35s ease; cursor: default;
}
.funnel-bar .fb-count { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.funnel-bar.stage-lead { background: var(--muted); }
.funnel-bar.stage-contacted { background: var(--series-2); color: #3a2c00; }
.funnel-bar.stage-qualified { background: var(--series-1); }
.funnel-bar.stage-proposal { background: var(--accent-strong); }
.funnel-bar.stage-won { background: var(--good); }
.funnel-bar.stage-lost { background: var(--critical); }

/* ---------- overview tab (bars + tiles) ---------- */
.ov-bar-row { display: grid; grid-template-columns: 110px 1fr 120px; align-items: center; gap: 10px; padding: 6px 0; }
.ov-bar-row .name { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ov-bar-track { height: 16px; border-radius: 5px; background: var(--page); position: relative; overflow: hidden; }
.ov-bar-fill { height: 100%; border-radius: 5px; min-width: 2px; transition: width .35s ease; }
.ov-bar-row .val { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ov-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.ov-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.ov-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ---------- forms & modal ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--grid); background: var(--surface);
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal-back {
  display: none; position: fixed; inset: 0; background: rgba(36,28,20,.45);
  z-index: 40; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
.modal-back.visible { display: flex; }
.modal {
  background: var(--surface); border-radius: 14px; border: 1px solid var(--border);
  width: 100%; max-width: 520px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal.wide { max-width: 680px; }
.modal h2 { margin-bottom: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.error-text { color: var(--critical); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------- theme toggle (segmented control) ---------- */
.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--grid);
  border-radius: 10px; padding: 3px; gap: 2px;
}
.seg button {
  border: 0; background: none; padding: 6px 14px; border-radius: 8px;
  color: var(--ink-2); font-weight: 550; font-size: 13.5px;
}
.seg button.active { background: var(--accent); color: #fff; font-weight: 650; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: none; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 500px at 80% -10%, color-mix(in srgb, var(--series-1) 20%, transparent), transparent),
    var(--page);
  padding: 20px;
}
.login-wrap.visible { display: flex; }
.login-card { width: 100%; max-width: 380px; padding: 34px 32px; }
.login-card .brand { justify-content: center; margin-bottom: 6px; font-size: 19px; }
.login-card .sub { text-align: center; }

/* ---------- toolbar rows ---------- */
.toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field { margin: 0; }
.toolbar .spacer { flex: 1; }
/* Pins the History date-range inputs and its Apply button to one identical
   height, regardless of browser-native date-picker chrome. */
#hist-from, #hist-to, #hist-apply { height: 40px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- customer detail ---------- */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-title { font-size: 19px; font-weight: 700; margin: 0 0 2px; }
.detail-sub { color: var(--muted); font-size: 13.5px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 18px 0; }
.detail-field .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.detail-field .v { font-size: 14px; }
.detail-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--grid); margin: 18px 0 16px; }
.detail-tabs button { background: none; border: 0; padding: 8px 4px; margin-right: 14px; color: var(--ink-2); font-weight: 550; border-bottom: 2px solid transparent; }
.detail-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.activity-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.activity-row:last-child { border-bottom: 0; }
#activity-list-body, #task-list-body { max-height: 340px; overflow-y: auto; padding-right: 6px; }
#contacts-list-body, #projects-list-body { max-height: 420px; overflow-y: auto; padding-right: 6px; }
.contact-pick-list { max-height: 220px; width: 100%; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; }
.contact-pick-row {
  display: grid; grid-template-columns: 14px 1fr 60px; align-items: center; gap: 6px;
  width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden;
  padding: 6px 2px; border-bottom: 1px solid var(--grid);
}
.contact-pick-row:last-child { border-bottom: 0; }
.contact-pick-row input[type="checkbox"] { width: 13px; height: 13px; margin: 0; accent-color: var(--accent); }
.contact-pick-row .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.contact-pick-row .name .muted { font-weight: 400; font-size: 12px; }
.contact-pick-row .primary-pick { display: flex; align-items: center; gap: 3px; margin: 0; white-space: nowrap; overflow: hidden; font-size: 11px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.contact-pick-row .primary-pick input[type="radio"] { width: 12px; height: 12px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.activity-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: color-mix(in srgb, var(--series-1) 16%, var(--surface));
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.activity-body { flex: 1; }
.activity-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.task-row:last-child { border-bottom: 0; }
.task-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.task-row .task-title { flex: 1; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }

/* ---------- pipeline (kanban) ---------- */
/* No minimum column width, so all 6 columns always shrink to fit the
   available width instead of forcing a horizontal scrollbar — falls back
   to fewer columns per row (with the board growing vertically instead) on
   narrower viewports. */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 980px) {
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pipe-col { background: var(--page); border-radius: var(--radius); padding: 12px; min-height: 220px; }
.pipe-col.dragover { background: color-mix(in srgb, var(--series-1) 12%, var(--page)); }
.pipe-col-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; padding: 0 2px; }
/* A busy Lead/Contacted column can pile up dozens of cards — cap each
   column's own height and let it scroll internally instead of stretching
   the whole board (and page) to fit the longest one. */
.pipe-cards { max-height: 65vh; overflow-y: auto; padding-right: 4px; }
.pipe-col-head .name { font-weight: 650; font-size: 13px; }
.pipe-col-head .count { color: var(--muted); font-size: 12px; }
.pipe-col-value { color: var(--muted); font-size: 11.5px; margin: -6px 2px 10px; }
.pipe-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow);
}
.pipe-card:active { cursor: grabbing; }
.pipe-card .co { font-weight: 650; font-size: 13.5px; }
.pipe-card .contact { color: var(--ink-2); font-size: 12.5px; margin-top: 1px; }
.pipe-card .value { color: var(--accent-strong); font-weight: 650; font-size: 12.5px; margin-top: 6px; }
.pipe-card .pipe-move {
  width: 100%; margin-top: 8px; padding: 5px 7px; font-size: 12px; border-radius: 7px;
  border: 1px solid var(--grid); background: var(--surface); color: var(--ink-2);
}

/* ---------- settings modal footer & about panel ---------- */
.settings-foot {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--grid);
  color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; justify-content: center; text-align: center;
}
.settings-foot a { color: var(--accent-strong); text-decoration: none; }
.settings-foot a:hover { text-decoration: underline; }
.settings-foot .dotsep { opacity: .6; }

.about-box {
  display: grid; grid-template-columns: 84px 1fr;
  row-gap: 7px; column-gap: 14px;
  font-size: 12.5px; line-height: 1.45; align-items: baseline;
}
.about-box .ab-l { color: var(--muted); font-weight: 600; }
.about-box .ab-v { color: var(--ink-2); }
.about-box strong { color: var(--ink); }
.about-box a { color: var(--accent-strong); text-decoration: none; }
.about-box a:hover { text-decoration: underline; }

/* ---------- app footer ---------- */
.app-foot {
  padding: 16px 28px 22px; margin-top: 8px;
  border-top: 1px solid var(--grid);
  color: var(--muted); font-size: 12.5px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center;
  text-align: center; flex-shrink: 0;
}
.app-foot a { color: var(--accent-strong); text-decoration: none; }
.app-foot a:hover { text-decoration: underline; }
.app-foot .dotsep { opacity: .6; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--page); padding: 10px 18px;
  border-radius: 10px; font-size: 13.5px; z-index: 60; display: none;
}
