:root {
  --bg: #f4efe8;
  --ink: #2c241c;
  --muted: #7a6b5c;
  --accent: #6b4a34;
  --accent-soft: #a07855;
  --accent-hover: #573a28;
  --bg-soft: #ebe1d4;
  --bg-soft2: #e7d8c6;
  --surface: #fffcf8;
  --line: #e5d9cb;
  --ok: #2d6a4f;
  --err: #9b3d32;
  --focus: rgba(107, 74, 52, 0.28);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(44, 36, 28, 0.06);
  --font-display: "Vazirmatn", Tahoma, sans-serif;
  --font-ui: Tahoma, "Segoe UI", sans-serif;
  --control-h: 42px;
  --control-fs: 14px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 0% -5%, var(--bg-soft) 0%, transparent 55%),
    radial-gradient(700px 400px at 100% 0%, var(--bg-soft2) 0%, transparent 50%),
    var(--bg);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ——— Typography roles ——— */
.brand,
.brand-hero,
.hero h1,
.panel h1,
.panel h2,
.admin-nav .brand,
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
}

.btn {
  font-family: var(--font-display);
  font-weight: 600;
}

body,
.nav a,
.muted,
.field-label,
input, select, textarea,
.data-table,
.table-option,
.badge,
.site-footer,
.card-number {
  font-family: var(--font-ui);
}

/* ——— Header ——— */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  position: sticky;
  top: 0;
  z-index: 20;
}

@supports not (background: color-mix(in srgb, white 50%, black)) {
  .site-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 252, 248, 0.94);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  color: var(--accent);
  letter-spacing: 0.01em;
  min-height: 48px;
}

.brand-with-logo {
  gap: 0.85rem;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 4px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(44, 36, 28, 0.1);
  box-shadow: 0 1px 3px rgba(44, 36, 28, 0.08);
  flex-shrink: 0;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: transparent;
  flex-shrink: 0;
}

.brand-logo-admin {
  background: transparent;
}

.admin-nav .brand-logo-wrap {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.35);
}

.brand-text {
  line-height: 1.25;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-logo-only .brand-logo-wrap {
  width: 52px;
  height: 52px;
}

.brand-hero-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(44, 36, 28, 0.08);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(44, 36, 28, 0.08);
}

.brand-hero-logo {
  width: min(140px, 42vw);
  height: auto;
  max-height: 96px;
  object-fit: contain;
  margin: 0;
  display: block;
}

.brand-display-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.brand-display-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid #c4b09a;
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}

.brand-display-option input {
  width: auto;
  height: auto;
  min-height: 0;
  accent-color: var(--accent);
}

.brand-display-option.is-active,
.brand-display-option:has(input:checked) {
  border-color: var(--accent);
  background: #faf6f1;
  box-shadow: 0 0 0 2px var(--focus);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}

.nav a,
.lang-switch a {
  font-size: 13px;
  color: var(--muted);
  padding: 0.25rem 0;
}

.nav a:hover,
.lang-switch a:hover,
.nav a.active,
.lang-switch a.active {
  color: var(--accent);
}

.lang-switch {
  display: inline-flex;
  gap: 0.55rem;
  margin-inline-start: 0.35rem;
  padding-inline-start: 0.85rem;
  border-inline-start: 1px solid var(--line);
}

/* ——— Layout ——— */
.container {
  width: min(880px, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: 1.75rem 2.75rem;
}

.site-footer {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ——— Hero ——— */
.hero {
  --hero-from: #2c241c;
  --hero-mid: #5a3d2c;
  --hero-to: #8a6344;
  --hero-accent: var(--accent);
  --hero-soft: var(--accent-soft);
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - 4.25rem);
  min-height: calc(100vh - 4.25rem);
  display: grid;
  align-content: center;
  justify-items: stretch;
  padding: clamp(3rem, 10vh, 5.5rem) clamp(1.25rem, 4vw, 3rem);
  color: #fffcf8;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 85% 15%, color-mix(in srgb, var(--hero-soft) 35%, transparent), transparent 60%),
    linear-gradient(135deg, var(--hero-from) 0%, var(--hero-mid) 48%, var(--hero-to) 100%);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hero {
    background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-mid) 48%, var(--hero-to) 100%);
  }
}

.hero-glow {
  position: absolute;
  inset: auto -12% -40% auto;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 248, 0.16), transparent 68%);
  animation: float 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.9rem;
  max-width: 38rem;
  width: min(100%, 38rem);
  margin-inline: 0;
  animation: rise 0.85s ease both;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -18px, 0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero .brand-hero-logo-wrap {
  margin: 0;
  justify-self: start;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 252, 248, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.hero .brand-hero-logo {
  width: min(128px, 38vw);
  max-height: 88px;
}

.hero .brand-hero {
  font-size: clamp(2.4rem, 6.5vw, 3.85rem);
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fffcf8;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.2);
}

.hero h1 {
  font-weight: 500;
  font-size: clamp(1.2rem, 2.8vw, 1.7rem);
  margin: 0;
  max-width: 18ch;
  line-height: 1.35;
  color: rgba(255, 252, 248, 0.96);
}

.hero .hero-lead {
  max-width: 34ch;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: rgba(255, 252, 248, 0.82);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.hero .btn {
  margin-top: 0;
  min-height: 46px;
  height: 46px;
  padding: 0 1.45rem;
  font-size: 0.95rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.hero .btn-hero-primary {
  background: #fffcf8;
  color: var(--hero-accent, var(--accent));
}

.hero .btn-hero-primary:hover {
  background: #fff;
  color: var(--hero-accent, var(--accent));
  transform: translateY(-2px);
}

.hero .btn-hero-secondary {
  background: transparent;
  color: #fffcf8;
  border: 1.5px solid rgba(255, 252, 248, 0.72);
  box-shadow: none;
  font-weight: 600;
}

.hero .btn-hero-secondary:hover {
  background: rgba(255, 252, 248, 0.12);
  border-color: #fffcf8;
  color: #fffcf8;
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .hero {
    min-height: calc(100dvh - 4.75rem);
    align-content: end;
    padding-bottom: 2.75rem;
  }
  .hero-actions {
    width: 100%;
  }
  .hero .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 999px;
  height: var(--control-h);
  padding: 0 1.2rem;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover { background: rgba(107, 74, 52, 0.06); }

.btn-danger { background: var(--err); }
.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.35);
}

/* ——— Panels ——— */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}

.panel + .panel { margin-top: 1rem; }

.panel h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: var(--accent);
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--accent);
}

.panel > .muted {
  margin: 0 0 1.15rem;
  font-size: 13px;
}

.muted { color: var(--muted); font-size: 13px; }

/* ——— Form sections ——— */
.form-section {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.form-section:first-of-type { border-top: 0; padding-top: 0; }

.form-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.85rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: normal;
  color: var(--muted);
  margin: 0;
}

.form-field .field-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.15rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--control-h);
  padding-top: 1.1rem;
}

.form-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.form-check .field-label {
  font-size: 13px;
  color: var(--ink);
}

.captcha-field {
  grid-column: 1 / -1;
}

.captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.captcha-challenge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  min-height: var(--control-h);
  padding: 0 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  user-select: none;
}

.captcha-row input {
  flex: 1 1 8rem;
  max-width: 12rem;
}

/* ——— Controls (compact, consistent) ——— */
input[type="text"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--control-fs);
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a6b5c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
  padding-inline-end: 0.75rem;
  padding-inline-start: 2rem;
  cursor: pointer;
}

html[dir="ltr"] select {
  background-position: right 0.75rem center;
  padding-inline-start: 0.75rem;
  padding-inline-end: 2rem;
}

textarea {
  height: auto;
  min-height: 84px;
  padding: 0.65rem 0.75rem;
  resize: vertical;
}

input[type="file"] {
  height: auto;
  padding: 0.45rem;
  font-size: 13px;
  background: #faf6f1;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--focus);
}

/* ——— Alerts ——— */
.alert {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 13px;
}

.alert-success { background: #e8f4ee; color: var(--ok); }
.alert-error { background: #f8ebe8; color: var(--err); }

/* ——— Tables list / salon ——— */
.table-list { display: grid; gap: 0.55rem; }

.table-option {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.table-option:hover,
.table-option.is-selected {
  border-color: var(--accent);
  background: #faf6f1;
}

.table-option input { width: auto; height: auto; }

.table-option-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 13px;
}

.salon-section {
  margin-top: 0.35rem;
}

.salon-section h2 { margin-top: 0.5rem; }

.salon-map {
  position: relative;
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(107, 74, 52, 0.05) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(rgba(107, 74, 52, 0.05) 1px, transparent 1px) 0 0 / 36px 36px,
    #efe5d8;
  overflow: hidden;
  touch-action: none;
}

.salon-map-editor {
  cursor: crosshair;
  margin-top: 0.5rem;
  height: 300px;
}

.salon-table {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
  appearance: none;
  -webkit-appearance: none;
  color: #fffcf8;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  box-sizing: border-box;
}

.salon-table .shape-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 3px 7px rgba(44, 36, 28, 0.22));
  pointer-events: none;
}

.salon-table .shape-svg rect,
.salon-table .shape-svg circle {
  fill: url(#tableFill);
  stroke: #4f3626;
  stroke-width: 4;
}

.salon-table.is-selected .shape-svg rect,
.salon-table.is-selected .shape-svg circle {
  stroke: #2d6a4f;
  stroke-width: 6;
  fill: var(--accent);
}

.salon-table:hover { z-index: 2; transform: scale(1.03); }
.salon-table.is-selected { z-index: 3; }

.salon-table-label {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.salon-table-label small {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.78em;
  opacity: 0.95;
}

.shape-preview {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.shape-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

.shape-preview rect,
.shape-preview circle {
  fill: #a07855;
  stroke: #4f3626;
  stroke-width: 3;
}

.shape-chip {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  background: #a07855;
  border: 1px solid #4f3626;
  vertical-align: middle;
  margin-inline-end: 0.3rem;
  flex-shrink: 0;
}

.shape-chip.shape-square { border-radius: 0.12rem; }
.shape-chip.shape-circle { border-radius: 50%; }
.shape-chip.shape-rectangle {
  width: 1.3rem;
  height: 0.8rem;
  border-radius: 0.15rem;
}

.shape-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.shape-picker label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink);
}

.shape-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: auto;
  width: auto;
}

.shape-picker label.is-active,
.shape-picker label:has(input:checked) {
  border-color: var(--accent);
  background: #faf6f1;
  box-shadow: 0 0 0 2px rgba(107, 74, 52, 0.12);
}

/* ——— Invoice ——— */
.invoice-amount {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--accent);
  margin: 0.2rem 0 0.85rem;
}

.card-number {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  padding: 0.65rem 0.85rem;
  background: #f3ebe1;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.tracking-code {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  letter-spacing: 0.12em;
  font-size: 1.05em;
  color: var(--accent);
  background: #f3ebe1;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* ——— Admin ——— */
.admin-shell {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 100vh;
}

.admin-nav {
  background: #2a2118;
  color: #f4efe8;
  padding: 1.25rem 0.9rem;
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.admin-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fffcf8;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.admin-nav a {
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: #d5c6b5;
  font-size: 13px;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.admin-main { padding: 1.25rem 1.35rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--accent);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  text-align: start;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table th {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 11px;
  background: #efe4d4;
  color: var(--accent);
}

.badge-pending_approval { background: #fff3cd; color: #7a5b00; }
.badge-pending_payment { background: #e7f0ff; color: #1e4b8f; }
.badge-approved { background: #e8f4ee; color: var(--ok); }
.badge-rejected { background: #f8ebe8; color: var(--err); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.actions .btn {
  height: 34px;
  padding: 0 0.85rem;
  font-size: 12px;
}

.receipt-preview {
  max-width: 380px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

@media (max-width: 820px) {
  .form-grid,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }

  .admin-shell { grid-template-columns: 1fr; }

  .admin-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .salon-map,
  .salon-map-editor { height: 260px; }

  /* Avoid iOS Safari zoom on focus; comfortable touch targets */
  input[type="text"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  textarea { min-height: 96px; }

  .btn {
    min-height: 44px;
    padding-inline: 1.1rem;
  }

  .container {
    padding-inline: max(0.85rem, env(safe-area-inset-left));
    padding-inline-end: max(0.85rem, env(safe-area-inset-right));
  }

  .panel { padding: 1rem; }

  .data-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-option {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .salon-table {
    min-width: 44px;
    min-height: 44px;
  }
}

.promo-ok { color: var(--ok); font-size: 13px; margin: 0; }
.promo-err { color: var(--err); font-size: 13px; margin: 0; }

.color-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-field input[type="color"] {
  width: 44px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.color-field input[type="text"] {
  flex: 1;
  min-width: 0;
  text-transform: lowercase;
  font-family: ui-monospace, monospace;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
  padding: 0.65rem;
  background: #f3ebe2;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.logo-preview img {
  max-height: 64px;
  width: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 0.25rem;
}

.theme-preview {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.theme-preview-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-block;
}

.theme-preview-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 0.9rem;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 600;
}

.theme-palettes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1.15rem;
}

.theme-palette {
  appearance: none;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.65rem 0.7rem 0.7rem;
  cursor: pointer;
  text-align: start;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  font: inherit;
  color: inherit;
}

.theme-palette:hover {
  border-color: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(44, 36, 28, 0.08);
}

.theme-palette.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus);
}

.theme-palette-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  height: 28px;
  margin-bottom: 0.55rem;
  border-radius: 7px;
  overflow: hidden;
}

.theme-palette-swatches span {
  display: block;
  height: 100%;
}

.theme-palette-name {
  display: block;
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.guest-filters {
  margin-bottom: 1rem;
}

.guest-filter-head {
  margin-bottom: 0.85rem;
}

.guest-filter-label {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.guest-filter-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.guest-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.65rem;
  background: #f3ebe2;
  border: 1px solid #d9cbb9;
  border-radius: var(--radius-sm);
}

.guest-cat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.45rem 1rem;
  border: 1.5px solid #c4b09a;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 1px 0 rgba(44, 36, 28, 0.06);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.guest-cat:hover {
  background: #faf6f1;
  border-color: var(--accent-soft);
  color: var(--accent);
}

.guest-cat:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

.guest-cat.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(107, 74, 52, 0.28);
}

.guest-cat.is-active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.guest-search {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.guest-search input[type="search"] {
  max-width: 280px;
}

.guest-recipient-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: #fff;
}

.guest-recipient {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 13px;
  cursor: pointer;
}

.guest-recipient input {
  width: auto;
  height: auto;
  min-height: 0;
}

@media (max-width: 820px) {
  .guest-cat {
    flex: 1 1 calc(50% - 0.55rem);
    min-width: 140px;
  }
}

/* Extra-narrow phones */
@media (max-width: 480px) {
  body { font-size: 15px; }
  h1 { font-size: 1.35rem; }
  .invoice-amount { font-size: 1.45rem; word-break: break-word; }
  .card-number { font-size: 1rem; letter-spacing: 0.04em; overflow-wrap: anywhere; }
}

