:root {
  --paper: #ffffff;
  --ink: #000000;
  --steel: #5e6166;
  --line: #e3e4e6;
  --wash: #f3f4f5;
  --red: #b3202a;
  --navy: #1e3264;
  --ok: #1d7a4a;
  --font-display: "Abril Fatface", Georgia, "Times New Roman", serif;
  --font-body: "Karla", "Segoe UI", Roboto, Arial, sans-serif;
  --pole: repeating-linear-gradient(-45deg, var(--red) 0 10px, var(--paper) 10px 20px, var(--navy) 20px 30px, var(--paper) 30px 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.pole-band { height: 8px; background: var(--pole); background-size: 56.57px 56.57px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 20px; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 8px; text-align: center; }
.hero .logo { width: min(300px, 80%); margin: 0 auto; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; font-size: 15px; color: var(--steel);
}
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--steel); }
.status.open .dot { background: var(--ok); }
.status.open strong { color: var(--ok); }

.cta-book {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; margin: 26px 0 14px; padding: 20px 20px 20px 34px;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-size: 26px; letter-spacing: .5px;
  cursor: pointer; overflow: hidden;
}
.cta-book::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 22px;
  background: var(--pole); background-size: 56.57px 56.57px;
}
@media (prefers-reduced-motion: no-preference) {
  .cta-book::before { animation: pole 1.6s linear infinite; }
  @keyframes pole { to { background-position: 0 56.57px; } }
}
.cta-book:hover { background: #1c1c1c; }
.cta-note { margin: 0 0 6px; text-align: center; font-size: 14px; color: var(--steel); }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 8px; }
.link-btn {
  display: flex; align-items: center; gap: 10px; padding: 14px 14px;
  border: 1.5px solid var(--ink); border-radius: 12px; text-decoration: none;
  font-weight: 700; font-size: 16px; background: var(--paper);
}
.link-btn i { font-size: 22px; }
.link-btn:hover { background: var(--wash); }

/* ---------- Sections ---------- */
section.block { padding: 36px 0 8px; }
section.block h2 {
  font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.1;
  margin: 0 0 6px;
}
section.block .lead { margin: 0 0 18px; color: var(--steel); font-size: 15px; }

.svc-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.svc {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: baseline;
  width: 100%; padding: 16px 2px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; cursor: pointer;
}
.svc:hover { background: var(--wash); }
.svc .name { font-weight: 700; font-size: 18px; }
.svc .price { font-weight: 700; font-size: 18px; white-space: nowrap; }
.svc .meta { grid-column: 1 / -1; color: var(--steel); font-size: 14px; }

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.barber { text-align: left; }
.barber .photo {
  aspect-ratio: 4 / 5; border-radius: 12px; background: var(--wash); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 44px; color: var(--steel);
}
.barber .photo img { width: 100%; height: 100%; object-fit: cover; }
.barber h3 { margin: 10px 0 0; font-size: 18px; }
.barber p { margin: 2px 0 0; font-size: 14px; color: var(--steel); }

.hours { width: 100%; border-collapse: collapse; font-size: 16px; }
.hours td { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; }
.hours tr.today td { font-weight: 700; }
.hours tr.closed td:last-child { color: var(--red); }

.map { margin-top: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--wash); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.address { font-size: 16px; margin: 0 0 6px; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 18px;
  border: 1.5px solid var(--ink); border-radius: 12px; text-decoration: none; font-weight: 700; background: var(--paper); cursor: pointer;
}
.btn-outline:hover { background: var(--wash); }

footer.site { margin-top: 48px; padding: 24px 0 40px; border-top: 1px solid var(--line); text-align: center; font-size: 14px; color: var(--steel); }

.empty { padding: 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--steel); font-size: 15px; }
.load-error { margin: 40px 0; padding: 18px; border: 1.5px solid var(--red); border-radius: 12px; }

/* ---------- Booking sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: none; background: rgba(0, 0, 0, .45); }
.sheet.open { display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel {
  width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 18px 18px 0 0; overflow: hidden;
}
@media (min-width: 700px) { .sheet.open { align-items: center; } .sheet-panel { border-radius: 18px; max-height: 86vh; } }
@media (prefers-reduced-motion: no-preference) {
  .sheet.open .sheet-panel { animation: rise .22s ease-out; }
  @keyframes rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--wash); cursor: pointer; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn[hidden] { display: none; }
.steps { display: flex; gap: 6px; padding: 12px 16px 0; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--ink); }
.step-label { padding: 6px 16px 0; font-size: 13px; color: var(--steel); }
.sheet-body { padding: 14px 16px 18px; overflow-y: auto; flex: 1; }
.sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }

.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 10px; padding: 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; cursor: pointer;
}
.choice:hover { border-color: var(--steel); }
.choice.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice .grow { flex: 1; min-width: 0; }
.choice .t { font-weight: 700; }
.choice .s { font-size: 14px; color: var(--steel); }
.choice .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--wash); overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 20px; color: var(--steel); }
.choice .avatar img { width: 100%; height: 100%; object-fit: cover; }

.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.date {
  flex: none; width: 62px; padding: 10px 4px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--paper); text-align: center; cursor: pointer; line-height: 1.2;
}
.date .d { font-size: 12px; color: var(--steel); }
.date .n { font-size: 22px; font-weight: 700; margin: 2px 0; }
.date .m { font-size: 12px; }
.date.sel { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.date.sel .d { color: #c9cbcf; }
.date:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; margin-top: 16px; }
.time { padding: 12px 4px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font-weight: 700; cursor: pointer; }
.time.sel { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.subhead { margin: 18px 0 8px; font-weight: 700; }

.summary { border: 1.5px solid var(--ink); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.summary .row span:first-child { color: var(--steel); }
.summary .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 15px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); outline: none; }
.field .hint { font-size: 13px; color: var(--steel); margin-top: 4px; }
.field .err { font-size: 14px; color: var(--red); margin-top: 4px; }

.btn-primary {
  width: 100%; padding: 16px; border: 0; border-radius: 12px; background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:disabled { background: #b9bbbf; cursor: not-allowed; }
.btn-wa { background: #128c4a; }
.note-small { font-size: 13px; color: var(--steel); margin: 10px 0 0; text-align: center; }

/* ---------- Admin ---------- */
.admin-body { background: var(--wash); }
.admin-top { background: var(--paper); border-bottom: 1px solid var(--line); }
.admin-top .inner { max-width: 880px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 14px; }
.admin-top img { height: 34px; width: auto; }
.admin-top .who { margin-left: auto; font-size: 14px; color: var(--steel); }
.admin-main { max-width: 880px; margin: 0 auto; padding: 20px; }
.demo-banner { background: #fff4d6; border: 1px solid #e8c766; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; }
.tab { padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); font-weight: 700; cursor: pointer; white-space: nowrap; }
.tab.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.panel h2 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.panel .lead { margin: 0 0 16px; color: var(--steel); font-size: 15px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t { font-weight: 700; }
.row-item .s { font-size: 14px; color: var(--steel); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.on { background: #dff3e8; color: #135a35; }
.badge.off { background: #eceef0; color: #4a4d52; }
.btn-sm { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; font-weight: 700; font-size: 14px; }
.btn-sm:hover { border-color: var(--ink); }
.btn-sm.danger { color: var(--red); }
.btn-dark { padding: 12px 18px; border: 0; border-radius: 10px; background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer; }
.btn-dark:disabled { background: #b9bbbf; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.hours-edit { display: grid; grid-template-columns: 90px auto 1fr 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hours-edit input[type=time] { padding: 8px; border: 1.5px solid var(--line); border-radius: 8px; width: 100%; }
@media (max-width: 480px) { .hours-edit { grid-template-columns: 1fr auto; } .hours-edit .tm { grid-column: span 1; } }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.switch input { width: 18px; height: 18px; accent-color: var(--ink); }
.daychecks { display: flex; flex-wrap: wrap; gap: 6px; }
.daychecks label { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 10px; font-size: 15px; z-index: 80; display: none; }
.toast.show { display: block; }
.login-card { max-width: 380px; margin: 60px auto; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.login-card img { width: 220px; margin: 0 auto 18px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal-bg.open { display: flex; }
.modal { width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; background: var(--paper); border-radius: 16px; padding: 20px; }
.modal h3 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.photo-prev { width: 72px; height: 90px; border-radius: 10px; background: var(--wash); overflow: hidden; flex: none; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 700px) {
  body { font-size: 18px; }
  .hero { padding-top: 56px; }
}

/* Admin di layar kecil */
.row-item { flex-wrap: wrap; }
.row-item .grow { min-width: 170px; }
.row-item .actions { margin-left: auto; }
@media (max-width: 560px) {
  .admin-top .who { display: none; }
  .admin-top .inner { gap: 8px; }
  .admin-top .inner > a { margin-left: auto; }
  .row-item .actions { width: 100%; justify-content: flex-end; }
}
