/* ── Dashboard ──────────────────────────────────────────── */
/* Team and group styles live in team.css. */

.dash {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 30px;
  align-items: start;
  width: 100%;
}

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

.dash-side {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 860px) { .dash-side { position: static; } }

.agent-picker { display: flex; flex-direction: column; gap: 8px; }

.select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 14.5px;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

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

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.16s var(--ease);
}

.dash-nav-item:hover { background: var(--surface); color: var(--text); }
.dash-nav-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.dash-nav-item svg { width: 16px; height: 16px; }
.dash-nav-item:disabled { opacity: 0.4; cursor: not-allowed; }
.dash-nav-item:disabled:hover { background: transparent; color: var(--muted); }

/* Label truncates rather than wrapping; flex:1 pushes trailing pills right. */
.dash-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

/* On phones the sidebar disappears entirely: mobile-nav.css hides it at the
   same breakpoint and the trigger-bar + bottom-sheet nav takes over. */

.dash-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

/* Tab strip above a merged section's card. Sits left rather than stretching:
   two tabs stretched across a wide panel read as a split view, not a choice. */
.dash-main > .segmented { align-self: flex-start; margin-bottom: -4px; }

.panel { padding: 26px 26px 28px; display: flex; flex-direction: column; gap: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.panel-title { font-size: 20px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.panel-note { font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.55; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

.stat {
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}

.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.stat-label { font-size: 12.5px; color: var(--subtle); margin-top: 2px; }

.empty-state {
  padding: 50px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.empty-state h3 { font-size: 19px; color: var(--text); }
.empty-state p { max-width: 40ch; font-size: 14.5px; line-height: 1.6; }

.wiki-layout { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }

.wiki-list { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }

/* Phones: the side column becomes a horizontal strip of pills above the
   article — a 420px nested scroll area stacked on top of the content was
   most of a screen of chrome. 860 rather than 760: between the two the old
   layout squeezed the list into a 230px sliver. */
@media (max-width: 860px) {
  .wiki-layout { grid-template-columns: 1fr; gap: 14px; }
  .wiki-list {
    flex-direction: row;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .wiki-item {
    flex: none;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-color: var(--line);
    background: var(--bg-raised);
  }
}

.wiki-item {
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s var(--ease);
}

.wiki-item:hover { background: var(--surface); color: var(--text); }
.wiki-item[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.wiki-section { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.wiki-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--subtle); font-weight: 500; }
.wiki-fact { padding: 11px 14px; border-radius: var(--r-sm); background: var(--bg-raised); border: 1px solid var(--line); font-size: 14px; line-height: 1.55; }

.save-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.save-note { font-size: 13px; color: var(--good); }

.snippet {
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  overflow-x: auto;
  white-space: pre;
}

/* ── Payments ───────────────────────────────────────────── */

.price-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.price-input { display: flex; align-items: center; gap: 0; flex: 1; min-width: 180px; }

.price-prefix {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: var(--r-md) 0 0 var(--r-md);
  background: var(--surface-hi);
  color: var(--muted);
  font-size: 15px;
}

.price-input .input { border-radius: 0 var(--r-md) var(--r-md) 0; }
.price-input .input:focus { position: relative; z-index: 1; }

.status-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}

.status-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
}

.status-icon.is-good { background: rgba(111, 191, 143, 0.12); color: var(--good); }
.status-icon.is-warn { background: rgba(214, 165, 92, 0.12); color: var(--warn); }

.callout {
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

.callout strong { color: var(--text); font-weight: 600; }

.callout--good {
  border-color: rgba(111, 191, 143, 0.26);
  background: rgba(111, 191, 143, 0.08);
}

/* The sidebar's quiet meta row: Support · Developers, side by side at the
   bottom left. Exits, not destinations — full-width stacking gave them the
   visual weight of nav items, which they are not. */
.dash-side-foot {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  margin-top: 2px;
}

/* Anchor links styled as quiet rows; also resets <button> user-agent styling
   for any other call sites that reuse the class. */
.dash-dev-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--subtle);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.dash-dev-link:hover { color: var(--text); background: var(--surface); }
.dash-dev-link svg { width: 13px; height: 13px; }

/* Group heading: says what the sections under it are for, so a dozen entries
   read as four short lists instead of one long one. It also does the job the
   account separator line used to, which is why that rule is now a no-op. */
.dash-nav-group {
  padding: 14px 13px 5px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

.dash-nav-group:first-child { padding-top: 2px; }

.dash-nav-item.is-account { border-top: none; }

/* ── Behaviour: titled clusters, so a long form reads as a few decisions ── */
.behaviour-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.behaviour-group:first-of-type { padding-top: 0; border-top: none; }

.behaviour-group-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

/* ── Sub-sections inside one panel ──────────────────────────
   The behaviour-group rhythm, generalised: a panel that does two or three
   related jobs (Answers: settings → unanswered → approved) separates them
   with a hairline and a quiet heading instead of ad-hoc margins, so every
   composite panel breathes at the same rate. */
.panel-sub {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* The first sub after the panel head sits flush — the head already opened the
   panel; a rule straight under it would read as a second lid. */
.panel-sub:first-child,
.panel-head + .panel-sub { padding-top: 0; border-top: none; }

.panel-sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-sub-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.panel-sub-note { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-top: -8px; }

/* A vertical run of cards (leads, gaps, reports) at one consistent pitch. */
.item-stack { display: flex; flex-direction: column; gap: 10px; }

/* Inside a sub-section, actions sit bottom-RIGHT with air above them — the
   settings-form convention everywhere from macOS to ChatGPT. row-reverse
   keeps the primary button at the far right edge and puts the "Saved" note
   (later in the DOM) to its left, where a status whisper belongs. */
.panel-sub .save-row {
  flex-direction: row-reverse;
  justify-content: flex-start;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
