/* Quintaum CRM & Commercial Hub — built on the Quintaum design tokens
   (navy #000078 anchors everything; Montserrat throughout). */
:root {
  --navy: #000078;
  --navy-deep: #000050;
  --blue: #0050fa;
  --blue-dark: #0038d0;
  --ink: #13131b;
  --body: #2c2d36;
  --muted: #6b7085;
  --faint: #9aa0b2;
  --tint: #eef2fe;
  --tint-2: #f6f8ff;
  --tintborder: #d6ddf7;
  --line: #e6e8ef;
  --line-soft: #f0f2f6;
  --field: #d9dce6;
  --paper: #ffffff;
  --backdrop: #f4f6fb;
  --teal: #0a6f61;
  --teal-tint: #e3f3f0;
  --late: #c0271f;
  --late-tint: #fdecea;
  --amber: #9a5b00;
  --amber-tint: #fff3dc;
  --violet: #5b3aa8;
  --violet-tint: #f3eefc;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 64, .04), 0 6px 20px rgba(16, 24, 64, .045);
  --shadow-pop: 0 14px 44px rgba(16, 24, 64, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Montserrat, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  background: var(--backdrop);
  -webkit-font-smoothing: antialiased;
}
a:where(:not(.ev *)) { color: var(--navy); text-decoration: none; }
a:hover { color: var(--blue); }
h1:where(:not(.ev *)), h2:where(:not(.ev *)), h3:where(:not(.ev *)) { color: var(--ink); margin: 0; line-height: 1.2; }
p:where(:not(.ev *)) { margin: 0 0 .6em; }
code { font-size: 12px; background: var(--tint); padding: 1px 5px; border-radius: 4px; }
em { font-style: normal; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; color: var(--ink); }
.pre { white-space: pre-wrap; }
.clip { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; padding: 22px 14px 16px;
  background: radial-gradient(120% 60% at 0% 0%, #0a0a8c 0%, transparent 60%), linear-gradient(170deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #cbd7ff;
}
.brand { display: block; padding: 4px 10px 20px; }
.brand img { width: 144px; display: block; }
.brand-sub { display: block; margin-top: 7px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #9fb4ff; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  color: #c3cfff; font-weight: 500; font-size: 13.5px; position: relative; transition: background .12s, color .12s;
}
.nav-item .i { width: 18px; height: 18px; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.nav-item.active .i { opacity: 1; }
.nav-item.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #6b97ff; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #ff5a4f; color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 19px; }
.nav-badge.soft { background: rgba(255, 255, 255, .18); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }
.who { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 4px 6px; }
.who-text { display: flex; flex-direction: column; line-height: 1.25; }
.who-text strong { color: #fff; font-size: 13px; }
.who-text small { color: #9fb4ff; font-size: 11.5px; }
.who select { grid-column: 1 / -1; margin-top: 4px; background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .18); border-radius: 7px; padding: 5px 8px; font: inherit; font-size: 12px; }
.who select option { color: var(--ink); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 32px; background: rgba(244, 246, 251, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 620px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; box-shadow: 0 1px 2px rgba(16, 24, 64, .03); }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 80, 250, .12); }
.search .i { color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; padding: 10px 0; font: inherit; outline: none; min-width: 0; box-shadow: none; }
.search input:focus { box-shadow: none; }
.search kbd { font: 600 11px Montserrat, sans-serif; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--backdrop); }
.search-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; max-height: 70vh; overflow: auto; }
.search-pop h4 { margin: 8px 10px 4px; font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.search-pop a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; color: var(--ink); }
.search-pop a span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-pop a:hover, .search-pop a.sel { background: var(--tint); }
.search-pop .all { justify-content: center; color: var(--blue); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }

.add-wrap { position: relative; margin-left: auto; }
.add-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; min-width: 210px; z-index: 30; }
.add-menu button, .add-menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.add-menu button:hover, .add-menu a:hover { background: var(--tint); color: var(--ink); }
.add-menu .i { color: var(--blue); }

.content { padding: 28px 32px 72px; max-width: 1440px; width: 100%; }
.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: var(--tint); border: 1px solid var(--tintborder); color: var(--navy); }

/* Toast after every change */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 10px; max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 500; box-shadow: 0 16px 40px rgba(0, 0, 60, .3);
  animation: toast-in .25s ease-out; transition: opacity .4s, transform .4s;
}
.toast .i { color: #8fb0ff; stroke-width: 2.6; }
.toast.error { background: #8e1c16; }
.toast.error .i { color: #ffc2bd; }
.toast.hide { opacity: 0; transform: translateY(8px); pointer-events: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ── Buttons & forms ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--field); background: #fff; color: var(--navy); font: 600 13px Montserrat, sans-serif; cursor: pointer; white-space: nowrap;
  transition: border-color .12s, background .12s, color .12s, filter .12s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); color: #fff; border-color: transparent; box-shadow: 0 1px 2px rgba(0, 56, 208, .3); }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--tint); }
.btn.white { background: #fff; color: var(--navy); border-color: #fff; }
.btn.white:hover { background: var(--tint); color: var(--navy); }
.btn.ghost-white { background: transparent; color: #cbd7ff; border-color: rgba(255, 255, 255, .25); }
.btn.ghost-white:hover { color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn.soft { background: var(--tint); border-color: var(--tintborder); color: var(--navy); }
.btn.soft:hover { background: #e3e9fd; color: var(--blue); }
.task-actions .btn { background: var(--tint-2); border-color: var(--tintborder); }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.big { padding: 11px 20px; font-size: 14px; }
.btn .i { width: 15px; height: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--tint); color: var(--navy); }
button:where(:not(.ev *)):disabled { cursor: default; opacity: .6; }
form.inline { display: inline; }

input:where(:not(.ev *)), select:where(:not(.ev *)), textarea:where(:not(.ev *)) {
  font: inherit; font-size: 13.5px; color: var(--ink); border: 1px solid var(--field); border-radius: 8px; padding: 7px 10px; background: #fff; min-width: 0;
}
input:where(:not(.ev *))::placeholder, textarea:where(:not(.ev *))::placeholder { color: #a6abbb; }
input:where(:not(.ev *)):focus, select:where(:not(.ev *)):focus, textarea:where(:not(.ev *)):focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 80, 250, .12); }
input.picker { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0b2' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat right 10px center / 14px; padding-right: 30px; }
textarea:where(:not(.ev *)) { resize: vertical; width: 100%; }
label:where(:not(.ev *)) { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
label.dim { opacity: .45; }
.opt { font-weight: 500; color: var(--faint); text-transform: none; letter-spacing: 0; }
fieldset:where(:not(.ev *)) { border: 0; padding: 0; margin: 0; }
legend:where(:not(.ev *)) { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid input:not([type=checkbox]):not([type=radio]), .form-grid select { width: 100%; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.row2, .row3 { display: grid; gap: 12px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
.row2 input, .row3 input, .row2 select, .row3 select { width: 100%; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inline-form label { flex-direction: row; align-items: center; gap: 8px; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.chips-field { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-field legend { width: 100%; }
.chip-check { flex-direction: row; cursor: pointer; position: relative; }
.chip-check input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chip-check span { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--field); font-weight: 500; color: var(--body); font-size: 12.5px; background: #fff; transition: .12s; }
.chip-check span:hover { border-color: var(--blue); }
.chip-check input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 80, 250, .25); }
.chip-input { width: 130px; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg label { flex-direction: row; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--field); color: var(--body); font-weight: 500; font-size: 12.5px; background: #fff; }
.seg input:checked + span { background: var(--tint); border-color: var(--blue); color: var(--navy); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 80, 250, .25); }
.seg.small span { padding: 3px 9px; font-size: 12px; }

/* ── Page structure ────────────────────────────────────────────────── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; position: relative; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kicker { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--blue); font-weight: 700; margin-bottom: 6px; }
.kicker a { color: var(--blue); }
h1:where(:not(.ev *)) { font-size: 27px; font-weight: 800; letter-spacing: -.3px; }
.sub { color: var(--muted); margin: 7px 0 0; max-width: 780px; }
.sub strong { color: var(--ink); }
.lead { color: var(--body); max-width: 820px; margin-bottom: 18px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; scroll-margin-top: 80px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 22px 0; }
.card-head h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 14px 22px 20px; }
.card-link { font-size: 12.5px; font-weight: 600; }
.card.warn { border-color: #f1c38b; box-shadow: 0 0 0 3px var(--amber-tint); }
.muted-card { opacity: .85; }
.count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--tint); color: var(--navy); font-size: 11.5px; font-weight: 700; text-align: center; line-height: 20px; }
.count.late { background: var(--late-tint); color: var(--late); }
.count.today { background: var(--blue); color: #fff; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid-home { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
.grid-order { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
.col { min-width: 0; }

.empty { color: var(--muted); padding: 12px 0; font-size: 13.5px; }
.empty > div { margin-top: 10px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.toolbar .filter { margin-left: auto; min-width: 220px; }
.seg-links { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-links a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.seg-links a:hover { color: var(--navy); }
.seg-links a.active { background: var(--navy); color: #fff; }
.seg-links.wrap { margin-bottom: 14px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 20px; overflow-x: auto;  overflow-y: hidden; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--navy); }
.tabs a.active { color: var(--navy); border-bottom-color: var(--blue); }

/* ── Stats ─────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats.small { gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; }
a.stat:hover { border-color: var(--tintborder); background: #fbfcff; color: inherit; }
.stat-label { font-size: 10.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.15; }
.stats.small .stat-value { font-size: 20px; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat.alert { border-color: #f3b8b3; background: linear-gradient(180deg, #fff, #fff7f6); }
.stat.alert .stat-value { color: var(--late); }

/* ── Chips ─────────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--tint); color: var(--navy); margin-right: 4px; white-space: nowrap; line-height: 1.6; }
.chip.tiny { font-size: 10.5px; padding: 0 7px; }
.chip.plain { background: #f1f2f6; color: var(--body); font-weight: 500; }
.chip.now { background: var(--blue); color: #fff; letter-spacing: .5px; text-transform: uppercase; }
.role-partner { background: var(--navy); color: #fff; }
.role-direct_client, .role-end_client { background: var(--tint); color: var(--navy); }
.role-prospect { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1px var(--tintborder); }
.role-research { background: var(--teal-tint); color: var(--teal); }
.role-internal, .role-other { background: #f1f2f6; color: var(--muted); }
.status-dormant, .status-archived { background: #f1f2f6; color: var(--muted); }
.status-warm { background: var(--amber-tint); color: var(--amber); }
.status-prospect { background: #fff; box-shadow: inset 0 0 0 1px var(--tintborder); }
.ostatus-received, .ostatus-confirmed, .ostatus-setup { background: #f1f2f6; color: var(--body); }
.ostatus-scheduled { background: var(--tint); color: var(--navy); }
.ostatus-live { background: var(--blue); color: #fff; }
.ostatus-reporting { background: #dfe6ff; color: var(--navy); }
.ostatus-completed { background: var(--teal-tint); color: var(--teal); }
.ostatus-on_hold { background: var(--amber-tint); color: var(--amber); }
.ostatus-cancelled { background: #f1f2f6; color: var(--muted); text-decoration: line-through; }
.pay-paid { background: var(--teal-tint); color: var(--teal); }
.pay-invoiced { background: var(--tint); color: var(--navy); }
.pay-ready { background: #fff; color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.pay-partially_paid { background: var(--amber-tint); color: var(--amber); }
.pay-overdue { background: var(--late-tint); color: var(--late); }
.pay-not_ready, .pay-not_applicable { background: #f1f2f6; color: var(--muted); }
.pay-not_recorded { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--field); font-weight: 500; }
.stage-lead, .stage-contacted { background: #f1f2f6; color: var(--body); }
.stage-meeting, .stage-qualified { background: var(--tint); color: var(--navy); }
.stage-proposal, .stage-decision { background: #dfe6ff; color: var(--navy); }
.stage-won { background: var(--teal-tint); color: var(--teal); }
.stage-lost { background: #f1f2f6; color: var(--muted); }
.side-quintaum { background: var(--tint); color: var(--navy); }
.side-partner { background: var(--teal-tint); color: var(--teal); }
.side-client { background: var(--violet-tint); color: var(--violet); }
.chip.live { background: var(--blue); color: #fff; }
.chip.known { background: var(--teal-tint); color: var(--teal); }
.chip.noconsent { background: var(--amber-tint); color: var(--amber); }
.chip.waiting { background: #f1f2f6; color: var(--muted); }
.chip.approved { background: var(--teal-tint); color: var(--teal); }
.chip.rejected { background: #f1f2f6; color: var(--muted); }
.chip.warn { background: var(--amber-tint); color: var(--amber); }
.chip.d-delivered { background: var(--teal-tint); color: var(--teal); }
.chip.d-in_progress { background: var(--tint); color: var(--navy); }
.chip.d-planned { background: #f1f2f6; color: var(--body); }

.due { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.due.late { color: var(--late); }
.due.today { color: var(--blue); }
.due.none { font-weight: 500; opacity: .7; }
.flag { display: inline-flex; align-items: center; gap: 4px; color: var(--late); font-weight: 600; font-size: 12px; }
.flag .i { width: 13px; height: 13px; }
.flag-dot { color: var(--amber); }
.flag-dot .i { width: 13px; height: 13px; }
.warn-line { display: flex; gap: 8px; align-items: center; color: var(--amber); font-weight: 600; font-size: 12.5px; margin-bottom: 12px; }

.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #2a3fd6, var(--blue)); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .3px; flex: none; }
.avatar.lg { width: 36px; height: 36px; font-size: 12.5px; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.ghost { background: #f1f2f6; color: var(--faint); }

.progress { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: #e9ecf4; overflow: hidden; vertical-align: middle; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--blue)); border-radius: 3px; }

/* ── Tables ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { border: 0; box-shadow: none; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfcfe; }
.card .table th { background: none; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: #fafbff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table.compact td, .table.compact th { padding: 8px 10px; }
.card .table th:first-child, .card .table td:first-child { padding-left: 0; }
.card .table th:last-child, .card .table td:last-child { padding-right: 0; }

/* ── Key-value ─────────────────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.kv.small dt, .kv.small dd { font-size: 12px; }
.kv dd .chip { white-space: normal; }

/* ── Home ──────────────────────────────────────────────────────────── */
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.home-head h1 { font-size: 31px; }
.attention .card-head h2::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 4px var(--late-tint); }
.attention.clear .card-head h2::before { background: var(--teal); box-shadow: 0 0 0 4px var(--teal-tint); }
.att-group + .att-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.att-group h3 { font-size: 11.5px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .8px; }
.att-group h3 .i { color: var(--blue); }
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.att-list li:last-child { border-bottom: 0; }
.att-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.att-detail { color: var(--body); font-size: 13px; min-width: 0; }
.att-side { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.att-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: 9px; background: var(--amber-tint); color: var(--amber); font-weight: 600; font-size: 12.5px; }
.att-foot:hover { color: var(--amber); filter: brightness(.98); }
.all-clear { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.all-clear > .i { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--teal-tint); color: var(--teal); stroke-width: 2.6; }
.all-clear div { display: flex; flex-direction: column; }
.all-clear strong { color: var(--ink); }
.all-clear span { color: var(--muted); font-size: 13px; }
.more { display: inline-block; margin-top: 8px; font-weight: 600; font-size: 12.5px; }

.agenda { list-style: none; padding: 0; margin: 0; }
.agenda > li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.agenda > li:last-child { border-bottom: 0; }
.agenda-date { display: flex; flex-direction: column; line-height: 1.25; }
.agenda-date strong { color: var(--ink); font-size: 13px; }
.agenda-date span { color: var(--muted); font-size: 11.5px; }
.agenda ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.agenda ul li { display: flex; gap: 8px; align-items: baseline; }
.agenda-kind { font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase; font-weight: 700; color: var(--muted); min-width: 54px; }
.k-event { color: var(--teal); }
.k-report { color: var(--blue); }
.k-start, .k-end { color: var(--navy); }
.k-opp { color: var(--violet); }

.mini-orders { list-style: none; margin: 0; padding: 0; }
.mini-orders li { border-bottom: 1px solid var(--line-soft); }
.mini-orders li:last-child { border-bottom: 0; }
.mini-orders a { display: flex; flex-direction: column; gap: 2px; padding: 11px 8px; margin: 0 -8px; border-radius: 10px; color: inherit; }
.mini-orders a:hover { background: var(--tint-2); color: inherit; }
.mo-head { display: flex; justify-content: space-between; gap: 8px; }
.mo-head strong { color: var(--ink); }
.mini-journey { display: flex; align-items: center; gap: 10px; margin-top: 5px; color: var(--navy); font-weight: 600; }
.mo-next { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; color: var(--body); }
.mo-next span:not(.due) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-next .i { width: 13px; height: 13px; color: var(--blue); }
.mo-next.late .i { color: var(--late); }

.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.funnel li { display: grid; grid-template-columns: 82px 1fr 24px; gap: 10px; align-items: center; font-size: 12.5px; }
.fl { color: var(--body); font-weight: 500; }
.ft { height: 10px; background: #eef0f6; border-radius: 5px; overflow: hidden; }
.ft span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--blue)); border-radius: 5px; min-width: 0; }
.fn { text-align: right; font-weight: 700; color: var(--navy); }
.funnel li.zero .fn, .funnel li.zero .fl { color: var(--faint); }
.pipe-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.pipe-foot strong { color: var(--ink); }

/* ── Tasks ─────────────────────────────────────────────────────────── */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.task:last-child { border-bottom: 0; }
.task.prio-urgent { box-shadow: inset 3px 0 0 var(--late); padding-left: 10px; }

.task-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.task-actions:empty { display: none; }
.chip.urgent { background: var(--late-tint); color: var(--late); }
.task-title { color: var(--ink); font-weight: 500; line-height: 1.4; }
.task.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 12px; margin-top: 3px; }
.task-meta a { color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.task-meta a:hover { color: var(--blue); }
.task-meta .i { width: 12px; height: 12px; }
.task-side { display: flex; align-items: center; gap: 10px; }
.auto { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--tint); color: var(--blue); margin-right: 6px; vertical-align: -3px; }
.auto .i { width: 11px; height: 11px; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #b8bdcc; background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; transition: .12s; margin-top: 1px; }
.check .i { width: 13px; height: 13px; stroke-width: 3; }
.check:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); background: var(--tint-2); }
.check.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.task-more, .done-note { position: relative; }
.task-more summary, .done-note summary { list-style: none; }
.task-more summary::-webkit-details-marker, .done-note summary::-webkit-details-marker { display: none; }
.menu-form, .pop-form { position: absolute; right: 0; top: 34px; z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; min-width: 250px; gap: 2px; }
.pop-form { padding: 12px; gap: 8px; min-width: 320px; }
.menu-form button { text-align: left; padding: 7px 10px; background: none; border: 0; border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.menu-form button:hover { background: var(--tint); }
.menu-form button.btn { padding: 4px 10px; text-align: center; border: 1px solid var(--field); }
.menu-form button.danger { color: var(--late); }
.menu-form label { padding: 5px 10px; font-weight: 500; }
.menu-form input, .menu-form select { padding: 4px 6px; font-size: 12.5px; }
.menu-row { display: flex; gap: 4px; padding: 2px; border-bottom: 1px solid var(--line-soft); margin-bottom: 2px; }
.menu-row button { flex: 1; text-align: center; background: var(--tint-2); font-weight: 600; font-size: 12px; }
.small-label { font-weight: 500; font-size: 12px; flex-wrap: wrap; }
.small-label input { padding: 4px 6px; font-size: 12.5px; }
.addtask { display: flex; gap: 8px; margin-bottom: 8px; }
.addtask input[name=title] { flex: 1; }
.tasks-group.late .card-head h2 { color: var(--late); }

/* ── Timeline ──────────────────────────────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 6px 0 12px; position: relative; }
.tl-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--navy); z-index: 1; box-shadow: 0 0 0 3px #fff; }
.tl-icon .i { width: 14px; height: 14px; }
.tl-system .tl-icon { background: #f3f4f8; color: var(--faint); }
.tl-system .tl-head strong { font-weight: 500; color: var(--body); }
.tl-head { display: flex; flex-direction: column; }
.tl-head strong { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.tl-head span { font-size: 11.5px; }
.tl-body p { margin: 4px 0 0; white-space: pre-wrap; }
.tl-links { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; margin-top: 2px; }
.quicklog { display: flex; flex-direction: column; gap: 8px; padding: 10px; margin-bottom: 14px; background: var(--tint-2); border: 1px solid var(--line); border-radius: 11px; }
.quicklog-row { display: flex; gap: 8px; }
.quicklog-row input { flex: 1; }
.quicklog-more { display: none; flex-direction: column; gap: 8px; }
.quicklog:focus-within .quicklog-more { display: flex; }

/* ── Pipeline ──────────────────────────────────────────────────────── */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(172px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px; }
.board .col { background: #eceff7; border-radius: var(--radius); padding: 10px; min-height: 240px; display: flex; flex-direction: column; }
.board .col header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.board .col h2 { font-size: 13px; letter-spacing: .2px; color: var(--navy); font-weight: 700; }
.col-count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: #fff; border-radius: 999px; padding: 0 7px; }
.col-sum { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.col-cards { display: flex; flex-direction: column; gap: 8px; flex: 1; border-radius: 9px; transition: background .12s; }
.drop { background: rgba(0, 80, 250, .08); outline: 2px dashed rgba(0, 80, 250, .35); outline-offset: 2px; }
.col-empty { color: #aab0c2; text-align: center; padding: 14px 6px; font-size: 12px; }
.opp { background: #fff; border-radius: 11px; padding: 12px; box-shadow: 0 1px 2px rgba(16, 24, 64, .08); border: 1px solid transparent; cursor: grab; }
.opp:hover { border-color: var(--tintborder); }
.opp.dragging { opacity: .5; }
.opp.flagged { box-shadow: inset 3px 0 0 #ff8f35, 0 1px 2px rgba(16, 24, 64, .08); }
.opp-name { font-weight: 700; color: var(--ink); display: block; line-height: 1.3; }
.opp-org { font-size: 12px; color: var(--body); margin-top: 3px; }
.opp-next { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.opp-next .flag { color: var(--amber); }
.opp-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.opp-value { font-weight: 700; color: var(--navy); font-size: 13px; margin-right: auto; }
.closed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.closed-zone { border: 1.5px dashed var(--tintborder); border-radius: var(--radius); padding: 14px 18px; background: #fff; transition: background .12s; }
.closed-zone.won { border-color: #b9ded7; background: #fbfefd; }
.closed-zone header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.closed-zone h2 { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.closed-zone.won h2 { color: var(--teal); }
.closed-zone.lost h2 { color: var(--muted); }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.plain li:last-child { border-bottom: 0; }

.stage-bar { list-style: none; margin: 0 0 18px; padding: 4px; display: flex; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.stage-bar li { flex: 1; min-width: 92px; position: relative; }
.stage-bar form { margin: 0; }
.stage-bar button, .stage-bar span { width: 100%; display: block; padding: 9px 8px; border: 0; background: none; font: 600 12.5px Montserrat, sans-serif; color: var(--faint); cursor: pointer; border-radius: 8px; text-align: center; }
.stage-bar button:hover { background: var(--tint); color: var(--navy); }
.stage-bar li.done button, .stage-bar li.done span { color: var(--navy); }
.stage-bar li.done button::before { content: '✓ '; color: var(--teal); }
.stage-bar li.current button, .stage-bar li.current span { background: var(--navy); color: #fff; }
.stage-bar li.lost span { background: #6b7085; color: #fff; }
.update-form { display: flex; flex-direction: column; gap: 12px; }
.update-form input:not([type=radio]) { width: 100%; }
.uf-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 10px; }
.opp-list { list-style: none; margin: 0; padding: 0; }
.opp-list li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.opp-list li:last-child { border-bottom: 0; }

/* ── Organizations ─────────────────────────────────────────────────── */
.org-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 24px; align-items: start; margin-bottom: 18px; }
.org-head h1 { font-size: 31px; }
.org-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.org-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.org-facts { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.review { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--amber-tint); color: var(--amber); margin-bottom: 10px; }
.review div { display: flex; flex-direction: column; gap: 2px; }
.review strong { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.review span { color: #6b4200; }
.review-actions { margin: -2px 0 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.metric-block h3 { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; }
.metric-block .kv { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.metric-block .kv dd { text-align: right; font-weight: 600; }
.rel-group + .rel-group { margin-top: 12px; }
.rel-group h3 { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.rel-list { list-style: none; margin: 0; padding: 0; }
.rel-list li { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.rel-list li::before { content: '→'; color: var(--blue); }
.add-rel { margin-top: 12px; }
.add-rel summary, .add-step summary, .edit > summary, .deliv-edit summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 12.5px; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.edit[open] > summary { margin-bottom: 12px; }
.client-list { list-style: none; margin: 0; padding: 0; }
.client-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.client-list li:last-child { border-bottom: 0; }
.client-products { grid-column: 1 / -1; }

/* ── Contacts ──────────────────────────────────────────────────────── */
.consents { white-space: nowrap; }
.consent { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; margin-right: 4px; }
.consent .i { width: 12px; height: 12px; stroke-width: 3; }
.consent.yes { background: var(--teal-tint); color: var(--teal); }
.consent.no { background: var(--amber-tint); color: var(--amber); }
.consent.unk { background: #f1f2f6; color: var(--faint); }
.consent-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.consent-row > div { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; border: 1px solid var(--line); }
.consent-row > div.yes { border-color: #bfe3dc; background: #f6fcfb; }
.consent-row > div.no { border-color: #f1d4a4; background: #fffaf0; }
.consent-row strong { display: block; font-size: 13px; color: var(--ink); }
.consent-row span { font-size: 12px; color: var(--muted); }

/* ── Orders board ──────────────────────────────────────────────────── */
.orders-board { grid-auto-columns: minmax(200px, 1fr); }
.orders-board .col.done { background: #e8f2f0; }
.ocard { display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: 11px; padding: 12px; box-shadow: 0 1px 2px rgba(16, 24, 64, .08); color: var(--body); border: 1px solid transparent; }
.ocard:hover { border-color: var(--tintborder); color: var(--body); }
.ocard.late { box-shadow: inset 3px 0 0 var(--late), 0 1px 2px rgba(16, 24, 64, .08); }
.ocard strong { color: var(--ink); line-height: 1.3; }
.ocard-date { display: flex; align-items: center; gap: 5px; }
.ocard-date .i { width: 12px; height: 12px; color: var(--muted); }
.ocard-journey { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ocard-next { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--body); margin-top: 4px; padding-top: 7px; border-top: 1px solid var(--line-soft); line-height: 1.35; }
.ocard-next .i { width: 12px; height: 12px; color: var(--blue); margin-top: 2px; }
.ocard-next.late { color: var(--late); }
.ocard-next.late .i { color: var(--late); }

/* ── Order page ────────────────────────────────────────────────────── */
.order-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.order-head h1 { font-size: 29px; }
.order-status { display: flex; align-items: center; gap: 8px; }
.order-menu .menu-form { top: 36px; }

.journey { list-style: none; margin: 0; padding: 0; display: flex; }
.journey li { flex: 1; position: relative; min-width: 0; }
.journey li > a, .journey li { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.journey li > a { color: inherit; width: 100%; }
.journey li::before { content: ''; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: #e1e5ef; z-index: 0; }
.journey li:first-child::before { display: none; }
.journey li.done::before, .journey li.current::before, .journey li.partial::before { background: var(--navy); }
.journey .dot { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid #d5d9e5; display: grid; place-items: center; z-index: 1; color: #fff; position: relative; }
.journey .dot .i { width: 13px; height: 13px; stroke-width: 3; }
.journey li.done .dot { background: var(--navy); border-color: var(--navy); }
.journey li.current .dot { border-color: var(--blue); box-shadow: 0 0 0 5px rgba(0, 80, 250, .14); background: #fff; }
.journey li.current .dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.journey li.partial .dot { border-color: var(--navy); }
.jl { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.journey li.current .jl { color: var(--blue); }
.journey li.done .jl { color: var(--navy); }
.journey a:hover .jl { text-decoration: underline; }
.jc { font-size: 11px; color: var(--faint); }
.journey.compact { width: 116px; flex: none; }
.journey.compact li { gap: 0; }
.journey.compact .dot { width: 12px; height: 12px; border-width: 1.5px; }
.journey.compact li::before { top: 5px; height: 1.5px; }
.journey.compact .dot .i { display: none; }
.journey.compact li.current .dot { box-shadow: 0 0 0 3px rgba(0, 80, 250, .16); }
.journey.compact li.current .dot::after { width: 4px; height: 4px; }
.journey-card .card-body { padding: 20px 22px 14px; }
.journey-foot { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12.5px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line-soft); }

.next-up {
  display: flex; align-items: center; gap: 24px; justify-content: space-between; flex-wrap: wrap;
  padding: 20px 24px; margin-bottom: 18px; border-radius: var(--radius); color: #fff; scroll-margin-top: 80px;
  background: radial-gradient(120% 140% at 100% 0%, #1b39d9 0%, transparent 55%), linear-gradient(135deg, var(--navy-deep), var(--navy));
  box-shadow: 0 10px 30px rgba(0, 0, 80, .18);
}
.next-up .kicker { color: #9fb4ff; }
.next-up h2 { color: #fff; font-size: 20px; font-weight: 700; }
.next-up-main { min-width: 0; flex: 1; }
.next-up-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; color: #cbd7ff; }
.next-up-meta .chip { background: rgba(255, 255, 255, .14); color: #fff; }
.next-up-meta .due { color: #fff; }
.next-up-meta .due.late { color: #ffb4ae; }
.next-up-then { margin-top: 10px; font-size: 12.5px; color: #9fb4ff; }
.next-up-then a { color: #dbe4ff; }
.next-up-then a:hover { color: #fff; }
.next-up-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.suggest { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; border-radius: 12px; background: linear-gradient(135deg, var(--navy-deep), var(--navy)); color: #fff; }
.suggest .i { color: #9fb4ff; }
.suggest span { flex: 1; font-weight: 500; }

.checklist { display: flex; flex-direction: column; gap: 14px; }
.phase header, .phase summary { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.phase summary { cursor: pointer; list-style: none; padding: 6px 10px; margin: 0; border-radius: 9px; background: #f7f9fc; }
.phase summary::-webkit-details-marker { display: none; }
.phase summary:hover { background: var(--tint); }
.phase[open] summary { margin-bottom: 6px; }
.phase h3 { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.phase.current h3 { color: var(--blue); }
.phase.complete h3 { color: var(--teal); }
.phase-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #cdd2e0; display: grid; place-items: center; color: #fff; flex: none; }
.phase-dot .i { width: 11px; height: 11px; stroke-width: 3; }
.phase.complete .phase-dot { background: var(--teal); border-color: var(--teal); }
.phase.current .phase-dot { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 80, 250, .14); }
.phase-count { font-size: 11px; color: var(--faint); font-weight: 600; }
.phase-toggle { margin-left: auto; font-size: 11.5px; color: var(--blue); font-weight: 600; }
.phase[open] .phase-toggle { visibility: hidden; }
.phase ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 11px; }
.phase.current ul { border-color: var(--tintborder); box-shadow: 0 0 0 3px var(--tint-2); }
.step { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 100px; }
.step:last-child { border-bottom: 0; }
.step:target { background: #f5f8ff; }
.step.is-next { background: linear-gradient(90deg, #f3f6ff, #fff); }
.step-main { display: flex; flex-direction: column; min-width: 0; }
.step-title { color: var(--ink); font-weight: 500; }
.step.is-next .step-title { font-weight: 700; }
.step-hint { font-size: 11.5px; color: var(--muted); }
.step.done .step-title { color: var(--muted); }
.step.na .step-title { color: #a2a7b8; text-decoration: line-through; }
.step.late { background: #fffafa; }
.step-side { display: flex; align-items: center; gap: 8px; }
.done-when { min-width: 46px; text-align: right; }
.add-step { margin-top: 2px; }

.deliv-list { list-style: none; margin: 0; padding: 0; }
.deliv-item { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.deliv-item:last-child { border-bottom: 0; }
.deliv-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deliv-head strong { color: var(--ink); }
.deliv-head .chip:last-child { margin-left: auto; }
.deliv-edit { margin-top: 6px; }
.deliv-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 8px; }
.deliv-form input[type=date] { width: 150px; }
label.mini { font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; gap: 3px; }
.qty { width: 64px; }
.grow { flex: 1 1 200px; }
.add-deliv { border-top: 1px dashed var(--line); padding-top: 10px; }

.bill-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.bill-status { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.bill-amount { font-size: 22px; font-weight: 800; color: var(--navy); display: flex; flex-direction: column; align-items: flex-end; }
.bill-notes { margin-top: 10px; }
.bill-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.edit-billing summary { list-style: none; }
.edit-billing[open] { flex-basis: 100%; }
.edit-billing[open] summary { margin-bottom: 12px; }
.legacy { background: #fff; border: 1px dashed var(--field); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.legacy summary { cursor: pointer; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.legacy[open] summary { margin-bottom: 10px; }
.import-notes { margin: 0 0 12px; padding-left: 18px; color: var(--amber); font-size: 12.5px; }

/* ── New order wizard ──────────────────────────────────────────────── */
.wizard { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.wz-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.wz-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy-deep), var(--navy)); color: #fff; font-weight: 800; }
.wz-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wz-body h2 { font-size: 17px; font-weight: 800; padding-top: 4px; }
.svc-group h3 { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.svc { cursor: pointer; }
.svc input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.svc > span { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px; height: 100%; transition: .12s; }
.svc strong { color: var(--ink); font-size: 13.5px; }
.svc small { color: var(--muted); font-weight: 500; font-size: 12px; }
.svc:hover > span { border-color: var(--tintborder); background: var(--tint-2); }
.svc input:checked + span { border-color: var(--blue); background: var(--tint); box-shadow: 0 0 0 3px rgba(0, 80, 250, .12); }
.svc input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 80, 250, .3); }
.deliv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.deliv-check { flex-direction: row; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 500; font-size: 13px; cursor: pointer; }
.deliv-check:has(input:checked) { border-color: var(--blue); background: var(--tint-2); }
.deliv-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); }
.deliv-check span { flex: 1; }
.wz-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 4px 0 20px; }

/* ── Events ────────────────────────────────────────────────────────── */
.event-list { display: flex; flex-direction: column; }
.event-tile { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 8px; margin: 0 -8px; border-radius: 10px; border-bottom: 1px solid var(--line-soft); color: inherit; }
.event-tile:last-child { border-bottom: 0; }
.event-tile:hover { color: inherit; background: var(--tint-2); }
.event-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 13px; background: linear-gradient(160deg, var(--navy-deep), var(--navy)); color: #fff; line-height: 1.1; }
.event-date strong { font-size: 20px; }
.event-date span { font-size: 10.5px; color: #c9d6ff; text-transform: uppercase; letter-spacing: .6px; }
.event-main { display: flex; flex-direction: column; }
.event-main strong { color: var(--ink); }
.event-nums { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.event-nums strong { color: var(--navy); }
.hbar { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hbar li { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 26px; gap: 10px; align-items: center; font-size: 12.5px; }
.hb-track { height: 8px; background: #eef0f6; border-radius: 4px; overflow: hidden; }
.hb-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--blue)); border-radius: 4px; }
.hb-n { text-align: right; font-weight: 700; color: var(--navy); }
.seg-buttons { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.seg-buttons form { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.seg-buttons button { padding: 4px 9px; border-radius: 7px; border: 1px solid var(--field); background: #fff; font: 600 11.5px Montserrat, sans-serif; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.seg-buttons button .i { width: 12px; height: 12px; }
.seg-buttons button:hover { border-color: var(--blue); color: var(--navy); }
.seg-buttons button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg-buttons button.on.a-attended { background: var(--teal); border-color: var(--teal); }
.seg-buttons button.on.a-no_show, .seg-buttons button.on.a-cancelled { background: #8a8fa3; border-color: #8a8fa3; }
.seg-buttons button.lead { color: var(--blue); border-color: var(--tintborder); background: var(--tint-2); }
.bulk { margin: 0 0 12px; }
.reg-profile { margin-top: 4px; }
.table td.nowrap { white-space: nowrap; }
.seg-buttons form { flex-wrap: nowrap; }
td.nowrap .seg-buttons { flex-wrap: nowrap; }
.notes-clip { max-width: 170px; }

/* ── Intake & settings ─────────────────────────────────────────────── */
.upload { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.upload .file { cursor: pointer; }
.upload .file input { position: absolute; opacity: 0; width: 1px; }
.upload .file span { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border: 1.5px dashed var(--tintborder); border-radius: 9px; color: var(--navy); font-weight: 600; background: var(--tint-2); }
.upload .file.has span { border-style: solid; border-color: var(--blue); }
.intake-list { list-style: none; margin: 0; padding: 0; }
.intake-list li { display: flex; gap: 16px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.intake-main { display: flex; flex-direction: column; gap: 2px; }
.match { margin: 4px 0 0; font-size: 13px; }
.intake-actions { display: flex; gap: 6px; align-items: flex-start; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.check-list li:last-child { border-bottom: 0; }
.tpl-phase { margin-bottom: 14px; }
.tpl-phase h3 { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.tpl-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 5px 0; }
.tpl-row.add { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 8px; }
.rule-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rule-row .chip-check span { min-width: 220px; }
.rule-desc { padding: 4px 0 0 4px; }
.results { list-style: none; padding: 0; margin: 0; }
.results li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.results li:last-child { border-bottom: 0; }

/* ── Dialogs ───────────────────────────────────────────────────────── */
.dialog { border: 0; padding: 0; border-radius: 18px; width: min(600px, calc(100vw - 32px)); box-shadow: 0 24px 80px rgba(0, 0, 50, .3); color: var(--body); }
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog[open] { animation: dlg-in .18s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.dialog::backdrop { background: rgba(0, 0, 40, .38); backdrop-filter: blur(2px); }
.dialog header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 4px; }
.dialog h2 { font-size: 18px; font-weight: 800; }
.dialog-body { padding: 12px 24px; display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow-y: auto; }
.dialog-body.form-grid { display: grid; }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; border-top: 1px solid var(--line-soft); }
.dialog input:not([type=checkbox]):not([type=radio]), .dialog select { width: 100%; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .grid-home, .grid-order { grid-template-columns: minmax(0, 1fr); }
  .metric-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 40, .4); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 20px 16px 56px; }
  .search kbd { display: none; }
  .grid-2, .closed-row, .org-head, .consent-row { grid-template-columns: minmax(0, 1fr); }
  .stats, .stats.small { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .toolbar .filter { margin-left: 0; width: 100%; }
  .uf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .uf-grid label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .add-wrap .btn span { display: none; }
  h1, .home-head h1, .org-head h1, .order-head h1 { font-size: 23px; }
  .form-grid, .row2, .row3, .metric-grid, .uf-grid { grid-template-columns: minmax(0, 1fr); }
  .att-list li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .att-side { justify-content: flex-start; }
  .journey .jl, .journey .jc { display: none; }
  .step { grid-template-columns: auto minmax(0, 1fr); }
  .step-side { grid-column: 2; flex-wrap: wrap; }
  .task { grid-template-columns: auto minmax(0, 1fr); }
  .task-side { grid-column: 2; flex-wrap: wrap; }
  .pop-form, .menu-form { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; min-width: 0; }
  .event-tile { grid-template-columns: 58px minmax(0, 1fr); }
  .event-nums { grid-column: 2; }
  .check-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .next-up { padding: 16px; }
  .next-up-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .next-up-actions .btn.big { flex: 1; }
  .wz-step { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .wz-num { width: 28px; height: 28px; }
  .bill-summary { flex-direction: column; align-items: flex-start; }
  .bill-amount { align-items: flex-start; }
  .toast { left: 12px; right: 12px; bottom: 12px; }
}

/* ── v0.3 components ───────────────────────────────────────────────── */
/* Bulk actions */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border: 1px dashed var(--field); border-radius: 11px; background: #fff; }
.bulk-bar select { padding: 4px 8px; font-size: 12.5px; }
.bulk-bar .btn, .bulk-bar select, .bulk-bar .chip-check { opacity: .45; pointer-events: none; }
.bulk-bar.active { border-style: solid; border-color: var(--blue); background: var(--tint-2); box-shadow: 0 0 0 3px rgba(0, 80, 250, .08); }
.bulk-bar.active .btn, .bulk-bar.active select, .bulk-bar.active .chip-check { opacity: 1; pointer-events: auto; }
.bulk-count { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-right: auto; }
.bulk-bar.active .bulk-count { color: var(--navy); }
.bulk-bar .chip-check span { padding: 3px 9px; font-size: 11.5px; }
.table th.pick, .table td.pick { width: 34px; padding-right: 0; }
.pick input, .task-pick { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }
.task.with-pick { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.task-pick { margin-top: 4px; }

/* Files */
.file-list { list-style: none; margin: 0 0 10px; padding: 0; }
.file-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.file-list .share-check { grid-column: 1 / -1; order: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-name { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop { display: flex; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1.5px dashed var(--tintborder); border-radius: 11px; background: var(--tint-2); cursor: pointer; font-weight: 600; color: var(--navy); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop span { display: inline-flex; gap: 6px; align-items: center; }
.file-drop small { font-weight: 500; }
.file-drop.drop, .file-drop:hover { border-color: var(--blue); background: var(--tint); }
.file-drop.busy { opacity: .6; pointer-events: none; }

/* People on an order */
.people-list { list-style: none; margin: 0 0 8px; padding: 0; }
.people-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.people-list .chip { margin-left: 6px; }
.chip.role-main { background: var(--navy); color: #fff; }
.chip.role-billing { background: var(--amber-tint); color: var(--amber); }
.chip.role-decision_maker { background: #dfe6ff; color: var(--navy); }
.people-add .picker { flex: 1 1 200px; }

/* Billing on the order page */
.invoice-block + .invoice-block { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.price-check { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--tint-2); border: 1px solid var(--line); }
.price-check summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: 13px; display: flex; gap: 6px; align-items: center; list-style: none; }
.price-check[open] summary { margin-bottom: 8px; }
.price-preview { padding: 10px 12px; border-radius: 10px; background: var(--tint-2); border: 1px solid var(--tintborder); font-size: 13px; color: var(--navy); }
.add-invoice { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 14px; }
.add-invoice input[name=label] { flex: 1 1 160px; }
.qty-wide { width: 110px; }

/* Pipeline forecast */
.forecast { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.forecast > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.forecast strong { font-size: 22px; font-weight: 800; color: var(--navy); }
.board .col header .muted.small { font-weight: 600; }

/* Price calculator */
.calc { display: flex; flex-direction: column; gap: 14px; }
.calc-check { align-self: end; }
.calc .calc-first { grid-template-columns: 2fr 1fr .8fr; }
.group-rows { display: flex; flex-direction: column; gap: 6px; }
.group-rows .inline-form { margin-top: 0; }
.legend-like { font-size: 12px; font-weight: 600; color: var(--muted); }
.table.quote td { padding: 9px 0; }
.table.quote tr.sum td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); }
.table.quote tr.total td { font-weight: 800; color: var(--navy); font-size: 16px; border-top: 2px solid var(--navy); }
.price-ref { margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.price-ref summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.price-ref h3 { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--blue); margin: 14px 0 4px; }
.price-in { width: 92px; text-align: right; padding: 4px 6px; font-size: 12.5px; }
.price-in.small-in { width: 70px; margin-top: 3px; display: block; margin-left: auto; color: var(--muted); }
.price-edit td { vertical-align: middle; }
.prob-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.prob-input { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 500; }

/* Reports */
.vbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; align-items: end; height: 190px; padding: 8px 0 0; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.vbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; cursor: default; position: relative; }
.vbar-fill { width: 60%; max-width: 34px; background: var(--navy); border-radius: 4px 4px 0 0; transition: background .12s; }
.vbar:hover .vbar-fill { background: var(--blue); }
.vbar-val { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.vbar-label { position: absolute; bottom: -22px; font-size: 11px; color: var(--muted); }
.mini-head { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.chip.health-growing { background: var(--teal-tint); color: var(--teal); }
.chip.health-steady { background: var(--tint); color: var(--navy); }
.chip.health-slipping { background: var(--amber-tint); color: var(--amber); }
.chip.health-dormant { background: #f1f2f6; color: var(--muted); }
.chip.health-onboarding, .chip.health-new { background: #fff; color: var(--blue); box-shadow: inset 0 0 0 1px var(--tintborder); }

/* Partner programme, journey start */
.journey-start { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.journey-start .muted { flex-basis: 100%; }
.org-menu .menu-form { top: 36px; left: 0; right: auto; }
.page-actions .org-menu .menu-form { left: auto; right: 0; }

/* E-mail templates */
.tpl-list { list-style: none; margin: 0; padding: 0; }
.tpl-list > li { border-bottom: 1px solid var(--line-soft); }
.tpl-list > li:last-child { border-bottom: 0; }
.tpl-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 10px 0; color: var(--ink); }
.tpl-head:hover { color: var(--blue); }
.tpl-head .muted { flex-basis: 100%; }
.tpl-list > li.open { background: var(--tint-2); margin: 0 -22px; padding: 0 22px 16px; }
.tpl-editor textarea { font-family: inherit; line-height: 1.55; }
.mail-btn { color: var(--blue); }
.seg-buttons button.mail { padding: 4px 6px; color: var(--blue); }
.settings-links { margin: -10px 0 16px; }

/* Misc */
.consent-edit { margin-top: 10px; }
.consent-edit[open] summary { margin-bottom: 10px; }
.tl-body { position: relative; }
.tl-delete { position: absolute; top: -4px; right: 0; opacity: 0; transition: opacity .12s; }
.timeline li:hover .tl-delete { opacity: 1; }
.rel-remove { margin-left: auto; opacity: 0; }
.rel-list li:hover .rel-remove { opacity: 1; }
.phase-done { margin-left: auto; }
.phase-done .btn { padding: 2px 8px; font-size: 11.5px; }
.backup-list li { font-size: 12.5px; }
@media (max-width: 960px) {
  .forecast, .calc .calc-first { grid-template-columns: minmax(0, 1fr); }
  .task.with-pick { grid-template-columns: auto auto minmax(0, 1fr); }
  .task.with-pick .task-side { grid-column: 3; }
  /* Wide tables inside cards scroll sideways instead of widening the page. */
  .card table.table:not(.quote) { display: block; overflow-x: auto; max-width: 100%; }
  .tl-delete, .rel-remove { opacity: 1; }
}
.market-pick { display: flex; gap: 6px; }
.market-pick select { min-width: 0; flex: 1 1 50%; }

/* ── v0.4 ───────────────────────────────────────────────────────────── */
/* Sidebar fold-out group (Toolkit) */
.nav-group summary { list-style: none; cursor: pointer; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-caret { margin-left: auto; width: 14px !important; height: 14px !important; transition: transform .15s; }
.nav-group[open] .nav-caret { transform: rotate(90deg); }
.nav-item.sub { padding-left: 38px; font-size: 13px; color: #c3cfff; }
.nav-item.sub:hover, .nav-item.sub.active { color: #fff; }
.nav-item.sub .i { width: 16px; height: 16px; }

/* Links to the app a step is done in */
.tool-link { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--tintborder); background: #fff; color: var(--blue); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tool-link .i { width: 13px; height: 13px; }
.tool-link:hover { border-color: var(--blue); background: var(--tint-2); }
.step-side .tool-link { padding: 4px 6px; }
.next-up .tool-link { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; }

/* Journey map (service blueprint) */
.jm-tabs { margin-bottom: 14px; flex-wrap: wrap; }
.jm-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.jm-stats strong { color: var(--navy); font-size: 15px; }
.jm-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px 6px; }
.jm { display: grid; grid-template-columns: 34px repeat(var(--cols), minmax(132px, 1fr)); gap: 6px; min-width: calc(34px + var(--cols) * 138px); }
.jm-corner { }
.jm-phase { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: linear-gradient(135deg, #000050, #000078); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .2px; }
.jm-num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .16); font-size: 11px; flex: none; }
.jm-lane { display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; border-radius: 10px; padding: 8px 0; }
.jm-lane.lane-client { background: var(--violet-tint); color: var(--violet); }
.jm-lane.lane-partner { background: var(--teal-tint); color: var(--teal); }
.jm-lane.lane-quintaum { background: var(--tint); color: var(--navy); }
.jm-cell { list-style: none; margin: 0; padding: 6px; border-radius: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.jm-cell.lane-client { background: #fbf9fe; }
.jm-cell.lane-partner { background: #f6fbfa; }
.jm-cell.lane-quintaum { background: var(--tint-2); }
.jm-step { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--tintborder); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.35; }
.lane-client .jm-step { border-left-color: #cdbdf0; }
.lane-partner .jm-step { border-left-color: #a9d9d0; }
.lane-quintaum .jm-step { border-left-color: #9fb4ff; }
.jm-step[data-href] { cursor: pointer; }
.jm-step[data-href]:hover { border-color: var(--blue); }
.jm-title { color: var(--ink); font-weight: 600; display: flex; gap: 4px; align-items: flex-start; }
.jm-title .i { width: 13px; height: 13px; flex: none; margin-top: 1px; stroke-width: 3; color: var(--teal); }
.jm-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; color: var(--muted); font-size: 11px; }
.jm-mail, .jm-tool { display: inline-flex; color: var(--blue); }
.jm-mail .i, .jm-tool .i, .jm-legend .i { width: 13px; height: 13px; }
.jm-deliv { padding: 0 6px; border-radius: 999px; background: var(--amber-tint); color: var(--amber); font-size: 10.5px; font-weight: 600; }
.jm-state { margin-left: auto; font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; }
.jm-step.done { background: #f7fbf9; border-color: #d3ebe5; }
.jm-step.done .jm-title { color: var(--muted); font-weight: 500; }
.jm-step.next { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 80, 250, .12); }
.jm-step.next .jm-state { color: var(--blue); }
.jm-step.late { border-color: #f1b8b3; background: var(--late-tint); }
.jm-step.late .jm-state { color: var(--late); }
.jm-step.na { opacity: .45; }
.jm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.jm-legend span { display: inline-flex; align-items: center; gap: 4px; }
.jm-key { padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 11px; }
.jm-key.done { background: #f7fbf9; }
.jm-key.next { border-color: var(--blue); color: var(--blue); }
.jm-key.late { background: var(--late-tint); color: var(--late); border-color: #f1b8b3; }
.journey-map-card { padding: 0; margin-bottom: 18px; }
.journey-map-card > summary { display: flex; align-items: center; gap: 10px; padding: 14px 20px; cursor: pointer; list-style: none; color: var(--navy); }
.journey-map-card > summary::-webkit-details-marker { display: none; }
.journey-map-card > summary .i { width: 18px; height: 18px; }
.journey-map-card[open] > summary { border-bottom: 1px solid var(--line); }
.journey-map-card > .jm-wrap, .journey-map-card > .jm-legend { margin: 14px 20px; }
.journey-map-card > .jm-legend { margin-top: 0; padding-bottom: 14px; }

/* To do */
.count-pill { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 6px; border-radius: 999px; background: var(--tint); color: var(--navy); font-size: 12px; text-align: center; vertical-align: 2px; }
.count-pill.late { background: var(--late-tint); color: var(--late); }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.todo-row:last-child { border-bottom: 0; }
.todo-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-title { font-weight: 600; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.todo-kind { width: 15px; height: 15px; color: var(--blue); flex: none; }
.todo-sub { font-size: 12.5px; color: var(--muted); }
.todo-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.todo-group.g-overdue .card-head h2 { color: var(--late); }
.toolbar .seg-links + .seg-links { margin-left: 0; }

/* Invoice documents */
.inv-docs { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 8px 0 4px; }
.inv-doc { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 600; }
.inv-doc a { display: inline-flex; align-items: center; gap: 4px; }
.inv-doc .i, .inv-attach .i, .inv-doc-link .i { width: 14px; height: 14px; }
.inv-attach { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--blue); cursor: pointer; font-weight: 600; position: relative; }
.inv-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.inv-attach.busy { opacity: .5; }
.inv-attach.drop { text-decoration: underline; }
.tiny-x { width: 20px; height: 20px; }
.tiny-x .i { width: 12px; height: 12px; }
.inv-doc-link { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.file-inline input[type=file] { padding: 6px; font-size: 12.5px; }

@media (max-width: 960px) {
  .todo-row { grid-template-columns: auto minmax(0, 1fr); }
  .todo-side { grid-column: 2; justify-content: flex-start; }
  .jm-stats { gap: 4px 12px; }
}

/* E-mail templates: Write from the list */
.tpl-row { display: flex; align-items: center; gap: 10px; }
.tpl-row .tpl-head { flex: 1; min-width: 0; }
.tpl-row .btn { flex: none; }
.compose-for { padding: 10px 12px; border-radius: 10px; background: var(--tint-2); border: 1px solid var(--tintborder); }

/* ── v0.5 ───────────────────────────────────────────────────────────── */
/* Pages outside the CRM shell: sign-in, invite, feedback */
.plain-body { background: linear-gradient(180deg, #f8faff, #eef1f9); min-height: 100vh; margin: 0; }
.plain-wrap { max-width: 420px; margin: 0 auto; padding: 56px 20px; }
.plain-wrap.wide { max-width: 640px; }
.plain-logo { width: 170px; display: block; margin: 0 0 28px; }
.plain-wrap h1 { font-size: 24px; color: var(--ink); margin: 0 0 8px; }
.plain-lead { color: var(--muted); margin: 0 0 18px; }
.plain-form { display: flex; flex-direction: column; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin: 14px 0; }
.plain-form fieldset { border: 0; padding: 0; margin: 0; }
.plain-form legend { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.plain-error { background: var(--late-tint); color: var(--late); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.plain-note { color: var(--muted); font-size: 13px; }
.btn.big { padding: 12px 18px; font-size: 15px; justify-content: center; }
.nps-row { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.nps { position: relative; }
.nps input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nps span { display: block; text-align: center; padding: 9px 0; border: 1px solid var(--field); border-radius: 8px; cursor: pointer; font-weight: 600; background: #fff; }
.nps input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.nps input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 80, 250, .25); }
.radio-line { display: flex; flex-direction: row; gap: 8px; font-size: 14px; color: var(--body); align-items: center; font-weight: 500; padding: 3px 0; }

/* Banners, copy lines, account */
.banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; font-size: 13.5px; }
.banner.warn { background: var(--amber-tint); color: var(--amber); font-weight: 600; }
.banner.ok { background: var(--teal-tint); color: var(--teal); }
.banner .i { width: 18px; height: 18px; }
.copy-line { display: flex; gap: 6px; width: 100%; }
.copy-line input { flex: 1; min-width: 0; font-size: 12.5px; }
.setup-steps { padding-left: 20px; }
.setup-steps li { margin: 0 0 10px; }
code.secret { font-size: 14px; letter-spacing: 1px; background: var(--tint); padding: 2px 6px; border-radius: 6px; }
.top-gap { margin-top: 10px; }
.toolbar-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* Delivery promise chips, weekly review */
.chip.promise-ok { background: var(--teal-tint); color: var(--teal); }
.chip.promise-late { background: var(--late-tint); color: var(--late); }
.chip.promise-run { background: var(--tint); color: var(--blue); }
.rv-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; margin-right: 6px; }
.rv-num.late { background: var(--late); }

/* Responses */
.resp { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.big-number { font-size: 28px; font-weight: 800; color: var(--navy); line-height: 1; margin: 0; }

/* Feedback */
.fb-list li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.fb-list blockquote { margin: 6px 0; font-family: Georgia, serif; font-style: italic; color: var(--ink); }
.fb-score { display: inline-block; padding: 1px 8px; border-radius: 999px; margin-bottom: 4px; }
.fb-score.shi { background: var(--teal-tint); color: var(--teal); }
.fb-score.smid { background: var(--tint); color: var(--navy); }
.fb-score.slo { background: var(--amber-tint); color: var(--amber); }
.chip.case-published { background: var(--teal-tint); color: var(--teal); }
.chip.case-declined { background: #f1f2f6; color: var(--muted); }

/* E-mail: final form */
.compose-views { display: flex; align-items: center; justify-content: space-between; margin-bottom: -4px; }
.compose-views .seg-buttons button.active { background: var(--navy); color: #fff; }
.compose-preview { display: none; border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fff; max-height: 52vh; overflow: auto; }
#compose.show-final .compose-preview { display: block; }
#compose.show-final .compose-text { display: none; }
.tpl-final { margin: 0 0 12px; }
.tpl-final > summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; list-style: none; }
.tpl-final > summary::-webkit-details-marker { display: none; }
.tpl-final > summary .i { width: 14px; height: 14px; }
.final-mail { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.final-subject { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--tint-2); }
.final-body { padding: 18px 20px; }
.final-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--tint-2); }
mark { background: #fff1a8; color: #5a4500; padding: 0 2px; border-radius: 2px; }
.stage-form input:not(.qty) { width: 100%; max-width: 260px; }

/* Partner portal */
.portal-body { background: var(--backdrop); margin: 0; }
.preview-bar { background: var(--amber-tint); color: var(--amber); text-align: center; padding: 8px; font-size: 13px; font-weight: 600; }
.portal-top { display: flex; align-items: center; gap: 22px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.portal-brand { display: flex; align-items: center; gap: 12px; }
.portal-brand img { height: 30px; }
.portal-brand span { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue); }
.portal-top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.portal-top nav a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 9px; color: var(--body); font-weight: 600; font-size: 13.5px; }
.portal-top nav a.active, .portal-top nav a:hover { background: var(--tint); color: var(--navy); }
.portal-top nav .i { width: 16px; height: 16px; }
.portal-who { margin-left: auto; font-weight: 700; color: var(--navy); }
.portal-main { max-width: 1100px; margin: 0 auto; padding: 28px 24px 40px; }
.portal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.portal-head h1 { margin: 2px 0 4px; font-size: 26px; color: var(--ink); }
.section-title { font-size: 15px; color: var(--ink); margin: 22px 0 10px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 18px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.pcard > header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pcard-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.pcard-meta span { display: inline-flex; gap: 6px; align-items: center; }
.pcard-meta .i { width: 14px; height: 14px; }
.pcard-wait { background: var(--tint-2); border-radius: 10px; padding: 8px 10px; }
.pcard-wait ul { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.psteps { list-style: none; margin: 0 0 6px; padding: 0; }
.pstep { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.pstep-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #b8bdcc; display: grid; place-items: center; }
.pstep.done .pstep-dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.pstep.done .pstep-title { color: var(--muted); }
.pstep-dot .i { width: 11px; height: 11px; stroke-width: 3; }
.pstep.yours .pstep-title { font-weight: 700; color: var(--ink); }
.pstep.na { opacity: .5; }
.portal-form { max-width: 760px; }
.portal-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 20px 30px; }

/* Print-ready pages: partner review pack, proposal */
.pack-body { background: #e9ebf1; margin: 0; font-family: Montserrat, "Segoe UI", Arial, sans-serif; color: var(--body); }
.pack-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.pack-tools form.inline { display: inline-flex; gap: 6px; align-items: center; }
.pack-page { width: 210mm; min-height: 297mm; margin: 16px auto; padding: 18mm 16mm; background: #fff; box-shadow: 0 6px 24px rgba(16, 24, 64, .08); position: relative; }
.pack-logo { width: 50mm; margin-bottom: 14mm; }
.pack-title { font-size: 30px; color: var(--ink); margin: 4px 0; }
.pack-sub { color: var(--muted); margin: 0 0 16px; }
.pack-page h2 { font-size: 17px; color: var(--navy); margin: 22px 0 8px; }
.pack-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.pack-stats > div { background: var(--tint-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.pack-stats strong { font-size: 22px; color: var(--navy); }
.pack-stats span { font-size: 12px; }
.pack-stats small { color: var(--teal); font-weight: 600; }
.pack-quote { font-family: Georgia, serif; font-style: italic; border-left: 3px solid var(--blue); margin: 8px 0; padding: 4px 0 4px 12px; }
.pack-quote cite { display: block; font-style: normal; font-family: Montserrat, sans-serif; font-size: 12px; color: var(--muted); }
.pack-plan { width: 100%; border-collapse: collapse; }
.pack-plan td { border: 1px solid var(--line); padding: 14px 10px; }
.pack-plan td:first-child { width: 40%; font-weight: 600; color: var(--navy); background: var(--tint-2); }
.pack-foot { position: absolute; bottom: 12mm; left: 16mm; right: 16mm; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; }
.proposal-cover { background: linear-gradient(160deg, #000050, #000078); color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.proposal-cover .cover-text { margin-top: 30mm; }
.proposal-cover h1 { font-size: 36px; margin: 6px 0 10px; color: #fff; }
.proposal-cover p { color: #cbd7ff; font-size: 17px; max-width: 140mm; }
.proposal-cover .kicker.light { color: #9fb4ff; }
.proposal-cover .cover-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: #9fb4ff; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 8px; }
.lead-p { font-size: 15px; line-height: 1.6; }
.questions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.questions p { margin: 0; background: var(--tint); border-radius: 10px; padding: 12px; font-family: Georgia, serif; font-style: italic; color: var(--navy); }
.gets { padding-left: 18px; line-height: 1.7; }
.how { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 10px; }
.how li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; }
.how li::before { content: counter(s); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.how strong { color: var(--ink); }
.proposal-price td { font-size: 14px; }
.per-person { color: var(--teal); font-weight: 600; }
.terms { font-size: 12.5px; color: var(--muted); }
.samples { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.samples figure { margin: 0; }
.samples img { width: 100%; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(16, 24, 64, .1); }
.samples figcaption { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.next-step { background: var(--tint); border-radius: 12px; padding: 4px 16px 12px; margin-top: 18px; }
.next-step .sign { margin-bottom: 0; }
@media print {
  .pack-body { background: #fff; }
  .pack-tools { display: none; }
  .pack-page { margin: 0; box-shadow: none; page-break-after: always; }
  @page { size: A4; margin: 0; }
}
@media (max-width: 960px) {
  .portal-top { padding: 12px 16px; gap: 10px; }
  .portal-who { margin-left: 0; }
  .pack-page { width: auto; min-height: 0; margin: 10px; padding: 18px; }
  .pack-stats, .questions, .samples { grid-template-columns: 1fr; }
  .nps-row { grid-template-columns: repeat(6, 1fr); }
}

/* ── v0.6: executive view ─────────────────────────────────────────────────── */
.exec-tiles { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.exec-tiles .stat { padding: 12px 14px; }
.exec-tiles .stat-value { font-size: 21px; }
.exec-tile { display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; border-radius: var(--radius); color: #fff; background: linear-gradient(150deg, var(--navy-deep), var(--navy)); box-shadow: var(--shadow); }
.exec-tile .stat-label { color: #9fb4ff; }
.exec-tile strong { font-size: 30px; font-weight: 800; line-height: 1.1; }
.exec-tile .stat-sub { color: #cbd7ff; }
.exec-tile .stat-sub a { color: #fff; text-decoration: underline; }
.exec-tile .progress { width: 100%; background: rgba(255, 255, 255, .18); }
.exec-tile .progress span { background: #fff; }
.exec-tile .chip { margin-left: 2px; }

.chip.pace-ahead { background: var(--teal-tint); color: var(--teal); }
.chip.pace-on_track { background: var(--tint); color: var(--navy); }
.chip.pace-behind { background: var(--amber-tint); color: var(--amber); }

.xbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 170px; align-items: end; padding-top: 6px; }
.xbar { display: flex; flex-direction: column; height: 100%; gap: 6px; min-width: 0; }
.xbar-cols { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.xbar-cols span { display: block; width: 42%; max-width: 14px; min-height: 0; border-radius: 4px 4px 0 0; }
.xbar-cols .now { background: var(--navy); }
.xbar-cols .prev { background: #c7d0ec; }
.xbar-label { font-size: 10.5px; color: var(--muted); text-align: center; }
.xbar:hover .xbar-cols { background: var(--tint-2); }
.legend-line { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.legend-line .key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.legend-line .key:first-child { margin-left: 0; }
.legend-line .key.now { background: var(--navy); }
.legend-line .key.prev { background: #c7d0ec; }

.wait-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wait-block { min-width: 0; }
.wait-block h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin: 0 0 2px; color: var(--ink); }
.wait-sum { font-weight: 800; color: var(--navy); white-space: nowrap; }
.wait-sum.big { font-size: 15px; margin-left: 8px; }
.wait-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.wait-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.wait-list li > div a { font-weight: 600; }
.wait-list form { grid-column: 1 / -1; }
.wait-val { text-align: right; font-weight: 700; color: var(--navy); white-space: nowrap; }
.wait-val small { display: block; font-weight: 500; font-size: 10.5px; color: var(--muted); }

/* ── v0.6: partner deal registration ──────────────────────────────────────── */
.deal-list { display: flex; flex-direction: column; }
.deal-list li { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.deal-list li:first-child { border-top: 0; }
.chip.reg { background: var(--violet-tint); color: var(--violet); }

/* ── v0.6: links inside a "More" menu ─────────────────────────────────────── */
.menu-link { display: block; padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--ink); text-decoration: none; }
.menu-link:hover { background: var(--tint); color: var(--ink); }

/* ── v0.6: quick log on the phone (/q) ────────────────────────────────────── */
.quick { max-width: 520px; margin: 0 auto; }
.quick h1 { margin-bottom: 14px; }
.quick-form { display: flex; flex-direction: column; gap: 14px; }
.quick-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
.quick-form input, .quick-form textarea { font-size: 16px; }
.quick-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.quick-form legend { font-weight: 600; margin-bottom: 5px; padding: 0; }
.quick-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quick-kinds label { position: relative; font-weight: 500; }
.quick-kinds input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.quick-kinds span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; border: 1px solid var(--field); border-radius: 12px; background: #fff; font-size: 12.5px; text-align: center; cursor: pointer; transition: .12s; }
.quick-kinds span .i { width: 20px; height: 20px; }
.quick-kinds.small span { min-height: 42px; }
.quick-kinds input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.quick-kinds input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 80, 250, .25); }
.quick .btn.big { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.quick h2 { font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 26px 0 6px; }
.quick-recent li { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-top: 1px solid var(--line-soft); }

@media (max-width: 1180px) {
  .exec-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .exec-tile { grid-column: 1 / -1; }
  .wait-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .exec-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .xbars { gap: 3px; height: 140px; }
  .xbar-label { font-size: 9px; }
  .quick-kinds:not(.small) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── v0.7: data check you can clear, marketing list ───────────────────────── */
.check-list.fixable li { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.inline-form.tight { margin-top: 0; gap: 6px; }
.check-actions .name-in { width: 120px; padding: 5px 8px; font-size: 12.5px; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; }
.copy-row textarea { flex: 1; min-width: 0; font-size: 12.5px; resize: vertical; }
.stack-form { display: flex; flex-direction: column; gap: 8px; }
.grid-2.tight { gap: 22px; margin-bottom: 6px; }
.grid-2.tight p { margin: 4px 0 10px; }
@media (max-width: 640px) {
  .check-list.fixable li { grid-template-columns: minmax(0, 1fr); }
  .check-actions .name-in { width: calc(50% - 4px); }
  .copy-row { flex-direction: column; align-items: stretch; }
}
.inline-label { flex-direction: row; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.plain-choice-head { margin: 0; font-weight: 600; color: var(--ink); }
.plain-rule { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.plain-form .btn.ghost.big { justify-content: center; border: 1px solid var(--tintborder); background: var(--tint-2); }

/* Saving in the background (no page reload) */
.is-saving { opacity: .55; transition: opacity .15s; }
form.is-saving button { cursor: progress; }
li.is-saving, tr.is-saving { pointer-events: none; }
.plain-preview { background: var(--amber-tint); color: var(--amber); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 0 0 18px; }
.plain-preview a { color: inherit; text-decoration: underline; }
.unsub-link { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }

/* ── v0.8: organization IDs, agreements, certified people ─────────────────── */
.qorg { font-family: inherit; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11px; letter-spacing: .3px; color: var(--muted); background: #f1f2f6; border-radius: 6px; padding: 1px 6px; text-transform: none; }
.agreement-list > li, .cert-list > li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.agreement-list > li:first-child, .cert-list > li:first-child { border-top: 0; }
.cert-list > li { flex-direction: column; gap: 4px; }
.agreement.superseded, .agreement.ended { opacity: .7; }
.agreement-docs { margin: 6px 0 0; }
.agreement-docs li { display: flex; gap: 8px; align-items: center; }
.agreement-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.file-drop.small { padding: 6px 10px; font-size: 12.5px; }
details.add-agreement, details.add-cert { margin-top: 10px; }
details.add-agreement > summary, details.add-cert > summary { list-style: none; display: inline-flex; }
details.add-agreement > summary::-webkit-details-marker, details.add-cert > summary::-webkit-details-marker { display: none; }
details[open].add-agreement > summary, details[open].add-cert > summary { margin-bottom: 12px; }
.linked-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.linked-line .chip .i { width: 12px; height: 12px; }
.link-actions .link-target { width: 190px; padding: 4px 8px; font-size: 12.5px; }
.link-table td { vertical-align: top; }

/* ── v0.9: saved views, list controls, bin, import ────────────────────────── */
.view-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.view-label { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-right: 4px; }
.view-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--body); }
.view-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.view-chip.active a, .view-chip.active .muted { color: #fff; }
.view-chip a { color: inherit; text-decoration: none; }
.icon-btn.tiny { width: 18px; height: 18px; padding: 0; }
.icon-btn.tiny .i { width: 12px; height: 12px; }
.view-save, .column-pick { position: relative; }
.view-save > summary, .column-pick > summary { list-style: none; }
.view-save > summary::-webkit-details-marker, .column-pick > summary::-webkit-details-marker { display: none; }
.list-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 12px; }
.list-controls select { padding: 5px 8px; font-size: 12.5px; max-width: 220px; }
.column-pick .menu-form { left: 0; right: auto; min-width: 220px; }
.map-table select { min-width: 220px; }
.import-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.import-list li:first-child { border-top: 0; }
tr.muted td { color: var(--muted); }

/* Outbound e-mail safety switch: shown on every page while e-mail is not Live */
.email-banner { display: flex; gap: 10px; align-items: center; padding: 7px 24px; font-size: 12.5px; background: var(--amber-tint); color: var(--amber); border-bottom: 1px solid #f3dcb0; }
.email-banner.paused { background: var(--late-tint); color: var(--late); border-bottom-color: #f3b8b3; }
.email-banner a { margin-left: auto; color: inherit; font-weight: 700; }
.email-banner .i { width: 15px; height: 15px; }

/* Sign in with Quintaum (pilot) */
.plain-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 4px 0 12px; }
.plain-or::before, .plain-or::after { content: ''; flex: 1; border-top: 1px solid var(--tintborder); }
.btn.quintaum-btn { display: flex; justify-content: center; width: 100%; border: 1px solid var(--tintborder); background: var(--paper); color: var(--navy); box-shadow: var(--shadow); }
.btn.quintaum-btn:hover { border-color: var(--navy); background: var(--tint-2); }
.plain-link-note { background: var(--tint); border-radius: 10px; padding: 10px 12px; color: var(--navy); }

/* Suggestion drop-down (app.js), in place of the browser's own list */
.combo-pop { position: fixed; z-index: 1000; overflow-y: auto; background: var(--paper); border: 1px solid var(--tintborder); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 4px; margin: 0; }
.combo-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.combo-item:hover, .combo-item[aria-selected="true"] { background: var(--tint); }
.combo-name { color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.3; }
.combo-mail { color: var(--muted); font-weight: 400; font-size: 13px; }
.combo-sub { color: var(--muted); font-size: 12px; line-height: 1.3; }
.combo-item[aria-selected="true"] .combo-name { color: var(--navy); }
.combo-more { padding: 8px 10px 6px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--line-soft); margin-top: 4px; }

/* Menus (<select>) open in the CRM's style where the browser allows it (Chrome and Edge);
   elsewhere they keep the browser's own list. */
@supports (appearance: base-select) {
  select:not([multiple]), ::picker(select) { appearance: base-select; }
  select:not([multiple]) { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  select:not([multiple])::picker-icon { color: var(--faint); transition: rotate .15s; }
  select:not([multiple]):open::picker-icon { rotate: 180deg; }
  ::picker(select) { border: 1px solid var(--tintborder); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 4px; background: var(--paper); margin-block: 4px; max-height: min(360px, 60vh); }
  select:not([multiple]) option { padding: 7px 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500; color: var(--ink); gap: 8px; }
  select:not([multiple]) option:hover, select:not([multiple]) option:focus-visible { background: var(--tint); outline: none; }
  select:not([multiple]) option:checked { font-weight: 600; color: var(--navy); }
  select:not([multiple]) option::checkmark { color: var(--blue); }
  select:not([multiple]) option:disabled { color: var(--faint); }
}
.export-pair { display: inline-flex; }
.export-pair .btn + .btn { padding-left: 6px; padding-right: 8px; color: var(--muted); }
/* Owner, changeable in place */
.owner-switch { display: inline-flex; margin: 0; }
.owner-switch select { padding: 3px 8px; font-size: 13px; font-weight: 600; color: var(--navy); border-color: var(--tintborder); background-color: var(--tint-2); }
.owner-line { display: flex; align-items: center; gap: 8px; margin: -6px 0 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
/* Settings → Owners */
.rule-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.rule-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.rule-list li.off { opacity: .6; }
.rule-actions { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.rule-add { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.rule-add-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.rule-add-row label { min-width: 150px; }
.danger-text { color: var(--late); }
/* Lists */
.list-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 18px; }
.list-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--body); text-decoration: none; }
.list-card:hover { border-color: var(--tintborder); box-shadow: var(--shadow-pop); }
.list-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; color: var(--ink); }
.list-card-count { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.list-card-count span { font-size: 13px; font-weight: 600; color: var(--muted); }
.kind-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-pick legend { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.radio-card { flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--field); border-radius: var(--radius-sm); font-weight: 400; color: var(--body); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--blue); background: var(--tint-2); }
.radio-card strong { display: block; color: var(--ink); margin-bottom: 2px; }
.smart-rules { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px 12px; }
.smart-rules legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.bulk-bar input.qty-wide { padding: 4px 8px; font-size: 12.5px; }
@media (max-width: 640px) { .kind-pick { grid-template-columns: 1fr; } }
/* E-mail logging */
.steps-plain { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.choice-list { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.choice-list legend { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.radio-line { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 13.5px; color: var(--body); }
.mail-file-rows { display: grid; gap: 10px; }
.mail-file-row { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mail-excerpt pre { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--tint-2); padding: 10px; border-radius: 8px; max-height: 260px; overflow: auto; }
.bulk-bar:not(.active) input.qty-wide { opacity: .45; pointer-events: none; }
.mail-copy { white-space: pre-wrap; font: inherit; font-size: 13.5px; line-height: 1.55; background: var(--tint-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 8px; max-height: 70vh; overflow: auto; }

/* Small pages outside the layout: errors, not allowed, not found */
.simple-page { display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 16px; background: var(--backdrop); }
.simple-card { max-width: 560px; width: 100%; padding: 28px; }
.simple-card h1 { font-size: 22px; margin: 0 0 8px; }
.simple-ref { white-space: pre-wrap; background: var(--tint-2); padding: 12px; border-radius: 8px; font-size: 12px; }

/* Authenticator set-up QR code */
.totp-qr { width: 184px; height: 184px; margin: 10px 0 8px; padding: 8px; background: #fff; border: 1px solid var(--tintborder); border-radius: var(--radius-sm); }
.totp-qr svg { display: block; width: 100%; height: 100%; }

/* FAQ answers */
.chip.draft { background: var(--amber-tint); color: var(--amber); }
.answer-filter { width: 100%; max-width: 460px; }
.toolbar .answer-filter { margin-left: 0; }
.answer-group { padding: 17px 22px 20px; }
.answer-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; }
.answer-group-head h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.answer-group-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.answer-item { border-top: 1px solid var(--line); }
.answer-item > summary { display: flex; align-items: center; gap: 10px; padding: 11px 0; cursor: pointer; font-weight: 600; }
.answer-item > summary::-webkit-details-marker { display: none; }
.answer-item > summary::before { content: '›'; flex: none; width: 12px; color: var(--muted); font-size: 16px; line-height: 1; transition: transform .12s; }
.answer-item[open] > summary::before { transform: rotate(90deg); }
.answer-q { min-width: 0; overflow-wrap: anywhere; }
.answer-body { padding: 0 0 16px 22px; }
.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; line-height: 1.55; }
.answer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.answer-edit > summary, .answer-add > summary { display: inline-flex; list-style: none; cursor: pointer; }
.answer-edit > summary::-webkit-details-marker, .answer-add > summary::-webkit-details-marker { display: none; }
.answer-body > .answer-edit { margin-top: 8px; }
.answer-add { margin-top: 12px; }
.answer-form { margin-top: 12px; }
.answer-form textarea { width: 100%; }
.answer-draft { align-self: end; }
.answer-rename { margin-top: 6px; }
.answer-new-group { margin-top: 0; }
.answer-new-group label { flex: 1; min-width: 220px; }
.answer-new-group label input { flex: 1; min-width: 0; }
.answer-pics { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.answer-pic { margin: 0; max-width: min(340px, 100%); }
.answer-pic img { display: block; max-width: 100%; max-height: 260px; border: 1px solid var(--line); border-radius: 8px; }
.answer-pic figcaption { display: flex; align-items: center; gap: 6px; margin-top: 6px; }

/* AI proposals and the connector's consent page */
.proposal-list { list-style: none; margin: 0; padding: 0; }
.proposal { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.proposal:first-child { border-top: 0; }
.proposal-main { min-width: 0; display: grid; gap: 4px; }
.proposal-change s { color: var(--muted); }
.proposal-effects { margin: 2px 0 0; padding-left: 18px; color: var(--muted); }
.connector-consent { max-width: 640px; }
.connector-consent ul { padding-left: 20px; }

/* Event registration pages (12 Nov 2026): one fixed template, filled from the event's fields. */
.sub-h { font-size: 14px; margin: 18px 0 8px; color: var(--ink); }
/* The registration template (13 Nov 2026): the wording beside a preview of the page and e-mails. */
.template-group { display: grid; gap: 12px; padding: 14px 0 4px; border-top: 1px solid var(--line); }
.template-group:first-of-type { border-top: 0; padding-top: 0; }
.template-group legend { font-size: 13px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .5px; padding-top: 14px; }
.template-group textarea { resize: vertical; }
.template-chooser { margin: 0 0 12px; }
.template-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: #fff; overflow: hidden; } /* the public page inside, as it is (event.css) */
.mail-preview { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; background: #fff; overflow: hidden; }
.mail-preview-head { margin: 0; padding: 10px 14px; background: var(--tint); border-bottom: 1px solid var(--line); }
.mail-preview-body { padding: 4px 14px; line-height: 1.5; overflow-wrap: anywhere; }
.event-wording { margin: 16px 0 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.event-wording summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.event-wording[open] summary { margin-bottom: 8px; }
@media (max-width: 900px) { .template-layout { grid-template-columns: minmax(0, 1fr); } }
/* Tags on people and the person timeline (14 Nov 2026). */
.tag-line { align-items: flex-start; flex-wrap: wrap; }
.tag-line > span { padding-top: 5px; }
.tag-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.tag-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--tint); border: 1px solid var(--tintborder); font-size: 12px; font-weight: 600; }
.tag-chip a { color: var(--navy); }
.tag-chip form { margin: 0; }
.tag-x { display: inline-flex; border: 0; background: none; padding: 2px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.tag-x:hover { color: var(--navy); background: #fff; }
.tag-x svg { width: 12px; height: 12px; }
.tag-add { display: inline-flex; gap: 4px; align-items: center; }
.tag-add input { width: 150px; padding: 4px 8px; font-size: 12px; }
.tag-rename { display: flex; gap: 6px; align-items: center; }
.tag-rename input { min-width: 0; width: 180px; }
.tl-filters { margin: 10px 0 12px; }
/* Registration pages for the December session (14 Nov 2026): text beside the form, the event's own questions. */
.zone-pick { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.zone-pick legend { width: 100%; }
.zone-pick .hint { width: 100%; }
.answer-lines { color: var(--body); margin-top: 4px; line-height: 1.4; }
.answer-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 12px; padding: 12px 14px; background: var(--tint); border: 1px solid var(--tintborder); border-radius: var(--radius); }
.answer-summary ul { margin: 4px 0 0; }
/* Mailings (v0.24). */
.note-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--tint); border: 1px solid var(--tintborder); font-size: 13px; }
.note-line > svg { flex: none; }
.note-line > span { flex: 1 1 260px; }
.note-line.warn-line { background: var(--amber-tint); border-color: transparent; }

/* Live previews (15 Nov 2026) */
.preview-error { margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--amber-tint); color: var(--amber); font-size: 13px; }
.live-preview { border-top: 1px solid #e6e8f0; padding-top: 8px; }

/* ── Welcome guide (Tilen, 16 Nov 2026) ────────────────────────────── */
.welcome-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.welcome-steps li { padding-left: 4px; }
.welcome-steps strong { display: block; color: var(--navy, #000078); font-weight: 700; }
.welcome-steps span { display: block; color: var(--body); line-height: 1.5; }

/* The form editor (registration redesign, 16 Nov 2026; from the design brief). */
/* The registration-form editor in the CRM (16 Nov 2026). Append to app/public/app.css, in the event section.
   It uses the CRM's own tokens (--navy, --blue, --line, --tint, --muted, --ink, --radius). */
.fe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .fe { grid-template-columns: minmax(0, 1fr); } }
.fe-lead { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.fe-fixed { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 11px 14px; margin: 0 0 14px; border-radius: 10px; background: var(--tint-2, #f6f8fe); color: var(--muted); font-size: 13px; }
.fe-pill { padding: 4px 10px; border-radius: 99px; background: #fff; border: 1px solid var(--tintborder); color: var(--navy); font-weight: 600; font-size: 12.5px; }
.fe-q { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; background: #fff; }
.fe-q[open] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 80, 250, .10); }
.fe-q > summary { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.fe-q > summary::-webkit-details-marker { display: none; }
.fe-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--navy); font-weight: 700; font-size: 12.5px; }
.fe-title { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-title.is-empty { color: var(--muted); font-weight: 500; }
/* The one-line summary of a closed question sits under its title (beside it, it squeezed the title to one letter). */
.fe-sum { order: 9; flex: 0 0 100%; padding-left: 36px; color: var(--muted); font-size: 12.5px; }
.fe-q[open] .fe-sum { display: none; }
.fe-ico { flex: none; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.fe-ico:hover { border-color: var(--blue); color: var(--navy); }
.fe-ico:disabled { opacity: .35; cursor: default; }
.fe-body { padding: 2px 14px 16px 50px; display: flex; flex-direction: column; gap: 12px; }
.fe-body label:not(.chip-check) { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.fe-body .chip-check { align-self: flex-start; flex: none; }
.fe-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.fe-row label:not(.chip-check) { flex: 1; min-width: 180px; }
.fe-answers { display: flex; flex-direction: column; gap: 7px; }
/* An answer takes two lines at every width: the answer and its remove button, then "Then…" and the "get in touch" tick.
   (In the first build the answer's box was 52px wide beside the other controls.) */
.fe-a { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 0 0 6px; }
.fe-a > input { order: 1; flex: 1 1 0; min-width: 0; }
.fe-a > .fe-ico { order: 2; }
.fe-a::after { content: ''; order: 3; flex: 0 0 100%; height: 0; }
.fe-a > select { order: 4; flex: 0 1 200px; height: 32px; font-size: 12.5px; }
.fe-a > .chip-check { order: 5; }
.fe-a .chip-check span { font-size: 12px; white-space: nowrap; }
.fe-sub { margin: 0 0 4px 16px; padding: 12px 14px; border-left: 3px solid var(--blue); border-radius: 0 10px 10px 0; background: var(--tint-2, #f6f8fe); display: flex; flex-direction: column; gap: 8px; }
.fe-sub p { margin: 0; font-size: 12.5px; color: var(--muted); }
.fe-ticks { display: flex; flex-wrap: wrap; gap: 7px; }
.fe-ticks .chip-check span { font-size: 12.5px; }
.fe-add { align-self: flex-start; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue); background: none; border: 0; padding: 6px 0; cursor: pointer; }
.fe-addq { width: 100%; padding: 13px; border: 1.5px dashed #c3cbe6; border-radius: 12px; background: #fbfcff; color: var(--navy); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.fe-addq:hover { border-color: var(--blue); background: var(--tint); }
.fe-addq:disabled { opacity: .5; cursor: default; }
.fe-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.fe-foot .muted { font-size: 12.5px; }
.fe-preview { position: sticky; top: 16px; }
.fe-preview .ev { border-radius: 12px; overflow: hidden; background: transparent; }
.fe-preview .ev-card { box-shadow: none; }
