/* gp-sales.css — the GP Sales tab, shared by the marketer portal and the GP
   Client Portal (CP5). Extends /css/style.css tokens ONLY — no portal-local
   tokens, so it renders identically on both hosts. Classes are gps-*; the
   component chrome (.kpi-card, .section-card, .data-table, .btn, .pill,
   .modal) comes from style.css. */

/* Layout + primitives the tab used to borrow from marketer.css */
.gps-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.gps-note { font-size: 11px; color: var(--color-slate-400); line-height: 1.5; }
.gps-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gps-hint { font-size: 11px; color: var(--color-on-surface-var); }
.gps-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; margin-bottom: 8px;
  border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.5;
}
.gps-alert--warn   { background: var(--color-warning-bg-faint); color: var(--color-warning-text); }
.gps-alert--danger { background: var(--color-error-bg-faint);   color: var(--color-error-text); }

/* Dialog fields (mirrors the GP registry form chrome) */
.gps__field { display: flex; flex-direction: column; gap: 4px; }
.gps__field label { font-size: 12px; font-weight: 500; color: var(--color-on-surface-var); }
.gps__field input[type="text"],
.gps__field input[type="number"],
.gps__field select {
  min-height: 40px;
  padding: 7px 10px;
  font-size: 13px;
  border: 0.5px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-on-surface);
  outline: none;
  transition: border-color 0.1s;
  font-family: inherit;
}
.gps__field input:focus, .gps__field select:focus { border-color: var(--color-secondary); }
.gps__field input:focus-visible, .gps__field select:focus-visible { box-shadow: var(--focus-ring); }

@media (max-width: 768px) {
  .gps-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── GP Sales tab (/js/gp-sales-tab.js) ───
   Month rows expandable to that month's Meta campaigns; four dialogs
   (Add sales · Update clinic sales · Sales target · History). Field chrome
   is shared with the GP registry form above via the selector lists. */
.gps__kpis { margin-bottom: 20px; }

.gps__note { margin-bottom: 16px; }

.gps__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Header copy stays a readable measure beside four buttons */
.gps__card .section-card__header > div:first-child { max-width: 620px; }

.gps__month-row { cursor: pointer; }
.gps__month-row [data-arrow] { color: var(--color-on-surface-var); }
.gps__month-row:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.gps__month-cell { font-weight: 600; white-space: nowrap; }
.gps__roas { font-weight: 600; }

.gps__camp-row td { background: var(--color-surface-row-alt); white-space: nowrap; }
.gps__camp-name { padding-left: 28px !important; color: var(--color-on-surface-var); }

/* Two-line numeric cells: value over a muted sub-line (leads split, % of target) */
.gps__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}
.gps__sub { font-size: 11px; color: var(--color-slate-400); line-height: 1.4; }
.gps__when { font-size: 12px; color: var(--color-slate-400); white-space: nowrap; }
.gps__pace--on { color: var(--color-success-text); font-weight: 600; }
.gps__pace--behind { color: var(--color-error-text); font-weight: 600; }
.gps__hero-sub { color: var(--color-hero-sublabel); }

/* Dialogs */
.gps__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.gps__form--single { grid-template-columns: 1fr; }

.gps__rm { position: relative; }
.gps__rm-prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-on-surface-var);
  pointer-events: none;
}
.gps__rm input { width: 100%; padding-left: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.gps__field input[type="number"] { -moz-appearance: textfield; }
.gps__field input[type="number"]::-webkit-outer-spin-button,
.gps__field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.gps__preview,
.gps__info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-surface-low);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-on-surface-var);
}
.gps__preview[hidden] { display: none; }
.gps__preview-label { font-weight: 600; color: var(--color-primary-text); }
.gps__preview-result { margin-left: auto; font-weight: 600; color: var(--color-primary-text); }
.gps__info { flex-direction: column; align-items: stretch; gap: 6px; }
.gps__info > div { display: flex; justify-content: space-between; gap: 12px; }

/* History */
.gps__modal .modal__body:has(.gps__history) { padding: 0; }
.gps__history { overflow-x: auto; }
.gps__history-table td { white-space: nowrap; }
.gps__when-cell { color: var(--color-on-surface-var); }
.gps__delta { font-weight: 600; color: var(--color-success-text); }
.gps__strong { font-weight: 600; }
.gps__history-count { font-size: 12px; color: var(--color-slate-400); margin-right: auto; }
.gps__row--voided td { color: var(--color-slate-400); }
.gps__row--voided s { text-decoration-thickness: 1px; }
.gps__warn { margin-top: 2px; }
.gps__warn[hidden] { display: none; }

@media (max-width: 768px) {
  .gps__form { grid-template-columns: 1fr; }
  .gps__actions { flex-wrap: wrap; }
  /* Title + copy above the four buttons instead of beside them */
  .gps__card .section-card__header { flex-direction: column; align-items: stretch; gap: 12px; }
  .gps__card .section-card__header > div:first-child { max-width: none; }
}
