/* settings.css — the Super Admin Settings page (settings.js) and the
   switches it flips elsewhere in the till. */

/* ---------- Things Settings can hide ----------
   Body classes are set by app.applyFeatureClasses(). */
body:not(.gk-is-owner) #header-settings-btn { display: none !important; }
body.gk-no-custom-item .btn-quick-custom-item { display: none !important; }
body.gk-no-discount #summary-discount-row { display: none !important; }
body.gk-no-parallel-carts #btn-add-cart-fixed,
body.gk-no-parallel-carts .cart-tab-close-btn { display: none !important; }
body.gk-no-pay-cash .charge-btn--cash,
body.gk-no-pay-cash .swipe-payout-wrapper--cash,
body.gk-no-pay-upi .charge-btn--upi,
body.gk-no-pay-upi .swipe-payout-wrapper--upi,
body.gk-no-pay-split .charge-btn--split { display: none !important; }
body.gk-no-wa-switch #whatsapp-receipt-row { display: none !important; }
body.gk-no-client-chat #client-chat-btn,
body.gk-no-client-notes #client-notes-btn { display: none !important; }
body.gk-no-client-notes #client-formula-bar { display: none !important; }
body.gk-no-appointments #menu-appointments,
body.gk-no-appointments #m-menu-appointments { display: none !important; }
body.gk-no-packages #catalog-packages-panel { display: none !important; }
body.gk-no-dob .gk-dob-field { display: none !important; }
body:not(.gk-unisex) .gk-gender-field { display: none !important; }

/* Incentive type: slabs and points only mean something under Points & slabs. */
body.gk-inc-percent .slab-progress-wrap,
body.gk-inc-none .slab-progress-wrap,
body.gk-inc-percent #mystats-slab-card,
body.gk-inc-none #mystats-slab-card,
body.gk-inc-percent .daily-points-table th:nth-child(n+5),
body.gk-inc-percent .daily-points-table td:nth-child(n+5),
body.gk-inc-none .daily-points-table th:nth-child(n+5),
body.gk-inc-none .daily-points-table td:nth-child(n+5) { display: none !important; }

/* ---------- Gender on the client form ---------- */
.gk-gender-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.gk-gender-pick { display: flex; gap: 8px; }
.gk-gender-pick label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-dark);
}
.gk-gender-pick label:has(input:checked) {
  border-color: var(--primary-green);
  background: var(--surface-sunken);
}
.gk-gender-pick input { accent-color: var(--primary-green); width: 16px; height: 16px; margin: 0; }
.gk-gender-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  vertical-align: 1px;
}

/* ---------- The page ---------- */
#view-settings { padding: 0; }
.gks {
  display: grid;
  grid-template-columns: 240px minmax(0, 760px);
  gap: 24px;
  justify-content: center;
  align-items: start;
  padding: 20px 20px 120px;
}
.gks-nav {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gks-nav__head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gks-nav__head h2 i { color: var(--brand-action); }
.gks-nav__head p { margin: 4px 0 0; font-size: 0.78rem; color: var(--text-muted); }

.gks-find {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
}
.gks-find input {
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.86rem;
  background: transparent;
  color: var(--text-dark);
}
.gks-find:focus-within { border-color: var(--primary-green); box-shadow: 0 0 0 3px var(--surface-active); }

.gks-nav__list { display: flex; flex-direction: column; gap: 2px; }
.gks-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}
.gks-nav__item i { width: 18px; text-align: center; color: var(--text-muted); }
.gks-nav__item:hover { background: var(--surface-hover); color: var(--text-dark); }
.gks-nav__item.is-on { background: var(--brand-tint); color: var(--brand-text); }
.gks-nav__item.is-on i { color: var(--brand-action); }

.gks-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gks-sec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  scroll-margin-top: 16px;
  overflow: hidden;
}
.gks-sec__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}
.gks-sec__icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-tint);
  color: var(--brand-action);
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.gks-sec__head h3 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--text-dark); }
.gks-sec__head p { margin: 2px 0 0; font-size: 0.78rem; color: var(--text-muted); }

.gks-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-top: 1px solid var(--border-subtle);
}
.gks-row.is-off,
.gks-row.is-filtered { display: none; }
.gks-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gks-row__text label { font-size: 0.88rem; font-weight: 700; color: var(--text-dark); }
.gks-row__text span { font-size: 0.76rem; line-height: 1.45; color: var(--text-muted); }
.gks-row__ctl { flex: none; }

/* A bigger switch than the bill's: this page is all switches. */
.gks-switch.switch { width: 44px; height: 26px; }
.gks-switch .slider { border-radius: 26px; }
.gks-switch .slider:before { width: 20px; height: 20px; }
.gks-switch input:checked + .slider { background-color: var(--brand-action); }
.gks-switch input:checked + .slider:before { transform: translateX(18px); }
.gks-switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--brand-border); }

.gks-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.gks-seg__btn {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
}
.gks-seg__btn:hover { color: var(--text-dark); }
.gks-seg__btn.is-on {
  background: var(--surface);
  color: var(--brand-text);
  box-shadow: 0 1px 3px rgba(15, 18, 54, 0.14);
}
.gks-seg__btn:focus-visible { outline: 2px solid var(--brand-action); outline-offset: 1px; }

.gks-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
}
.gks-num input {
  width: 84px;
  border: 0;
  outline: 0;
  font: inherit;
  font-weight: 700;
  color: var(--text-dark);
  text-align: right;
  background: transparent;
}
.gks-num:focus-within,
.gks-text:focus { border-color: var(--primary-green); box-shadow: 0 0 0 3px var(--surface-active); outline: 0; }
.gks-text {
  width: 260px;
  max-width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.88rem;
  color: var(--text-dark);
}

/* Blocks: slabs, shout-outs, bill design, sign-in, Glowa connection. */
.gks-row--block { display: block; }
.gks-block { display: flex; flex-direction: column; gap: 10px; }
.gks-block .gks-row__text { margin-bottom: 2px; }
.gks-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gks-pair label,
.gks-pair__one {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.gks-pair input[type="text"],
.gks-pair__one input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.86rem;
  color: var(--text-dark);
}
.gks-pair .gks-num input { width: 100%; }
.gks-check { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; color: var(--text-dark); cursor: pointer; }
.gks-check input { width: 16px; height: 16px; accent-color: var(--brand-action); }
.gks-note { margin: 0; font-size: 0.72rem; color: var(--text-muted); }
.gks-note code { font-family: ui-monospace, monospace; }
.gks-status { font-size: 0.78rem; font-weight: 600; }
.gks-invoice { display: grid; gap: 8px; }

.gks-slabs { width: 100%; max-width: 420px; }
.gks-slabs th { text-align: left; font-size: 0.72rem; color: var(--text-muted); font-weight: 700; padding: 4px 6px; }
.gks-slabs td { padding: 4px 6px; }
.gks-slabs td:last-child { width: 40px; }
.gks-slabs input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
}
.gks-block > .btn { align-self: flex-start; }

.gks-empty { text-align: center; color: var(--text-muted); font-size: 0.86rem; padding: 24px; }
.gks-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 2px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.gks-savebar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 60;
  width: min(720px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  background: var(--surface-inverse);
  color: var(--text-on-dark);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(15, 18, 54, 0.28);
  font-size: 0.86rem;
  font-weight: 600;
}
.gks-savebar[hidden] { display: none; }
.gks-savebar > div { display: flex; gap: 8px; flex: none; }
.gks-savebar .btn-outline-gold { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }

/* ---------- Phone ---------- */
@media (max-width: 860px) {
  .gks {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px 16px 160px;
  }
  .gks-nav {
    position: static;
    gap: 10px;
  }
  .gks-nav__list {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    scrollbar-width: none;
  }
  .gks-nav__list::-webkit-scrollbar { display: none; }
  .gks-nav__item {
    flex: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-pill);
    padding: 7px 12px;
    font-size: 0.8rem;
  }
  .gks-sec__head { padding: 14px 14px 10px; }
  .gks-row { padding: 12px 14px; }
  .gks-row--wide { flex-direction: column; align-items: stretch; gap: 10px; }
  .gks-row--wide .gks-seg { display: flex; }
  .gks-row--wide .gks-seg__btn { flex: 1; padding: 7px 8px; }
  .gks-text { width: 100%; }
  .gks-pair { grid-template-columns: 1fr; }
  .gks-savebar {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  .gks-savebar > div > .btn { flex: 1; }
}
