/* ============================================================
 *  Trà Nail Portal – Design System v2
 *  Light-first with dark mode toggle
 *  Optimised for iPad Pro 10.5″ (1024×1366)
 * ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─────────────── LIGHT THEME (default) ─────────────── */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Background */
  --bg: #f5f0ee;
  --bg-soft: #efe8e5;
  --bg-warm: #faf6f4;

  /* Surfaces */
  --surface: rgba(255, 255, 255, 0.75);
  --surface-hover: rgba(255, 255, 255, 0.9);
  --surface-glass: rgba(255, 255, 255, 0.6);
  --surface-solid: #ffffff;

  /* Borders */
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);

  /* Text */
  --text: #1a1520;
  --text-secondary: rgba(26, 21, 32, 0.65);
  --text-muted: rgba(26, 21, 32, 0.4);

  /* Brand */
  --primary: #d63384;
  --primary-soft: rgba(214, 51, 132, 0.1);
  --primary-glow: rgba(214, 51, 132, 0.2);
  --accent: #e84393;
  --accent2: #6c5ce7;
  --success: #00b894;
  --success-soft: rgba(0, 184, 148, 0.1);
  --warning: #e17055;
  --warning-soft: rgba(225, 112, 85, 0.1);
  --danger: #d63031;
  --danger-soft: rgba(214, 48, 49, 0.08);

  /* Radius */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(214, 51, 132, 0.08);

  /* Transition */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.12s ease;

  /* Select option bg */
  --option-bg: #ffffff;

  /* Scrollbar */
  --scroll-thumb: rgba(0,0,0,0.12);
  --scroll-thumb-hover: rgba(0,0,0,0.22);

  /* Header */
  --header-bg: rgba(250, 246, 244, 0.85);
  --header-border: rgba(0, 0, 0, 0.06);

  /* Gate overlay */
  --gate-bg: var(--bg);

  /* Modal */
  --modal-bg: rgba(255, 255, 255, 0.97);
  --modal-backdrop: rgba(0, 0, 0, 0.35);

  /* Body gradient blobs */
  --blob1: rgba(214, 51, 132, 0.045);
  --blob2: rgba(108, 92, 231, 0.035);
  --blob3: rgba(0, 184, 148, 0.025);

  /* Admin */
  --sidebar-bg: rgba(250, 246, 244, 0.97);

  /* QR */
  --qr-bg: var(--bg-soft);

  /* Table row hover */
  --row-hover: rgba(0,0,0,0.025);
  --row-border: rgba(0,0,0,0.04);
}

/* ─────────────── DARK THEME ─────────────── */
[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-soft: #12121a;
  --bg-warm: #0f0f14;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --surface-glass: rgba(255, 255, 255, 0.06);
  --surface-solid: #16161e;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.6);
  --text-muted: rgba(240, 240, 245, 0.4);
  --primary: #e84393;
  --primary-soft: rgba(232, 67, 147, 0.15);
  --primary-glow: rgba(232, 67, 147, 0.3);
  --accent: #fd79a8;
  --accent2: #a29bfe;
  --success-soft: rgba(0, 184, 148, 0.15);
  --warning-soft: rgba(253, 203, 110, 0.15);
  --danger-soft: rgba(214, 48, 49, 0.15);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(232, 67, 147, 0.15);
  --option-bg: #1a1a24;
  --scroll-thumb: rgba(255,255,255,0.1);
  --scroll-thumb-hover: rgba(255,255,255,0.2);
  --header-bg: rgba(10, 10, 15, 0.85);
  --header-border: rgba(255, 255, 255, 0.06);
  --gate-bg: #0a0a0f;
  --modal-bg: rgba(18, 18, 26, 0.98);
  --modal-backdrop: rgba(0, 0, 0, 0.6);
  --blob1: rgba(232, 67, 147, 0.06);
  --blob2: rgba(162, 155, 254, 0.05);
  --blob3: rgba(0, 184, 148, 0.03);
  --sidebar-bg: rgba(10, 10, 15, 0.95);
  --qr-bg: var(--bg-soft);
  --row-hover: rgba(255,255,255,0.03);
  --row-border: rgba(255,255,255,0.04);
}

/* ── HTML & Body ── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 10%, var(--blob1), transparent 60%),
    radial-gradient(ellipse 600px 400px at 80% 20%, var(--blob2), transparent 60%),
    radial-gradient(ellipse 500px 500px at 50% 80%, var(--blob3), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

/* ── Container ── */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ===================================================================
 *  HEADER
 * =================================================================== */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--header-border);
  transition: background 0.35s ease;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.header-title {
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

/* ── Theme Toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 18px;
  line-height: 1;
  font-family: var(--font);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text);
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Language Switcher ── */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.lang-btn:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.lang-current { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--modal-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 200;
}
.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.lang-option:hover { background: var(--surface-hover); color: var(--text); }
.lang-option.active { color: var(--primary); background: var(--primary-soft); }

/* ── Mobile Menu ── */
.mobile-menu-btn {
  display: none;
  padding: 6px;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.mobile-menu-btn:hover { background: var(--surface-hover); }

.mobile-nav {
  display: none;
  padding: 8px 24px 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.mobile-nav.open { display: flex; flex-direction: column; gap: 4px; }

.mobile-nav-link {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.mobile-nav-link:hover { background: var(--surface-hover); color: var(--text); }
.mobile-nav-link.active { color: var(--primary); background: var(--primary-soft); }

@media (max-width: 768px) {
  .header-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .lang-current { display: none; }
}

/* ===================================================================
 *  CARD
 * =================================================================== */
.card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 20px 0;
  box-shadow: var(--shadow);
  transition: background 0.35s ease, border-color 0.35s ease;
}

/* ===================================================================
 *  PAGE HERO
 * =================================================================== */
.page-hero {
  padding: 44px 0 12px;
  text-align: center;
}
.page-hero h1 {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-hero .subtitle {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===================================================================
 *  FORM ELEMENTS
 * =================================================================== */
.field {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  transition: all var(--transition);
  outline: none;
}
.field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface-hover);
}
.field::placeholder { color: var(--text-muted); }

select.field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select.field option { background: var(--option-bg); color: var(--text); }
textarea.field { resize: vertical; min-height: 80px; }

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===================================================================
 *  BUTTONS
 * =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #c2185b);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 8px 30px var(--primary-glow);
  filter: brightness(1.08);
  border-color: transparent;
}

.btn-success { background: var(--success); border-color: transparent; color: #fff; }
.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(214, 48, 49, 0.2);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===================================================================
 *  PRICE GRID
 * =================================================================== */
.pricegrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}
@media (min-width: 640px) { .pricegrid { grid-template-columns: repeat(2, 1fr); } }

/* iPad Pro 10.5 optimisation */
@media (min-width: 1000px) and (max-width: 1100px) {
  .pricegrid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

.price-item {
  border: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.price-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-soft), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.price-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.price-item:hover::before { opacity: 1; }

.price-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--primary-glow);
}

.price-mid { flex: 1; min-width: 0; position: relative; z-index: 1; }
.price-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price-meta {
  display: flex;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.price-right {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.price-amount {
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  color: var(--primary);
}
.price-amount .sep { opacity: 0.4; margin: 0 4px; }
.price-amount .usd { color: var(--accent2); }

.price-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Search Bar ── */
.search-bar { position: relative; }
.search-bar .field { padding-left: 42px; }
.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ===================================================================
 *  MODAL
 * =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-overlay .backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
}
.modal-box {
  position: relative;
  max-width: 680px;
  width: 100%;
  background: var(--modal-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.modal-head-left { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.modal-thumb {
  width: 80px; height: 80px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
  display: none;
}
.modal-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.modal-svc { font-size: 20px; font-weight: 900; color: var(--text); line-height: 1.3; }
.modal-close {
  padding: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }

.modal-body {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.7;
  white-space: pre-line;
  padding-bottom: 16px;
}

.modal-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.modal-tag.price-tag {
  color: var(--primary);
  border-color: rgba(214, 51, 132, 0.2);
  background: var(--primary-soft);
}

/* ===================================================================
 *  TOAST
 * =================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--success);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(0, 184, 148, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ===================================================================
 *  ACCESS CODE GATE
 * =================================================================== */
.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gate-bg);
  padding: 20px;
  transition: background 0.35s ease;
}
.gate-box { max-width: 420px; width: 100%; text-align: center; }
.gate-logo {
  width: 80px; height: 80px;
  border-radius: 20px;
  margin: 0 auto 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-glow);
}
.gate-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gate-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.gate-input {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 6px;
  padding: 16px 20px;
}
.gate-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  display: none;
}
.gate-error.show { display: block; }
.gate-btn { margin-top: 16px; }

/* ===================================================================
 *  QR PAGE
 * =================================================================== */
.qr-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 20px 0;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.qr-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.qr-title { font-size: 20px; font-weight: 900; }
.qr-sub { margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.qr-chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--primary-soft);
  font-weight: 800;
  font-size: 12px;
  color: var(--primary);
}
.qr-status {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  min-width: 90px;
  text-align: center;
}
.qr-status.ok { background: var(--success-soft); border-color: rgba(0, 184, 148, 0.3); color: var(--success); }
.qr-status.err { background: var(--danger-soft); border-color: rgba(214, 48, 49, 0.3); color: var(--danger); }

.qr-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
  grid-template-areas: "form qr";
}
.qr-card-form { grid-area: form; }
.qr-card-qr { grid-area: qr; }

@media (max-width: 900px) {
  .qr-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "qr" "form";
  }
}

/* iPad Pro 10.5 landscape */
@media (min-width: 1000px) and (max-width: 1100px) {
  .qr-grid { grid-template-columns: 1fr 380px; }
}

.qr-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 20px;
}
.qr-box {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 20%, var(--primary-soft), transparent 50%),
    var(--bg-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.35s ease;
}

.qr-placeholder { text-align: center; padding: 20px; }
.qr-placeholder .ph-title { font-weight: 900; font-size: 16px; color: var(--text); }
.qr-placeholder .ph-sub { margin-top: 6px; color: var(--text-muted); font-size: 13px; }

.qr-img-wrap {
  position: absolute;
  inset: 0;
  display: none;
}
.qr-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.qr-logo-overlay {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(70px, 22%, 120px);
  height: clamp(70px, 22%, 120px);
  border-radius: 18%;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border: 2px solid rgba(255,255,255,0.4);
}
.qr-logo-overlay img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.15);
}

/* ===================================================================
 *  GALLERY
 * =================================================================== */
.gallery-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.filter-chip:hover { background: var(--surface-hover); color: var(--text); }
.filter-chip.active { background: var(--primary-soft); border-color: rgba(214, 51, 132, 0.3); color: var(--primary); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  aspect-ratio: 1;
  background: var(--surface);
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item .gallery-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 30px 12px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lightbox .lb-close {
  position: absolute;
  top: 20px; right: 20px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition-fast);
}
.lightbox .lb-close:hover { background: rgba(255,255,255,0.1); }

/* ===================================================================
 *  BOOKING
 * =================================================================== */
.booking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) { .booking-grid { grid-template-columns: 1fr; } }

.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.time-slot {
  padding: 11px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.time-slot:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-hover); }
.time-slot.selected { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.time-slot.disabled { opacity: 0.3; pointer-events: none; }

/* Booking Success */
.booking-success { text-align: center; padding: 40px 20px; }
.booking-success .check-circle {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--success-soft);
  border: 2px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  animation: successPop 0.5s ease;
}
@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
.booking-success h2 { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.booking-success p { color: var(--text-muted); font-size: 14px; }

/* ── Note Bar ── */
.note-bar {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; font-weight: 800; color: var(--text-secondary); margin-bottom: 8px; }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================================================================
 *  ADMIN STYLES
 * =================================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 768px) { .admin-layout { grid-template-columns: 1fr; } }

.admin-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: background 0.35s ease;
}
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: 260px;
    z-index: 1000;
    transition: left var(--transition);
  }
  .admin-sidebar.open { left: 0; }
}

.admin-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 20px;
}
.admin-sidebar .sidebar-brand img { width: 32px; height: 32px; border-radius: 8px; }
.admin-sidebar .sidebar-brand span {
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-link.active { background: var(--primary-soft); color: var(--primary); }
.sidebar-link .icon { width: 20px; text-align: center; font-size: 16px; }

.admin-main { padding: 24px; min-width: 0; }

.admin-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
@media (max-width: 768px) { .admin-topbar { display: flex; } }

.admin-header { margin-bottom: 24px; }
.admin-header h1 { font-size: 24px; font-weight: 900; }
.admin-header .desc { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  transition: background 0.35s ease;
}
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 900; margin-top: 6px; }
.stat-card .stat-value.pink { color: var(--primary); }
.stat-card .stat-value.purple { color: var(--accent2); }
.stat-card .stat-value.green { color: var(--success); }
.stat-card .stat-value.yellow { color: var(--warning); }

/* Admin table */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.data-table thead th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--row-border);
  vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Badge */
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-new { background: var(--primary-soft); color: var(--primary); }
.badge-confirmed { background: rgba(108, 92, 231, 0.1); color: var(--accent2); }
.badge-completed { background: var(--success-soft); color: var(--success); }
.badge-cancelled { background: var(--danger-soft); color: var(--danger); }

/* ===================================================================
 *  UTILITY
 * =================================================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-sm { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease both; }
.fade-in-delay { animation: fadeIn 0.4s ease 0.1s both; }

/* ── Admin Overlay ── */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}
.admin-overlay.open { display: block; }

/* ===================================================================
 *  iPad Pro 10.5″ OPTIMIZATION (1024 × 1366)
 *  Both portrait and landscape refinements
 * =================================================================== */
@media (min-width: 768px) and (max-width: 1100px) {
  html { font-size: 17px; }

  .wrap { max-width: 1000px; padding: 0 28px; }
  .header-inner { padding: 0 28px; height: 68px; }

  .page-hero { padding: 48px 0 14px; }
  .page-hero h1 { font-size: 32px; }

  .card { padding: 32px; margin: 24px 0; }

  .price-item { padding: 20px; gap: 16px; }
  .price-name { font-size: 16px; }
  .price-amount { font-size: 15px; }
  .price-thumb { width: 52px; height: 52px; }

  .time-slots { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .time-slot { padding: 13px 8px; font-size: 14px; }

  .qr-shell { padding: 32px; margin: 24px 0; }
  .qr-title { font-size: 22px; }

  .field { padding: 14px 18px; font-size: 16px; }
  .btn { padding: 14px 24px; font-size: 15px; }
  .btn-sm { padding: 10px 16px; font-size: 13px; }
}

/* Portrait iPad — stacking tweaks */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .qr-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "qr" "form";
    gap: 20px;
  }
  .qr-box { max-width: 480px; margin: 0 auto; }
  .booking-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}
