/* Business owner pages: join, business form, perk form, dashboard (owner agent).
   Only what site.css does not already have. Mobile first. */

/* ------------------------------------------------------------------ join */
.join-split { gap: var(--s-8); }
@media (min-width: 900px) { .join-split { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: var(--s-10); } }
.join-main .page-head { margin-bottom: var(--s-5); }
.join-invited { margin-bottom: var(--s-5); }
.join-card { max-width: var(--w-narrow); }
.join-card .card-title { margin-bottom: var(--s-5); }
.join-card .form-actions { margin-top: var(--s-5); }
.join-aside { align-self: start; }
@media (min-width: 900px) { .join-aside { padding-top: var(--s-10); } }
.join-aside-title { font-size: var(--fs-xl); margin-bottom: var(--s-5); }
.join-features { grid-template-columns: minmax(0, 1fr) !important; gap: var(--s-5); }
.join-steps { margin-top: var(--s-7); }
.join-steps-title { font-size: var(--fs-md); margin-bottom: var(--s-3); }
.join-steps-list { display: grid; gap: var(--s-3); list-style: none; margin: 0; padding: 0; }
.join-steps-list li { display: flex; align-items: flex-start; gap: var(--s-3); margin: 0; line-height: 1.35; }
.join-steps-list strong { display: block; }
.join-step-text { display: block; color: var(--muted); font-size: var(--fs-sm); }
.join-step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line-strong);
  font-size: var(--fs-sm);
  font-weight: 800;
}

/* ------------------------------------------------------------------ business form */
.form-section { margin: 0 0 var(--s-7); }
.form-section > legend { margin-bottom: var(--s-4); font-weight: 800; }
.biz-form .form-actions { margin-top: var(--s-6); }
.biz-form .switch-row { margin-top: 0; }

.loc-box {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: 14px;
  background: var(--card);
  border: 1.5px solid var(--line-strong);
}
.loc-box[data-state="none"],
.loc-box[data-state="approx"] { background: var(--butter); border-color: var(--butter-line); }
.loc-box[data-state="gps"] { background: var(--ok-tint); border-color: var(--ok-line); }
.loc-status { display: flex; align-items: flex-start; gap: var(--s-3); }
.loc-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.loc-icon .icon { width: 1.15rem; height: 1.15rem; }
.loc-box[data-state="none"] .loc-icon,
.loc-box[data-state="approx"] .loc-icon { background: var(--sun); color: var(--ink); }
.loc-words { min-width: 0; }
.loc-title { margin: 0; font-weight: 800; line-height: 1.3; }
.loc-text { margin: 0.15rem 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.loc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.loc-note { margin: 0; font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; }
.loc-note:empty { display: none; }
.loc-tip { margin: 0; }
.loc-skip { margin: 0; padding-top: var(--s-3); border-top: 1px solid var(--butter-line); }
.biz-danger, .perk-danger { margin-top: var(--s-9); }
.biz-danger .field, .perk-danger .field { margin-bottom: var(--s-3); }

/* Desktop only: a side column with shortcuts (edit) or why we ask (setup). Phones have it all on the dashboard. */
.biz-aside { display: none; }
@media (min-width: 1024px) {
  .biz-layout { display: grid; grid-template-columns: minmax(0, 42rem) minmax(0, 19rem); justify-content: space-between; gap: var(--s-8); align-items: start; }
  .biz-aside { display: block; position: sticky; top: calc(var(--header-h) + var(--s-5)); }
}
.biz-aside-panel .biz-card-head { margin-bottom: var(--s-3); }
.biz-aside-name { min-width: 0; }
.biz-aside-name p { margin: 0 0 0.25rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.biz-aside-name .pill { margin-left: 0; }
.biz-aside-title { margin-bottom: var(--s-4); font-size: var(--fs-md); }
.biz-aside-list { display: grid; gap: var(--s-4); list-style: none; margin: 0; padding: 0; }
.biz-aside-list li { display: flex; gap: var(--s-3); margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.biz-aside-list .icon { margin-top: 0.05rem; color: var(--brand); }
.biz-aside-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.biz-aside-links li { margin: 0; border-bottom: 1px solid var(--line); }
.biz-aside-links li:last-child { border-bottom: 0; }
.biz-aside-links a { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); padding: 0.5rem 0.25rem; color: var(--ink); font-weight: 600; text-decoration: none; }
.biz-aside-links a:hover { color: var(--brand); }
.biz-aside-links .icon { color: var(--muted); }

/* ------------------------------------------------------------------ perk form */
.perk-form { display: grid; gap: 0 var(--s-8); }
.perk-form-fields { min-width: 0; max-width: var(--w-text); }
.perk-title-field { margin-bottom: var(--s-5); }
.perk-title-field .field { margin-bottom: var(--s-3); }
.perk-ideas { padding-bottom: 0; }
.range-count {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: var(--s-3) 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--paper);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.4;
}
.range-count .icon { width: 1.1rem; height: 1.1rem; margin-top: 0.05rem; color: var(--muted); }
/* Nobody in range (perk.php / perk-form.js set data-state): customers won't see the perk, so it reads as a notice */
.range-count .range-icon-none,
.range-count[data-state="zero"] .range-icon-some { display: none; }
.range-count[data-state="zero"] { background: var(--butter); box-shadow: inset 0 0 0 1px var(--butter-line); }
.range-count[data-state="zero"] .range-icon-none { display: inline-block; color: var(--ink); }
.range-count a { white-space: nowrap; }
.choice-list-scroll { max-height: 23rem; overflow-y: auto; overscroll-behavior: contain; }
.radio-card-extra .label { margin-bottom: 0.5rem; }
/* Under 900px the preview and buttons sit under the fields: keep them as wide as the fields */
.perk-preview { min-width: 0; max-width: var(--w-text); margin-top: var(--s-2); }
.perk-preview-title { margin-bottom: var(--s-3); font-size: var(--fs-md); color: var(--muted); }
.perk-preview-note { margin: var(--s-3) 0 0; }
.perk-form-actions { margin-top: var(--s-6); max-width: var(--w-text); }
.perk-biz-note { max-width: var(--w-text); }
@media (min-width: 900px) {
  .perk-form { grid-template-columns: minmax(0, 1fr) minmax(0, 23rem); grid-template-areas: "fields preview" "actions preview"; align-items: start; }
  .perk-form-fields { grid-area: fields; }
  .perk-form-actions { grid-area: actions; }
  .perk-preview { grid-area: preview; position: sticky; top: calc(var(--header-h) + var(--s-5)); margin-top: 0; }
}

/* ------------------------------------------------------------------ dashboard */
.dash-jump { margin-bottom: var(--s-5); }
.dash-jump .chip { white-space: nowrap; }
.dash-list { display: grid; gap: var(--s-7); }
.dash-biz { scroll-margin-top: calc(var(--header-h) + 1rem); }
.dash-biz .biz-card-head { align-items: flex-start; flex-wrap: wrap; }
.dash-biz .biz-card-head .pill { margin-top: 0.35rem; }
.dash-biz-name { flex: 1 1 12rem; min-width: 0; }
/* Phones: the status pill sits under the name instead of wrapping to the far right */
@media (max-width: 599px) {
  .dash-biz-name { flex-basis: calc(100% - 3rem); }
  .dash-biz .biz-card-head { row-gap: var(--s-2); }
  .dash-biz .biz-card-head .pill { margin: 0 0 0 3rem; }
}
.dash-biz-name h2 { margin: 0; font-size: var(--fs-xl); overflow-wrap: anywhere; }
.dash-biz-meta { margin: 0.2rem 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.dash-notice { margin-bottom: var(--s-4); }
.dash-block { margin-top: var(--s-7); }
.dash-sub { margin: 0 0 var(--s-3); font-size: var(--fs-md); }
.dash-people { gap: var(--s-6); }
.dash-people .list-row-unit { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.dash-empty {
  margin: 0;
  padding: var(--s-4);
  border-radius: 14px;
  background: var(--paper);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.dash-perks-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.dash-add-perk { margin: var(--s-4) 0 0; }
.dash-empty-perks { display: grid; gap: var(--s-4); justify-items: start; }
.dash-empty-perks p { margin: 0; }
@media (max-width: 599px) { .dash-empty-perks .btn { width: 100%; } }
.dash-add-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 4.5rem;
  padding: var(--s-4);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-card);
  color: var(--brand);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.dash-add-tile:hover { background: var(--paper); border-color: var(--field); color: var(--brand-dark); }
.dash-add-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--brand-tint);
}
.dash-add-icon .icon { width: 1.25rem; height: 1.25rem; }
@media (max-width: 767px) { .dash-add-tile { flex-direction: row; } .dash-add-icon { width: 2rem; height: 2rem; } }
.dash-more {
  display: grid;
  justify-items: center;
  gap: var(--s-2);
  margin-top: var(--s-7);
  padding: var(--s-6) var(--s-5);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-card);
  text-align: center;
}
.dash-more .form-note { margin: 0; }
@media (max-width: 599px) { .dash-more .btn { width: 100%; } }
