/* ── Team ───────────────────────────────────────────────── */

/* .input and .select are width:100% by default, which makes them consume a
   whole flex row. Inside these rows they size to content instead. */
.invite-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
input.invite-row-input, .invite-row input.input { flex: 1 1 220px; width: auto; min-width: 0; }
.invite-row .btn { flex: none; }
/* `select.` rather than `.role-select` alone: the generic `.select { width:100% }`
   is declared later in this file and would otherwise win at equal specificity. */
select.role-select { width: auto; min-width: 132px; flex: none; }

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

.member-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.member-row:last-child { border-bottom: none; }
.member-row.is-pending { opacity: 0.72; }

.member-avatar {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
}

.member-avatar.is-pending { background: var(--surface-hi); color: var(--subtle); }
.member-avatar svg { width: 14px; height: 14px; }

.member-main { flex: 1; min-width: 0; }
.member-name { font-size: 14.5px; font-weight: 500; }
.member-meta { font-size: 12.5px; color: var(--subtle); }

.invite-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ── Groups ─────────────────────────────────────────────── */

.group-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}

.group-head { display: flex; align-items: center; gap: 10px; }
.group-name { font-size: 14px; font-weight: 500; flex: 1; }
.group-name.is-fixed { color: var(--muted); }
.group-name-input { flex: 1; padding: 8px 12px; font-size: 14px; }

.source-groups { display: inline-flex; gap: 4px; flex-wrap: wrap; flex: none; }

.group-chip {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--subtle);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s var(--ease);
}

.group-chip:hover { color: var(--text); border-color: var(--line-hi); }
.group-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ── Dashboard ──────────────────────────────────────────── */

.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); }

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

.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; }
.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; }
@media (max-width: 760px) { .wiki-layout { grid-template-columns: 1fr; } }

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

.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); }

/* ── Charts ─────────────────────────────────────────────────
   One measure over time = one hue, no legend (the title names it).
   Marks: columns capped at 24px, 4px rounded cap and square at the
   baseline, 2px surface gap between neighbours, hairline recessive axis. */

.chart { display: flex; flex-direction: column; gap: 10px; }

.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart-title { font-size: 14.5px; font-weight: 500; }
.chart-sub { font-size: 12.5px; color: var(--subtle); }

.chart-plot {
  display: flex;
  align-items: flex-end;
  gap: 2px;                      /* the surface gap, one consistent width */
  height: 132px;
  padding-top: 8px;
  border-bottom: 1px solid var(--line);
}

.chart-col {
  flex: 1;
  min-width: 0;
  max-width: 24px;               /* never fill the slot -- the rest is air */
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
  cursor: default;
}

.chart-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;    /* rounded data-end, square at the baseline */
  min-height: 2px;
  transition: opacity 0.15s var(--ease);
}

.chart-col:hover .chart-bar { opacity: 0.75; }

.chart-col .chart-tip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -6px);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--bg-raised);
  border: 1px solid var(--line-hi);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease);
  z-index: 3;
}

.chart-col:hover .chart-tip { opacity: 1; }
.chart-tip b { font-weight: 600; }

.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}

/* Meter list — part-to-whole without a pie, same-ramp track */
.meter-list { display: flex; flex-direction: column; gap: 12px; }
.meter-row { display: flex; flex-direction: column; gap: 6px; }
.meter-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.meter-head span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-track { height: 6px; border-radius: var(--r-pill); background: var(--accent-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); }

.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);
}

/* Workspace-level nav entry, set apart from the per-agent ones above it. */
.dash-nav-item.is-account {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}

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

.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.order-row:last-child { border-bottom: none; }
.order-amount { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ── Plan & billing: two upgrade cards, a little wider, centered ── */
.plan-grid--two {
  /* Capped near the landing card width: wide enough to breathe, never so
     wide the copy inside stops reading as a card. */
  grid-template-columns: repeat(2, minmax(280px, 390px));
  justify-content: center;
}
@media (max-width: 900px) {
  .plan-grid--two { grid-template-columns: 1fr; }
}
