:root {
  --spa-dark: #1a1209;
  --spa-brown-dark: #6b3410;
  --spa-brown: #8d4b1f;
  --spa-brown-mid: #c4783a;
  --spa-brown-light: #e6b07a;
  --spa-tan: #f0d7b8;
  --spa-cream: #fbf6ef;
  --spa-white: #ffffff;
  --spa-gold: #c9a227;
  --spa-gold-light: #e3c56b;
  --spa-muted: #6d5c4d;
  --spa-line: #f3e7d8;
  --spa-ink: var(--spa-dark);
  --spa-surface: #ffffff;
  --spa-raise: #ffffff;
  --spa-pos: #fffaf4;
  --spa-topbar: var(--spa-dark);
  --spa-topbar-ink: var(--spa-cream);
  --sidebar-width: 260px;
  --header-height: 64px;
  --shadow: 0 14px 40px rgba(26, 18, 9, 0.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--spa-cream);
  color: var(--spa-ink);
  font-family: Poppins, sans-serif;
  font-size: 15px;
}
h1, h2, h3, h4, h5, .brand-serif { font-family: "Playfair Display", Georgia, serif; }
a { color: var(--spa-brown); }
button, input, select, textarea { font-family: inherit; }

.app-topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--spa-topbar);
  color: var(--spa-topbar-ink);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--spa-topbar-ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-mark span {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--spa-gold);
  color: var(--spa-dark);
  font-family: "Playfair Display", Georgia, serif;
}
.topbar-center { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; }
.user-role { color: var(--spa-tan); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.app-main { padding: 18px; max-width: 1280px; margin: 0 auto; }

.btn-spa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--spa-surface);
  color: var(--spa-ink);
}
.btn-spa-sm { min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-spa-primary { background: var(--spa-brown); color: white; }
.btn-spa-secondary { background: transparent; color: var(--spa-ink); border-color: var(--spa-tan); }
.app-topbar .btn-spa-secondary { color: var(--spa-topbar-ink); border-color: rgba(255,255,255,.25); }
.btn-spa-success { background: #2e7d32; color: white; }
.btn-spa-danger { background: #a33b32; color: white; }
.btn-spa-warning { background: #f0b429; color: var(--spa-dark); }
.btn-spa-info { background: #1565c0; color: white; }
.btn-spa-gold { background: var(--spa-gold); color: var(--spa-dark); }
.btn-spa:disabled { opacity: .55; cursor: not-allowed; }
.btn-spa:focus-visible, .form-spa-control:focus-visible { outline: 3px solid var(--spa-gold-light); outline-offset: 2px; }

.form-spa-group { display: flex; flex-direction: column; gap: 6px; }
.form-spa-label { font-size: 13px; font-weight: 600; color: var(--spa-brown-dark); }
.form-spa-control {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--spa-tan);
  background: var(--spa-surface);
  padding: 8px 12px;
  color: var(--spa-ink);
}
.form-spa-control-sm { min-height: 40px; border-radius: 10px; }
textarea.form-spa-control { min-height: 96px; }

.card-spa, .modal-content {
  background: var(--spa-surface);
  color: var(--spa-ink);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.card-spa { overflow: hidden; }
.public-body .btn-spa-secondary { color: #fff; border-color: rgba(255,255,255,.45); }
.card-header-spa {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--spa-cream);
}
.card-header-spa h5, .card-header-spa h6 { margin: 0; font-family: Poppins, sans-serif; font-weight: 700; }
.card-body-spa { padding: 16px; }
.header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--spa-cream);
  color: var(--spa-brown);
}

.table-spa { width: 100%; border-collapse: collapse; }
.table-spa th {
  text-align: left;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--spa-brown);
  padding: 12px;
  background: var(--spa-cream);
}
.table-spa td { padding: 12px; border-top: 1px solid var(--spa-line); vertical-align: middle; }
.table-spa tbody tr:hover { background: var(--spa-cream); }

.badge-spa {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge-open { background: #e3f2fd; color: #1565c0; }
.badge-confirmed { background: #e8f5e9; color: #2e7d32; }
.badge-done { background: #e8f5e9; color: #1b5e20; }
.badge-cancel { background: #fdecea; color: #a33b32; }
.badge-void { background: #f3e5e5; color: #7a2e2e; }
.badge-paid { background: #e8f5e9; color: #2e7d32; }
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #eee; color: #666; }
.badge-pending { background: #fff4d6; color: #8a5a00; }

.modal-spa .modal-content { border: 0; border-radius: 18px; }
.modal-spa .modal-header, .modal-spa .modal-footer { border-color: var(--spa-cream); }
.spa-spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--spa-tan);
  border-top-color: var(--spa-brown);
  border-radius: 50%;
  display: inline-block;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.text-brown { color: var(--spa-brown); }
.mono { font-variant-numeric: tabular-nums; }
.rounded-spa { border-radius: 18px; }

#spaToasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1080; }
.spa-toast { min-width: 220px; max-width: 360px; padding: 12px 14px; border-radius: 12px; color: white; box-shadow: var(--shadow); }
.spa-toast.is-ok { background: #2e7d32; }
.spa-toast.is-error { background: #a33b32; }

.app-main .land-kicker { color: var(--spa-brown); }
.menu-board {
  background: var(--spa-surface);
  border: 1px solid var(--spa-line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.menu-board-hd { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.menu-board-hd h2 { margin: 0; font-size: 28px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.icon-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 148px;
  padding: 16px;
  border-radius: 18px;
  background: var(--spa-cream);
  border: 1px solid transparent;
  color: var(--spa-ink);
  text-decoration: none;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.icon-tile:hover { transform: translateY(-2px); background: var(--spa-raise); border-color: var(--spa-tan); color: var(--spa-ink); }
.icon-tile i {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--spa-raise); color: var(--spa-brown); font-size: 20px;
  box-shadow: inset 0 0 0 1px var(--spa-tan);
}
.icon-tile strong { font-size: 17px; font-weight: 600; }
.icon-tile span { color: var(--spa-muted); font-size: 13px; line-height: 1.35; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--spa-surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--spa-line); }
.stat-card em { display: block; font-style: normal; color: var(--spa-muted); font-size: 13px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.theme-pick {
  text-align: left;
  border: 1px solid var(--spa-line);
  background: var(--spa-surface);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  color: var(--spa-ink);
}
.theme-pick.is-on { border-color: var(--spa-brown); box-shadow: inset 0 0 0 1px var(--spa-brown); }
.theme-dots { display: flex; gap: 6px; margin-bottom: 10px; }
.theme-dots i { width: 22px; height: 22px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.theme-pick strong { display: block; font-size: 15px; }
.theme-pick span { color: var(--spa-muted); font-size: 12px; }
.stat-card strong { font-size: 26px; font-family: "Playfair Display", Georgia, serif; }

.public-body { background: var(--spa-dark); color: white; }
.land-hero {
  min-height: 88vh;
  display: grid;
  align-items: end;
  padding: 28px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.land-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,18,9,.15), rgba(26,18,9,.82));
  pointer-events: none;
  z-index: 0;
}
.land-hero > * { position: relative; z-index: 1; }
.land-hero-inner { position: relative; z-index: 1; max-width: 760px; }
.land-kicker { letter-spacing: .16em; text-transform: uppercase; color: var(--spa-gold-light); font-size: 12px; font-weight: 700; }
.land-hero h1 { font-size: clamp(40px, 6vw, 72px); margin: 8px 0; color: white; }
.land-hero p { font-size: 18px; max-width: 560px; color: #f6efe6; }
.land-section { background: var(--spa-cream); color: var(--spa-dark); padding: 36px 20px 56px; }
.land-wrap { max-width: 1100px; margin: 0 auto; }
.land-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.land-gallery img { width: 100%; height: 180px; object-fit: cover; border-radius: 16px; }
.auth-card {
  position: relative;
  z-index: 2;
  max-width: 440px;
  margin: 8vh auto;
  background: #fff;
  color: var(--spa-dark);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-card .form-spa-control { background: #fff; color: var(--spa-dark); opacity: 1; }
.auth-card .btn-spa { opacity: 1; pointer-events: auto; }

.pos-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .86fr);
  gap: 12px;
  min-height: calc(100dvh - 100px);
}
.pos-board, .pos-cart { background: var(--spa-surface); border-radius: 20px; box-shadow: var(--shadow); min-height: 0; color: var(--spa-ink); }
.pos-board { display: flex; flex-direction: column; padding: 12px; }
.pos-tools, .chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--spa-tan);
  background: var(--spa-surface); color: var(--spa-ink); font-weight: 600; cursor: pointer;
}
.chip.is-on { background: var(--spa-brown); color: white; border-color: var(--spa-brown); }
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  overflow: auto;
  align-content: start;
  padding-bottom: 8px;
}
.pos-card {
  border: 0; background: var(--spa-pos); color: var(--spa-ink); border-radius: 16px; overflow: hidden; text-align: left; padding: 0; cursor: pointer;
  min-height: 176px;
}
.pos-card img, .pos-ph { width: 100%; height: 108px; object-fit: cover; display: block; }
.pos-ph { display: grid; place-items: center; background: var(--spa-tan); color: var(--spa-brown-dark); font-weight: 700; }
.pos-card b, .pos-card small { display: block; padding: 0 10px; }
.pos-card b { margin-top: 8px; }
.pos-card small { color: var(--spa-muted); padding-bottom: 10px; }
.pos-cart { display: flex; flex-direction: column; }
.pos-cart-hd, .pos-cart-ft { padding: 12px; }
.pos-lines { overflow: auto; padding: 0 12px; flex: 1; }
.pos-line { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--spa-line); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--spa-tan); background: var(--spa-surface); color: var(--spa-ink); }
.meja-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.meja-grid button { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--spa-tan); background: var(--spa-surface); color: var(--spa-ink); font-weight: 700; }
.meja-grid button.is-on { background: var(--spa-gold); border-color: var(--spa-gold); color: var(--spa-dark); }
.pay-row { display: grid; grid-template-columns: 1.1fr .9fr .9fr auto; gap: 6px; margin-bottom: 6px; }
.big-total { font-family: "Playfair Display", Georgia, serif; font-size: 32px; }

.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.check-grid label { display: flex; gap: 8px; align-items: center; min-height: 40px; background: var(--spa-cream); border-radius: 10px; padding: 6px 10px; }

@media (max-width: 980px) {
  .pos-shell { grid-template-columns: 1fr; }
  .topbar-center strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-name { display: none; }
  .pay-row { grid-template-columns: 1fr 1fr; }
}
body[data-theme="gelap"] .text-muted { color: var(--spa-muted) !important; }
body[data-theme="gelap"] .btn-close { filter: invert(1) grayscale(1); }

.struk-preview {
  background: #fff;
  color: #1c140c;
  border: 1px dashed #e4d3bc;
  border-radius: 12px;
  padding: 12px 8px;
  margin: 0 auto;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.25;
  white-space: pre;
  overflow: auto;
}
@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .app-main { max-width: none; padding: 0; }
}
