/* ── Variables ───────────────────────────────────────────── */
:root {
  --bg:        #0f1318;
  --surface:   #171d26;
  --card:      #1c2430;
  --border:    #2a3a4f;
  --accent:    #f0a500;
  --accent2:   #e05c00;
  --text:      #e8edf4;
  --muted:     #7a95b0;
  --success:   #2ecc71;
  --warning:   #fbbf24;
  --danger:    #ef4444;
  --radius:    8px;
  --font-head: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  /* Allow pull-to-refresh and natural touch behavior */
  touch-action: pan-y pan-x;
  -webkit-text-size-adjust: 100%;
  /* Prevent iOS bounce effect but allow pull-to-refresh */
  overscroll-behavior-y: contain;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: .35;
}

/* ── Header — 3 rows ─────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,17,23,.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; flex-direction: column; align-items: stretch;
}

/* Row 1: brand */
.header-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 12px 16px 8px; cursor: pointer;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--accent); border-radius: 4px;
  display: grid; place-items: center; font-size: 16px; flex-shrink: 0;
}
.logo-text {
  font-family: var(--font-head); font-size: 22px; font-weight: 800;
  letter-spacing: 1.5px; color: var(--text); line-height: 1;
}
.logo-text span { color: var(--accent); }
.logo-sub {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  letter-spacing: 2px; text-transform: uppercase;
}

/* Row 2: nav */
.header-nav {
  display: flex; border-top: 1px solid var(--border);
}
.nav-btn {
  flex: 1; padding: 11px 6px;
  border: none; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .3px;
  transition: all .2s; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.nav-btn .nav-icon { font-size: 15px; flex-shrink: 0; }
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(240,165,0,.05); }

/* Row 3: info bar — removed */

/* ── Promo ticker — animated scrolling strip ─────────────── */
.promo-ticker-wrap {
  display: flex; align-items: center; gap: 0;
  background: linear-gradient(135deg, rgba(240,165,0,.08), rgba(249,115,22,.08));
  border: 1px solid rgba(240,165,0,.2);
  border-radius: var(--radius); padding: 0; margin-bottom: 16px;
  overflow: hidden; cursor: pointer; position: relative;
  min-height: 40px; transition: all .2s;
}
.promo-ticker-wrap:hover { border-color: var(--accent); }
.promo-ticker-label {
  font-size: 18px; padding: 0 10px; flex-shrink: 0;
  display: grid; place-items: center; z-index: 2;
}
.promo-ticker-track {
  flex: 1; overflow: hidden; position: relative;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.promo-ticker-inner {
  display: flex; gap: 40px; white-space: nowrap;
  animation: ticker-scroll 15s linear infinite;
  will-change: transform;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.promo-ticker-item {
  font-family: var(--font-body); font-size: 13px;
  color: var(--text); font-weight: 500;
  flex-shrink: 0;
}
.promo-ticker-arrow {
  font-size: 20px; color: var(--muted); padding: 0 10px;
  flex-shrink: 0; animation: arrow-bounce 1.5s ease-in-out infinite;
}
@keyframes arrow-bounce {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(3px); }
}


/* ── Main layout ─────────────────────────────────────────── */
main {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto;
  padding: 28px 16px 80px;
}

/* ── Section title ───────────────────────────────────────── */
.section-title {
  font-family: var(--font-head); font-size: 12px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0; transition: opacity .3s;
}
.card:focus-within::before, .card.active::before { opacity: 1; }

/* ── Input ───────────────────────────────────────────────── */
.input-group { margin-bottom: 14px; }
.input-group label {
  display: block; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.input-group input, .input-group select {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-mono);
  font-size: 16px; padding: 11px 13px; outline: none;
  transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none;
}
.input-group input:focus, .input-group select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,165,0,.07);
}
.input-group input::placeholder { color: var(--muted); }

/* phone as link */
.phone-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); text-decoration: none; font-family: var(--font-mono);
  font-size: 14px; transition: opacity .2s;
}
.phone-link:hover { opacity: .75; }
.phone-hint { font-size: 12px; color: var(--muted); margin-top: 5px; font-family: var(--font-mono); }

/* ── Service picker button (replaces dropdown) ───────────── */
.service-pick-btn {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); cursor: pointer;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .2s, box-shadow .2s; text-align: left;
  font-family: var(--font-body);
}
.service-pick-btn:hover, .service-pick-btn:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,165,0,.08); outline: none;
}
.svc-icon  { font-size: 20px; flex-shrink: 0; }
.svc-name  { flex: 1; font-size: 15px; color: var(--text); font-weight: 500; }
.svc-dur   { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.svc-arrow { color: var(--muted); font-size: 20px; line-height: 1; }

/* ── Service modal — bottom sheet ────────────────────────── */
.svc-modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.7);
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.svc-modal-overlay.open {
  opacity: 1; pointer-events: auto;
}
.svc-modal-sheet {
  width: 100%; max-width: 600px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 16px 16px 0 0;
  max-height: 80vh; display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.svc-modal-overlay.open .svc-modal-sheet {
  transform: translateY(0);
}
.svc-modal-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 12px auto 0; flex-shrink: 0;
}
.svc-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.svc-modal-title {
  font-family: var(--font-head); font-size: 18px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--accent);
}
.svc-modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 14px; cursor: pointer;
  display: grid; place-items: center; transition: all .15s;
}
.svc-modal-close:hover { border-color: var(--danger); color: var(--danger); }
.svc-modal-list {
  overflow-y: auto; padding: 6px 0 16px;
  -webkit-overflow-scrolling: touch;
}
.svc-modal-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px; cursor: pointer;
  border-bottom: 1px solid rgba(42,58,79,.5);
  transition: background .15s;
}
.svc-modal-item:last-child { border-bottom: none; }
.svc-modal-item:hover, .svc-modal-item:active { background: rgba(240,165,0,.07); }
.svc-modal-item.selected { background: rgba(240,165,0,.1); }
.svc-modal-icon { font-size: 26px; width: 36px; text-align: center; flex-shrink: 0; }
.svc-modal-info { flex: 1; }
.svc-modal-name { font-size: 16px; font-weight: 500; color: var(--text); }
.svc-modal-dur  { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.svc-modal-check { font-size: 20px; color: var(--accent); flex-shrink: 0; opacity: 0; transition: opacity .15s; }
.svc-modal-item.selected .svc-modal-check { opacity: 1; }

/* ── Options checkboxes ─────────────────────────────────── */
.option-checkbox-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer;
  border-bottom: 1px solid rgba(42,58,79,.5);
  transition: background .15s; position: relative;
}
.option-checkbox-item:last-child { border-bottom: none; }
.option-checkbox-item:hover, .option-checkbox-item:active { background: rgba(240,165,0,.07); }
.option-checkbox-item.selected { background: rgba(240,165,0,.1); }
.option-checkbox {
  width: 20px; height: 20px; accent-color: var(--accent);
  cursor: pointer; flex-shrink: 0;
}
.option-checkbox-label {
  flex: 1; font-size: 15px; color: var(--text); font-weight: 400;
}
.option-check-icon {
  font-size: 18px; color: var(--accent); flex-shrink: 0;
  opacity: 0; transition: opacity .15s;
}
.option-checkbox-item.selected .option-check-icon { opacity: 1; }

@media (min-width: 521px) {
  .svc-modal-sheet { border-radius: 12px; margin-bottom: 40px; max-width: 480px; }
  .svc-modal-overlay { align-items: center; }
}

/* ── Day grid ────────────────────────────────────────────── */
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 9px; }
.day-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); cursor: pointer;
  padding: 13px 8px; text-align: center; transition: all .18s; font-family: var(--font-body);
}
.day-btn .day-name { font-family: var(--font-head); font-size: 16px; font-weight: 700; letter-spacing: 1px; display: block; }
.day-btn .day-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.day-btn:hover { border-color: var(--accent); background: rgba(240,165,0,.06); }
.day-btn.selected { border-color: var(--accent); background: rgba(240,165,0,.12); color: var(--accent); }
.day-btn.selected .day-date { color: var(--accent); opacity: .7; }

/* ── Days checkboxes (schedule admin) ───────────────────── */
.days-checkboxes {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px;
}
.day-check {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; cursor: pointer; font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); transition: all .15s; user-select: none;
}
.day-check input[type=checkbox] {
  accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer;
  background: unset; border: unset; padding: unset; font-size: unset;
}
.day-check:has(input:checked) {
  border-color: var(--accent); color: var(--accent); background: rgba(240,165,0,.08);
}

/* ── Time grid ───────────────────────────────────────────── */
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px,1fr)); gap: 9px; }
.time-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); cursor: pointer;
  padding: 12px 4px; text-align: center; font-family: var(--font-mono);
  font-size: 15px; font-weight: 500; transition: all .18s;
}
.time-btn:hover { border-color: var(--accent); background: rgba(240,165,0,.06); }
.time-btn.selected { border-color: var(--accent); background: rgba(240,165,0,.15); color: var(--accent); }

/* Client's own booked slots — green */
.time-btn-mine {
  border-color: var(--success); background: rgba(34,197,94,.12); color: var(--success);
  cursor: default; opacity: 1; position: relative;
}
.time-btn-mine:disabled { opacity: 1; }
.mine-dot {
  display: block; font-size: 12px; margin-top: 2px; color: var(--success);
}

/* ── Summary ─────────────────────────────────────────────── */
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.summary-value { font-family: var(--font-mono); font-size: 14px; color: var(--text); font-weight: 500; text-align: right; max-width: 60%; }
.summary-value.big { font-size: 20px; color: var(--accent); font-weight: 700; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius); border: none; cursor: pointer;
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; transition: all .2s; width: 100%;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #000; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(240,165,0,.28); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.btn-danger {
  background: transparent; border: 1px solid var(--danger); color: var(--danger);
  font-size: 12px; padding: 7px 13px; width: auto; letter-spacing: .5px;
}
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-sm { padding: 8px 14px; font-size: 12px; width: auto; }
.btn-success { background: linear-gradient(135deg,#22c55e,#16a34a); color: #000; }

/* ── Steps ───────────────────────────────────────────────── */
.steps {
  display: flex; gap: 0; margin-bottom: 28px; position: relative;
}
.steps::before {
  content: ''; position: absolute; top: 17px; left: 18px; right: 18px;
  height: 1px; background: var(--border); z-index: 0;
}
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; z-index: 1; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--muted); transition: all .3s;
}
.step.done .step-num { background: rgba(34,197,94,.12); border-color: var(--success); color: var(--success); }
.step.active .step-num { background: rgba(240,165,0,.15); border-color: var(--accent); color: var(--accent); }
.step-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: center; }
.step.active .step-label { color: var(--accent); }
.step.done .step-label { color: var(--success); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 13px 15px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 9px; }
.alert-success { background: rgba(34,197,94,.07); border: 1px solid rgba(34,197,94,.3); color: var(--success); }
.alert-error   { background: rgba(239,68,68,.07);  border: 1px solid rgba(239,68,68,.3);  color: var(--danger); }
.alert-info    { background: rgba(240,165,0,.06);  border: 1px solid rgba(240,165,0,.2);  color: var(--accent); }

/* ── Booking item ────────────────────────────────────────── */
.booking-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 9px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.booking-item.expired { opacity: .45; }
.booking-meta { display: flex; flex-direction: column; gap: 3px; }
.booking-date { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text); }
.booking-svc  { font-size: 12px; color: var(--muted); }
.booking-status { font-size: 12px; font-family: var(--font-mono); display: flex; align-items: center; gap: 5px; color: var(--muted); }
.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--success); }
.dot-red   { background: var(--danger); }

/* ── Skeleton loading ────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 18px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skel {
  height: 50px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 200% 100%; border-radius: var(--radius); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Pages ───────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── Hero ────────────────────────────────────────────────── */
.hero { padding: 36px 0 28px; text-align: center; }
.hero-title {
  font-family: var(--font-head); font-size: clamp(32px, 8vw, 52px); font-weight: 800;
  letter-spacing: 2px; line-height: .95; text-transform: uppercase; margin-bottom: 12px;
}
.hero-title .accent { color: var(--accent); display: block; }
.hero-sub { color: var(--muted); font-size: 14px; max-width: 340px; margin: 0 auto 24px; line-height: 1.6; }
.hero-badges { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
.badge {
  background: var(--surface); border: 1px solid var(--border); border-radius: 100px;
  padding: 5px 13px; font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 5px;
}

/* ── Confirm animation ───────────────────────────────────── */
.confirm-icon {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(34,197,94,.12); border: 2px solid var(--success);
  display: grid; place-items: center; font-size: 30px;
  margin: 0 auto 18px; animation: popIn .4s cubic-bezier(.18,.89,.32,1.28);
}
@keyframes popIn { from { transform:scale(0); opacity:0; } to { transform:scale(1); opacity:1; } }

/* ── Days checkboxes (schedule admin) ───────────────────── */
.days-checkboxes {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px;
}
.day-check {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; cursor: pointer; font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); transition: all .15s; user-select: none;
}
.day-check input[type=checkbox] {
  accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer;
  /* reset inherited input styles */
  background: unset; border: unset; padding: unset; font-size: unset;
}
.day-check:has(input:checked) {
  border-color: var(--accent); color: var(--accent); background: rgba(240,165,0,.08);
}

/* ── Admin ───────────────────────────────────────────────── */
.admin-login {
  max-width: 340px; margin: 40px auto 0; text-align: center;
}
.admin-login-title { font-family: var(--font-head); font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.admin-login-sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }

/* PIN pad */
.pin-display {
  display: flex; justify-content: center; gap: 10px; margin: 20px 0;
}
.pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); background: transparent; transition: all .15s;
}
.pin-dot.filled { background: var(--accent); border-color: var(--accent); }
.pin-pad { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 16px 0; }
.pin-key {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-mono); font-size: 20px; font-weight: 500;
  padding: 16px; cursor: pointer; transition: all .15s; text-align: center;
}
.pin-key:hover { border-color: var(--accent); background: rgba(240,165,0,.07); color: var(--accent); }
.pin-key:active { transform: scale(.95); }
.pin-key.del { font-size: 18px; color: var(--muted); }
.pin-key.fp  { font-size: 22px; }
.pin-error { color: var(--danger); font-family: var(--font-mono); font-size: 12px; margin-top: 8px; min-height: 20px; }
.pin-section-title { font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

/* fingerprint animation */
@keyframes fpPulse { 0%,100%{opacity:.5} 50%{opacity:1} }
.fp-scanning { animation: fpPulse .8s ease-in-out infinite; color: var(--accent) !important; }

.admin-tabs {
  display: flex; gap: 1px; margin-bottom: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Fade edge hint — shows more content exists */
  -webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent 100%);
  /* Ensure tabs don't overlap buttons */
  flex: 1;
  min-width: 0;
  /* Smooth scrolling */
  scroll-behavior: smooth;
}
.admin-tabs::-webkit-scrollbar { display: none; }

/* Admin tabs wrapper with navigation buttons */
.admin-tabs-wrapper {
  display: flex; align-items: stretch; gap: 0; position: relative;
  border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.admin-tab-nav {
  width: 36px; height: auto; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); font-size: 20px; font-weight: 700;
  cursor: pointer; display: grid; place-items: center;
  transition: all .2s; z-index: 20;
  padding: 9px 0; line-height: 1;
  align-self: stretch;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: rgba(240,165,0,.1);
  /* Ensure clickable */
  pointer-events: auto !important;
}
.admin-tab-nav:hover {
  background: rgba(240,165,0,.1); border-color: var(--accent);
  color: var(--accent);
}
.admin-tab-nav:active { 
  transform: scale(.95); 
  background: rgba(240,165,0,.2);
}
.admin-tab-prev { 
  border-radius: var(--radius) 0 0 0; 
  border-right: none;
}
.admin-tab-next { 
  border-radius: 0 var(--radius) 0 0; 
  border-left: none;
}

/* Always show nav buttons and enable scroll on all screen sizes */
.admin-tab-nav { display: grid; }
.admin-tabs-wrapper { border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.admin-tabs {
  -webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent 100%);
  padding-right: 0;
  border-bottom: none; margin-bottom: 0;
}
.admin-tab {
  padding: 9px 13px; cursor: pointer; font-family: var(--font-mono);
  font-size: clamp(9px, 2vw, 11px);
  letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid transparent; transition: all .2s;
  background: none; border-left: none; border-right: none; border-top: none;
  white-space: nowrap; flex-shrink: 0;
  position: relative;
}
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-tab:hover  { color: var(--text); }

/* Special highlight for Bookings tab */
.admin-tab.active:first-child {
  background: linear-gradient(135deg, rgba(240,165,0,0.1), rgba(255,180,0,0.05));
  border-radius: 8px 8px 0 0;
  border-bottom-color: var(--accent);
  box-shadow: 0 -2px 8px rgba(240,165,0,0.2);
}

/* Admin tab badge */
.admin-tab-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 100px;
  line-height: 1.4;
  animation: pulse 2s infinite;
}

/* Extra glow for bookings badge */
.admin-tab:first-child .admin-tab-badge {
  box-shadow: 0 0 12px rgba(239,68,68,0.6), 0 0 20px rgba(239,68,68,0.3);
  animation: pulseBadge 1.5s ease-in-out infinite;
}

@keyframes pulseBadge {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 12px rgba(239,68,68,0.6), 0 0 20px rgba(239,68,68,0.3);
  }
  50% { 
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(239,68,68,0.8), 0 0 28px rgba(239,68,68,0.5);
  }
}

/* admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); padding: 9px 10px;
  text-align: left; border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 11px 10px; border-bottom: 1px solid rgba(30,45,61,.4); font-family: var(--font-mono); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }

/* service item in admin */
.service-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
}
.service-item.inactive { opacity: .45; }
.service-name { flex: 1; font-size: 14px; }
.service-dur { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.service-actions { display: flex; gap: 6px; }
.toggle-btn {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--muted); transition: all .2s;
  font-family: var(--font-mono);
}
.toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.toggle-btn.on  { border-color: var(--success); color: var(--success); }
.toggle-btn.off { border-color: var(--danger);  color: var(--danger); }

/* add service form */
.add-service-form {
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 16px; margin-top: 12px; display: none;
}
.add-service-form.open { display: block; animation: fadeUp .2s ease; }
.form-row { display: flex; gap: 8px; align-items: flex-end; }
.form-row .input-group { flex: 1; margin-bottom: 0; }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 14px; z-index: 9999;
  display: flex; flex-direction: column; gap: 7px;
  max-width: 320px; width: calc(100vw - 28px);
}
.toast {
  padding: 12px 15px; border-radius: var(--radius); font-family: var(--font-mono);
  font-size: 12px; display: flex; align-items: center; gap: 9px;
  animation: slideIn .3s ease; box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.toast-success { background: #0d2118; border: 1px solid rgba(34,197,94,.4); color: var(--success); }
.toast-error   { background: #1e0d0d; border: 1px solid rgba(239,68,68,.4);  color: var(--danger); }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }
.toast.hide { animation: slideOut .3s ease forwards; }
@keyframes slideOut { to{transform:translateX(100%);opacity:0} }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Booking Cards (Admin) ──────────────────────────────────── */
.bookings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 4px;
}

.booking-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.booking-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Green glow for upcoming appointments (within 10 minutes) */
.booking-upcoming {
  border-color: #1a9e4a;
  animation: upcomingGlow 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(26,158,74,0.3), 0 0 40px rgba(26,158,74,0.2);
}

@keyframes upcomingGlow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(26,158,74,0.3), 0 0 40px rgba(26,158,74,0.2);
    border-color: #1a9e4a;
  }
  50% { 
    box-shadow: 0 0 30px rgba(26,158,74,0.5), 0 0 60px rgba(26,158,74,0.3);
    border-color: #2ecc71;
  }
}

.booking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.booking-date-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.booking-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.booking-time {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.grouped-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  margin-top: 2px;
  width: fit-content;
}

.booking-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.booking-client {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.client-phone {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.client-phone:hover {
  color: var(--accent);
}

.booking-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.detail-row {
  display: flex;
  gap: 6px;
  line-height: 1.3;
}

.detail-label {
  color: var(--muted);
  font-weight: 500;
  min-width: 50px;
  flex-shrink: 0;
}

.services-list {
  color: var(--text);
  font-weight: 500;
}

.options-text {
  color: var(--text);
  font-size: 12px;
}

.vin-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.booking-times {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.time-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.upcoming-indicator {
  margin-top: 8px;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(26,158,74,0.15), rgba(46,204,113,0.1));
  border: 1px solid rgba(26,158,74,0.3);
  border-radius: var(--radius);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #1a9e4a;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.btn-sm {
  padding: 5px 8px;
  font-size: 13px;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  header { padding: 0; }
  .header-brand { padding: 10px 12px 6px; gap: 8px; }
  .logo-text { font-size: 19px; }
  .logo-sub { display: none; }
  .nav-btn { font-size: 12px; gap: 4px; padding: 10px 4px; }
  main { padding: 16px 10px 60px; }
  .hero { padding: 20px 0 18px; }
  .card { padding: 14px; }
  .day-grid { grid-template-columns: repeat(2,1fr); }
  .time-grid { grid-template-columns: repeat(3,1fr); }
  /* Admin table — horizontal scroll on small screens */
  #admin-bookings-table, #admin-clients-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table { font-size: 12px; min-width: 480px; }
  .admin-table th, .admin-table td { padding: 7px 6px; }
  .form-row { flex-direction: column; }
  
  /* Smaller tab nav buttons on mobile */
  .admin-tab-nav { width: 32px; height: auto; font-size: 18px; padding: 9px 0; }
}
@media (min-width: 521px) and (max-width: 767px) {
  /* On tablet — remove fade mask */
  .admin-tabs {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Tablet landscape — increase base font size for better readability */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  html {
    font-size: 18px; /* Increase from default 16px */
  }
  
  /* Increase overall spacing */
  main {
    padding: 24px 20px 80px;
  }
  
  .card {
    padding: 20px;
  }
  
  /* Larger navigation buttons */
  .nav-btn {
    padding: 12px 8px;
    font-size: 13px;
  }
  
  /* Adjust booking cards for tablet landscape */
  .bookings-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
  }
  
  .booking-card {
    padding: 14px;
  }
  
  .booking-time {
    font-size: 17px;
  }
  
  .client-name {
    font-size: 16px;
  }
  
  .client-phone {
    font-size: 13px;
  }
  
  .booking-details {
    font-size: 13px;
  }
  
  /* Larger buttons for touch */
  .btn-sm {
    padding: 7px 12px;
    font-size: 14px;
  }
  
  /* Larger inputs */
  input, textarea, select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }
}
@media (max-width: 360px) {
  .logo-text { font-size: 17px; }
  .nav-btn { padding: 7px 2px; font-size: 12px; }
  .admin-tab { padding: 8px 9px; }
  .admin-tab-nav { width: 28px; height: auto; font-size: 16px; padding: 9px 0; }
}

/* ── Chat ────────────────────────────────────────────────── */
.chat-messages {
  height: 420px; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.chat-bubble {
  max-width: 82%; padding: 9px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.5; word-break: break-word;
}
.chat-bubble.in {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.chat-bubble.out {
  background: rgba(240,165,0,.15); border: 1px solid rgba(240,165,0,.3);
  color: var(--text); align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.chat-bubble .chat-time {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  margin-top: 4px; display: block;
}
.chat-input-bar {
  display: flex; gap: 8px; align-items: flex-end;
  /* Prevent iOS from breaking layout on focus */
  position: relative;
}
.chat-textarea {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-body);
  font-size: 16px; padding: 11px 14px; outline: none;
  transition: border-color .2s; resize: none; line-height: 1.5;
  max-height: 120px; overflow-y: auto;
  -webkit-appearance: none;
}
.chat-textarea:focus { border-color: var(--accent); }
.chat-textarea::placeholder { color: var(--muted); }
.chat-emoji-btn {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 20px; cursor: pointer; display: grid; place-items: center;
  flex-shrink: 0; transition: border-color .2s;
}
.chat-emoji-btn:hover { border-color: var(--accent); }
.chat-send-btn {
  width: 48px; height: 48px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #000; font-size: 18px; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
  transition: filter .2s;
}
.chat-send-btn:hover { filter: brightness(1.1); }
.chat-client-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: border-color .2s;
}
.chat-client-row:hover { border-color: var(--accent); }
.chat-client-name { font-size: 14px; font-weight: 500; }
.chat-client-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.chat-client-badge {
  background: var(--accent); color: #000; font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 100px;
}

/* ── Swipe container ─────────────────────────────────────── */
#swipe-container {
  touch-action: pan-y;
  overflow: hidden;
}

/* ── Emoji panel ─────────────────────────────────────────── */
.emoji-panel {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 10px 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -6px 24px rgba(0,0,0,.4);
  margin-bottom: 6px;
  animation: fadeUp .15s ease;
}
.emoji-item {
  background: none; border: none; cursor: pointer;
  font-size: 22px; padding: 4px; border-radius: 4px;
  transition: background .1s; line-height: 1;
}
.emoji-item:hover { background: rgba(240,165,0,.12); }

/* ── Nav tab swipe flash ─────────────────────────────────── */
@keyframes navFlash {
  0%   { background: rgba(240,165,0,.0);  color: var(--muted); }
  30%  { background: rgba(240,165,0,.18); color: var(--accent); }
  100% { background: rgba(240,165,0,.05); color: var(--accent); }
}
.nav-btn.nav-flash {
  animation: navFlash .35s ease forwards;
}

/* ── PWA install banner ──────────────────────────────────── */
.pwa-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--border);
  animation: fadeUp .3s ease;
  position: sticky; top: var(--header-top, 96px); z-index: 95;
}
.pwa-banner-text {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
}
.pwa-banner-icon { font-size: 18px; }
.pwa-install-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: var(--radius);
  color: #000; font-family: var(--font-head); font-size: 13px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 7px 14px; cursor: pointer; white-space: nowrap;
  transition: filter .2s;
}
.pwa-install-btn:hover { filter: brightness(1.1); }
.pwa-dismiss-btn {
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 4px 6px; line-height: 1;
}
.pwa-dismiss-btn:hover { color: var(--text); }

/* ── My bookings greeting ────────────────────────────────── */
.my-bookings-greeting {
  padding: 12px 16px; margin-bottom: 14px;
  background: rgba(240,165,0,.07);
  border: 1px solid rgba(240,165,0,.2);
  border-radius: var(--radius);
  font-size: 15px; color: var(--text);
  animation: fadeUp .3s ease;
}
.my-bookings-greeting strong { color: var(--accent); }

/* ── Chat unread badge (client side) ─────────────────────── */
.chat-unread-badge {
  background: #ff4444;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  min-width: 24px;
  text-align: center;
  animation: blinkBadge 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255,68,68,0.4);
}

@keyframes blinkBadge {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.6;
    transform: scale(1.05);
  }
}

.my-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* ── Service price inline edit ───────────────────────────── */
.price-edit {
  display: flex; align-items: center; gap: 6px;
}
.price-input {
  width: 90px; padding: 4px 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-mono); font-size: 12px; outline: none;
  transition: border-color .2s;
}
.price-input:focus { border-color: var(--accent); }
.price-badge {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); font-weight: 600;
}
.svc-modal-price {
  color: var(--accent); font-weight: 600; margin-left: 6px;
}

/* ── Promo badge button ──────────────────────────────────── */
.promo-badge-btn {
  background: linear-gradient(135deg, #1a9e4a, #16834a);
  color: #fff; border: none; border-radius: 100px;
  padding: 5px 14px; font-family: var(--font-mono); font-size: 12px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: filter .2s; letter-spacing: .5px;
  box-shadow: 0 0 10px rgba(26,158,74,.3);
}
.promo-badge-btn:hover { filter: brightness(1.15); }

/* ── Promo modal items ───────────────────────────────────── */
.promo-item {
  padding: 16px 20px; border-bottom: 1px solid rgba(42,58,79,.5);
  font-size: 15px; line-height: 1.6; color: var(--text);
}
.promo-item:last-child { border-bottom: none; }

/* ── Contacts block ─────────────────────────────────────── */
.contacts-addr {
  font-size: 15px; color: var(--text); margin-bottom: 10px; font-weight: 500;
}
.contacts-extra {
  font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.6;
}
.contacts-map {
  border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
}
.contacts-map iframe { display: block; border-radius: var(--radius); }
.contacts-photos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 8px;
}
.contacts-photo {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  transition: opacity .2s;
}
.contacts-photo:hover { opacity: .85; }

/* ── Promo edit row (admin) ─────────────────────────────── */
.promo-edit-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.promo-num {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  width: 18px; flex-shrink: 0; text-align: right;
}
.promo-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-body);
  font-size: 14px; padding: 9px 12px; outline: none;
  transition: border-color .2s;
}
.promo-input:focus { border-color: var(--accent); }

/* ── Cancel button compact in admin table ───────────────── */
.btn-cancel-row {
  background: transparent; border: 1px solid var(--danger);
  color: var(--danger); border-radius: var(--radius);
  width: 28px; height: 28px; font-size: 13px; cursor: pointer;
  display: grid; place-items: center; transition: background .15s;
  flex-shrink: 0;
}
.btn-cancel-row:hover { background: rgba(239,68,68,.12); }

/* ═══════════════════════════════════════════════════════════
   ADMIN — GREEN THEME
   All admin elements override accent to #22c55e
   ═══════════════════════════════════════════════════════════ */

/* Login screen */
#page-admin .admin-login-title { color: #22c55e; }
#page-admin .pin-dot.filled    { background: #22c55e; border-color: #22c55e; }
#page-admin .pin-key:hover     { border-color: #22c55e; background: rgba(34,197,94,.08); color: #22c55e; }

/* Panel header & section titles */
#admin-panel .section-title    { color: #22c55e; }

/* Tabs */
#page-admin .admin-tab.active  {
  color: #22c55e;
  border-bottom-color: #22c55e;
}
#page-admin .admin-tab:hover   { color: #e8edf4; }

/* Tab navigation buttons in admin */
#page-admin .admin-tab-nav:hover {
  background: rgba(34,197,94,.1); border-color: #22c55e;
  color: #22c55e;
}

/* Primary buttons inside admin */
#page-admin .btn-primary,
#page-admin .btn.btn-primary {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
}
#page-admin .btn-primary:hover { filter: brightness(1.1); }

/* Toggle on */
#page-admin .toggle-btn.on     { border-color: #22c55e; color: #22c55e; }
#page-admin .toggle-btn:hover  { border-color: #22c55e; color: #22c55e; }

/* Logout button — keep danger red */
#page-admin .btn-danger,
#page-admin .btn.btn-danger    { background: none; }

/* Chat rows in admin */
#page-admin .chat-client-row:hover { border-color: #22c55e; }
#page-admin .chat-client-badge     { background: #16a34a; color: #fff; }

/* Nav badge (unread messages) */
.nav-btn { position: relative; }
.nav-badge {
  position: absolute; top: 5px; right: 3px;
  background: var(--danger); color: #fff;
  font-size: 12px; font-weight: 700; font-family: var(--font-mono);
  padding: 1px 4px; border-radius: 100px;
  min-width: 16px; text-align: center; line-height: 14px;
  pointer-events: none;
  animation: badgeBounce .6s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes badgeBounce {
  0%,100% { transform: scale(1); }
  20%     { transform: scale(1.4); }
  40%     { transform: scale(.9); }
  60%     { transform: scale(1.15); }
  80%     { transform: scale(.97); }
}
.nav-badge.pulse {
  animation: badgeBounce .6s cubic-bezier(.36,.07,.19,.97) both,
             badgePulse 2s ease 0.6s infinite;
}
@keyframes badgePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  50%     { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Blinking nav button text when unread messages */
.nav-blink {
  animation: navTextBlink 1.5s ease-in-out infinite;
}
@keyframes navTextBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* Chat unread badge inside page */
.my-chat-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.chat-unread-badge {
  background: var(--danger); color: #fff;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  padding: 2px 7px; border-radius: 100px; min-width: 22px; text-align: center;
  animation: badgeBounce .6s cubic-bezier(.36,.07,.19,.97) both,
             badgePulse 2s ease 0.6s infinite,
             badgeGlow 1.5s ease-in-out infinite alternate;
}

@keyframes badgeGlow {
  from { 
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
    transform: scale(1);
  }
  to { 
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8), 0 0 20px rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
  }
}

/* Admin chat unread badge */
.admin-chat-unread-badge {
  display: inline-block;
  background: var(--danger); color: #fff;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  padding: 1px 6px; border-radius: 100px; min-width: 18px; text-align: center;
  margin-left: 6px; vertical-align: middle;
  animation: badgeBounce .6s cubic-bezier(.36,.07,.19,.97) both,
             badgePulse 2s ease 0.6s infinite;
}
/* ═══════════════════════════════════════════════════
   CAR BRAND/MODEL — booking modal (two-level)
   ═══════════════════════════════════════════════════ */
.car-brand-row {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px; cursor: pointer;
  border-bottom: 1px solid rgba(42,58,79,.4);
  transition: background .15s;
}
.car-brand-row:hover, .car-brand-row:active { background: rgba(240,165,0,.06); }
.car-brand-row.selected { background: rgba(240,165,0,.1); }
.car-brand-icon { font-size: 20px; width: 28px; flex-shrink: 0; }
.car-brand-name { flex: 1; font-size: 15px; font-weight: 500; color: var(--text); }
.car-brand-arrow {
  color: var(--muted); font-size: 20px; transition: transform .2s;
  display: inline-block;
}
.car-brand-arrow.open { transform: rotate(90deg); color: var(--accent); }

.car-models-wrap {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
  background: rgba(15,19,24,.5);
}
.car-models-wrap.open { max-height: 600px; }

.car-model-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px 10px 48px; cursor: pointer;
  border-bottom: 1px solid rgba(42,58,79,.25);
  transition: background .12s;
}
.car-model-row:hover  { background: rgba(240,165,0,.05); }
.car-model-row.selected { background: rgba(240,165,0,.1); }
.car-model-name { flex: 1; font-size: 14px; color: var(--text); }

/* ═══════════════════════════════════════════════════
   CAR BRANDS ADMIN — tree with models
   ═══════════════════════════════════════════════════ */
.admin-car-brand {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.admin-car-brand-header {
  display: flex; align-items: center; gap: 8px; padding: 2px 8px 2px 0;
}
.car-expand-btn {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; background: none; border: none;
  cursor: pointer; text-align: left; color: var(--text);
}
.car-expand-arrow {
  font-size: 18px; color: var(--muted); transition: transform .2s;
  display: inline-block; width: 18px;
}
.car-expand-arrow.open { transform: rotate(90deg); color: var(--success); }
.car-brand-label { flex: 1; font-size: 14px; font-weight: 500; }
.car-model-count {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.admin-car-models {
  padding: 6px 12px 12px 40px;
  border-top: 1px solid var(--border);
  background: rgba(10,14,20,.3);
}
.admin-car-model-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid rgba(42,58,79,.3);
}
.admin-car-model-row:last-of-type { border-bottom: none; }
.car-model-label { flex: 1; font-size: 13px; color: var(--text); font-family: var(--font-mono); }
.admin-add-model-row {
  display: flex; gap: 8px; margin-top: 10px;
}
.admin-model-input {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-body);
  font-size: 13px; padding: 7px 10px; outline: none;
}
.admin-model-input:focus { border-color: var(--success); }

/* ═══════════════════════════════════════════════════
   SERVICES — drag-and-drop reorder
   ═══════════════════════════════════════════════════ */
.svc-drag-handle {
  cursor: grab; color: var(--muted); font-size: 18px;
  padding: 0 6px 0 2px; user-select: none; flex-shrink: 0;
  letter-spacing: -2px;
}
.service-item[draggable="true"]:active .svc-drag-handle { cursor: grabbing; }
.service-item.svc-dragging {
  opacity: .4; border-style: dashed;
}
.service-item.svc-drag-over {
  border-color: var(--success);
  background: rgba(34,197,94,.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34,197,94,.15);
}

/* Reorder buttons (up/down arrows) */
.service-reorder-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 4px;
}
.reorder-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  min-width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reorder-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240,165,0,0.05);
}
.reorder-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.reorder-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   CLIENTS — Card-based view
   ═══════════════════════════════════════════════════ */
.clients-grid {
  display: grid;
  gap: 12px;
}

.client-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}

.client-card:hover {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.client-card.expanded {
  border-color: #22c55e;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.15);
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.client-card-header:hover {
  background: rgba(34, 197, 94, 0.03);
}

.client-main-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.client-summary {
  flex: 1;
  min-width: 0;
}

.client-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.client-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Service client name - brown color */
.client-name.service-name {
  color: #a67c52;
}

/* Service badge */
.service-badge {
  display: inline-block;
  background: rgba(166, 124, 82, 0.15);
  color: #a67c52;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Service client card styling */
.client-card.service-client {
  border-left: 3px solid #a67c52;
}

.client-card.service-client:hover {
  border-color: rgba(166, 124, 82, 0.4);
}

.client-card.service-client.expanded {
  border-color: #a67c52;
  box-shadow: 0 6px 16px rgba(166, 124, 82, 0.15);
}

.client-badge {
  display: inline-block;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.client-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: color 0.2s;
}

.client-phone:hover {
  color: var(--accent);
}

.client-expand-icon {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.3s, color 0.2s;
  flex-shrink: 0;
}

.client-card.expanded .client-expand-icon {
  color: #22c55e;
  transform: rotate(0deg);
}

.client-card-body {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.3);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.client-details-section {
  margin-bottom: 16px;
}

.client-details-section .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(42, 58, 79, 0.3);
}

.client-details-section .detail-row:last-child {
  border-bottom: none;
}

.client-details-section .detail-label {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.client-details-section .detail-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.client-details-section .detail-value.highlight {
  color: #22c55e;
  font-weight: 700;
}

.client-edit-form {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.client-edit-form .input-group {
  margin-bottom: 12px;
}

.client-edit-form .input-group label {
  font-size: 12px;
  margin-bottom: 6px;
}

.client-edit-form .input-group input {
  font-size: 14px;
  padding: 10px 12px;
}

/* Checkbox label for service flag */
.client-edit-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}

.client-edit-form .checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #a67c52;
  cursor: pointer;
}

.client-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(42, 58, 79, 0.3);
}

.client-actions .btn {
  flex: 1;
  font-size: 13px;
  padding: 8px 12px;
}

/* Booking History List */
.booking-history-list {
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.booking-history-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(15, 19, 24, 0.5);
  border-left: 3px solid #22c55e;
  border-radius: 4px;
}

.booking-history-item:hover {
  background: rgba(34, 197, 94, 0.05);
}

.booking-history-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #22c55e;
  font-weight: 600;
  margin-bottom: 3px;
}

.booking-history-service {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.detail-row.clickable {
  cursor: pointer;
  transition: background 0.2s;
}

.detail-row.clickable:hover {
  background: rgba(34, 197, 94, 0.05);
}

/* ════════════════════════════════════════════════════════════
   ANALYTICS DASHBOARD
   ════════════════════════════════════════════════════════════ */

.analytics-grid {
  display: grid;
  gap: 20px;
  animation: fadeIn 0.4s ease;
}

/* Summary Cards */
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card.success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.05);
}

.stat-card.warning {
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.05);
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Chart Sections */
.chart-section,
.ranking-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px 0;
}

/* Pie Chart */
.pie-chart-container {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.pie-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Ranking Lists */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(15, 19, 24, 0.5);
  border-left: 3px solid #22c55e;
  border-radius: 6px;
}

.ranking-item:hover {
  background: rgba(34, 197, 94, 0.08);
}

.ranking-position {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #22c55e;
  min-width: 35px;
}

.ranking-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.ranking-count {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(34, 197, 94, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

/* Analytics Modal - Responsive sizing */
.analytics-modal {
  max-width: min(900px, 95vw);
  max-height: min(85vh, 800px);
  overflow-y: auto;
  margin: 0 auto;
}

@media (min-width: 1200px) {
  .analytics-modal {
    max-width: 1000px;
  }
}

@media (max-width: 768px) {
  .analytics-modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }
  
  .analytics-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-value {
    font-size: 24px;
  }
}
