/* Shared building blocks for the Facility Settings pages and the Payments page. Page stylesheets (general-settings, staff-settings,
   sched-settings, ...) hold only what is specific to that page and may use anything defined here; they must not borrow classes from
   each other. Loaded before every page stylesheet (site/app/index.html and native/src/main.js keep the same order). */
/* ---- building blocks: page card, buttons, form fields, dialog, menu, notes (was settings.css) ------------ */
.st { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 1180px; color: #0b0f17; font-size: 14px; }
.st h1 { font-family: var(--body); font-weight: 700; text-transform: none; letter-spacing: -.01em; font-size: 26px; line-height: 1.2; color: #0b0f17; }
.st h2 {
  font-family: var(--body);
  font-weight: 700;
  text-transform: none;
  letter-spacing: -.01em;
  font-size: 20px;
  line-height: 1.25;
  color: #0b0f17;
  margin: 0;
}
.st h3 { font-family: var(--body); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 16px; color: #0b0f17; margin: 0; }
.st-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted, #6b7280); }
.st-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.st-note { margin: 0; padding: 10px 14px; border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px; color: #92400e; font-size: 13px; }
.st-card { background: #fff; border: 1px solid var(--line, #e8eaee); border-radius: var(--radius, 14px); padding: 20px; }
.st-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
/* Form grid: two columns, three for Regional Preferences, `wide` spans the row. One column on narrow screens. */
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-top: 16px; }
.st-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.st-f { display: grid; gap: 6px; align-content: start; min-width: 0; font-size: 13px; font-weight: 600; color: #374151; position: relative; }
.st-f.wide { grid-column: 1 / -1; }
.st-f input,
.st-f select,
.st-f textarea {
  width: 100%;
  min-height: var(--ctl-h, 40px);
  padding: 0 12px;
  border: 1px solid #d9dde3;
  border-radius: var(--ctl-r, 10px);
  background: #fff;
  color: #0b0f17;
  font: inherit;
  font-weight: 400;
  font-size: 14px;
}
.st-f textarea { padding: 10px 12px; min-height: 84px; resize: vertical; line-height: 1.45; }
.st-f input:disabled,
.st-f select:disabled,
.st-f textarea:disabled { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }
/* Buttons: same height and radius as every facility page */
.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ctl-h, 40px);
  padding: 0 16px;
  border: 1px solid #d9dde3;
  border-radius: var(--ctl-r, 10px);
  background: #fff;
  color: #0b0f17;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.st-btn:hover:not(:disabled) { background: #f9fafb; }
.st-btn.blue { background: #2563eb; border-color: #2563eb; color: #fff; }
.st-btn.blue:hover:not(:disabled) { background: #1d4ed8; }
.st-btn.outline { border-color: #2563eb; color: #2563eb; }
.st-btn:disabled { opacity: .5; cursor: not-allowed; }
.st-btn:focus-visible,
.st-ib:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.st-btn .ic { width: 16px; height: 16px; }
.st-ib { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: #6b7280; cursor: pointer; }
.st-ib:hover:not(:disabled) { background: #f3f4f6; color: #0b0f17; }
.st-ib:disabled { opacity: .4; cursor: not-allowed; }
.st-ib .ic { width: 18px; height: 18px; }
.st-menu {
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 20;
  min-width: 190px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line, #e8eaee);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  text-align: left;
}
.st-menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: #1f2937;
  cursor: pointer;
}
.st-menu button:hover { background: #f3f4f6; }
.st-menu button.danger { color: #dc2626; }
.st-menu p { margin: 0; padding: 8px 10px; font-size: 12.5px; color: #6b7280; white-space: normal; }
/* Add / Manage location dialog */
.st-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, .45); }
.st-dlg { width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 22px; background: #fff; border-radius: 16px; color: #0b0f17; }
.st-dlg .st-grid { margin-top: 14px; }
.st-dlg-b { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (max-width: 760px) {
  .st-grid,
  .st-grid.three { grid-template-columns: minmax(0, 1fr); }
  .st-head,
  .st-row { flex-direction: column; align-items: stretch; }
  /* Underline tab rows scroll sideways instead of running off the edge (Staff, Integrations, Payments). */
  .sf-tabs { overflow-x: auto; scrollbar-width: none; }
  .sf-tabs button { white-space: nowrap; flex-shrink: 0; }
}
/* ---- shared from Staff & Permissions: info box, key/value rows, tabs, button sizes, avatar --------------- */
.sf-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line, #e8eaee); margin-bottom: 16px; }
.sf-tabs button {
  padding: 10px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  margin-bottom: -1px;
}
.sf-tabs button.on { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.ui-av { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.ui-av.big { width: 52px; height: 52px; font-size: 17px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sf-kv { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 5px 0; font-size: 13.5px; }
.sf-kv span { color: #6b7280; flex-shrink: 0; }
.sf-kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 6px; }
.sf-kv small { font-weight: 400; color: #9ca3af; }
.sf-info {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  line-height: 1.4;
}
.sf-info .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.st-btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.st-btn.danger { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }
.st-btn.danger:hover:not(:disabled) { background: #fecaca; }
.st-btn.wide { width: 100%; margin-top: 10px; }
/* ---- shared from Scheduling: section cards, tables, switches, checkboxes --------------------------------- */
.ss-page { max-width: none; }
.ss { display: grid; gap: 16px; }
.ss-card { padding: 16px 18px; min-width: 0; }
.ss-ch { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ss-ch > div { flex: 1; min-width: 0; }
.ss-ch h2 { font-size: 17px; }
.ss-ch .st-sub { font-size: 13px; margin-top: 2px; }
.ss-ci { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; color: #1f2937; }
.ss-loc {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(260px, 1.4fr);
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
}
.ss-loc h2 { font-size: 17px; }
.ss-loc-pick { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid #d9dde3; border-radius: 10px; }
.ss-loc-pick small { color: #6b7280; }
.ss-loc .sf-info { margin: 0; }
.ss-loc .sf-info a { color: #1d4ed8; font-weight: 600; }
.ss-tw { overflow-x: auto; position: relative; }   /* relative: absolutely placed switch inputs and .sr labels stay inside the scroll box */
.ss-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ss-tbl th {
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid var(--line, #e8eaee);
  white-space: nowrap;
}
.ss-tbl td { padding: 8px 10px; border-bottom: 1px solid #f1f2f4; vertical-align: middle; }
.ss-tbl tr.off td { opacity: .55; }
.ss-tag { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ss-st { display: inline-block; padding: 2px 9px; border-radius: 6px; background: #f3f4f6; color: #4b5563; font-size: 12.5px; font-weight: 600; }
.ss-st.on { background: #dcfce7; color: #15803d; }
.ss-acts { white-space: nowrap; text-align: right; }
.ss-acts .st-btn.sm { margin-right: 4px; vertical-align: middle; }
.ss-empty { padding: 24px 10px !important; text-align: center; color: #6b7280; }
.ss-hint { font-weight: 400; font-size: 12px; color: #6b7280; }
.ss-sub2 { margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: #374151; }
.ss-ck { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13.5px; }
.ss-ck input:disabled + *,
.ss-ck:has(input:disabled) { color: #9ca3af; }
.ss-sw { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; cursor: pointer; }
.ss-sw input { position: absolute; opacity: 0; pointer-events: none; }
.ss-sw-t { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #d1d5db; transition: background .15s; margin-top: 1px; }
.ss-sw-t::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.ss-sw input:checked + .ss-sw-t { background: #2563eb; }
.ss-sw input:checked + .ss-sw-t::after { transform: translateX(16px); }
.ss-sw input:focus-visible + .ss-sw-t { outline: 2px solid #93c5fd; outline-offset: 2px; }
.ss-sw.locked { cursor: default; }
.ss-sw.locked .ss-sw-t { opacity: .6; }
.ss-sw b { display: block; font-size: 13.5px; font-weight: 600; }
.ss-sw small { display: block; font-size: 12px; color: #6b7280; line-height: 1.35; }
/* ---- shared from Payment Processing: status chip, segmented control, demo bar ---------------------------- */
.pc-demo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px dashed #c7cdd6;
  border-radius: 10px;
  background: #fafbfc;
  font-size: 13px;
  color: #4b5563;
}
.pc-seg { display: inline-flex; border: 1px solid #d9dde3; border-radius: 8px; overflow: hidden; background: #fff; }
.pc-seg button { min-height: 30px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 12.5px; color: #4b5563; cursor: pointer; }
.pc-seg button + button { border-left: 1px solid #e8eaee; }
.pc-seg button.on { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.pc-chip { flex-shrink: 0; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #f3f4f6; color: #4b5563; }
.pc-chip.ok { background: #dcfce7; color: #15803d; }
.pc-chip.warn { background: #fef3c7; color: #b45309; }
.pc-chip.bad { background: #fee2e2; color: #b91c1c; }
/* ---- shared from Membership & Booking: card grid and field stack ----------------------------------------- */
.bk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.bk-sel { display: grid; gap: 12px; }
.bk-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; display: grid; }
@media (max-width: 1300px) {
  .bk-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Selects inside a section card's fields, and their disabled look. */
.ss-card .st-f select { min-height: 36px; border: 1px solid #d9dde3; border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13.5px; background: #fff; width: 100%; }
.ss-card select:disabled { background: #f3f4f6; color: #9ca3af; }
