/* Pine & Citrus skin for the FleetFixer Bridge (CRM).
   /shared/style.css is synced from elsewhere and still carries the old
   navy/teal token values, so it must not be edited here. This file loads
   after it, re-points every legacy token at the Pine & Citrus palette
   from /shared/ff-tokens.css, and restates the few rules in style.css
   that hardcode old colors. Visual only: no selectors are renamed. */

:root {
  --accent:        var(--pine-600);
  --accent-dark:   var(--pine-700);
  --accent-soft:   var(--sea-50);
  --accent-ring:   rgba(21,97,74,.18);
  --text:          var(--bark-900);
  --muted:         #5A6B61;
  --dim:           #9DB0A6;
  --stroke:        #E1E9DD;
  --stroke-strong: #CDD8C6;
  --bg:            #F1F5EF;
  --bg-subtle:     #E8F0E6;
  --panel-hover:   var(--bark-50);
  --err:           var(--pine-600);
  --err-soft:      var(--sea-50);
  --info:          var(--pine-600);
  --info-soft:     var(--sea-50);

  --shadow-xs:     0 1px 2px rgba(15,40,30,.06);
  --shadow-sm:     0 4px 10px rgba(15,40,30,.06);
  --shadow-md:     0 10px 28px rgba(15,40,30,.08);
}

/* Brand shape language: pill buttons. */
.btn { border-radius: var(--radius-pill); }

/* Rules in style.css that hardcode the old teal/navy. */
.btn-danger { box-shadow: inset 0 0 0 1px rgba(21,97,74,.35); }
.msg.err  { border-color: rgba(21,97,74,.2); }
.msg.info { border-color: rgba(21,97,74,.2); }

.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--surface-2) 50%, var(--bg-subtle) 100%);
  background-size: 200% 100%;
}

.crm-login-page {
  background:
    radial-gradient(circle at 15% 10%, rgba(21,97,74,.07) 0, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(21,97,74,.05) 0, transparent 45%),
    var(--bg);
}

pre.out {
  background: var(--pine-800);
  color: var(--sea-100);
  border-color: var(--pine-700);
}

.modal-backdrop { background: rgba(15,40,30,.44); }

/* ==========================================================
   Shared CRM components (added for the staff-onboarding pass).
   These replace per-page inline styles so every list page gets
   the same toolbar, filter box, and small button. CRM-owned, so
   they live here rather than in the synced style.css.
   ========================================================== */

/* Toolbar cluster that sits in a panel heading (search + filters +
   primary action). Pairs with the existing .h2-actions, and also works
   as a standalone row on pages whose filters are not inside an <h2>. */
.crm-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* One canonical look for every search box and filter select. Was
   reproduced inline on seven pages in two conflicting value sets. */
.crm-filter {
  background: var(--panel);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.crm-filter:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input.crm-filter { width: 240px; max-width: 100%; }
@media (max-width: 640px) { input.crm-filter { width: 100%; } }

/* Real small button, so pages stop carrying inline padding/font-size. */
.btn.small { padding: 4px 10px; font-size: 11px; }

/* Persistent back link for the club/customer detail pages. */
.crm-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}
.crm-back:hover { color: var(--accent); text-decoration: none; }
.crm-back i { font-size: 11px; }

/* Command-palette additions: group headers, keyboard highlight, and the
   "records still loading" hint. Base .crm-search-* rules are in style.css. */
.crm-search-group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--dim);
  padding: 8px 10px 3px;
}
.crm-search-hit.is-active { background: var(--bg-subtle); }
.crm-search-loading {
  padding: 7px 10px 9px;
  font-size: 11px;
  color: var(--dim);
}

/* ==========================================================
   Platform access switches. Shared by every platform picker
   (account / customer / pilot / pilots). A real on/off toggle
   built from a checkbox, laid out as rows, grouped with a live
   count and All / None. Rendered by renderPlatformSwitches().
   ========================================================== */
.plat-groupwrap { margin-bottom: 14px; }
.plat-group {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 0 4px; padding: 0 2px;
}
.plat-group-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--dim);
}
.plat-group-tools { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.plat-count { color: var(--muted); font-weight: 600; }
.plat-all, .plat-none {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font: inherit; font-size: 11px; font-weight: 600;
}
.plat-all:hover, .plat-none:hover { text-decoration: underline; }

.plat-switches { display: flex; flex-direction: column; gap: 2px; }
.plat-switch {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr auto 40px;
  align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.plat-switch:hover { background: var(--bg-subtle); }
.plat-switch:has(input:checked) { background: var(--accent-soft); }
.plat-ico { width: 20px; text-align: center; font-size: 14px; color: var(--dim); }
.plat-switch:has(input:checked) .plat-ico { color: var(--accent); }
.plat-name { font-size: 13px; font-weight: 600; color: var(--text); }
.plat-code { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.plat-switch input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.plat-track {
  justify-self: end;
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--stroke-strong); position: relative;
  transition: background .15s;
}
.plat-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(20,32,27,.25);
  transition: transform .15s;
}
.plat-switch:has(input:checked) .plat-track { background: var(--accent); }
.plat-switch:has(input:checked) .plat-track::after { transform: translateX(16px); }
.plat-switch:has(input:focus-visible) .plat-track { box-shadow: var(--focus-ring); }
