* { box-sizing: border-box; }
:root {
  --bg: #fff8fb;
  --card: #ffffff;
  --text: #2f2430;
  --muted: #746873;
  --accent: #9c3d72;
  --accent-dark: #7a2f59;
  --soft: #f7dce9;
  --border: #ead7e1;
  --danger: #b93a4b;
  --success: #1f7a55;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { margin: 0; font-size: 25px; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
nav { display: flex; gap: 10px; flex-wrap: wrap; }
button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 650;
}
.nav-btn { background: #f3edf1; color: var(--text); }
.nav-btn.active { background: var(--accent); color: white; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: var(--soft); color: var(--accent-dark); }
.danger { background: #fae0e4; color: var(--danger); }
.large { min-height: 70px; font-size: 20px; }
main { width: min(1180px, 94%); margin: 35px auto; }
.view { display: none; }
.view.active { display: block; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(83, 45, 67, 0.08);
  padding: 28px;
  margin-bottom: 24px;
}
.hero { text-align: center; padding: 50px 28px; max-width: 780px; margin: 20px auto; }
.hero h2 { font-size: clamp(29px, 4vw, 44px); margin-bottom: 10px; }
.hero p { color: var(--muted); font-size: 19px; }
.logo-circle {
  width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  margin: 0 auto 18px; background: var(--accent); color: #fff; font-size: 27px; font-weight: 800;
}
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 28px; }
.hidden { display: none !important; }
.narrow { max-width: 500px; margin: 30px auto; }
label { display: flex; flex-direction: column; gap: 8px; font-weight: 650; }
input, select {
  border: 1px solid #d9c5d0;
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  font-size: 17px;
  width: 100%;
}
form { display: grid; gap: 18px; }
.form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-full { grid-column: 1 / -1; }
.back-btn { background: transparent; color: var(--accent); padding-left: 0; }
.success-box, .info-box, .error-box {
  margin-top: 20px; padding: 18px; border-radius: 12px; line-height: 1.5;
}
.success-box { background: #e5f5ee; color: #185d43; }
.info-box { background: #f4edf5; }
.error-box, .error { color: #9e2d3d; background: #fdecef; }
.admin-header, .table-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap;
}
.admin-actions { display: flex; gap: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.stat { margin: 0; }
.stat span { display: block; color: var(--muted); }
.stat strong { display: block; font-size: 34px; margin-top: 8px; }
.table-toolbar { margin-bottom: 18px; }
.table-toolbar input { max-width: 420px; }
.table-toolbar select { max-width: 240px; }
.table-wrap { overflow-x: auto; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 14px; }
.badge {
  display: inline-block; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; margin: 2px;
}
.badge.reward { background: #e4f5ec; color: #176544; }
.badge.none { background: #f2edf0; color: #71636b; }
.action-group { display: flex; gap: 6px; flex-wrap: wrap; }
.action-group button { padding: 7px 10px; font-size: 13px; touch-action: manipulation; }
button, .nav-btn, .admin-secret-trigger { touch-action: manipulation; }
.modal {
  position: fixed; inset: 0; background: rgba(30,20,26,.55); display: grid; place-items: center; z-index: 20;
  padding: 20px;
}
.modal-content {
  width: min(720px, 100%); background: white; border-radius: 18px; padding: 26px; position: relative;
  max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-close { position: absolute; top: 10px; right: 12px; background: transparent; font-size: 30px; }
footer { text-align: center; color: var(--muted); padding: 20px; }
@media (max-width: 800px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .choice-grid, .form-grid, .stats-grid { grid-template-columns: 1fr; }
  .form-full { grid-column: auto; }
  main { width: 95%; }
  .card { padding: 20px; }
}


.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-brand img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
}
.brand-logo {
  width: min(260px, 70vw);
  height: auto;
  display: block;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 10px 30px rgba(156, 61, 114, 0.15);
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 18px;
}
.photo-gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid white;
  box-shadow: 0 7px 18px rgba(60, 30, 48, 0.16);
}
.checkin-prompt {
  font-weight: 700;
  color: var(--text) !important;
}
.hero {
  background:
    linear-gradient(rgba(255,255,255,.93), rgba(255,255,255,.93)),
    url("assets/style_2.png") center/cover;
}
@media (max-width: 900px) {
  .photo-gallery {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}
@media (max-width: 520px) {
  .photo-gallery {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .header-brand img {
    width: 54px;
    height: 54px;
  }
}


.user-badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 13px;
  border-radius: 999px;
  background: #f5e7ef;
  color: var(--accent-dark);
  font-weight: 750;
}
.status-online { color: #157347; font-weight: 750; }
.status-offline { color: #766a72; font-weight: 650; }
.cloud-sync-status { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.cloud-sync-status.syncing, .cloud-sync-status.waiting { background: #f3edf1; color: var(--muted); }
.cloud-sync-status.online { background: #e4f4ec; color: #157347; }
.cloud-sync-status.offline { background: #fae0e4; color: var(--danger); }
.account-table-wrap { margin-top: 24px; }
.narrow-modal { max-width: 520px; }
.permission-note {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff4d8;
  color: #6a5317;
  margin: 0 0 18px;
}

.three-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-status-card {
  margin-top: 20px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.status-grid > div {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
}

.status-grid span,
.status-grid strong {
  display: block;
}

.status-grid span {
  font-size: 0.88rem;
  margin-bottom: 7px;
}

.status-grid strong {
  font-size: 1.2rem;
}

@media (max-width: 820px) {
  .three-options,
  .status-grid {
    grid-template-columns: 1fr;
  }
}


.panel-photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 24px;
}

.panel-photo-gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(52, 32, 44, 0.14);
}

.admin-secret-trigger {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (max-width: 700px) {
  .panel-photo-gallery img {
    height: 125px;
  }
}


.permission-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-weight: 650;
}

.permission-check input {
  width: 20px;
  height: 20px;
}

.permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-tag {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1e7ed;
  color: #664c5d;
  font-size: 0.82rem;
  font-weight: 700;
}
.profile-modal-content{max-width:980px}.profile-heading{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:18px 0}.profile-section{padding:16px;border:1px solid #eadde4;border-radius:16px;background:#fff}.profile-section h3{margin-top:0}.profile-section textarea{width:100%;box-sizing:border-box;resize:vertical}.customer-photo-preview{width:150px;height:150px;object-fit:cover;border-radius:16px;border:2px solid #eadde4}.profile-photo-actions{margin-top:12px}.service-table-wrap{margin-top:14px}.compact-form{align-items:end}.vip-badge{display:inline-block;padding:7px 12px;border-radius:999px;background:#f3d27a;color:#4d3300;font-weight:800}.customer-mini-photo{width:46px;height:46px;object-fit:cover;border-radius:50%;vertical-align:middle;margin-right:9px}.customer-name-wrap{display:flex;align-items:center}.profile-btn{white-space:nowrap}@media(max-width:760px){.profile-grid{grid-template-columns:1fr}.profile-heading{flex-direction:column}.customer-photo-preview{width:120px;height:120px}}

/* Service history photos */
.service-photo-preview-wrap{display:flex;justify-content:flex-start}.service-photo-preview{width:180px;height:180px;object-fit:cover;border-radius:14px;border:2px solid #eadde4}.photo-thumb-button{border:0;background:transparent;padding:0;cursor:pointer}.service-photo-thumb{width:72px;height:72px;object-fit:cover;border-radius:12px;border:2px solid #eadde4;display:block}.service-photo-modal-content{max-width:760px;text-align:center}.service-photo-full{display:block;max-width:100%;max-height:70vh;margin:0 auto;border-radius:16px;object-fit:contain}.service-photo-caption{font-weight:700;margin-bottom:0}

.single-column-profile { grid-template-columns: 1fr; }
.compact-form select { width: 100%; }


/* Responsive customer experience: phone, iPad landscape, and desktop */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

#kiosk-view {
  width: 100%;
}

#kiosk-view > .card {
  width: min(100%, 980px);
  margin-left: auto;
  margin-right: auto;
}

.customer-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-choice-grid button {
  width: 100%;
  min-width: 0;
  min-height: 68px;
  padding: 14px 12px;
  line-height: 1.2;
}

#returning-panel,
#status-panel,
#new-panel {
  scroll-margin-top: 110px;
}

#returning-panel form,
#status-panel form {
  max-width: 620px;
}

.panel-photo-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(60, 30, 48, 0.14);
}

#kiosk-view input,
#kiosk-view select,
#kiosk-view button {
  min-height: 48px;
}

/* iPad landscape and similarly sized tablets */
@media (min-width: 768px) and (max-width: 1180px) and (orientation: landscape) {
  .topbar {
    padding: 12px 22px;
  }

  .header-brand img {
    width: 58px;
    height: 58px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .topbar p {
    font-size: 14px;
  }

  main {
    width: min(96%, 1080px);
    margin: 20px auto;
  }

  .hero {
    max-width: 980px;
    padding: 24px 30px 28px;
    margin-top: 0;
  }

  .brand-logo {
    width: 150px;
    margin-bottom: 10px;
  }

  .hero h2 {
    font-size: 34px;
    margin: 6px 0;
  }

  .hero p {
    font-size: 17px;
    margin: 8px 0;
  }

  .photo-gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 14px;
  }

  .photo-gallery img {
    aspect-ratio: 4 / 5;
    border-radius: 11px;
  }

  .customer-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
  }

  .customer-choice-grid button {
    font-size: 17px;
    min-height: 58px;
  }

  #returning-panel,
  #status-panel,
  #new-panel {
    padding: 24px 28px;
  }

  .panel-photo-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  #new-customer-form.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop and large screens */
@media (min-width: 1181px) {
  #kiosk-view > .card {
    width: min(100%, 1040px);
  }

  .hero {
    max-width: 920px;
  }

  .customer-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #returning-panel,
  #status-panel {
    max-width: 820px;
  }

  #new-panel {
    max-width: 1040px;
  }
}

/* Phones and narrow portrait screens */
@media (max-width: 767px) {
  .topbar {
    position: static;
    padding: 12px 14px;
    gap: 10px;
  }

  .header-brand {
    gap: 10px;
  }

  .header-brand img {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
  }

  .topbar h1 {
    font-size: 19px;
    line-height: 1.15;
  }

  .topbar p {
    font-size: 13px;
  }

  nav,
  nav button {
    width: 100%;
  }

  main {
    width: 100%;
    margin: 0;
    padding: 12px;
  }

  .card {
    padding: 18px 16px;
    border-radius: 14px;
    margin-bottom: 14px;
  }

  .hero {
    padding: 22px 16px;
    margin: 0 auto;
  }

  .brand-logo {
    width: 128px;
    margin-bottom: 10px;
  }

  .hero h2 {
    font-size: clamp(27px, 8vw, 36px);
    line-height: 1.1;
    margin: 8px 0;
  }

  .hero p {
    font-size: 16px;
    line-height: 1.45;
  }

  .photo-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 18px 0 14px;
  }

  .photo-gallery img {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border-width: 2px;
  }

  .customer-choice-grid,
  .choice-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .customer-choice-grid button {
    min-height: 56px;
    font-size: 17px;
  }

  .panel-photo-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 18px;
  }

  .panel-photo-gallery img {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
  }

  #new-customer-form.form-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-full {
    grid-column: auto;
  }

  #kiosk-view input,
  #kiosk-view select {
    font-size: 16px;
    padding: 13px;
  }

  #kiosk-view button {
    width: 100%;
  }

  .back-btn {
    width: auto !important;
    min-height: 44px !important;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}

/* Small phones */
@media (max-width: 390px) {
  main {
    padding: 8px;
  }

  .card,
  .hero {
    padding-left: 13px;
    padding-right: 13px;
  }

  .photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Customer gallery polish: clean fit on phones, iPad landscape, and computers */
#returning-panel .panel-photo-gallery,
#new-panel .panel-photo-gallery,
#status-panel .panel-photo-gallery {
  align-items: stretch;
}

#returning-panel .panel-photo-gallery img,
#new-panel .panel-photo-gallery img,
#status-panel .panel-photo-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 22%;
  overflow: hidden;
}

@media (min-width: 768px) and (max-width: 1180px) and (orientation: landscape) {
  #returning-panel,
  #new-panel,
  #status-panel {
    width: min(96vw, 1080px);
    max-width: none;
  }

  #returning-panel .panel-photo-gallery,
  #new-panel .panel-photo-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 12px 0 20px;
  }

  #returning-panel .panel-photo-gallery img,
  #new-panel .panel-photo-gallery img {
    aspect-ratio: 16 / 9;
    min-height: 150px;
    max-height: 205px;
    object-position: center 20%;
  }
}

@media (min-width: 1181px) {
  #returning-panel .panel-photo-gallery img,
  #new-panel .panel-photo-gallery img {
    aspect-ratio: 16 / 9;
    max-height: 230px;
    object-position: center 20%;
  }
}

@media (max-width: 767px) {
  #returning-panel .panel-photo-gallery,
  #new-panel .panel-photo-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #returning-panel .panel-photo-gallery img,
  #new-panel .panel-photo-gallery img {
    aspect-ratio: 1 / 1;
    min-height: 0;
    object-position: center 20%;
  }
}

@media (max-width: 420px) {
  #returning-panel .panel-photo-gallery,
  #new-panel .panel-photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
