/* Zyrax Customer OS — admin console
   Colour only ever encodes state: plum = brand/primary, red = urgent, marigold = waiting, green = healthy. */
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(/vendor/figtree.woff2) format('woff2');
}

:root {
  --ink: #1f1a2e;
  --ink-2: #4a4458;
  --muted: #736d82;
  --faint: #a39eae;
  --paper: #f7f5f9;
  --surface: #fff;
  --line: #e6e1ea;
  --line-2: #d6cfdc;
  --plum: #6b2d5c;
  --plum-dark: #4f1f44;
  --plum-tint: #f4ebf2;
  --red: #c8372d;
  --red-tint: #fdecea;
  --marigold: #a87200;
  --marigold-fill: #d19000;
  --marigold-tint: #fff5d9;
  --green: #1e7f5c;
  --green-tint: #e4f4ed;
  --blue: #2c5aa0;
  --blue-tint: #e8effa;
  --radius: 6px;
  --rail: 216px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Figtree, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.boot {
  padding: 40px;
  color: var(--muted);
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0;
  font-weight: 750;
}

h2 {
  font-size: 16px;
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: -.005em;
}

h3 {
  font-size: 13.5px;
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--ink-2);
}

p {
  margin: 0 0 8px;
}

a {
  color: var(--plum);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

.right {
  text-align: right;
}

.pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.grow {
  flex: 1;
  min-width: 0;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row.top {
  align-items: flex-start;
}

.wrap {
  flex-wrap: wrap;
}

.stack>*+* {
  margin-top: 14px;
}

.gap-s {
  gap: 6px;
}

.between {
  justify-content: space-between;
}

:focus-visible {
  outline: 2.5px solid var(--marigold-fill);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── shell */
.shell {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
}

.rail {
  background: var(--ink);
  color: #d9d4e2;
  padding: 16px 10px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.rail .brand {
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.01em;
  padding: 2px 10px 0;
}

.rail .brand small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: #a59db4;
  letter-spacing: 0;
  margin-top: 1px;
}

.rail nav {
  margin-top: 18px;
  flex: 1;
}

.rail .group {
  margin: 16px 10px 4px;
  font-size: 11.5px;
  color: #8e86a0;
  font-weight: 600;
}

.rail a.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: #d9d4e2;
  font-weight: 550;
}

.rail a.item:hover {
  background: #2c2540;
  text-decoration: none;
}

.rail a.item.on {
  background: var(--plum);
  color: #fff;
}

.rail .count {
  font-size: 12px;
  font-weight: 700;
  padding: 0 7px;
  border-radius: 999px;
  background: #3a3250;
  color: #fff;
}

.rail .count.hot {
  background: var(--red);
}

.rail .me {
  border-top: 1px solid #332b47;
  padding: 12px 10px 0;
  font-size: 13px;
}

.rail .me b {
  color: #fff;
  display: block;
}

.rail .me button {
  background: none;
  border: 0;
  color: #b7afc6;
  font: inherit;
  padding: 0;
  cursor: pointer;
  margin-right: 12px;
}

.rail .me button:hover {
  color: #fff;
  text-decoration: underline;
}

.main {
  min-width: 0;
  padding: 0 28px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.modebar {
  background: var(--marigold-tint);
  border-bottom: 1px solid #ecd58a;
  color: #6a4a00;
  font-size: 13px;
  padding: 6px 28px;
  margin: 0 -28px;
  font-weight: 550;
}

.search {
  position: relative;
  width: 340px;
}

.search input {
  width: 100%;
}

.search .results {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(31, 26, 46, .14);
  z-index: 20;
  max-height: 360px;
  overflow: auto;
}

.search .results a {
  display: block;
  padding: 8px 12px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.search .results a:hover {
  background: var(--plum-tint);
  text-decoration: none;
}

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pagehead p {
  margin: 4px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

/* ── controls */
button,
.btn {
  font: inherit;
  font-weight: 650;
  padding: 7px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.btn:hover {
  border-color: var(--ink-2);
  text-decoration: none;
}

button.primary {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
}

button.primary:hover {
  background: var(--plum-dark);
}

button.danger {
  color: var(--red);
  border-color: #e8b8b3;
}

button.quiet {
  border-color: transparent;
  background: none;
  color: var(--plum);
  padding: 4px 6px;
}

button.quiet:hover {
  background: var(--plum-tint);
}

button.s {
  padding: 4px 9px;
  font-size: 13px;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 7px 10px;
  max-width: 100%;
}

textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

label.f {
  display: block;
  margin-bottom: 12px;
}

label.f>span {
  display: block;
  font-weight: 650;
  font-size: 13px;
  margin-bottom: 4px;
}

label.f>small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}

label.f input:not([type=checkbox]),
label.f select {
  width: 100%;
}

label.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 550;
}

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tabs button {
  border: 0;
  border-bottom: 2.5px solid transparent;
  border-radius: 0;
  background: none;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 650;
}

.tabs button.on {
  color: var(--plum);
  border-bottom-color: var(--plum);
}

.tabs button .n {
  font-size: 12px;
  margin-left: 5px;
  color: var(--faint);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

/* ── surfaces */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}

.panel.flush {
  padding: 0;
  overflow: hidden;
}

.panel>h2:first-child {
  margin-bottom: 12px;
}

.cols {
  display: grid;
  gap: 18px;
}

.cols.c2 {
  grid-template-columns: 1fr 1fr;
}

.cols.c3 {
  grid-template-columns: repeat(3, 1fr);
}

.cols.side {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.cols.with-rail {
  grid-template-columns: 300px minmax(0, 1fr);
}

@media (max-width: 1100px) {

  .cols.c2,
  .cols.c3,
  .cols.side,
  .cols.with-rail {
    grid-template-columns: 1fr;
  }
}

/* phones: the menu folds into a top bar with a Menu button */
.railhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menubtn {
  display: none;
}

.railbody {
  display: flex;
  flex-direction: column;
  flex: 1;
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 10px 14px;
    overflow: visible;
  }

  .rail .brand {
    padding: 0;
  }

  .menubtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2c2540;
    color: #fff;
    border-color: #3a3250;
    padding: 9px 16px;
    font-size: 15px;
  }

  .railbody {
    display: none;
  }

  .railbody.open {
    display: flex;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding-bottom: 8px;
  }

  .rail a.item {
    padding: 11px 10px;
    font-size: 16px;
  }

  .main {
    padding: 0 14px 40px;
  }

  .modebar {
    margin: 0 -14px;
    padding: 6px 14px;
  }

  .topbar {
    position: static;
  }

  .search {
    width: 100%;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* stops iPhone zooming into fields */
  .modal {
    width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 20px);
  }

  .topbar .search[style] {
    width: calc(100vw - 28px) !important;
  }
}

.empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.error {
  background: var(--red-tint);
  border-left: 3px solid var(--red);
  padding: 9px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-weight: 550;
}

.notice {
  background: var(--marigold-tint);
  border-left: 3px solid var(--marigold-fill);
  padding: 9px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.info {
  background: var(--blue-tint);
  border-left: 3px solid var(--blue);
  padding: 9px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  background: #fbfafc;
  white-space: nowrap;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

tr.click {
  cursor: pointer;
}

tr.click:hover td {
  background: #faf6f9;
}

td .sub {
  color: var(--muted);
  font-size: 12.5px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: #efecf3;
  color: var(--ink-2);
  white-space: nowrap;
}

.badge.red {
  background: var(--red-tint);
  color: var(--red);
}

.badge.amber {
  background: var(--marigold-tint);
  color: #8a5d00;
}

.badge.green {
  background: var(--green-tint);
  color: var(--green);
}

.badge.plum {
  background: var(--plum-tint);
  color: var(--plum);
}

.badge.blue {
  background: var(--blue-tint);
  color: var(--blue);
}

.badge.solid-red {
  background: var(--red);
  color: #fff;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--faint);
}

.dot.red {
  background: var(--red);
}

.dot.amber {
  background: var(--marigold-fill);
}

.dot.green {
  background: var(--green);
}

/* ── dashboard ledger: one line per area, the bar is the breakdown */
.headline {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  padding: 4px 2px 20px;
}

.headline .fig {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.headline .lbl {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.ledger .line {
  display: grid;
  grid-template-columns: 130px minmax(120px, 1fr) minmax(0, 1.5fr);
  gap: 16px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.ledger .line:last-child {
  border-bottom: 0;
}

.ledger .name {
  font-weight: 700;
}

/* status fills validated for colour-blind separation; every segment is also named and counted in the legend beside it */
.bar {
  display: flex;
  gap: 2px;
  height: 12px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}

.bar:empty {
  background: #efecf3;
}

.bar i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: 2px;
}

.bar .g {
  background: var(--green);
}

.bar .a {
  background: var(--marigold-fill);
}

.bar .r {
  background: var(--red);
}

.ledger .legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.ledger .legend b {
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}

.kv {
  display: grid;
  grid-template-columns: fit-content(46%) minmax(0, 1fr);
  gap: 5px 14px;
  font-size: 13.5px;
}

.qa {
  font-size: 13.5px;
}

.qa>div {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.qa>div:last-child {
  border-bottom: 0;
}

.qa .q {
  color: var(--muted);
}

.qa .q.screen {
  color: var(--plum);
}

.qa .a {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-weight: 550;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ── action center lanes */
.lane {
  border-left: 4px solid var(--faint);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lane.URGENT {
  border-left-color: var(--red);
}

.lane.HIGH {
  border-left-color: var(--marigold-fill);
}

.lane.MEDIUM {
  border-left-color: #d9c66b;
}

.lane.LOW {
  border-left-color: var(--faint);
}

.lane>header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 16px 9px;
  border-bottom: 1px solid var(--line);
}

.lane>header b {
  font-size: 15px;
}

.task {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.task:last-child {
  border-bottom: 0;
}

.task .acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .task {
    grid-template-columns: 1fr;
  }

  .task .acts {
    justify-content: flex-start;
  }
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
}

.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip b {
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

/* ── customer 360 journey spine (a real sequence, so it is drawn as one) */
.spine {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spine li {
  position: relative;
  padding: 0 0 15px 26px;
}

.spine li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: -3px;
  width: 2px;
  background: var(--line-2);
}

.spine li:last-child::before {
  display: none;
}

.spine li::after {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-2);
}

.spine li.done::after {
  background: var(--green);
  border-color: var(--green);
}

.spine li.done::before {
  background: var(--green);
}

.spine li.now::after {
  background: var(--marigold-fill);
  border-color: var(--marigold-fill);
}

.spine li.bad::after {
  background: var(--red);
  border-color: var(--red);
}

.spine .step {
  font-weight: 700;
}

.spine .when {
  color: var(--muted);
  font-size: 12.5px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline time {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.timeline .who {
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}

/* ── chat bubbles (customer 360 messages + simulator) */
.chat {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  background: #efe9e1;
  border-radius: 8px;
  max-height: 560px;
  overflow-y: auto;
}

.bubble {
  max-width: 78%;
  padding: 7px 10px 5px;
  border-radius: 8px;
  background: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

.bubble.out {
  align-self: flex-end;
  background: #dcf8c6;
}

.bubble.in {
  align-self: flex-start;
}

.bubble.fail {
  background: var(--red-tint);
}

.bubble .meta {
  font-size: 11px;
  color: #6c7a6a;
  text-align: right;
  margin-top: 3px;
}

.bubble .wa-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 6px;
  padding: 6px;
  background: #fff;
  border: 0;
  border-top: 1px solid #cfe6bd;
  border-radius: 0 0 6px 6px;
  color: #0b6bcb;
  font-weight: 650;
  cursor: pointer;
}

.bubble .wa-btn:disabled {
  color: #7a8794;
  cursor: default;
  opacity: 1;
}

.phone {
  width: 380px;
  max-width: 100%;
  border: 10px solid var(--ink);
  border-radius: 30px;
  overflow: hidden;
  background: #efe9e1;
  display: flex;
  flex-direction: column;
  height: 690px;
}

.phone .bar-top {
  background: #075e54;
  color: #fff;
  padding: 12px 14px;
  font-weight: 700;
}

.phone .chat {
  flex: 1;
  max-height: none;
  border-radius: 0;
}

.phone form {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: #f0f0f0;
}

.phone form input {
  flex: 1;
  border-radius: 999px;
}

/* ── modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 46, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  z-index: 50;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: 10px;
  width: 560px;
  max-width: 100%;
  box-shadow: 0 24px 60px rgba(31, 26, 46, .3);
}

.modal.wide {
  width: 860px;
}

.modal>header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.modal>header h2 {
  margin: 0;
  font-size: 17px;
}

.modal>.body {
  padding: 16px 18px;
}

.modal>footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 80;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.toast.bad {
  background: var(--red);
}

/* ── login */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.login .pitch {
  background: var(--plum);
  color: #fff;
  padding: 9vh 7vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login .pitch h1 {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 800;
  max-width: 12ch;
}

.login .pitch p {
  font-size: 17px;
  opacity: .88;
  max-width: 34ch;
  margin-top: 18px;
}

.login .pitch .flow {
  font-size: 13.5px;
  opacity: .8;
  line-height: 1.9;
}

.login .form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 7vw;
  max-width: 520px;
}

.login .form h2 {
  font-size: 22px;
  margin-bottom: 18px;
}

@media (max-width: 860px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login .pitch {
    padding: 32px 24px;
  }

  .login .pitch h1 {
    font-size: 30px;
  }

  .login .pitch .flow {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: rise .18s ease-out;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translate(-50%, 8px);
    }
  }
}

/* ── buttons shared by <a> and <button> */
.btn {
  display: inline-block;
}

.btn.primary {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
}

.btn.primary:hover {
  background: var(--plum-dark);
}

.btn.s {
  padding: 4px 9px;
  font-size: 13px;
}

button.big,
.btn.big {
  font-size: 16px;
  padding: 11px 22px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

label.chip {
  display: inline-flex;
  align-items: center;
  user-select: none;
}

label.chip:focus-within {
  outline: 2.5px solid var(--marigold-fill);
  outline-offset: 2px;
}

.late {
  color: var(--red);
  font-weight: 650;
}

/* ── call screen */
.dial {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.dial>.info,
.dial>.notice,
.dial>.error,
.dial>.row,
.dial>p {
  flex-basis: 100%;
}

.dial .live {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(30, 127, 92, .5);
}

@media (prefers-reduced-motion: no-preference) {
  .pulse {
    animation: pulse 1.4s ease-out infinite;
  }

  @keyframes pulse {
    to {
      box-shadow: 0 0 0 10px rgba(30, 127, 92, 0);
    }
  }
}

.checks label.check {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.checks label.check:last-child {
  border-bottom: 0;
}

.checks {
  margin-bottom: 12px;
}

/* ── nutritionist consultation */
fieldset.qs {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 6px;
  padding: 10px 0 0;
}

fieldset.qs legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0 6px 0 0;
}

fieldset.qs.screen {
  background: var(--plum-tint);
  border-radius: 6px;
  border-top: 0;
  padding: 10px 12px 2px;
  margin-top: 8px;
}

fieldset.qs.screen legend {
  color: var(--plum);
  float: left;
  width: 100%;
  padding: 0 0 6px;
}

.chart-edit h3 {
  margin-top: 6px;
}

.chart-edit .meal {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--paper);
}

.chart-edit .meal textarea {
  margin-top: 6px;
  width: 100%;
}

/* ── diet chart preview: the same structure as the PDF */
.chart-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  background: #fff;
  max-height: 56vh;
  overflow-y: auto;
}

.chart-preview .cp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--plum);
  padding-bottom: 8px;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-preview .cp-brand {
  font-weight: 800;
  color: var(--plum);
  font-size: 16px;
}

.chart-preview h2 {
  font-size: 19px;
  margin-bottom: 6px;
}

.chart-preview ul {
  margin: 4px 0 0 18px;
  padding: 0;
}

.chart-preview li {
  margin-bottom: 2px;
}

table.cp-meals {
  margin: 10px 0 12px;
}

table.cp-meals th {
  width: 150px;
  text-align: left;
  vertical-align: top;
  background: var(--plum-tint);
  color: var(--ink);
  font-size: 13px;
  padding: 8px 10px;
  border-bottom: 2px solid #fff;
}

table.cp-meals td {
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 600px) {
  table.cp-meals th {
    width: 96px;
  }
}

/* ── admin additions: integrations editor, call tracker, queries, sales report */
.notice.bad {
  background: var(--red-tint);
  border-left-color: var(--red);
}

.keys {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.keys .f>span.row {
  align-items: baseline;
}

.keys input[type=password],
.keys input[type=text] {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}

.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.statcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.statcard h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.statcard .nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 13px;
}

.statcard .nums button.linky {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: underline dotted;
  cursor: pointer;
  font: inherit;
}

.statcard .big {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.bulkbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--plum-tint, #f3e8f0);
  border: 1px solid #e3cbe0;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.bulkbar .pickpeople {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1 1 320px;
}

.bulkbar .chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #fff;
  border: 1px solid #d9c3d4;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 14px;
}

.bulkbar .chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.bulkbar .chip input {
  margin: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.filters label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}

.sparkbars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 70px;
  margin: 8px 0 4px;
}

.sparkbars i {
  flex: 1;
  background: var(--plum, #6b2d5c);
  min-height: 1px;
  border-radius: 2px 2px 0 0;
  opacity: .85;
}

.sparkbars i.zero {
  background: var(--line, #e6e1ea);
}

/* sales dashboard */
.salesfilters {
  margin-bottom: 14px;
  padding: 12px 14px;
}

button.s.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.statgrid.kpis6 {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.sectionh {
  font-size: 15px;
  margin: 18px 0 8px;
}

.teamcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.teamcard {
  text-align: left;
  white-space: normal;
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 400;
}

.teamcard:hover:not([disabled]) {
  border-color: var(--plum);
}

.teamcard.on {
  border-color: var(--plum);
  box-shadow: 0 0 0 1px var(--plum) inset;
}

.teamcard[disabled] {
  cursor: default;
  opacity: .85;
}

.teamcard .big {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 6px 0 4px;
}

.teamcard .kv {
  margin-top: 10px;
}

.sharebar {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  min-width: 70px;
}

.sharebar i {
  display: block;
  height: 100%;
  background: var(--plum);
  border-radius: 99px;
}

@media (max-width: 640px) {
  .salesfilters .filters label {
    width: 100%;
  }
}

/* finance */
.dot.plumdot {
  background: var(--plum);
}

.statcard.neg .big {
  color: var(--red);
}

.statcard.pos .big {
  color: var(--green);
}

.pnlbars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
  padding: 10px 16px 6px;
}

.pnlbars .pb {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 100%;
  min-width: 4px;
}

.pnlbars .pb i {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 1px;
}

.pnlbars .pb i.n {
  background: var(--plum);
}

.pnlbars .pb i.e {
  background: var(--marigold-fill);
}

.gridwrap {
  overflow-x: auto;
}

table.salesgrid {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}

table.salesgrid th,
table.salesgrid td {
  padding: 7px 8px;
  white-space: nowrap;
  font-size: 13px;
}

table.salesgrid .sticky {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  min-width: 150px;
  box-shadow: 1px 0 0 var(--line);
}

table.salesgrid thead .sticky {
  background: #fbfafc;
}

table.salesgrid tr.totalrow td {
  background: #fbfafc;
  border-top: 2px solid var(--line-2);
}

.exportgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.exportcard {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.exportbtns .btn.s,
a.btn.s {
  padding: 4px 10px;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
}

.gap-s {
  gap: 6px;
}

/* bulk assign on Leads / Customers */
.selbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--plum-tint);
  border: 1px solid #e3cbe0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.selbar .chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #fff;
  border: 1px solid #d9c3d4;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.selbar .chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.selbar .chip input {
  margin: 0;
}