:root {
  --pink: #e91e63;
  --pink-dark: #c2185b;
  --pink-light: #fce4ec;
  --pink-soft: #f8bbd9;
  --purple: #9c27b0;
  --purple-light: #f3e5f5;
  --gold: #ff9800;
  --gold-light: #fff3e0;
  --success: #4caf50;
  --success-light: #e8f5e9;
  --warning: #ff9800;
  --error: #f44336;
  --error-light: #ffebee;
  --info: #2196f3;
  --info-light: #e3f2fd;

  --text: #1a1a2e;
  --text-2: #4a4a6a;
  --text-3: #8888aa;
  --text-inv: #ffffff;

  --bg: #ffffff;
  --bg-2: #f8f9ff;
  --bg-3: #f0f0f8;
  --border: #e8e8f0;
  --border-2: #d0d0e0;

  --font: 'Sarabun', 'Noto Sans Thai', sans-serif;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-pink: 0 4px 20px rgba(233,30,99,0.25);

  --header-h: 60px;
  --nav-h: 64px;
  --transition: 200ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--nav-h);
}

body.no-nav { padding-bottom: 0; }

a { color: var(--pink); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--pink-dark); }

img { max-width: 100%; display: block; }

h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.4rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

/* Layout */
.container { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px; }
.page { padding: 16px; max-width: 480px; margin: 0 auto; }

/* Header */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
}
.app-header .logo { font-size: 1.1rem; font-weight: 700; color: var(--pink); }
.app-header .header-actions { display: flex; align-items: center; gap: 8px; }

/* Main content offset */
.app-main { margin-top: var(--header-h); min-height: calc(100vh - var(--header-h) - var(--nav-h)); }

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.bottom-nav .nav-items { display: flex; width: 100%; justify-content: space-around; }
.bottom-nav .nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 12px; color: var(--text-3);
  font-size: 0.7rem; font-weight: 500; transition: color var(--transition);
  cursor: pointer; border: none; background: none; text-decoration: none;
  min-width: 56px;
}
.bottom-nav .nav-item svg { width: 22px; height: 22px; }
.bottom-nav .nav-item.active, .bottom-nav .nav-item:hover { color: var(--pink); }
.bottom-nav .nav-item.active svg { stroke: var(--pink); }

/* Cards */
.card {
  background: var(--bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-body { padding: 16px; }
.card-header { padding: 16px; border-bottom: 1px solid var(--border); }
.card-footer { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg-2); }

/* Gradient cards */
.card-gradient-pink { background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%); color: white; }
.card-gradient-gold { background: linear-gradient(135deg, #ff9800 0%, #f44336 100%); color: white; }
.card-gradient-blue { background: linear-gradient(135deg, #2196f3 0%, #9c27b0 100%); color: white; }
.card-gradient-green { background: linear-gradient(135deg, #4caf50 0%, #009688 100%); color: white; }

/* Stats */
.stat-card {
  background: var(--bg); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.pink { background: var(--pink-light); color: var(--pink); }
.stat-icon.gold { background: var(--gold-light); color: var(--gold); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-full);
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--pink); color: white; box-shadow: var(--shadow-pink); }
.btn-primary:hover:not(:disabled) { background: var(--pink-dark); color: white; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-3); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-outline { background: transparent; color: var(--pink); border: 2px solid var(--pink); }
.btn-outline:hover:not(:disabled) { background: var(--pink-light); }
.btn-ghost { background: transparent; color: var(--text-2); padding: 8px; }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--error); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; }
.btn-icon { padding: 8px; border-radius: var(--radius); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 1rem; color: var(--text);
  background: var(--bg); transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(233,30,99,0.1); }
.form-control.error { border-color: var(--error); }
.form-control::placeholder { color: var(--text-3); }
.form-hint { font-size: 0.8rem; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 0.8rem; color: var(--error); margin-top: 4px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238888aa' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* Input with icon */
.input-group { position: relative; }
.input-group .form-control { padding-left: 42px; }
.input-group .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--success-light); color: #2e7d32; border-left: 4px solid var(--success); }
.alert-error { background: var(--error-light); color: #c62828; border-left: 4px solid var(--error); }
.alert-warning { background: var(--gold-light); color: #e65100; border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-light); color: #1565c0; border-left: 4px solid var(--info); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; }
.badge-pink { background: var(--pink-light); color: var(--pink); }
.badge-success { background: var(--success-light); color: #2e7d32; }
.badge-warning { background: var(--gold-light); color: #e65100; }
.badge-error { background: var(--error-light); color: #c62828; }
.badge-info { background: var(--info-light); color: #1565c0; }
.badge-gray { background: var(--bg-3); color: var(--text-2); }

/* Status badges */
.status-pending { background: var(--gold-light); color: #e65100; }
.status-confirmed { background: var(--info-light); color: #1565c0; }
.status-assigned { background: var(--purple-light); color: var(--purple); }
.status-in_progress { background: #e8f5e9; color: #2e7d32; }
.status-completed { background: var(--success-light); color: #1b5e20; }
.status-cancelled { background: var(--error-light); color: #c62828; }
.status-active { background: var(--success-light); color: #2e7d32; }
.status-inactive { background: var(--bg-3); color: var(--text-3); }

/* Lists */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg-2); }
.list-item-icon { width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-subtitle { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }
.list-item-action { flex-shrink: 0; }

/* Avatar */
.avatar { border-radius: var(--radius-full); object-fit: cover; background: var(--pink-light); display: flex; align-items: center; justify-content: center; color: var(--pink); font-weight: 700; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-md { width: 48px; height: 48px; font-size: 1rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.8rem; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 0.85rem; margin: 16px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Section */
.section { margin-bottom: 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.section-link { font-size: 0.85rem; color: var(--pink); font-weight: 500; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* Spacing */
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}
.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.p-6{padding:24px}
.px-4{padding-left:16px;padding-right:16px}.py-3{padding-top:12px;padding-bottom:12px}

/* Text */
.text-sm{font-size:0.85rem}.text-xs{font-size:0.75rem}.text-lg{font-size:1.1rem}.text-xl{font-size:1.25rem}
.font-bold{font-weight:700}.font-semibold{font-weight:600}.font-medium{font-weight:500}
.text-pink{color:var(--pink)}.text-muted{color:var(--text-3)}.text-2{color:var(--text-2)}
.text-success{color:var(--success)}.text-error{color:var(--error)}.text-warning{color:var(--warning)}
.text-center{text-align:center}.text-right{text-align:right}
.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Misc */
.rounded{border-radius:var(--radius)}.rounded-full{border-radius:var(--radius-full)}
.shadow{box-shadow:var(--shadow)}.shadow-sm{box-shadow:var(--shadow-sm)}
.w-full{width:100%}.hidden{display:none}.block{display:block}
.relative{position:relative}.absolute{position:absolute}
.overflow-hidden{overflow:hidden}
.cursor-pointer{cursor:pointer}
.bg-white{background:var(--bg)}.bg-pink{background:var(--pink)}.bg-pink-light{background:var(--pink-light)}

/* Hero banner */
.hero-banner {
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  color: white; padding: 24px 16px; border-radius: var(--radius-xl);
  margin-bottom: 20px; position: relative; overflow: hidden;
}
.hero-banner::after {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

/* Service cards */
.service-card {
  background: var(--bg); border-radius: var(--radius-lg);
  padding: 16px; text-align: center; box-shadow: var(--shadow-sm);
  border: 2px solid transparent; transition: all var(--transition); cursor: pointer;
}
.service-card:hover, .service-card.selected { border-color: var(--pink); background: var(--pink-light); }
.service-card .service-icon { font-size: 2rem; margin-bottom: 8px; }
.service-card .service-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.service-card .service-price { font-size: 0.8rem; color: var(--pink); font-weight: 600; margin-top: 4px; }

/* Quick action buttons */
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; background: var(--bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: all var(--transition);
  border: none; text-decoration: none; color: var(--text);
}
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-action .qa-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.quick-action .qa-label { font-size: 0.8rem; font-weight: 600; text-align: center; }

/* Booking card */
.booking-card {
  background: var(--bg); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 12px;
  border-left: 4px solid var(--pink);
}
.booking-card.status-pending { border-left-color: var(--warning); }
.booking-card.status-confirmed { border-left-color: var(--info); }
.booking-card.status-completed { border-left-color: var(--success); }
.booking-card.status-cancelled { border-left-color: var(--error); }

/* Steps */
.steps { display: flex; align-items: center; margin-bottom: 24px; }
.step { display: flex; flex-direction: column; align-items: center; flex: 1; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; border: 2px solid var(--border);
  background: var(--bg); color: var(--text-3); transition: all var(--transition);
}
.step.active .step-circle { border-color: var(--pink); background: var(--pink); color: white; }
.step.done .step-circle { border-color: var(--success); background: var(--success); color: white; }
.step-label { font-size: 0.7rem; color: var(--text-3); margin-top: 4px; text-align: center; }
.step.active .step-label { color: var(--pink); font-weight: 600; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 4px; margin-bottom: 20px; }
.step.done + .step-line { background: var(--success); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  transform: translateY(100%); transition: transform 300ms ease;
  padding: 20px;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-handle { width: 40px; height: 4px; background: var(--border-2); border-radius: 2px; margin: 0 auto 16px; }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }

/* Toast */
.toast-container { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 448px; }
.toast {
  padding: 12px 16px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: slideDown 300ms ease;
}
.toast-success { background: #2e7d32; color: white; }
.toast-error { background: #c62828; color: white; }
.toast-info { background: #1565c0; color: white; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Loading */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--pink); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.8); z-index: 400; display: flex; align-items: center; justify-content: center; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-2); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; color: var(--text-3); }

/* Auth pages */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); max-width: 440px; margin: 0 auto; }
.auth-header { padding: 48px 24px 24px; text-align: center; }
.auth-logo { font-size: 2rem; margin-bottom: 8px; }
.auth-title { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.auth-subtitle { color: var(--text-3); font-size: 0.9rem; margin-top: 4px; }
.auth-body { flex: 1; padding: 0 24px 32px; }
.auth-footer { padding: 16px 24px; text-align: center; font-size: 0.9rem; color: var(--text-3); }

/* Tab bar */
.tabs { display: flex; background: var(--bg-3); border-radius: var(--radius); padding: 4px; margin-bottom: 16px; }
.tab { flex: 1; padding: 8px; text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--text-3); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); border: none; background: none; font-family: var(--font); }
.tab.active { background: var(--bg); color: var(--pink); box-shadow: var(--shadow-sm); }

/* Progress bar */
.progress { height: 6px; background: var(--bg-3); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--pink), var(--purple)); border-radius: var(--radius-full); transition: width 500ms ease; }

/* Rating stars */
.stars { display: flex; gap: 2px; }
.star { color: #ddd; font-size: 1.1rem; }
.star.filled { color: #ffc107; }

/* Wallet card */
.wallet-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white; border-radius: var(--radius-xl); padding: 24px;
  position: relative; overflow: hidden;
}
.wallet-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(233,30,99,0.2);
}
.wallet-balance { font-size: 2rem; font-weight: 700; }
.wallet-label { font-size: 0.85rem; opacity: 0.7; }

/* Admin sidebar (desktop) */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .app-main { margin-left: 240px; }
  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
    background: #1a1a2e; color: white; padding: 20px 0; z-index: 50;
    overflow-y: auto;
  }
}

/* Responsive */
@media (max-width: 360px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.5rem; }
}

/* Desktop styles */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .app-main { margin-left: 0; max-width: 1200px; margin: var(--header-h) auto 0; padding: 32px; }
  .container, .page { max-width: 1200px; padding: 0 32px; }
  .hero h1 { font-size: 3rem; }
  .hero p { font-size: 1.2rem; }
  .feature-grid, .services-grid { max-width: 900px; grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
