/* ─── D3TAILER — Minimalist Mobile-First Styles ─── */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: #fff;
  color: #18181b;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

::selection { background: #dbe4ff; color: #364fc7; }

/* ─── Layout ─── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #f4f4f5;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.logo span { color: #a1a1aa; }

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px;
}

.page-wide {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ─── Typography ─── */

h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.5px; line-height: 1.2; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: 0; }
.text-light { color: #a1a1aa; }
.text-muted { color: #71717a; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.pb-8 { padding-bottom: 32px; }

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: all 0.2s ease;
  gap: 6px;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: #18181b;
  color: #fff;
}
.btn-primary:hover { background: #27272a; }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; }

.btn-secondary {
  background: #fff;
  color: #18181b;
  border: 1px solid #e4e4e7;
}
.btn-secondary:hover { background: #fafafa; }

.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ─── Forms ─── */

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-label .req { color: #a1a1aa; }

.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background: #fff;
  color: #18181b;
}

.input::placeholder { color: #a1a1aa; }
.input:focus { border-color: #a1a1aa; box-shadow: 0 0 0 3px #f4f4f5; }
.input-icon { padding-left: 40px; }

textarea.input { resize: none; }

.input-wrapper {
  position: relative;
}

.input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #a1a1aa;
  pointer-events: none;
}

/* ─── Service Chips ─── */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #52525b;
  transition: all 0.2s;
  cursor: pointer;
  user-select: none;
}

.chip:hover { border-color: #d4d4d8; }

.chip.active {
  background: #18181b;
  color: #fff;
  border-color: #18181b;
}

.chip-display {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #f4f4f5;
  color: #52525b;
  display: inline-block;
}

/* ─── Cards ─── */

.card {
  border-radius: 16px;
  border: 1px solid #f4f4f5;
  background: #fff;
  padding: 20px;
  transition: all 0.2s;
}

.card:hover { border-color: #e4e4e7; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }

.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.card-actions .btn { flex: 1; text-align: center; }

/* ─── Badges ─── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-green { background: #ecfdf5; color: #059669; }
.badge-amber { background: #fffbeb; color: #d97706; }
.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-gray { background: #f4f4f5; color: #71717a; }

/* ─── Gallery ─── */

.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  background: #f4f4f5;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
}

.gallery-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.gallery-thumb:hover { opacity: 0.8; }
.gallery-thumb.active { opacity: 1; border-color: #18181b; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Contact Links ─── */

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #f4f4f5;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.contact-link:hover { border-color: #e4e4e7; }

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg { width: 16px; height: 16px; }
.contact-icon-phone { background: #f4f4f5; color: #52525b; }
.contact-icon-wa { background: #ecfdf5; color: #059669; }

/* ─── Back Link ─── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #71717a;
  transition: color 0.2s;
  margin-bottom: 16px;
}

.back-link:hover { color: #18181b; }
.back-link svg { width: 16px; height: 16px; }

/* ─── Empty State ─── */

.empty {
  padding: 48px 20px;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.empty-icon svg { width: 24px; height: 24px; color: #a1a1aa; }

/* ─── Success State ─── */

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.success-icon svg { width: 28px; height: 28px; color: #059669; }

/* ─── Spinner ─── */

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Skeleton ─── */

.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, #f4f4f5 25%, #e4e4e7 50%, #f4f4f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── Animations ─── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.anim-fade-up {
  animation: fadeUp 0.5s ease-out both;
}

.anim-delay-1 { animation-delay: 60ms; }
.anim-delay-2 { animation-delay: 120ms; }
.anim-delay-3 { animation-delay: 180ms; }
.anim-delay-4 { animation-delay: 240ms; }

/* Stagger children */
.stagger > * {
  opacity: 0;
  animation: fadeUp 0.5s ease-out forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 360ms; }
.stagger > *:nth-child(8) { animation-delay: 420ms; }

/* ─── Admin Tabs ─── */

.tabs {
  display: flex;
  gap: 4px;
  background: #f4f4f5;
  border-radius: 12px;
  padding: 4px;
}

.tab {
  flex: 1;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #71717a;
  transition: all 0.2s;
  text-transform: capitalize;
}

.tab:hover { color: #52525b; }
.tab.active { background: #fff; color: #18181b; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* ─── Admin Status Buttons ─── */

.status-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.status-btn {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: none;
  background: #f4f4f5;
  color: #71717a;
  transition: all 0.2s;
  text-transform: capitalize;
  cursor: pointer;
}

.status-btn:hover { background: #e4e4e7; }
.status-btn.active { background: #18181b; color: #fff; }

/* ─── Admin Form Grid ─── */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}

.form-grid-full { grid-column: 1 / -1; }

.checkbox-group {
  display: flex;
  gap: 16px;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input { width: 16px; height: 16px; }

/* ─── Error ─── */

.error-msg { color: #dc2626; font-size: 13px; margin-top: 8px; }

/* ─── Utilities ─── */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }
