/* =========================================================
   FoodEzy — Design system
   Warm tangerine + cream, deep-pine teal for secondary accents.
   Display face: Prompt (headlines, logo wordmark)
   Body face: IBM Plex Sans Thai (everything else)
   ========================================================= */

:root {
  /* -- color tokens -- */
  --fz-ink: #2B1D12;
  --fz-ink-soft: #6B5A4A;
  --fz-ink-faint: #A6957F;
  --fz-cream: #FFFBF5;
  --fz-peach-50: #FFF3E8;
  --fz-peach-100: #FFE4CC;
  --fz-sand-line: #F0DEC5;
  --fz-orange-600: #FF6A2C;
  --fz-orange-500: #FF8A3D;
  --fz-orange-glow: #FFB877;
  --fz-teal-700: #146356;
  --fz-teal-050: #E9F5F1;
  --fz-white: #FFFFFF;
  --fz-danger: #C74B3F;

  /* -- type -- */
  --fz-font-display: 'Prompt', 'Segoe UI', sans-serif;
  --fz-font-body: 'IBM Plex Sans Thai', 'Prompt', sans-serif;

  /* -- shape / motion -- */
  --fz-radius-lg: 20px;
  --fz-radius-md: 14px;
  --fz-radius-sm: 10px;
  --fz-radius-pill: 999px;
  --fz-shadow-card: 0 20px 50px -20px rgba(43, 29, 18, 0.25);
  --fz-shadow-btn: 0 10px 24px -8px rgba(255, 106, 44, 0.55);
  --fz-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: var(--fz-font-body);
  color: var(--fz-ink);
  background: var(--fz-cream);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

body.fz-no-scroll {
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
}

h1, h2, h3, h4, .fz-display {
  font-family: var(--fz-font-display);
  font-weight: 600;
  color: var(--fz-ink);
  letter-spacing: -0.01em;
}

a { color: var(--fz-orange-600); }
a:hover { color: var(--fz-orange-500); }

/* =========================================================
   Logo mark — circular utensils monogram + wordmark
   ========================================================= */

.fz-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.fz-logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fz-orange-500), var(--fz-orange-600));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px rgba(255, 106, 44, 0.5);
  position: relative;
}

.fz-logo-mark svg {
  width: 22px;
  height: 22px;
  display: block;
}

.fz-logo--lg .fz-logo-mark {
  width: 68px;
  height: 68px;
}
.fz-logo--lg .fz-logo-mark svg {
  width: 34px;
  height: 34px;
}

.fz-logo-word {
  font-family: var(--fz-font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--fz-ink);
  line-height: 1;
}
.fz-logo-word span {
  color: var(--fz-orange-600);
}
.fz-logo--lg .fz-logo-word {
  font-size: 1.9rem;
}

/* gentle breathing glow — signature micro-interaction, once on load */
@media (prefers-reduced-motion: no-preference) {
  .fz-logo-mark::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid var(--fz-orange-glow);
    opacity: 0;
    animation: fz-pulse 2.4s var(--fz-ease) 0.3s 2;
  }
}
@keyframes fz-pulse {
  0%   { opacity: 0.6; transform: scale(0.9); }
  70%  { opacity: 0; transform: scale(1.35); }
  100% { opacity: 0; transform: scale(1.35); }
}

/* =========================================================
   Buttons
   ========================================================= */

.fz-btn {
  font-family: var(--fz-font-body);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: var(--fz-radius-pill);
  padding: 0.85rem 1.75rem;
  cursor: pointer;
  transition: transform 0.15s var(--fz-ease), box-shadow 0.15s var(--fz-ease), opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.fz-btn:focus-visible {
  outline: 3px solid var(--fz-orange-glow);
  outline-offset: 2px;
}

.fz-btn--primary {
  background: linear-gradient(135deg, var(--fz-orange-500), var(--fz-orange-600));
  color: var(--fz-white);
  box-shadow: var(--fz-shadow-btn);
  width: 100%;
}
.fz-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -8px rgba(255, 106, 44, 0.6); color: var(--fz-white); }
.fz-btn--primary:active { transform: translateY(0); }
.fz-btn--primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.fz-btn--ghost {
  background: transparent;
  color: var(--fz-ink);
  border: 1.5px solid var(--fz-sand-line);
}
.fz-btn--ghost:hover { background: var(--fz-peach-50); color: var(--fz-ink); }

/* =========================================================
   Form fields
   ========================================================= */

.fz-field { margin-bottom: 1.25rem; }

.fz-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--fz-ink-soft);
  margin-bottom: 0.4rem;
  display: block;
}

.fz-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--fz-white);
  border: 1.5px solid var(--fz-sand-line);
  border-radius: var(--fz-radius-md);
  transition: border-color 0.15s var(--fz-ease), box-shadow 0.15s var(--fz-ease);
}
.fz-input-wrap:focus-within {
  border-color: var(--fz-orange-500);
  box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.15);
}
.fz-input-wrap.is-error {
  border-color: var(--fz-danger);
}

.fz-input-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fz-ink-faint);
}
.fz-input-icon svg { width: 19px; height: 19px; }

.fz-input {
  border: none;
  background: transparent;
  outline: none;
  padding: 0.85rem 0.25rem;
  width: 100%;
  font-family: var(--fz-font-body);
  font-size: 1rem;
  color: var(--fz-ink);
  min-width: 0;
}
.fz-input::placeholder { color: var(--fz-ink-faint); }

.fz-input-toggle {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--fz-ink-faint);
  cursor: pointer;
}
.fz-input-toggle:hover { color: var(--fz-ink-soft); }
.fz-input-toggle svg { width: 19px; height: 19px; }

.fz-error-text {
  color: var(--fz-danger);
  font-size: 0.83rem;
  margin-top: 0.4rem;
}

/* remember-me pill toggle */
.fz-remember {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  margin-bottom: 1.6rem;
}
.fz-switch {
  width: 40px;
  height: 24px;
  border-radius: var(--fz-radius-pill);
  background: var(--fz-sand-line);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s var(--fz-ease);
}
.fz-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--fz-white);
  transition: transform 0.2s var(--fz-ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.fz-remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.fz-remember input:checked ~ .fz-switch { background: var(--fz-orange-600); }
.fz-remember input:checked ~ .fz-switch::after { transform: translateX(16px); }
.fz-remember input:focus-visible ~ .fz-switch { outline: 3px solid var(--fz-orange-glow); outline-offset: 2px; }

.fz-remember-text { font-size: 0.92rem; color: var(--fz-ink-soft); line-height: 1.35; }
.fz-remember-text strong { color: var(--fz-ink); font-weight: 600; }

/* =========================================================
   Login page layout
   ========================================================= */

.fz-login-shell {
  height: 100dvh;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.fz-login-brand {
  flex: 0 0 44%;
  max-width: 44%;
  background: linear-gradient(155deg, var(--fz-orange-600) 0%, #E85218 65%, #C7420F 100%);
  color: var(--fz-white);
  padding: 3rem 3.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.fz-login-brand::before {
  /* oversized translucent watermark utensils, purely decorative */
  content: "";
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
}
.fz-login-brand::after {
  content: "";
  position: absolute;
  right: -160px;
  bottom: -160px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
}

.fz-login-brand .fz-logo-word,
.fz-login-brand .fz-logo-word span { color: var(--fz-white); }
.fz-login-brand .fz-logo-mark {
  background: rgba(255,255,255,0.16);
  box-shadow: none;
}
.fz-login-brand .fz-logo-mark svg { color: var(--fz-white); }

.fz-login-tagline {
  font-family: var(--fz-font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  max-width: 420px;
  margin-top: 3rem;
  position: relative;
  z-index: 1;
}
.fz-login-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  margin-top: 0.9rem;
  max-width: 380px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.fz-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}
.fz-chip {
  font-size: 0.83rem;
  font-weight: 500;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  color: var(--fz-white);
  padding: 0.45rem 0.9rem;
  border-radius: var(--fz-radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.fz-chip svg { width: 14px; height: 14px; flex-shrink: 0; }

.fz-login-brand-footer {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.65);
  position: relative;
  z-index: 1;
}

.fz-login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--fz-cream);
}

.fz-login-card {
  width: 100%;
  max-width: 400px;
}

.fz-login-card .fz-logo { margin-bottom: 2.2rem; }

.fz-login-heading {
  font-size: 1.55rem;
  margin-bottom: 0.35rem;
}
.fz-login-sub-text {
  color: var(--fz-ink-soft);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.fz-login-support {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--fz-sand-line);
  font-size: 0.88rem;
  color: var(--fz-ink-soft);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.fz-login-support svg { width: 17px; height: 17px; color: var(--fz-teal-700); flex-shrink: 0; }

.fz-alert {
  border-radius: var(--fz-radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.fz-alert--error {
  background: #FCEDEA;
  color: var(--fz-danger);
  border: 1px solid #F3CFC7;
}
.fz-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* Tablet — keep the two-pane layout but narrower brand panel */
@media (max-width: 991px) and (min-width: 768px) {
  .fz-login-brand { flex: 0 0 38%; max-width: 38%; padding: 2.5rem 2rem; }
  .fz-login-tagline { font-size: 1.6rem; }
}

/* =========================================================
   Mobile login — brand panel hidden entirely; the form side
   becomes the whole screen, dressed with a soft diagonal
   tangerine/cream stripe field instead of the orange slab.
   ========================================================= */
@media (max-width: 767px) {
  .fz-login-shell { height: 100dvh; height: 100vh; }

  .fz-login-brand { display: none; }

  .fz-login-form-side {
    flex: 1 1 100%;
    width: 100%;
    padding: max(2rem, env(safe-area-inset-top)) 1.5rem max(1.75rem, env(safe-area-inset-bottom));
    position: relative;
    overflow: hidden;
    background:
      repeating-linear-gradient(
        135deg,
        var(--fz-peach-50) 0px,
        var(--fz-peach-50) 26px,
        var(--fz-cream) 26px,
        var(--fz-cream) 52px
      );
  }

  /* two soft glow blobs so the stripes don't feel flat/printed */
  .fz-login-form-side::before,
  .fz-login-form-side::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
  }
  .fz-login-form-side::before {
    width: 260px;
    height: 260px;
    top: -80px;
    right: -70px;
    background: radial-gradient(circle, rgba(255,138,61,0.35), transparent 70%);
  }
  .fz-login-form-side::after {
    width: 320px;
    height: 320px;
    bottom: -120px;
    left: -90px;
    background: radial-gradient(circle, rgba(255,106,44,0.22), transparent 70%);
  }

  .fz-login-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
  }

  .fz-login-card .fz-logo { justify-content: center; margin-bottom: 2.4rem; }
  .fz-login-heading, .fz-login-sub-text { text-align: center; }
  .fz-login-sub-text { margin-bottom: 1.75rem; }
}

/* =========================================================
   Login success — water-fill transition
   A bowl-shaped mark fills from the bottom with a rising,
   wobbling wave of tangerine "broth" before handing off to
   the dashboard. This is the one deliberately showy moment.
   ========================================================= */

.fz-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--fz-cream);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--fz-ease);
}
.fz-success-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.fz-fill-bowl {
  width: 132px;
  height: 132px;
  position: relative;
}
.fz-fill-bowl svg { width: 100%; height: 100%; display: block; }

.fz-fill-mask-rect {
  transform: translateY(100%);
  animation: fz-fill-rise 1.5s var(--fz-ease) forwards;
  animation-play-state: paused;
}
.fz-success-overlay.is-active .fz-fill-mask-rect {
  animation-play-state: running;
}

.fz-fill-wave {
  animation: fz-wave-drift 1.1s ease-in-out infinite;
}

@keyframes fz-fill-rise {
  0%   { transform: translateY(100%); }
  100% { transform: translateY(6%); }
}
@keyframes fz-wave-drift {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-14px); }
}

.fz-success-text {
  font-family: var(--fz-font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fz-orange-600);
  opacity: 0;
  transition: opacity 0.3s var(--fz-ease) 0.5s;
}
.fz-success-overlay.is-active .fz-success-text { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .fz-fill-mask-rect { animation-duration: 0.01ms !important; }
  .fz-fill-wave { animation: none; }
}

/* =========================================================
   Dashboard shell — one screen, zero scroll, on any device.
   Signature: the whole viewport reads as a torn order ticket —
   a slim printed header strip, then a perforated tear dividing
   the two modes: dark "front of house" service side vs a calm
   paper-white "back office" side. No cards, no gradients-for-
   the-sake-of-it — the perforation *is* the UI.
   ========================================================= */

html, body { height: 100%; }

body.fz-dash-body {
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
}

.fz-dash-shell {
  height: 100dvh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fz-cream);
}

/* ---- Printed header strip -------------------------------- */
.fz-dash-topbar {
  flex: 0 0 auto;
  background: var(--fz-white);
  padding: 0.7rem 1.5rem;
  padding-top: max(0.7rem, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 2;
}
.fz-dash-topbar .fz-logo-word { font-size: 1.1rem; }
.fz-dash-topbar .fz-logo-mark { width: 34px; height: 34px; }
.fz-dash-topbar .fz-logo-mark svg { width: 17px; height: 17px; }

.fz-dash-meta {
  display: none;
  font-family: 'IBM Plex Sans Thai', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--fz-ink-faint);
  text-align: center;
  flex: 1;
}
.fz-dash-meta strong { color: var(--fz-ink-soft); font-weight: 600; }

.fz-shop-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.fz-shop-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fz-peach-100);
  color: var(--fz-orange-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--fz-font-display);
  flex-shrink: 0;
}
.fz-shop-name { font-weight: 600; font-size: 0.85rem; color: var(--fz-ink); line-height: 1.15; }
.fz-shop-role { font-size: 0.72rem; color: var(--fz-ink-faint); }

.fz-logout-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fz-ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.4rem 0.9rem 0.4rem 0.4rem;
  border-radius: var(--fz-radius-pill);
  border: 1.5px solid var(--fz-sand-line);
  background: var(--fz-peach-50);
  transition: background 0.25s var(--fz-ease), border-color 0.25s var(--fz-ease),
              color 0.25s var(--fz-ease), box-shadow 0.25s var(--fz-ease), transform 0.25s var(--fz-ease);
}
.fz-logout-link svg {
  width: 15px;
  height: 15px;
  padding: 6px;
  box-sizing: content-box;
  border-radius: 50%;
  background: var(--fz-white);
  color: var(--fz-ink-soft);
  transition: background 0.25s var(--fz-ease), color 0.25s var(--fz-ease), transform 0.3s var(--fz-ease);
}
.fz-logout-link:hover {
  color: var(--fz-white);
  background: var(--fz-danger);
  border-color: var(--fz-danger);
  box-shadow: 0 10px 22px -9px rgba(199, 75, 63, 0.6);
  transform: translateY(-1px);
}
.fz-logout-link:hover svg {
  background: rgba(255, 255, 255, 0.22);
  color: var(--fz-white);
  transform: rotate(-10deg) translateX(-1px);
}
.fz-logout-link:active { transform: translateY(0); }

/* Ticket-edge under the header: a row of little punched holes */
.fz-dash-perf-h {
  flex: 0 0 auto;
  height: 14px;
  background:
    radial-gradient(circle at 7px 0, transparent 6px, var(--fz-white) 6.5px) top / 14px 14px repeat-x,
    var(--fz-cream);
  position: relative;
  z-index: 1;
}

/* ---- Split body: two modes ------------------------------- */
.fz-mode-split {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  position: relative;
  padding: 10px 0;
  box-sizing: border-box;
  background: var(--fz-cream);
}

.fz-mode-panel {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 2.5rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 22px 46px -26px rgba(43, 29, 18, 0.4);
  transition: flex-grow 0.25s var(--fz-ease), filter 0.25s var(--fz-ease), box-shadow 0.25s var(--fz-ease);
}
.fz-mode-split:hover .fz-mode-panel:not(:hover) { filter: brightness(0.94); }
.fz-mode-panel:hover { flex-grow: 1.08; }

.fz-mode-panel--pos {
  background: var(--fz-ink);
  color: var(--fz-cream);
}
.fz-mode-panel--manage {
  background: var(--fz-cream);
  color: var(--fz-ink);
}

/* faint dot-grid texture, subject-appropriate (ticket paper) */
.fz-mode-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.05;
  pointer-events: none;
}

/* faint mode-relevant illustration, tucked in the lower corner */
.fz-mode-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: bottom -20px right -20px;
  background-size: min(62%, 320px);
}
.fz-mode-panel--pos::after {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNDAgMzQwIj4KICA8ZyBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMjU1LDE4NCwxMTksMC4xNikiIHN0cm9rZS13aWR0aD0iMi40IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPgogICAgPGNpcmNsZSBjeD0iMTg1IiBjeT0iMTg1IiByPSIxMjAiLz4KICAgIDxjaXJjbGUgY3g9IjE4NSIgY3k9IjE4NSIgcj0iOTAiLz4KICAgIDxwYXRoIGQ9Ik01NSA0MHY3OGExNiAxNiAwIDAgMCAzMiAwVjQwIi8+CiAgICA8bGluZSB4MT0iNzEiIHkxPSI0MCIgeDI9IjcxIiB5Mj0iMTE4Ii8+CiAgICA8bGluZSB4MT0iNzEiIHkxPSIxMTgiIHgyPSI3MSIgeTI9IjMwMCIvPgogICAgPHBhdGggZD0iTTI4MiA0MGMxNiAxMSAyNSAyOSAyNSA1MSAwIDI1LTE2IDQyLTI1IDQ5djE2MCIvPgogIDwvZz4KPC9zdmc+");
}
.fz-mode-panel--manage::after {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNDAgMzQwIj4KICA8ZyBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMjAsOTksODYsMC4xMikiIHN0cm9rZS13aWR0aD0iMi40IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPgogICAgPGxpbmUgeDE9IjQwIiB5MT0iMjkwIiB4Mj0iMzAwIiB5Mj0iMjkwIi8+CiAgICA8cmVjdCB4PSI2MiIgeT0iMjEwIiB3aWR0aD0iMzQiIGhlaWdodD0iODAiIHJ4PSIyIi8+CiAgICA8cmVjdCB4PSIxMTgiIHk9IjE1MCIgd2lkdGg9IjM0IiBoZWlnaHQ9IjE0MCIgcng9IjIiLz4KICAgIDxyZWN0IHg9IjE3NCIgeT0iMjMwIiB3aWR0aD0iMzQiIGhlaWdodD0iNjAiIHJ4PSIyIi8+CiAgICA8cmVjdCB4PSIyMzAiIHk9IjEwMCIgd2lkdGg9IjM0IiBoZWlnaHQ9IjE5MCIgcng9IjIiLz4KICAgIDxwYXRoIGQ9Ik02MiAxNzAgTDExOCAxMjggTDE3NCAxNTggTDIzMCA3OCIgc3Ryb2tlLWRhc2hhcnJheT0iMSAxMSIvPgogICAgPGNpcmNsZSBjeD0iMjMwIiBjeT0iNzgiIHI9IjciIGZpbGw9InJnYmEoMjAsOTksODYsMC4xNCkiIHN0cm9rZT0ibm9uZSIvPgogIDwvZz4KPC9zdmc+");
}

.fz-mode-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  opacity: 0.65;
  position: relative;
  z-index: 1;
}

.fz-mode-icon {
  width: clamp(48px, 8vh, 68px);
  height: clamp(48px, 8vh, 68px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  position: relative;
  z-index: 1;
}
.fz-mode-panel--pos .fz-mode-icon { background: rgba(255,138,61,0.16); color: var(--fz-orange-500); }
.fz-mode-panel--manage .fz-mode-icon { background: var(--fz-teal-050); color: var(--fz-teal-700); }
.fz-mode-icon svg { width: 46%; height: 46%; }

.fz-mode-title {
  font-family: var(--fz-font-display);
  font-size: clamp(1.15rem, 3.2vh, 1.6rem);
  font-weight: 600;
  margin-bottom: 0.45rem;
  position: relative;
  z-index: 1;
}
.fz-mode-desc {
  font-size: clamp(0.82rem, 1.9vh, 0.95rem);
  line-height: 1.55;
  margin-bottom: 1.3rem;
  max-width: 34ch;
  position: relative;
  z-index: 1;
}
.fz-mode-panel--pos .fz-mode-desc { color: rgba(255,251,245,0.72); }
.fz-mode-panel--manage .fz-mode-desc { color: var(--fz-ink-soft); }

@property --fz-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.fz-mode-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
  width: fit-content;
  padding: 0.6rem 1.15rem;
  border-radius: var(--fz-radius-pill);
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.25s var(--fz-ease), box-shadow 0.3s var(--fz-ease);
}
.fz-mode-cta::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -2;
  border-radius: inherit;
  background: conic-gradient(from var(--fz-angle), transparent 0%, currentColor 18%, transparent 40%, transparent 60%, currentColor 82%, transparent 100%);
  animation: fz-neon-spin 3s linear infinite;
}
.fz-mode-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
}
.fz-mode-panel--pos .fz-mode-cta::after { background: var(--fz-ink); }
.fz-mode-panel--manage .fz-mode-cta::after { background: var(--fz-cream); }

.fz-mode-panel--pos .fz-mode-cta {
  color: var(--fz-orange-500);
  box-shadow: 0 0 14px -2px rgba(255, 138, 61, 0.55);
}
.fz-mode-panel--manage .fz-mode-cta {
  color: var(--fz-teal-700);
  box-shadow: 0 0 14px -3px rgba(20, 99, 86, 0.4);
}
.fz-mode-panel--pos:hover .fz-mode-cta { box-shadow: 0 0 26px 0px rgba(255, 138, 61, 0.75); }
.fz-mode-panel--manage:hover .fz-mode-cta { box-shadow: 0 0 26px 0px rgba(20, 99, 86, 0.6); }

.fz-mode-cta svg { width: 15px; height: 15px; position: relative; z-index: 1; transition: transform 0.2s var(--fz-ease); }
.fz-mode-panel:hover .fz-mode-cta { transform: translateY(-2px) scale(1.03); }
.fz-mode-panel:hover .fz-mode-cta svg { transform: translateX(4px); }

@keyframes fz-neon-spin {
  to { --fz-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .fz-mode-cta::before { animation: none; }
}

/* ---- The tear: perforated seam down the middle ----------- */
.fz-mode-seam {
  flex: 0 0 1px;
  position: relative;
  background: repeating-linear-gradient(
    to bottom,
    var(--fz-ink-faint) 0, var(--fz-ink-faint) 6px,
    transparent 6px, transparent 14px
  );
  opacity: 0.4;
  z-index: 1;
}
.fz-mode-seam::before,
.fz-mode-seam::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fz-cream);
}
.fz-mode-seam::before { top: -11px; }
.fz-mode-seam::after { bottom: -11px; }

@media (max-width: 767px) {
  .fz-dash-topbar { padding: 0.6rem 1.1rem; padding-top: max(0.6rem, env(safe-area-inset-top)); }
  .fz-shop-role, .fz-dash-meta { display: none; }

  .fz-mode-split { flex-direction: column; gap: 14px; padding: 10px; }
  .fz-mode-panel {
    flex: 1 1 50%;
    padding: 1.25rem 1.5rem;
    align-items: flex-start;
  }
  .fz-mode-panel:hover { flex-grow: 1; } /* no hover-grow on touch */
  .fz-mode-desc { max-width: none; }
  .fz-mode-panel::after { background-position: bottom -10px right -10px; background-size: min(48%, 200px); }

  .fz-mode-seam { display: none; }
}

@media (min-width: 768px) {
  .fz-dash-meta { display: block; }
}

/* =========================================================
   Manage dashboard — "จัดการร้าน"
   Unlike the POS/home split screen (fixed, no-scroll), this is
   a scrolling back-office page. Same printed-ticket header,
   same perforation seam, but the body underneath behaves like
   a normal page: stat strip → module grid → a punch-out
   "quick menu" ticket stub pinned at the bottom.
   ========================================================= */

:root {
  --fz-gold: #A9790C;
  --fz-gold-bg: #FBF1DD;
}

body.fz-manage-body {
  height: auto;
  min-height: 100dvh;
  min-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: auto;
}

.fz-manage-shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fz-cream);
}

.fz-manage-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
}

.fz-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.fz-crumb {
  display: none;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--fz-ink-faint);
  white-space: nowrap;
}
.fz-crumb strong { color: var(--fz-ink-soft); font-weight: 600; }

.fz-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fz-ink-soft);
  text-decoration: none;
  padding: 0.5rem 0.95rem 0.5rem 0.6rem;
  border-radius: var(--fz-radius-pill);
  border: 1.5px solid var(--fz-sand-line);
  background: var(--fz-white);
  flex-shrink: 0;
  transition: background 0.2s var(--fz-ease), border-color 0.2s var(--fz-ease),
              transform 0.2s var(--fz-ease), color 0.2s var(--fz-ease);
}
.fz-back-pill svg {
  width: 15px; height: 15px;
  transition: transform 0.25s var(--fz-ease);
}
.fz-back-pill:hover {
  background: var(--fz-peach-50);
  border-color: var(--fz-orange-glow);
  color: var(--fz-orange-600);
  transform: translateY(-1px);
}
.fz-back-pill:hover svg { transform: translateX(-3px); }

.fz-manage-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.75rem clamp(1rem, 4vw, 2.5rem) 128px;
  box-sizing: border-box;
}

/* ---- Stat strip -------------------------------------------------- */
.fz-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.4rem;
}
.fz-stat-card {
  background: var(--fz-white);
  border: 1px solid var(--fz-sand-line);
  border-radius: var(--fz-radius-md);
  padding: 0.95rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 14px 28px -22px rgba(43, 29, 18, 0.4);
}
.fz-stat-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fz-stat-icon svg { width: 19px; height: 19px; }
.fz-stat-icon--orange { background: var(--fz-peach-100); color: var(--fz-orange-600); }
.fz-stat-icon--teal   { background: var(--fz-teal-050);  color: var(--fz-teal-700); }
.fz-stat-icon--ink    { background: var(--fz-peach-50);  color: var(--fz-ink-soft); }

.fz-stat-value {
  font-family: var(--fz-font-display);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--fz-ink);
}
.fz-stat-label { font-size: 0.76rem; color: var(--fz-ink-faint); margin-top: 0.15rem; }

/* ---- Section headers ---------------------------------------------- */
.fz-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.fz-section-title {
  font-family: var(--fz-font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--fz-ink);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.fz-section-title .fz-section-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fz-orange-500);
  flex-shrink: 0;
}
.fz-section-sub { font-size: 0.8rem; color: var(--fz-ink-faint); }

/* ---- Module grid ---------------------------------------------------- */
.fz-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 1rem;
  margin-bottom: 2.6rem;
}

.fz-module-card {
  background: var(--fz-white);
  border: 1.5px solid var(--fz-sand-line);
  border-radius: var(--fz-radius-lg);
  padding: 1.3rem 1.35rem 1.2rem;
  text-decoration: none;
  color: var(--fz-ink);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s var(--fz-ease), box-shadow 0.22s var(--fz-ease), border-color 0.22s var(--fz-ease);
}
.fz-module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--fz-shadow-card);
  border-color: transparent;
  color: var(--fz-ink);
}

.fz-module-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.9rem;
}
.fz-module-icon svg { width: 21px; height: 21px; }
.fz-module-icon--orange { background: var(--fz-peach-100); color: var(--fz-orange-600); }
.fz-module-icon--teal   { background: var(--fz-teal-050);  color: var(--fz-teal-700); }
.fz-module-icon--gold   { background: var(--fz-gold-bg);   color: var(--fz-gold); }

.fz-module-title { font-family: var(--fz-font-display); font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.fz-module-desc { font-size: 0.85rem; color: var(--fz-ink-soft); line-height: 1.55; margin-bottom: 1.1rem; flex: 1; }

.fz-module-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--fz-sand-line);
}
.fz-module-stat {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fz-ink-soft);
}
.fz-module-arrow {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--fz-sand-line);
  display: flex; align-items: center; justify-content: center;
  color: var(--fz-ink-soft);
  flex-shrink: 0;
  transition: background 0.2s var(--fz-ease), border-color 0.2s var(--fz-ease),
              color 0.2s var(--fz-ease), transform 0.2s var(--fz-ease);
}
.fz-module-arrow svg { width: 14px; height: 14px; }
.fz-module-card:hover .fz-module-arrow {
  background: var(--fz-orange-600);
  border-color: var(--fz-orange-600);
  color: var(--fz-white);
  transform: translateX(3px);
}

/* owner-only card: dashed gold border + ribbon, sits apart visually */
.fz-module-card--locked {
  border-style: dashed;
  border-color: #E4CFA0;
  background: linear-gradient(180deg, var(--fz-gold-bg) 0%, var(--fz-white) 46%);
}
.fz-module-card--locked:hover { border-color: var(--fz-gold); }
.fz-module-card--locked:hover .fz-module-arrow {
  background: var(--fz-gold);
  border-color: var(--fz-gold);
}
.fz-lock-ribbon {
  position: absolute;
  top: 0.9rem;
  right: -2.1rem;
  transform: rotate(38deg);
  background: var(--fz-gold);
  color: var(--fz-white);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.22rem 2.4rem;
  box-shadow: 0 4px 10px -2px rgba(169, 121, 12, 0.5);
}

/* ---- Rich menu — fixed bottom bar, LINE-OA style -------------------
   Pinned to the viewport regardless of scroll position. A pull-tab
   above the bar collapses it down to just the tab, so it never
   permanently blocks content on small screens.
   ==================================================================== */
.fz-richmenu {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--fz-peach-50);
  border-top: 1px solid var(--fz-sand-line);
  box-shadow: 0 -16px 32px -22px rgba(43, 29, 18, 0.45);
}

.fz-richmenu-handle {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 25px;
  background: var(--fz-peach-50);
  border: 1px solid var(--fz-sand-line);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fz-ink-soft);
  padding: 0;
}
.fz-richmenu-handle:focus-visible { outline: 3px solid var(--fz-orange-glow); outline-offset: 2px; }
.fz-richmenu-handle svg {
  width: 16px; height: 16px;
  transition: transform 0.3s var(--fz-ease);
}
.fz-richmenu.is-collapsed .fz-richmenu-handle svg { transform: rotate(180deg); }

.fz-richmenu-body {
  overflow: hidden;
  max-height: 132px;
  padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
  transition: max-height 0.3s var(--fz-ease), padding 0.3s var(--fz-ease);
}
.fz-richmenu.is-collapsed .fz-richmenu-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.fz-richmenu-grid {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1180px;
  margin: 0 auto;
}
.fz-richmenu-grid::-webkit-scrollbar { display: none; }

.fz-rm-tile {
  flex: 0 0 auto;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--fz-ink);
}
.fz-rm-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--fz-white);
  border: 1px solid var(--fz-sand-line);
  color: var(--fz-orange-600);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s var(--fz-ease), box-shadow 0.18s var(--fz-ease), border-color 0.18s var(--fz-ease);
}
.fz-rm-icon svg { width: 19px; height: 19px; }
.fz-rm-tile:hover .fz-rm-icon {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px -10px rgba(255, 106, 44, 0.55);
  border-color: var(--fz-orange-glow);
}
.fz-rm-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: var(--fz-ink);
}

@media (min-width: 900px) {
  .fz-richmenu-grid { justify-content: center; overflow-x: visible; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .fz-richmenu-body, .fz-richmenu-handle svg { transition: none; }
}

@media (max-width: 767px) {
  .fz-manage-main { padding: 1.4rem 1rem 118px; }
  .fz-stat-row { grid-template-columns: repeat(2, 1fr); }
  .fz-module-grid { grid-template-columns: 1fr; }
  .fz-rm-tile { width: 66px; }
  .fz-rm-icon { width: 40px; height: 40px; }
  .fz-rm-label { font-size: 0.64rem; }

  .fz-manage-topbar { gap: 0.5rem; }
  .fz-topbar-left { gap: 0.5rem; }
  .fz-back-pill {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
  }
  .fz-back-pill span { display: none; }
}

@media (min-width: 900px) {
  .fz-crumb { display: inline-flex; }
}
