/* Sha4owX Flow — Premium UI (huashu-design) */
:root {
  --flow-bg: #08080a;
  --flow-bg2: #111114;
  --flow-bg3: #18181c;
  --flow-surface: oklch(0.14 0.018 255 / 0.72);
  --flow-card: oklch(0.15 0.02 255 / 0.85);
  --flow-cyan: oklch(0.82 0.14 195);
  --flow-cyan-dim: oklch(0.82 0.14 195 / 0.12);
  --flow-teal: oklch(0.65 0.1 195);
  --flow-green: oklch(0.72 0.17 145);
  --flow-wa: oklch(0.68 0.16 155);
  --flow-yellow: oklch(0.82 0.14 95);
  --flow-red: oklch(0.62 0.2 25);
  --flow-white: oklch(0.93 0.01 255);
  --flow-w95: oklch(0.93 0.01 255 / 0.95);
  --flow-w90: oklch(0.93 0.01 255 / 0.9);
  --flow-w80: oklch(0.93 0.01 255 / 0.8);
  --flow-w70: oklch(0.93 0.01 255 / 0.7);
  --flow-w60: oklch(0.93 0.01 255 / 0.58);
  --flow-w55: oklch(0.93 0.01 255 / 0.55);
  --flow-w45: oklch(0.93 0.01 255 / 0.45);
  --flow-w40: oklch(0.93 0.01 255 / 0.38);
  --flow-w25: oklch(0.93 0.01 255 / 0.22);
  --flow-w20: oklch(0.93 0.01 255 / 0.18);
  --flow-w15: oklch(0.93 0.01 255 / 0.14);
  --flow-w12: oklch(0.93 0.01 255 / 0.1);
  --flow-w10: oklch(0.93 0.01 255 / 0.08);
  --flow-w08: oklch(0.93 0.01 255 / 0.06);
  --flow-w06: oklch(0.93 0.01 255 / 0.05);
  --flow-w04: oklch(0.93 0.01 255 / 0.035);
  --flow-border: oklch(0.93 0.01 255 / 0.08);
  --flow-border-hi: oklch(0.82 0.14 195 / 0.22);
  --flow-accent: oklch(0.82 0.14 195);
  --flow-ok: oklch(0.72 0.17 145);
  --flow-danger: oklch(0.62 0.2 25);
  --flow-panel: oklch(0.16 0.02 255 / 0.85);
  --flow-elevated: oklch(0.18 0.02 255 / 0.96);
  --flow-overlay: rgba(0, 0, 0, 0.55);
  --flow-font: 'Space Grotesk', system-ui, sans-serif;
  --flow-display: 'Cabinet Grotesk', var(--flow-font);
  --flow-serif: 'Newsreader', Georgia, serif;
  --flow-mono: 'JetBrains Mono', monospace;
  --flow-r: 12px;
  --flow-r-lg: 18px;
  --flow-r-xl: 24px;
  --flow-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --flow-shadow: 0 24px 64px oklch(0.05 0.02 255 / 0.55);
  --flow-glow: 0 0 80px oklch(0.82 0.14 195 / 0.08);
  --flow-scroll-track: transparent;
  --flow-scroll-thumb: oklch(0.93 0 0 / 0.22);
  --flow-scroll-thumb-hover: oklch(0.93 0 0 / 0.38);
  --flow-scroll-thumb-active: oklch(0.93 0 0 / 0.52);
  --flow-scroll-size: 6px;
  /* Dashboard surfaces (dark default) */
  --hd-surface: oklch(0.15 0.014 255 / 0.92);
  --hd-surface-border: oklch(1 0 0 / 0.08);
  --hd-surface-shadow: 0 4px 20px oklch(0 0 0 / 0.32);
  --hd-text-primary: var(--flow-white);
  --hd-text-secondary: var(--flow-w40);
  --hd-text-muted: var(--flow-w25);
  --hd-accent: oklch(0.75 0.14 195);
  --hd-alert-bg: oklch(0.82 0.14 75 / 0.1);
  --hd-alert-border: oklch(0.82 0.14 75 / 0.22);
  --hd-bulk-bg: oklch(0.55 0.15 305 / 0.12);
  --hd-bulk-border: oklch(0.55 0.15 305 / 0.22);
  /* Order pipeline kanban (dark default) */
  --hd-kb-wrap-bg: transparent;
  --hd-kb-wrap-border: transparent;
  --hd-kb-wrap-shadow: none;
  --hd-kb-title: var(--flow-white);
  --hd-kb-link: oklch(0.75 0.14 195);
  --hd-kb-col-bg: transparent;
  --hd-kb-col-border: transparent;
  --hd-kb-col-shadow: none;
  --hd-kb-col-head-bg: transparent;
  --hd-kb-col-head-text: var(--flow-w80);
  --hd-kb-col-count-bg: oklch(1 0 0 / 0.08);
  --hd-kb-col-count-text: var(--flow-w40);
  --hd-kb-col-divider: transparent;
  --hd-kb-col-sep: oklch(1 0 0 / 0.07);
  --hd-kb-card-bg: oklch(0.17 0.014 255 / 0.95);
  --hd-kb-card-border: oklch(1 0 0 / 0.08);
  --hd-kb-card-shadow: none;
  --hd-kb-name: var(--flow-white);
  --hd-kb-muted: var(--flow-w40);
  --hd-kb-amt: var(--flow-w80);
  --hd-kb-btn-advance-fg: oklch(0.72 0.17 145);
  --hd-kb-btn-advance-bg: oklch(0.72 0.17 145 / 0.14);
  --hd-kb-btn-cancel-fg: oklch(0.72 0.12 255);
  --hd-kb-btn-cancel-bg: oklch(0.55 0.12 255 / 0.18);
  --hd-kb-btn-remind-fg: oklch(0.82 0.14 75);
  --hd-kb-btn-remind-bg: oklch(0.82 0.14 75 / 0.14);
  --hd-kb-remind-tag: oklch(0.82 0.14 75);
  --hd-kb-empty: var(--flow-w25);
  /* Form & inset surfaces (dark default) */
  --flow-input-bg: oklch(0.1 0.015 255 / 0.45);
  --flow-inset-bg: oklch(0.1 0.015 255 / 0.35);
  --flow-bar-bg: oklch(0.1 0.015 255 / 0.3);
  --flow-subtle-bg: oklch(0.14 0.02 255 / 0.6);
  --flow-bubble-in-bg: oklch(0.17 0.02 255);
  --flow-preview-bg: oklch(0.12 0.02 255 / 0.55);
  --flow-muted-surface: oklch(0.1 0.015 255 / 0.4);
  --flow-nested-surface: oklch(0.12 0.012 255 / 0.65);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--flow-bg);
  color: var(--flow-white);
  font-family: var(--flow-font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: oklch(0.82 0.14 195 / 0.25); }

/* iOS-style minimal scrollbars — sitewide */
html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: var(--flow-scroll-thumb) var(--flow-scroll-track);
}
*::-webkit-scrollbar {
  width: var(--flow-scroll-size);
  height: var(--flow-scroll-size);
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--flow-scroll-thumb);
  border-radius: 999px;
  border: none;
  min-height: 24px;
  min-width: 24px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--flow-scroll-thumb-hover);
}
*::-webkit-scrollbar-thumb:active {
  background: var(--flow-scroll-thumb-active);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
@media (max-width: 640px) {
  :root { --flow-scroll-size: 4px; }
}

/* Grain overlay */
.flow-premium::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ── Buttons ── */
.flow-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--flow-r);
  font-weight: 600; font-size: 0.82rem;
  transition: transform 0.2s var(--flow-ease), box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.flow-btn-primary {
  background: var(--flow-accent);
  color: var(--flow-on-accent, #fff);
  box-shadow: none;
  border-radius: 100px;
}
.flow-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  background: #fff;
}
.flow-btn-outline {
  border: 1px solid var(--flow-border);
  color: var(--flow-w80);
  background: var(--flow-w06);
  backdrop-filter: blur(8px);
}
.flow-btn-outline:hover { border-color: var(--flow-border-hi); color: var(--flow-cyan); }

/* ── Logo ── */
.flow-logo {
  font-family: var(--flow-display);
  font-weight: 900; font-size: 1.15rem; letter-spacing: -0.02em;
}
.flow-logo span { color: var(--flow-cyan); }
.flow-logo small {
  display: block; font-size: 0.55rem; font-family: var(--flow-mono);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--flow-w40);
  font-weight: 500; margin-top: 2px;
}

/* ── Landing nav ── */
.flow-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem); height: 68px;
  background: oklch(0.11 0.015 255 / 0.72);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--flow-border);
}
.flow-nav-links { display: flex; align-items: center; gap: 1.75rem; }
.flow-nav-links a:not(.flow-btn) {
  font-size: 0.8rem; color: var(--flow-w60);
  transition: color 0.2s; letter-spacing: 0.01em;
}
.flow-nav-links a:not(.flow-btn):hover { color: var(--flow-white); }

/* ── Hero split ── */
.flow-hero {
  padding: clamp(6.5rem, 12vw, 9rem) clamp(1.5rem, 5vw, 3rem) clamp(3rem, 6vw, 5rem);
  position: relative; overflow: hidden;
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.flow-hero-glow {
  position: absolute; inset: -20% -10%; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 20% 30%, oklch(0.82 0.14 195 / 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 85% 70%, oklch(0.55 0.06 195 / 0.06) 0%, transparent 50%);
}
.flow-hero-content { position: relative; z-index: 1; text-align: left; }
.flow-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--flow-mono); font-size: 0.62rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--flow-cyan); margin-bottom: 1.25rem;
  padding: 7px 14px; border-radius: 999px;
  background: var(--flow-cyan-dim); border: 1px solid var(--flow-border-hi);
}
.flow-hero h1 {
  font-family: var(--flow-display);
  font-size: clamp(2.4rem, 5.5vw, 3.6rem); font-weight: 900;
  line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 1.25rem;
}
.flow-hero h1 em { font-style: normal; color: var(--flow-cyan); }
.flow-hero-lead {
  font-family: var(--flow-serif);
  font-size: clamp(1rem, 2vw, 1.12rem); color: var(--flow-w60);
  line-height: 1.65; margin-bottom: 2rem; max-width: 480px;
  font-weight: 400; font-style: italic;
}
.flow-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.flow-hero-visual {
  position: relative; z-index: 1;
  border-radius: var(--flow-r-xl);
  border: 1px solid var(--flow-border);
  background: linear-gradient(165deg, oklch(0.16 0.02 255 / 0.95), oklch(0.12 0.015 255 / 0.98));
  box-shadow: var(--flow-shadow), var(--flow-glow);
  overflow: hidden;
  aspect-ratio: 4/3;
  min-height: 320px;
}
.flow-hero-visual::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 36px;
  background: oklch(0.1 0.015 255 / 0.6);
  border-bottom: 1px solid var(--flow-border);
  display: flex;
}
.flow-mock-topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 36px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 0.62rem; font-family: var(--flow-mono); color: var(--flow-w40);
  border-bottom: 1px solid var(--flow-border);
  background: oklch(0.1 0.015 255 / 0.5);
}
.flow-mock-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 36px; }
.flow-mock-row { display: flex; gap: 8px; }
.flow-mock-chip {
  height: 28px; border-radius: 8px; background: var(--flow-w06);
  border: 1px solid var(--flow-border); flex: 1;
}
.flow-mock-chip.on { background: var(--flow-cyan-dim); border-color: var(--flow-border-hi); }
.flow-mock-chat {
  margin-top: 8px; display: flex; flex-direction: column; gap: 8px;
}
.flow-mock-bubble {
  max-width: 72%; padding: 8px 12px; border-radius: 12px;
  font-size: 0.68rem; line-height: 1.45; color: var(--flow-w60);
}
.flow-mock-bubble.in {
  align-self: flex-start; background: var(--flow-elevated);
  border: 1px solid var(--flow-border); border-radius: 12px 12px 12px 4px;
}
.flow-mock-bubble.out {
  align-self: flex-end; background: oklch(0.68 0.16 155 / 0.15);
  border: 1px solid oklch(0.68 0.16 155 / 0.25);
  border-radius: 12px 12px 4px 12px; color: var(--flow-w80);
}
.flow-mock-badge {
  position: absolute; bottom: 16px; right: 16px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: oklch(0.68 0.16 155 / 0.12);
  border: 1px solid oklch(0.68 0.16 155 / 0.28);
  font-size: 0.65rem; font-family: var(--flow-mono); color: oklch(0.78 0.12 155);
}
.flow-mock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--flow-green); animation: flowPulse 1.4s infinite; }

/* ── Stats ── */
.flow-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 1100px; margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem) clamp(3rem, 6vw, 4rem);
  gap: 1px;
  background: var(--flow-border);
  border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-xl);
  overflow: hidden;
}
.flow-stat {
  text-align: center; padding: 1.75rem 1rem;
  background: var(--flow-bg2);
}
.flow-stat-num {
  font-family: var(--flow-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900;
  color: var(--flow-cyan); letter-spacing: -0.02em;
}
.flow-stat-label {
  font-size: 0.72rem; color: var(--flow-w40); margin-top: 6px;
  font-family: var(--flow-mono); letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── Sections ── */
.flow-section { padding: clamp(4rem, 9vw, 7rem) clamp(1.5rem, 5vw, 3rem); }
.flow-section-dark { background: var(--flow-bg2); }
.flow-container { max-width: 1100px; margin: 0 auto; }
.flow-section-head { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); max-width: 640px; }
.flow-section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.flow-section-head h2 {
  font-family: var(--flow-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 900;
  line-height: 1.1; letter-spacing: -0.025em;
}
.flow-section-head h2 em { font-style: normal; color: var(--flow-cyan); }
.flow-section-head p {
  color: var(--flow-w60); margin-top: 1rem; font-size: 0.92rem; line-height: 1.65;
}

/* ── Features ── */
.flow-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.flow-feature {
  padding: 1.75rem 1.5rem; border-radius: var(--flow-r-lg);
  background: var(--flow-card); border: 1px solid var(--flow-border);
  transition: border-color 0.25s, transform 0.25s var(--flow-ease);
}
.flow-feature:hover {
  border-color: var(--flow-border-hi);
  transform: translateY(-2px);
}
.flow-feature-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--flow-cyan-dim); border: 1px solid var(--flow-border-hi);
  display: flex; align-items: center; justify-content: center;
  color: var(--flow-cyan); margin-bottom: 1.1rem;
}
.flow-feature h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.flow-feature p { font-size: 0.82rem; color: var(--flow-w60); line-height: 1.6; }
.flow-feature-link {
  display: inline-block; margin-top: 0.65rem; font-size: 0.78rem; font-weight: 600;
  color: var(--flow-accent); text-decoration: none;
}
.flow-feature-link:hover { text-decoration: underline; }

/* ── Channels ── */
.flow-channels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.flow-channel {
  padding: 1.35rem 1.1rem; border-radius: var(--flow-r-lg);
  background: var(--flow-card); border: 1px solid var(--flow-border);
  text-align: center; transition: border-color 0.2s, transform 0.2s var(--flow-ease);
}
.flow-channel:hover { border-color: var(--flow-border-hi); transform: translateY(-2px); }
.flow-channel-icon {
  width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 0.75rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--flow-w06); border: 1px solid var(--flow-border);
  color: var(--flow-cyan);
}
.flow-channel-icon.live { background: oklch(0.68 0.16 155 / 0.1); border-color: oklch(0.68 0.16 155 / 0.22); color: var(--flow-wa); }
.flow-channel strong { font-size: 0.85rem; display: block; margin-bottom: 4px; }
.flow-channel span { font-size: 0.72rem; color: var(--flow-w40); font-family: var(--flow-mono); }

/* ── Ask widget ── */
.flow-ask {
  max-width: 720px; margin: 0 auto;
  background: var(--flow-card); border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-xl); overflow: hidden;
  box-shadow: var(--flow-shadow);
}
.flow-ask-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--flow-border);
  font-size: 0.7rem; font-family: var(--flow-mono); color: var(--flow-w40);
}
.flow-ask-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--flow-green);
  display: inline-block; margin-right: 6px; animation: flowPulse 1.4s infinite;
}
@keyframes flowPulse { 0%,100%{opacity:1} 50%{opacity:0.35} }
.flow-ask-chat {
  min-height: 180px; max-height: 300px; overflow-y: auto;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
}
.flow-ask-msg { display: flex; gap: 10px; align-items: flex-start; }
.flow-ask-msg.user { justify-content: flex-end; }
.flow-ask-bubble {
  background: oklch(0.17 0.02 255); border: 1px solid var(--flow-border);
  padding: 12px 15px; border-radius: 16px 16px 16px 4px;
  font-size: 0.86rem; line-height: 1.6; max-width: 85%; color: var(--flow-w80);
  text-wrap: pretty;
}
.flow-ask-msg.user .flow-ask-bubble {
  background: var(--flow-cyan-dim); border-color: var(--flow-border-hi);
  border-radius: 16px 16px 4px 16px;
}
.flow-ask-bubble strong { color: var(--flow-cyan); font-weight: 600; }
.flow-ask-suggestions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 0 20px 16px;
}
.flow-ask-q {
  text-align: left; padding: 12px 14px; border-radius: var(--flow-r);
  background: var(--flow-w06); border: 1px solid var(--flow-border);
  font-size: 0.76rem; color: var(--flow-w60); line-height: 1.45;
  transition: all 0.2s var(--flow-ease);
}
.flow-ask-q:hover { background: var(--flow-cyan-dim); border-color: var(--flow-border-hi); color: var(--flow-white); }
.flow-ask-q:disabled { opacity: 0.4; cursor: not-allowed; }
.flow-ask-input {
  display: flex; gap: 10px; padding: 16px 20px;
  border-top: 1px solid var(--flow-border);
  background: var(--flow-inset-bg);
}
.flow-ask-input input {
  flex: 1; background: var(--flow-input-bg); border: 1px solid var(--flow-border);
  border-radius: var(--flow-r); padding: 12px 16px; outline: none; font-size: 0.86rem;
}
.flow-ask-input input:focus { border-color: var(--flow-border-hi); box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.1); }
.flow-ask-input button {
  width: 44px; height: 44px; border-radius: var(--flow-r);
  background: var(--flow-cyan); color: oklch(0.12 0.02 255);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.flow-ask-input button:hover { transform: scale(1.04); }
.flow-ask-typing { display: flex; gap: 4px; padding: 4px 0; }
.flow-ask-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--flow-cyan); opacity: 0.5; animation: flowBounce 1.4s infinite;
}
.flow-ask-typing span:nth-child(2) { animation-delay: 0.2s; }
.flow-ask-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes flowBounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-5px)} }

/* ── CTA + footer ── */
.flow-cta {
  text-align: center; padding: clamp(4rem, 8vw, 6rem) 1.5rem;
  border-top: 1px solid var(--flow-border);
  background: linear-gradient(180deg, var(--flow-bg2), var(--flow-bg));
  position: relative;
}
.flow-cta::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 100%, oklch(0.82 0.14 195 / 0.06), transparent);
}
.flow-cta h2 {
  font-family: var(--flow-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900;
  margin-bottom: 0.75rem; letter-spacing: -0.02em; position: relative;
}
.flow-cta p { color: var(--flow-w60); margin-bottom: 1.75rem; font-size: 0.92rem; position: relative; }
.flow-footer {
  padding: 2rem clamp(1.5rem, 5vw, 3rem);
  border-top: 1px solid var(--flow-border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: 0.75rem; color: var(--flow-w40);
}
.flow-footer a { color: var(--flow-w60); transition: color 0.2s; }
.flow-footer a:hover { color: var(--flow-cyan); }

/* ═══ AUTH — split layout ═══ */
.flow-auth-screen {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100dvh;
}
.flow-auth-brand {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 6vw, 4rem);
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, oklch(0.82 0.14 195 / 0.12), transparent 55%),
    linear-gradient(160deg, oklch(0.13 0.02 255), oklch(0.1 0.015 255));
  border-right: 1px solid var(--flow-border);
  position: relative; overflow: hidden;
}
.flow-auth-brand h1 {
  font-family: var(--flow-display); font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; margin: 1.5rem 0 1rem;
}
.flow-auth-brand h1 em { font-style: normal; color: var(--flow-cyan); }
.flow-auth-brand p {
  font-family: var(--flow-serif); font-style: italic;
  color: var(--flow-w60); font-size: 1.05rem; line-height: 1.65; max-width: 380px;
}
.flow-auth-perks {
  list-style: none; margin-top: 2.5rem; display: flex; flex-direction: column; gap: 14px;
}
.flow-auth-perks li {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.84rem; color: var(--flow-w80);
}
.flow-auth-perk-icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--flow-cyan-dim); border: 1px solid var(--flow-border-hi);
  display: flex; align-items: center; justify-content: center; color: var(--flow-cyan);
}
.flow-auth-panel-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem clamp(1.5rem, 4vw, 3rem);
  background: var(--flow-bg);
}
.flow-auth-wrap {
  width: 100%; max-width: 420px;
  padding: 1.75rem 1.6rem 1.5rem;
  border-radius: 20px;
  background: var(--flow-panel, var(--flow-w06));
  border: 1px solid var(--flow-border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}
.flow-auth-brand .flow-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.flow-auth-mark {
  width: 40px;
  height: 40px;
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
}
.flow-auth-brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--flow-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.flow-auth-brand-text > span { color: var(--flow-cyan); }
.flow-auth-brand-text small {
  display: block;
  margin-top: 3px;
  font-family: var(--flow-sans, inherit);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flow-w40);
}
.flow-auth-wrap .flow-logo { margin-bottom: 2rem; display: inline-block; }
.flow-auth-tabs {
  display: flex; gap: 4px; background: var(--flow-w06);
  padding: 4px; border-radius: 12px; margin-bottom: 1.5rem;
  border: 1px solid var(--flow-border);
  position: relative;
  isolation: isolate;
}
.flow-auth-tab {
  flex: 1; padding: 10px; border-radius: 9px; font-size: 0.8rem;
  font-weight: 600; color: var(--flow-w40); transition: all 0.2s var(--flow-ease);
  border: none; background: transparent; cursor: pointer;
}
.flow-auth-tab.active {
  background: var(--flow-cyan-dim); color: var(--flow-cyan);
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.05) inset;
}
.flow-auth-panel { display: none; }
.flow-auth-panel.active { display: block; }
.flow-auth-panel h2 {
  font-family: var(--flow-display); font-size: 1.35rem;
  font-weight: 900; letter-spacing: -0.02em; margin-bottom: 0.35rem;
}
.flow-auth-sub { font-size: 0.84rem; color: var(--flow-w40); margin-bottom: 1.5rem; }
.flow-auth-panel input {
  width: 100%; padding: 13px 16px; margin-bottom: 10px;
  border-radius: var(--flow-r); border: 1px solid var(--flow-border);
  background: var(--flow-input-bg); outline: none; font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.flow-auth-panel input:focus {
  border-color: var(--flow-border-hi);
  box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.1);
}
.flow-auth-submit { width: 100%; margin-top: 8px; }
.flow-auth-error { color: var(--flow-red); font-size: 0.78rem; text-align: center; margin-top: 1rem; min-height: 1.2em; }
.flow-auth-foot { text-align: center; margin-top: 1.5rem; font-size: 0.75rem; }
.flow-auth-foot a { color: var(--flow-w40); }
.flow-auth-foot a:hover { color: var(--flow-cyan); }
.flow-auth-demo-wrap { margin-top: 1rem; }
.flow-auth-demo-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0.35rem 0 0.85rem; color: var(--flow-w40); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.flow-auth-demo-divider::before,
.flow-auth-demo-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--flow-border);
}
.flow-auth-demo-hint {
  margin: 0.65rem 0 0; font-size: 0.72rem; line-height: 1.45; color: var(--flow-w40); text-align: center;
}
.flow-demo-banner {
  flex-shrink: 0;
  padding: 0.55rem 1.25rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--flow-w80);
  background: var(--flow-subtle-bg);
  border-bottom: 1px solid var(--flow-border);
}
.flow-demo-banner strong { color: var(--flow-w95); font-weight: 600; }
.flow-connect-demo-callout {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid oklch(0.7 0.12 195 / 0.35);
  background: oklch(0.22 0.04 195 / 0.35);
  border-radius: 12px;
}
.flow-connect-demo-callout h4 {
  margin: 0 0 0.35rem; font-size: 0.92rem; font-weight: 600;
}
.flow-connect-demo-callout p {
  margin: 0; font-size: 0.8rem; line-height: 1.5; color: var(--flow-w60);
}
html[data-theme="light"] .flow-demo-banner {
  color: var(--flow-w70);
  background: var(--flow-subtle-bg);
  border-bottom-color: var(--flow-border);
}
html[data-theme="light"] .flow-demo-banner strong { color: var(--flow-w95); }
html[data-theme="light"] .flow-connect-demo-callout {
  background: oklch(0.97 0.02 195);
  border-color: oklch(0.8 0.06 195 / 0.5);
}
.flow-demo-readonly > .app-page-header {
  margin-bottom: 0.35rem;
}
body.flow-demo-mode #btn-save-razorpay {
  opacity: 0.45;
  cursor: not-allowed;
}
#wm-floor[hidden],
#kitchen-board[hidden] {
  display: none !important;
}
.flow-rzp-demo-note {
  margin: 12px 0 0;
}
.flow-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1.25rem;
}
.flow-settings-tab {
  border: 1px solid var(--flow-border);
  background: var(--flow-muted-surface);
  color: var(--flow-w60);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.flow-settings-tab:hover {
  border-color: var(--flow-border-hi);
  color: var(--flow-white);
}
.flow-settings-tab.active {
  background: oklch(0.82 0.14 195 / 0.14);
  border-color: oklch(0.7 0.12 195 / 0.45);
  color: var(--flow-cyan);
}
.flow-settings-panel { display: none; }
.flow-settings-panel.active { display: block; animation: pageIn 0.25s var(--flow-ease); }
.flow-leads-layout--single {
  grid-template-columns: 1fr;
  max-width: none;
  width: 100%;
}
.flow-leads-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.flow-leads-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.flow-leads-toolbar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.flow-leads-search {
  flex: 1 1 240px;
  min-width: 200px;
  background: var(--flow-input-bg);
  border: 1px solid var(--flow-border);
  color: var(--flow-white);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.84rem;
}
.flow-leads-filter {
  background: var(--flow-input-bg);
  border: 1px solid var(--flow-border);
  color: var(--flow-white);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  min-width: 160px;
}
.flow-leads-board { width: 100%; }
.flow-leads-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}
.flow-lead-card {
  background: var(--flow-card);
  border: 1px solid var(--flow-border);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  box-shadow: var(--flow-shadow);
}
.flow-lead-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
}
.flow-lead-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.flow-lead-identity strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--flow-white);
}
.flow-lead-phone {
  font-size: 0.78rem;
  color: var(--flow-w60);
}
.flow-lead-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.flow-lead-meta time {
  font-size: 0.72rem;
  color: var(--flow-w40);
  white-space: nowrap;
}
.flow-lead-source {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  background: var(--flow-muted-surface);
  color: var(--flow-w60);
}
.flow-lead-source--form {
  background: oklch(0.72 0.14 250 / 0.14);
  color: oklch(0.78 0.12 250);
}
.flow-lead-source--catalog {
  background: oklch(0.78 0.14 145 / 0.14);
  color: oklch(0.72 0.14 145);
}
.flow-lead-source--wa {
  background: oklch(0.82 0.14 195 / 0.14);
  color: var(--flow-cyan);
}
.flow-lead-source--support {
  background: oklch(0.78 0.14 55 / 0.14);
  color: oklch(0.78 0.12 55);
}
.flow-lead-headline {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--flow-w80);
  line-height: 1.35;
}
.flow-lead-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.flow-lead-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--flow-muted-surface);
  border: 1px solid var(--flow-border);
  font-size: 0.74rem;
  color: var(--flow-white);
  max-width: 100%;
}
.flow-lead-chip em {
  font-style: normal;
  font-weight: 600;
  color: var(--flow-w40);
  font-size: 0.68rem;
}
html[data-theme="light"] .flow-lead-source--form { color: oklch(0.42 0.14 250); }
html[data-theme="light"] .flow-lead-source--catalog { color: oklch(0.4 0.12 145); }
html[data-theme="light"] .flow-lead-source--wa { color: oklch(0.38 0.1 210); }
html[data-theme="light"] .flow-lead-source--support { color: oklch(0.45 0.12 55); }
@media (max-width: 720px) {
  .flow-leads-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-leads-list { grid-template-columns: 1fr; }
}
html[data-theme="light"] .flow-settings-tab.active {
  color: oklch(0.38 0.1 210);
}

/* ═══ DASHBOARD ═══ */
.app-shell { display: none; height: 100dvh; flex-direction: column; }
.app-shell.active { display: flex; }

.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 1.25rem; flex-shrink: 0;
  border-bottom: 1px solid var(--flow-border);
  background: var(--flow-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative; z-index: 200;
}
.app-topbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--flow-display); font-weight: 900;
  font-size: 0.95rem; letter-spacing: -0.02em;
}
.app-topbar-mark {
  width: 28px;
  height: 28px;
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
}
.app-topbar-wordmark { color: var(--flow-w90); }
.app-topbar-wordmark > span { color: var(--flow-accent); }
.app-topbar-branch {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-left: 2px;
  padding: 5px 10px 5px 12px;
  min-width: 0;
  max-width: min(320px, 42vw);
  border: 0;
  border-left: 1px solid var(--flow-border);
  border-radius: 0;
  background: transparent;
  color: var(--flow-w90);
  cursor: pointer;
  text-align: left;
  line-height: 1.15;
  transition: background 0.15s ease;
}
.app-topbar-branch:hover,
.app-topbar-branch:focus-visible {
  background: oklch(from var(--flow-w90) l c h / 0.06);
  outline: none;
}
.app-topbar-branch-kicker {
  flex-shrink: 0;
  font-family: var(--flow-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--flow-w55);
}
.app-topbar-branch-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--flow-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--flow-w90);
}
.app-topbar-branch-chevron {
  flex-shrink: 0;
  opacity: 0.5;
}
.app-topbar-right { display: flex; align-items: center; gap: 10px; }
.app-sub-pill {
  font-size: 0.6rem; font-family: var(--flow-mono); padding: 5px 11px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.1em;
}
.app-sub-pill.active {
  color: var(--flow-green); border: 1px solid oklch(0.72 0.17 145 / 0.35);
  background: oklch(0.72 0.17 145 / 0.08);
}
.app-sub-pill.inactive {
  color: oklch(0.75 0.12 25); border: 1px solid oklch(0.62 0.2 25 / 0.3);
  background: oklch(0.62 0.2 25 / 0.07);
}

.flow-alerts-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.flow-alerts-mute {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--flow-accent);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  touch-action: manipulation;
}
.flow-alerts-mute svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.flow-alerts-mute:hover { color: var(--flow-accent); opacity: 0.85; }
.flow-alerts-mute.is-muted {
  color: var(--flow-w45);
  opacity: 0.75;
}
.flow-alerts-mute.is-open {
  color: var(--flow-accent);
  background: color-mix(in oklab, var(--flow-accent) 12%, transparent);
}
.flow-alerts-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  font-family: var(--flow-mono, ui-monospace, monospace);
  line-height: 18px;
  text-align: center;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--flow-bar-bg, #fff);
  pointer-events: none;
}
.flow-alerts-badge[hidden] { display: none !important; }
.flow-alerts-panel {
  /* Anchored by JS to topbar or POS chrome bell (fixed, outside topbar) */
  position: fixed;
  top: 56px;
  right: 12px;
  width: min(320px, calc(100vw - 24px));
  max-height: min(360px, 60vh);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--flow-border-hi, var(--flow-border));
  background: var(--flow-card, #141820);
  box-shadow: var(--flow-shadow, 0 16px 40px rgba(0,0,0,0.28));
  z-index: 60000;
  overflow: hidden;
}
.flow-alerts-panel[hidden] { display: none !important; }
.flow-alerts-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--flow-border);
}
.flow-alerts-panel-head strong {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.flow-alerts-panel-actions { display: flex; gap: 6px; }
.flow-alerts-panel-btn {
  border: 1px solid var(--flow-border);
  background: transparent;
  color: var(--flow-w70);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
}
.flow-alerts-panel-btn:hover { color: var(--flow-w95); border-color: var(--flow-w20); }
.flow-alerts-panel-btn.is-muted { opacity: 0.7; }
.flow-alerts-list {
  overflow: auto;
  padding: 6px;
}
.flow-alerts-empty {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
  color: var(--flow-w45);
  font-size: 0.75rem;
}
.flow-alerts-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px 8px;
  border-radius: 10px;
}
.flow-alerts-item:hover { background: var(--flow-muted-surface); }
.flow-alerts-item.is-nav { cursor: pointer; }
.flow-alerts-item.is-nav:hover { border-color: rgba(0, 229, 255, 0.25); }
.flow-alerts-item-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.82 0.14 195 / 0.12);
  color: var(--flow-cyan);
}
.flow-alerts-item--order .flow-alerts-item-ico,
.flow-alerts-item--payment .flow-alerts-item-ico {
  background: oklch(0.72 0.17 145 / 0.12);
  color: var(--flow-green);
}
.flow-alerts-item--stock .flow-alerts-item-ico,
.flow-alerts-item--warn .flow-alerts-item-ico {
  background: oklch(0.82 0.14 75 / 0.14);
  color: oklch(0.78 0.14 75);
}
.flow-alerts-item-text { min-width: 0; }
.flow-alerts-item-text strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 2px;
}
.flow-alerts-item-text span {
  display: block;
  font-size: 0.68rem;
  color: var(--flow-w70);
  line-height: 1.35;
  word-break: break-word;
}
.flow-alerts-item time {
  font-size: 0.6rem;
  color: var(--flow-w45);
  font-family: var(--flow-mono, ui-monospace, monospace);
  white-space: nowrap;
  padding-top: 2px;
}
/* iOS-style notification banners — clipped glass, no backdrop-filter square */
.flow-alerts-stack,
.flow-alerts-banners {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}
.flow-alerts-stack {
  --fa-ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  left: auto;
  /* Above grain / POS chrome / toasts floor — phone must see banners */
  z-index: 150000;
  width: min(340px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
  overflow: visible;
  visibility: visible;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
.flow-alerts-banners {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(70vh, 520px);
  overflow-x: visible;
  overflow-y: auto;
  pointer-events: none;
  scrollbar-width: none;
  touch-action: manipulation;
}
.flow-alerts-banners::-webkit-scrollbar { display: none; }
.flow-alerts-banner {
  position: relative;
  pointer-events: auto;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 12px 36px 14px 14px;
  border-radius: 22px;
  border: none;
  /* Solid fill — backdrop-filter leaves a hard square behind rounded corners in Chromium */
  background: #2c2c2e;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  font-family: var(--fa-ios-font);
  color: #f5f5f7;
  /* Never shrink inside the stack — flex-shrink was chopping the subtitle line */
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(-10px);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition:
    opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.flow-alerts-banner.is-in {
  opacity: 1;
  transform: translateY(0);
}
.flow-alerts-banner.is-out {
  opacity: 0;
  transform: translateY(-8px);
}
.flow-alerts-banner.is-nav { cursor: pointer; }
.flow-alerts-banner.is-nav:hover { filter: brightness(1.06); }
.flow-alerts-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #3a3a3c;
  flex-shrink: 0;
}
.flow-alerts-banner-icon svg { display: block; stroke-width: 2; }
.flow-alerts-banner--order .flow-alerts-banner-icon {
  background: #ff9f0a;
}
.flow-alerts-banner--payment .flow-alerts-banner-icon,
.flow-alerts-banner.is-pay .flow-alerts-banner-icon {
  background: #30d158;
}
.flow-alerts-banner--stock .flow-alerts-banner-icon,
.flow-alerts-banner.is-warn .flow-alerts-banner-icon {
  background: #ff453a;
}
.flow-alerts-banner-body {
  min-width: 0;
  padding-right: 18px;
}
.flow-alerts-banner-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.flow-alerts-banner-app {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(235, 235, 245, 0.5);
}
.flow-alerts-banner-now {
  font-size: 0.68rem;
  font-weight: 400;
  color: rgba(235, 235, 245, 0.38);
  flex-shrink: 0;
}
.flow-alerts-banner-title {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.22;
  color: #f5f5f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flow-alerts-banner-sub {
  display: block;
  margin-top: 2px;
  margin-bottom: 1px;
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: rgba(235, 235, 245, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flow-alerts-banner-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(120, 120, 128, 0.32);
  color: rgba(235, 235, 245, 0.85);
  cursor: pointer;
  opacity: 0.85;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.flow-alerts-banner:hover .flow-alerts-banner-x,
.flow-alerts-banner:focus-within .flow-alerts-banner-x {
  opacity: 1;
}
.flow-alerts-banner-x::before,
.flow-alerts-banner-x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}
.flow-alerts-banner-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.flow-alerts-banner-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.flow-alerts-banner-x:hover { background: rgba(120, 120, 128, 0.5); }
.flow-alerts-clear-all {
  pointer-events: auto;
  align-self: center;
  border: 0;
  border-radius: 980px;
  padding: 6px 14px;
  font-family: var(--fa-ios-font);
  font-size: 0.78rem;
  font-weight: 510;
  color: #f5f5f7;
  background: #2c2c2e;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.flow-alerts-clear-all[hidden] { display: none !important; }
.flow-alerts-clear-all:hover { background: #3a3a3c; }
html[data-theme="light"] .flow-alerts-mute {
  color: rgba(12, 12, 24, 0.65);
  border-color: rgba(12, 12, 24, 0.12);
  background: #fff;
}
html[data-theme="light"] .flow-alerts-mute.is-muted { color: rgba(12, 12, 24, 0.4); }
html[data-theme="light"] .flow-alerts-mute.is-open {
  background: #f4f5f7;
  color: #0c0c18;
}
html[data-theme="light"] .flow-alerts-badge {
  box-shadow: 0 0 0 2px #fff;
}
html[data-theme="light"] .flow-alerts-panel {
  background: #fff;
  border-color: rgba(12, 12, 24, 0.12);
  color: #0c0c18;
  box-shadow: 0 16px 40px rgba(12, 12, 24, 0.12);
}
html[data-theme="light"] .flow-alerts-panel-btn {
  color: rgba(12, 12, 24, 0.65);
  border-color: rgba(12, 12, 24, 0.12);
}
html[data-theme="light"] .flow-alerts-item-text span {
  color: rgba(12, 12, 24, 0.65);
}
html[data-theme="light"] .flow-alerts-empty,
html[data-theme="light"] .flow-alerts-item time {
  color: rgba(12, 12, 24, 0.4);
}
html[data-theme="light"] .flow-alerts-banner {
  background: #ffffff;
  color: #1c1c1e;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] .flow-alerts-banner-app { color: rgba(60, 60, 67, 0.48); }
html[data-theme="light"] .flow-alerts-banner-now { color: rgba(60, 60, 67, 0.36); }
html[data-theme="light"] .flow-alerts-banner-title { color: #1c1c1e; }
html[data-theme="light"] .flow-alerts-banner-sub { color: rgba(60, 60, 67, 0.68); }
html[data-theme="light"] .flow-alerts-banner-x {
  background: rgba(120, 120, 128, 0.16);
  color: rgba(60, 60, 67, 0.75);
}
html[data-theme="light"] .flow-alerts-clear-all {
  color: #1c1c1e;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Silent desktop backup — never show sync chrome to end users */
.flow-desktop-sync-badge,
body.flow-desktop #flow-desktop-sync-badge {
  display: none !important;
}

body.flow-desktop #sub-banner { display: none !important; }
body.flow-desktop:not(.flow-acct-restaurant) #dash-wa-card,
body.flow-desktop:not(.flow-acct-restaurant) #page-connect {
  display: none !important;
}

.app-user-dropdown-sep {
  height: 1px;
  background: var(--flow-border);
  margin: 4px 10px;
}

/* User widget */
.app-user-widget { position: relative; display: flex; align-items: center; gap: 8px; }
.app-user-name { font-size: 0.8rem; color: var(--flow-w80); font-weight: 500; }
.app-user-avatar {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 5px;
  border-radius: 999px;
  background: var(--flow-inset-bg);
  border: 1px solid var(--flow-border);
  font-size: 0.72rem; font-weight: 700;
  color: var(--flow-white);
  transition: background 0.15s;
}
.app-user-avatar:hover { background: var(--flow-subtle-bg); }
.app-user-avatar span {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: oklch(0.45 0.14 255); color: #fff;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0;
}
.app-user-chevron { color: var(--flow-w40); flex-shrink: 0; }
.app-user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--flow-elevated);
  border: 1px solid var(--flow-border-hi);
  border-radius: 12px;
  padding: 4px 0;
  min-width: 200px;
  box-shadow: var(--flow-shadow);
  z-index: 200;
}
.app-user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--flow-w80);
  text-align: left;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.app-user-dropdown button svg,
.app-user-dropdown button i {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.75;
}
.app-user-dropdown button span {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.app-user-dropdown button:hover,
.app-user-dropdown button:focus-visible {
  background: var(--flow-w06);
  color: var(--flow-white);
  outline: none;
}
.app-user-dropdown button:hover svg,
.app-user-dropdown button:hover i,
.app-user-dropdown button:focus-visible svg,
.app-user-dropdown button:focus-visible i {
  opacity: 1;
}

.app-body { display: flex; flex: 1; overflow: hidden; }
.app-sidebar {
  width: 240px; flex-shrink: 0;
  border-right: 1px solid var(--flow-border);
  background: var(--flow-surface);
  backdrop-filter: blur(12px);
  padding: 1.25rem 0.85rem;
  display: flex; flex-direction: column; gap: 2px;
  transition: width 0.22s var(--flow-ease), padding 0.22s var(--flow-ease);
  overflow: hidden;
  min-height: 0;
}
.app-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
}
.app-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.app-sidebar-top .app-nav-label {
  margin: 0;
  padding: 0 6px 0 14px;
}
.app-sidebar-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--flow-w60);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.app-sidebar-toggle:hover {
  background: oklch(1 0 0 / 0.06);
  color: var(--flow-white);
}
.app-shell.sidebar-collapsed .app-sidebar {
  width: 64px;
  padding: 1rem 0.45rem;
}
.app-shell.sidebar-collapsed .app-nav-label,
.app-shell.sidebar-collapsed .app-nav-text,
.app-shell.sidebar-collapsed .app-sidebar-footer {
  display: none;
}
.app-shell.sidebar-collapsed .app-sidebar-top {
  justify-content: center;
  margin-bottom: 10px;
}
.app-shell.sidebar-collapsed .app-nav-item {
  justify-content: center;
  padding: 10px;
  gap: 0;
}
.app-shell.sidebar-collapsed .app-sidebar-toggle i {
  transform: scaleX(-1);
}
.app-nav-label {
  font-size: 0.68rem; letter-spacing: 0.01em;
  color: var(--flow-w40); padding: 0 14px 8px; margin-top: 8px;
}
.app-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 0.84rem; font-weight: 500; color: var(--flow-w60);
  transition: background 0.2s var(--flow-ease), color 0.2s; text-align: left; width: 100%;
  border: none;
}
.app-nav-item:hover { background: oklch(1 0 0 / 0.04); color: var(--flow-white); }
.app-nav-item.active {
  background: oklch(1 0 0 / 0.08); color: var(--flow-white);
}
.app-nav-item svg { flex-shrink: 0; opacity: 0.55; stroke-width: 1.75; }
.app-nav-item.active svg { opacity: 0.95; }
.app-nav-text { /* desktop: inline label */ }
.app-sidebar-footer {
  flex-shrink: 0;
  margin-top: 8px;
  padding-top: 1rem;
  border-top: 1px solid var(--flow-border);
}
.app-sidebar-footer a {
  font-size: 0.72rem; color: var(--flow-w40);
  display: block; padding: 9px 12px; transition: color 0.2s;
}
.app-sidebar-footer a:hover { color: var(--flow-cyan); }

.app-main {
  flex: 1; overflow-y: auto; padding: clamp(1.25rem, 3vw, 2rem);
  background: transparent; position: relative;
  min-height: 0;
}
/* Inbox: lock page height; scroll only inside chat + contact list */
.app-main:has(#page-inbox.active) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.app-main:has(#page-home.active) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.app-main::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 80% 0%, oklch(0.82 0.14 195 / 0.04), transparent 55%);
}
.app-page { display: none; position: relative; z-index: 1; animation: pageIn 0.35s var(--flow-ease); }
.app-page.active { display: block; }
#page-inbox.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#page-inbox .flow-inbox-header { flex-shrink: 0; margin-bottom: 1rem; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.app-page-header { margin-bottom: 1.75rem; }
.app-page-title {
  font-family: var(--flow-display); font-size: 1.5rem;
  font-weight: 900; letter-spacing: -0.025em; margin-bottom: 0.35rem;
}
.app-page-desc { font-size: 0.84rem; color: var(--flow-w60); line-height: 1.55; max-width: 560px; }
.app-page-desc strong { color: var(--flow-w80); font-weight: 600; }

.app-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.app-status-dot.on { background: var(--flow-green); box-shadow: 0 0 8px oklch(0.72 0.17 145 / 0.5); }
.app-status-dot.off { background: var(--flow-red); }

/* Cards */
.app-card, .premium-card {
  background: var(--flow-card);
  border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-lg);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset;
  transition: border-color 0.25s;
}
.premium-card:hover { border-color: var(--flow-border-hi); }
.app-card-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.9rem; font-weight: 600; margin-bottom: 1.1rem;
}
.app-card-title svg { color: var(--flow-cyan); }

.app-form-group { margin-bottom: 1.1rem; }
.app-form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--flow-w60);
  margin-bottom: 8px;
  font-family: var(--flow-font);
  letter-spacing: 0.01em;
}
.app-form-group input,
.app-form-group textarea,
.app-form-group select {
  width: 100%; padding: 12px 14px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: var(--flow-input-bg);
  color: var(--flow-white); font-size: 0.84rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.app-form-group textarea { resize: vertical; font-family: var(--flow-mono); line-height: 1.5; }
.app-form-group input:focus,
.app-form-group textarea:focus,
.app-form-group select:focus {
  border-color: var(--flow-border-hi);
  box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.08);
}
.app-field-hint { font-size: 0.72rem; color: var(--flow-w40); margin-top: 6px; }
.flow-profile-preview {
  padding: 14px 16px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: var(--flow-preview-bg);
  font-size: 0.84rem; line-height: 1.6; color: var(--flow-w80);
  min-height: 72px; white-space: pre-wrap;
}
.flow-profile-preview.empty {
  color: var(--flow-w40); font-style: italic;
}

.app-toggle {
  width: 44px; height: 24px; border-radius: 12px; flex-shrink: 0;
  background: var(--flow-w12); position: relative; transition: background 0.25s;
}
.app-toggle.on { background: var(--flow-cyan); }
.app-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.25s var(--flow-ease);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.3);
}
.app-toggle.on::after { transform: translateX(20px); }
.flow-bot-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

/* QR connect */
.flow-connect-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start;
}
.flow-qr-card {
  border-radius: 16px; overflow: hidden;
  border: none;
  background: oklch(0.17 0.012 255);
  box-shadow: none;
}
.flow-qr-status {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px 10px;
  font-size: 0.84rem; font-weight: 500; color: var(--flow-w80);
}
.flow-qr-body { padding: 1.5rem 1.75rem 2rem; text-align: center; }
.flow-qr-placeholder { color: var(--flow-w40); }
.flow-wa-starting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin: 0.5rem 0 1rem;
}
.flow-wa-starting[hidden] { display: none !important; }
.flow-wa-radial {
  width: 52px;
  height: 52px;
  border-width: 3px;
}
.flow-wa-starting-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--flow-w80, rgba(255,255,255,0.85));
}
.flow-wa-fail-msg {
  color: #e85d5d !important;
  font-size: 0.82rem !important;
  margin-bottom: 1rem !important;
}
.flow-wa-fail-msg[hidden] { display: none !important; }
.flow-qr-placeholder .flow-qr-icon-wrap {
  width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 1.25rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--flow-w06); border: 1px solid var(--flow-border);
  color: var(--flow-cyan);
}
.flow-qr-placeholder p { font-size: 0.86rem; margin-bottom: 1.5rem; line-height: 1.55; }
.flow-wa-connect-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 320px);
  margin: 0 auto;
}
.flow-wa-connect-actions .flow-btn { width: 100%; justify-content: center; }
.flow-wa-force-hint {
  margin: 10px auto 0;
  max-width: 320px;
  font-size: 0.72rem;
  line-height: 1.4;
  opacity: 0.65;
}
#btn-wa-force-restart {
  border-color: color-mix(in srgb, #e85d5d 45%, var(--flow-border));
  color: #f0a0a0;
}
#btn-wa-force-restart:hover:not(:disabled) {
  border-color: #e85d5d;
  color: #ffd0d0;
  background: color-mix(in srgb, #e85d5d 10%, transparent);
}
#btn-wa-force-restart:disabled { opacity: 0.55; cursor: wait; }
.flow-qr-img-wrap {
  background: #fff; border-radius: 18px; padding: 16px;
  display: inline-block; margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.25);
}
.flow-qr-steps {
  text-align: left; font-size: 0.82rem; color: var(--flow-w60);
  padding-left: 1.25rem; line-height: 1.9;
}
.flow-qr-steps strong { color: var(--flow-white); font-weight: 600; }
.flow-connected-badge {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.68 0.16 155 / 0.12);
  border: 1px solid oklch(0.68 0.16 155 / 0.28);
  color: var(--flow-wa);
}
.flow-qr-connected h3 {
  font-family: var(--flow-display); font-size: 1.2rem;
  font-weight: 900; margin-bottom: 0.5rem;
}
.flow-qr-connected p { font-size: 0.84rem; color: var(--flow-w60); line-height: 1.55; }

.flow-connect-info {
  display: flex; flex-direction: column; gap: 0;
}
.flow-info-card {
  padding: 1.15rem 1.25rem; border-radius: var(--flow-r-lg);
  background: var(--flow-card); border: 1px solid var(--flow-border);
}
.flow-info-card h4 {
  font-size: 0.88rem; font-weight: 600;
  color: var(--flow-white); margin-bottom: 6px;
}
.flow-info-card p { font-size: 0.84rem; color: var(--flow-w60); line-height: 1.55; }

/* Inbox */
.flow-inbox-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 14px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.flow-inbox-list {
  background: var(--flow-card); border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-lg); overflow-y: auto;
  min-height: 0;
}
.flow-inbox-empty {
  padding: 2rem 1.5rem; font-size: 0.82rem; color: var(--flow-w40);
  text-align: center; line-height: 1.55;
}
.flow-inbox-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 13px 15px; border: none;
  border-bottom: 1px solid var(--flow-border);
  background: none; text-align: left; cursor: pointer;
  transition: background 0.15s;
}
.flow-inbox-item:hover, .flow-inbox-item.active {
  background: var(--flow-cyan-dim);
}
.flow-inbox-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: oklch(0.68 0.16 155 / 0.12);
  color: var(--flow-wa); font-weight: 700; font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid oklch(0.68 0.16 155 / 0.2);
}
.flow-inbox-info { flex: 1; min-width: 0; }
.flow-inbox-info strong {
  display: block; font-size: 0.84rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flow-inbox-info span {
  display: block; font-size: 0.72rem; color: var(--flow-w40);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.flow-inbox-time {
  font-size: 0.62rem; color: var(--flow-w40);
  font-family: var(--flow-mono); flex-shrink: 0;
}
.flow-inbox-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.flow-inbox-refresh-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: var(--flow-subtle-bg);
  color: var(--flow-w80); font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.flow-inbox-refresh-btn:hover {
  background: var(--flow-cyan-dim);
  border-color: oklch(0.68 0.16 155 / 0.35);
  color: var(--flow-wa);
}
.flow-inbox-refresh-btn.spinning i {
  animation: flow-spin 0.8s linear infinite;
}
@keyframes flow-spin {
  to { transform: rotate(360deg); }
}

.flow-chat-panel {
  background: var(--flow-card); border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-lg);
  display: flex; flex-direction: column; overflow: hidden;
  min-height: 0;
  height: 100%;
}
.flow-chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--flow-w40); gap: 0.85rem; padding: 2rem;
}
.flow-chat-active { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.flow-chat-head {
  padding: 14px 18px; border-bottom: 1px solid var(--flow-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--flow-bar-bg);
  flex-shrink: 0;
}
.flow-chat-head-info {
  display: flex; align-items: baseline; gap: 10px; min-width: 0;
}
.flow-chat-head strong { font-size: 0.92rem; font-weight: 600; }
.flow-chat-head span { font-size: 0.72rem; color: var(--flow-w40); font-family: var(--flow-mono); }
.flow-chat-delete-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: var(--flow-r);
  border: 1px solid oklch(0.55 0.18 25 / 0.35);
  background: oklch(0.55 0.18 25 / 0.08);
  color: oklch(0.72 0.16 25); font-size: 0.72rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
  flex-shrink: 0;
}
.flow-chat-delete-btn:hover {
  background: oklch(0.55 0.18 25 / 0.18);
}
.flow-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0;
  overscroll-behavior: contain;
}
.flow-chat-bubble {
  max-width: 78%; padding: 11px 14px; border-radius: 16px;
  font-size: 0.86rem; line-height: 1.55; word-break: break-word;
  text-wrap: pretty;
  white-space: pre-wrap;
}
.flow-chat-bubble strong { font-weight: 700; }
.flow-chat-bubble em { font-style: italic; }
.flow-chat-bubble s { text-decoration: line-through; opacity: 0.85; }
.flow-chat-bubble .wa-mono,
.flow-chat-bubble code.wa-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: oklch(0.5 0.02 260 / 0.18);
  padding: 0.08em 0.28em;
  border-radius: 4px;
  white-space: pre-wrap;
}
.flow-chat-bubble.in {
  align-self: flex-start;
  background: var(--flow-bubble-in-bg);
  border: 1px solid var(--flow-border);
  border-radius: 16px 16px 16px 4px;
}
.flow-chat-bubble.out {
  align-self: flex-end;
  background: oklch(0.68 0.16 155 / 0.14);
  border: 1px solid oklch(0.68 0.16 155 / 0.22);
  border-radius: 16px 16px 4px 16px;
}
.flow-chat-send {
  display: flex; gap: 10px; padding: 14px 16px;
  border-top: 1px solid var(--flow-border);
  background: var(--flow-inset-bg);
  flex-shrink: 0;
}
.flow-chat-send input {
  flex: 1; padding: 12px 16px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: var(--flow-input-bg);
  outline: none; font-size: 0.86rem;
}
.flow-chat-send input:focus { border-color: var(--flow-border-hi); }
.flow-chat-send button {
  width: 44px; height: 44px; border-radius: var(--flow-r);
  background: var(--flow-wa); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, filter 0.15s;
}
.flow-chat-send button:hover { transform: scale(1.04); filter: brightness(1.08); }

/* Bulk */
.flow-bulk-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px;
}
.flow-bulk-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.1rem;
}
.flow-bulk-stat {
  text-align: center; padding: 14px 10px; border-radius: var(--flow-r);
  background: var(--flow-muted-surface); border: 1px solid var(--flow-border);
}
.flow-bulk-stat-num {
  display: block; font-size: 1.5rem; font-weight: 900;
  color: var(--flow-cyan); font-family: var(--flow-display);
  letter-spacing: -0.02em;
}
.flow-bulk-stat-label {
  font-size: 0.62rem; color: var(--flow-w40);
  text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--flow-mono);
}
.flow-bulk-bar-wrap {
  height: 5px; border-radius: 3px;
  background: var(--flow-w06); overflow: hidden; margin-bottom: 0.75rem;
}
.flow-bulk-bar {
  height: 100%; width: 0; border-radius: 3px;
  background: var(--flow-cyan);
  transition: width 0.45s var(--flow-ease);
}
.flow-bulk-status-text { font-size: 0.82rem; color: var(--flow-w60); }
.flow-bulk-errors { margin-top: 0.75rem; }
.flow-bulk-err {
  font-size: 0.72rem; color: oklch(0.75 0.12 25);
  padding: 7px 11px; margin-top: 5px;
  background: oklch(0.62 0.2 25 / 0.08); border-radius: 8px;
  font-family: var(--flow-mono);
}

/* Subscription banner + modal */
.flow-sub-banner {
  margin-bottom: 1.25rem; padding: 13px 17px; border-radius: var(--flow-r-lg);
  background: oklch(0.62 0.2 25 / 0.08);
  border: 1px solid oklch(0.62 0.2 25 / 0.2);
  color: oklch(0.78 0.1 25); font-size: 0.84rem; line-height: 1.55;
}
.flow-sub-banner.warn {
  background: oklch(0.82 0.14 95 / 0.08);
  border-color: oklch(0.82 0.14 95 / 0.22);
  color: oklch(0.88 0.1 95);
}
.flow-sub-banner strong { color: var(--flow-white); }
.flow-sub-banner-link {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--flow-cyan); font: inherit; font-weight: 600;
  text-decoration: underline; cursor: pointer;
}
.flow-sub-banner-link:hover { color: var(--flow-white); }
.flow-btn.needs-sub {
  background: linear-gradient(135deg, oklch(0.82 0.14 195), oklch(0.68 0.16 155));
  color: #041018;
}

.flow-modal-bg {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: oklch(0.05 0.02 255 / 0.88);
  backdrop-filter: blur(16px) saturate(1.1);
  align-items: center; justify-content: center; padding: 1.5rem;
}
.flow-modal-bg.open { display: flex; }
.flow-modal.premium-modal {
  width: 100%; max-width: 420px;
  background: var(--flow-card);
  border: 1px solid var(--flow-border-hi);
  border-radius: var(--flow-r-xl); padding: 2.25rem 2rem;
  box-shadow: var(--flow-shadow), var(--flow-glow);
  text-align: center;
}
.flow-modal-lock {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.62 0.2 25 / 0.1);
  border: 1px solid oklch(0.62 0.2 25 / 0.2);
  color: oklch(0.78 0.1 25);
}
.flow-modal h3 {
  font-family: var(--flow-display);
  font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 0.65rem;
}
.flow-modal-text {
  font-size: 0.88rem; color: var(--flow-w60); line-height: 1.65; margin-bottom: 1.35rem;
}
.flow-modal-features {
  list-style: none; text-align: left; margin-bottom: 1.5rem;
  padding: 1rem 1.1rem; border-radius: var(--flow-r);
  background: var(--flow-muted-surface); border: 1px solid var(--flow-border);
}
.flow-modal-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem; color: var(--flow-w80); padding: 7px 0;
}
.flow-modal-features svg { color: var(--flow-green); flex-shrink: 0; }
.flow-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.flow-modal-actions .flow-btn { width: 100%; }
.flow-pay-modal { max-width: 440px; }

/* App dialog — alert/confirm (fixed width so short copy doesn’t collapse) */
.flow-app-dialog {
  width: min(420px, calc(100vw - 2.5rem));
  max-width: 420px;
  box-sizing: border-box;
  text-align: left;
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: 18px;
  background: var(--flow-card);
  border: 1px solid var(--flow-border-hi);
  box-shadow: var(--flow-shadow);
  color: var(--flow-white);
}
.flow-app-dialog-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--flow-accent) 12%, transparent);
  color: var(--flow-accent);
  margin-bottom: 0.9rem;
}
.flow-app-dialog.is-error .flow-app-dialog-icon {
  background: oklch(0.62 0.2 25 / 0.12);
  color: oklch(0.72 0.16 25);
}
.flow-app-dialog.is-success .flow-app-dialog-icon {
  background: color-mix(in srgb, var(--flow-ok) 12%, transparent);
  color: var(--flow-ok);
}
.flow-app-dialog h3 {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 0.4rem; text-align: left;
  color: var(--flow-white);
}
.flow-app-dialog-msg {
  font-size: 0.95rem;
  color: var(--flow-w80);
  line-height: 1.5;
  margin-bottom: 1.35rem;
  word-break: break-word;
  white-space: pre-wrap;
}
html[data-theme="light"] .flow-app-dialog {
  background: #ffffff;
  border-color: rgba(12, 12, 24, 0.12);
  color: #0c0c18;
}
html[data-theme="light"] .flow-app-dialog h3 {
  color: #0c0c18;
}
html[data-theme="light"] .flow-app-dialog-msg {
  color: rgba(12, 12, 24, 0.72);
}
.flow-app-dialog-actions {
  display: flex; gap: 10px; justify-content: stretch;
}
.flow-app-dialog-actions .flow-btn {
  flex: 1; min-height: 46px; border-radius: 12px; font-size: 0.9rem;
}
/* Keep notice dialogs as centered cards on mobile (not a skinny bottom scrap) */
#app-dialog.flow-modal-bg.open {
  padding: 1.25rem;
  align-items: center;
  justify-content: center;
}
#app-dialog .flow-app-dialog {
  width: min(420px, calc(100vw - 2.5rem));
  margin: 0;
  border-radius: 18px;
}
.flow-app-dialog-actions #app-dialog-cancel { display: none; }
.flow-app-dialog.is-confirm .flow-app-dialog-actions #app-dialog-cancel { display: inline-flex; }

.flow-plan-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 0 0 1rem;
}
.flow-plan-card {
  padding: 12px 10px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: var(--flow-muted-surface);
  cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s;
}
.flow-plan-card:hover { border-color: var(--flow-border-hi); }
.flow-plan-card.on {
  border-color: oklch(0.68 0.16 155 / 0.45);
  background: oklch(0.68 0.16 155 / 0.1);
}
.flow-plan-card strong {
  display: block; font-size: 0.78rem; text-transform: capitalize; margin-bottom: 4px;
}
.flow-plan-card .flow-plan-price {
  font-family: var(--flow-display); font-weight: 800; font-size: 1rem;
}
.flow-plan-card span {
  display: block; font-size: 0.62rem; color: var(--flow-w40); margin-top: 4px; line-height: 1.35;
}
.flow-pay-status {
  min-height: 1.2em; font-size: 0.76rem; color: var(--flow-w60); text-align: center; margin-bottom: 0.5rem;
  line-height: 1.5;
}
.flow-pay-status a { color: var(--flow-cyan); text-decoration: underline; }
.flow-btn-ghost {
  background: transparent; border: none; color: var(--flow-w40); font-size: 0.78rem;
}
.flow-btn-ghost:hover { color: var(--flow-w60); }

.sub-inactive .app-nav-item:not([data-page="connect"]) { opacity: 0.42; }
.sub-inactive .app-nav-item:not([data-page="connect"]):hover { opacity: 0.65; }

.flow-save-hint { font-size: 0.75rem; color: var(--flow-green); margin-left: 12px; }

.flow-rzp-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.68rem; font-family: var(--flow-mono); font-weight: 600;
  padding: 6px 11px; border-radius: 999px; margin-bottom: 14px;
  background: oklch(0.55 0.18 25 / 0.1); color: oklch(0.72 0.14 25);
  border: 1px solid oklch(0.55 0.18 25 / 0.22);
}
.flow-rzp-status.on {
  background: oklch(0.68 0.16 155 / 0.12); color: var(--flow-wa);
  border-color: oklch(0.68 0.16 155 / 0.28);
}

.flow-commerce-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.flow-catalog-row {
  display: grid;
  grid-template-columns: 72px 1.2fr 0.7fr 1.4fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: start;
}
.cat-image-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cat-image-btn {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px dashed var(--flow-border);
  background: var(--flow-inset-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.cat-image-btn:hover { border-color: var(--flow-cyan); }
.cat-image-ph {
  font-size: 0.62rem;
  color: var(--flow-w40);
  text-align: center;
  line-height: 1.2;
  padding: 4px;
}
.cat-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-image-clear {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid oklch(0.62 0.2 25 / 0.25);
  background: oklch(0.62 0.2 25 / 0.08);
  color: var(--flow-red); cursor: pointer;
  font-size: 0.85rem; line-height: 1;
}
.flow-catalog-row input,
.flow-catalog-row textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: var(--flow-input-bg);
  color: var(--flow-white);
  font-size: 0.8rem;
  font-family: var(--flow-font);
}
.flow-catalog-row textarea { min-height: 38px; resize: vertical; }
.flow-catalog-del {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid oklch(0.62 0.2 25 / 0.25);
  background: oklch(0.62 0.2 25 / 0.08);
  color: var(--flow-red); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.flow-leads-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1rem;
  align-items: start;
}
.flow-lead-q-row {
  display: flex; gap: 8px; margin-bottom: 8px; align-items: center;
}
.flow-lead-q-row input { flex: 1; }
.flow-lead-q-row button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--flow-border);
  background: transparent; color: var(--flow-red); cursor: pointer;
}
.flow-leads-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.flow-leads-table-wrap { overflow-x: auto; }
.flow-leads-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
}
.flow-leads-table th,
.flow-leads-table td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--flow-border);
  vertical-align: top;
}
.flow-leads-table th {
  color: var(--flow-w40); font-weight: 600; font-size: 0.72rem;
}
.flow-leads-empty {
  color: var(--flow-w40); font-size: 0.82rem; text-align: center; padding: 2rem 1rem;
}
.flow-lead-details { color: var(--flow-w60); line-height: 1.45; max-width: 220px; }

.flow-books-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1rem; }
.flow-books-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.flow-books-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; flex-wrap: wrap; }
.flow-month-nav { display: flex; align-items: center; gap: 8px; }
.flow-month-btn { min-width: 36px; padding: 8px 12px; font-size: 1.1rem; line-height: 1; }
.flow-month-label { font-size: 0.82rem; color: var(--flow-w50); margin-left: auto; }
.flow-invoice-toolbar { display: flex; align-items: center; gap: 8px; }
.flow-invoice-toolbar input[type="month"] { background: var(--flow-surface); border: 1px solid var(--flow-border); color: var(--flow-w90); padding: 6px 8px; border-radius: 8px; font-size: 0.78rem; }

.flow-inv-tabs {
  display: inline-flex; gap: 6px; padding: 4px;
  margin: 0 0 1.1rem;
  border-radius: 14px;
  background: var(--flow-surface);
  border: 1px solid var(--flow-border);
}
.flow-inv-tab {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: transparent; cursor: pointer;
  color: var(--flow-w50); font-size: 0.84rem; font-weight: 600;
  padding: 10px 16px; border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}
.flow-inv-tab:hover { color: var(--flow-w90); }
.flow-inv-tab.is-active {
  background: color-mix(in oklab, var(--flow-accent) 18%, var(--flow-surface));
  color: var(--flow-w90);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--flow-accent) 35%, transparent);
}
.flow-inv-panel[hidden] { display: none !important; }
.flow-inv-view-toolbar { margin-top: 0; }
.flow-inv-month-label-wrap {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 148px; height: 40px; padding: 0 14px; gap: 6px;
  border-radius: 10px; border: 1px solid var(--flow-border);
  background: var(--flow-surface); cursor: pointer;
  color: inherit; font: inherit; appearance: none; -webkit-appearance: none;
  transition: border-color 0.15s, background 0.15s;
}
.flow-inv-month-label-wrap:hover {
  border-color: color-mix(in oklab, var(--flow-accent) 45%, var(--flow-border));
  background: color-mix(in oklab, var(--flow-accent) 8%, var(--flow-surface));
}
.flow-inv-month-label-wrap:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--flow-accent) 55%, transparent);
  outline-offset: 2px;
}
.flow-inv-month-caption {
  font-size: 0.88rem; font-weight: 600; color: var(--flow-w90);
  pointer-events: none; white-space: nowrap;
}
.flow-inv-month-label-wrap::after {
  content: "";
  width: 14px; height: 14px; flex-shrink: 0; pointer-events: none; opacity: 0.65;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--flow-w70);
}
.flow-inv-month-label-wrap input[type="month"],
.flow-inv-month-label-wrap input[type="date"] {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  width: 100%; height: 100%; border: 0; padding: 0; margin: 0;
}
.gst-period-panel { margin-bottom: 0.5rem; }
.gst-period-panel select,
.gst-period-panel input[type="date"],
.gst-period-panel input[type="month"] {
  width: 100%; background: var(--flow-surface); border: 1px solid var(--flow-border);
  color: var(--flow-w90); padding: 8px 10px; border-radius: 8px;
}
.flow-books-toolbar input[type="month"] { background: var(--flow-surface); border: 1px solid var(--flow-border); color: var(--flow-w90); padding: 8px 10px; border-radius: 8px; }
.flow-import-block { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--flow-border); }
.flow-import-title { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; color: var(--flow-w90); margin: 0 0 8px; }
.flow-import-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.flow-file-btn { cursor: pointer; margin: 0; }
.flow-file-btn input { display: none; }
.flow-import-status { font-size: 0.78rem; color: var(--flow-w60); margin: 10px 0 0; min-height: 1.2em; }
.flow-import-status.ok { color: var(--flow-ok); }
.flow-import-status.err { color: #dc2626; }

.flow-scan-block {
  margin: 0 0 1.1rem;
  padding: 12px 14px;
  border: 1px dashed color-mix(in oklab, var(--flow-accent) 45%, var(--flow-border));
  border-radius: 14px;
  background: color-mix(in oklab, var(--flow-accent) 6%, var(--flow-surface));
}
.flow-scan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flow-scan-preview {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  padding: 10px; border-radius: 12px; background: var(--flow-surface); border: 1px solid var(--flow-border);
}
.flow-scan-preview[hidden],
.flow-scan-progress[hidden] { display: none !important; }
.flow-scan-thumb-wrap {
  width: 56px; height: 56px; border-radius: 8px; background: var(--flow-w10);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
  color: var(--flow-w40);
}
.flow-scan-preview img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--flow-w10);
  display: block;
}
.flow-scan-preview img[hidden] { display: none !important; }
.flow-scan-preview-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.flow-scan-preview-meta strong {
  font-size: 0.8rem; color: var(--flow-w90); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flow-scan-preview-meta span { font-size: 0.72rem; color: var(--flow-w40); }
.flow-scan-progress { margin-top: 12px; }
.flow-scan-bar {
  height: 4px; border-radius: 999px; background: var(--flow-w10); overflow: hidden; margin-bottom: 8px;
}
.flow-scan-bar span {
  display: block; height: 100%; width: 40%;
  background: var(--flow-accent);
  animation: flow-scan-slide 1.1s ease-in-out infinite;
}
@keyframes flow-scan-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
.flow-scan-progress p { margin: 0; font-size: 0.78rem; color: var(--flow-w60); }
.flow-gstin-row { display: flex; gap: 8px; align-items: stretch; }
.flow-gstin-row input { flex: 1; min-width: 0; }
.flow-gstin-row .flow-btn { flex-shrink: 0; padding: 0 12px; font-size: 0.75rem; }
.flow-inv-extra-items {
  margin: 0 0 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--flow-w05, oklch(1 0 0 / 0.03)); border: 1px solid var(--flow-border);
  font-size: 0.78rem; color: var(--flow-w60); line-height: 1.45;
}
.flow-gst-modal { max-width: 420px; }
.flow-gst-gstin {
  font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; letter-spacing: 0.04em;
  color: var(--flow-accent); margin: 0 0 14px; word-break: break-all;
}
.flow-gst-captcha-wrap {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  min-height: 56px;
}
.flow-gst-captcha-wrap img {
  height: 52px; max-width: 180px; border-radius: 8px; background: #fff; border: 1px solid var(--flow-border);
}
.flow-gst-captcha-ph {
  flex: 1; font-size: 0.82rem; color: var(--flow-w40);
  padding: 14px; border-radius: 8px; border: 1px dashed var(--flow-border);
}
.flow-books-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 1.25rem; }
.flow-gst-collected-card {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--flow-accent) 28%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--flow-accent) 12%, var(--flow-card)) 0%, var(--flow-card) 55%);
}
.flow-gst-collected-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.flow-gst-collected-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flow-w40);
}
.flow-gst-collected-period {
  font-size: 0.78rem;
  color: var(--flow-w55);
}
.flow-gst-collected-total {
  display: block;
  font-size: 1.85rem;
  line-height: 1.1;
  color: #b45309;
  margin-bottom: 10px;
}
.flow-gst-collected-split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.flow-gst-collected-split div {
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--flow-w90) 4%, transparent);
}
.flow-gst-collected-split span {
  display: block;
  font-size: 0.68rem;
  color: var(--flow-w40);
  margin-bottom: 4px;
}
.flow-gst-collected-split strong {
  font-size: 0.95rem;
  color: var(--flow-w90);
}
.flow-stat-card {
  background: var(--flow-surface); border: 1px solid var(--flow-border); border-radius: 12px; padding: 14px 16px;
}
.flow-stat-card span { display: block; font-size: 0.72rem; color: var(--flow-w40); margin-bottom: 6px; }
.flow-stat-card strong { font-size: 1.15rem; color: var(--flow-w90); }
.flow-stat-card.income strong { color: var(--flow-ok); }
.flow-stat-card.expense strong { color: #dc2626; }
.flow-stat-card.net strong { color: var(--flow-accent); }
.flow-stat-card.turnover strong { color: #2563eb; }
.flow-check-row { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--flow-w60); margin: 12px 0; }
.flow-inv-dl { font-size: 0.72rem; color: var(--flow-accent); text-decoration: none; background: none; border: none; cursor: pointer; padding: 0; }
.flow-inv-dl:hover { text-decoration: underline; }
.flow-inv-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flow-inv-del { background: none; border: none; color: #dc2626; cursor: pointer; font-size: 0.72rem; padding: 0; }
.flow-inv-del:hover { text-decoration: underline; }
.tx-del { background: none; border: none; color: #dc2626; cursor: pointer; font-size: 0.72rem; }

.flow-inventory-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 1.25rem; }
.flow-inv-scan-result {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--flow-border-hi);
  background: var(--flow-surface);
}
.flow-inv-scan-result.is-miss {
  border-color: #dc262655;
  background: #dc262614;
}
.flow-inv-scan-result.is-lookup {
  border-color: oklch(0.68 0.16 155 / 0.4);
  background: oklch(0.68 0.16 155 / 0.08);
}
.flow-inv-scan-result.is-hit {
  border-color: color-mix(in srgb, var(--flow-ok) 28%, transparent);
  background: color-mix(in srgb, var(--flow-ok) 7%, transparent);
}
.flow-inv-scan-hit {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;
}
.flow-inv-scan-hit img,
.flow-inv-scan-hit .ph {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  background: var(--flow-bg); border: 1px solid var(--flow-border); flex-shrink: 0;
}
.flow-inv-lookup-spin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--flow-border-hi);
  border-top-color: var(--flow-wa, var(--flow-ok));
  animation: flow-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.flow-inv-lookup-spin--sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
}
.flow-inv-scan-hit strong { display: block; font-size: 0.9rem; color: var(--flow-w95); }
.flow-inv-scan-hit span { display: block; font-size: 0.72rem; color: var(--flow-w40); margin-top: 2px; }
.flow-inv-scan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.flow-inv-panel {
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-inset-bg);
}
.flow-inv-panel .app-card-title { margin: 0 0 10px; }
.flow-inv-table-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.flow-inv-barcode-modal { max-width: 520px; width: min(96vw, 520px); }
.flow-inv-barcode-reader {
  width: 100%; min-height: 280px; border-radius: 12px; overflow: hidden;
  background: #0a0a0a; border: 1px solid var(--flow-border); margin: 12px 0;
}
.flow-inv-barcode-reader video,
.flow-inv-barcode-reader canvas {
  border-radius: 12px !important;
}
.flow-inv-barcode-reader img { display: none !important; }
#inv-barcode-status.is-ok { color: var(--flow-ok); }
#inv-barcode-status.is-err { color: #dc2626; }
.flow-inv-add-modal { max-width: 480px; width: min(96vw, 480px); }
.flow-inv-wizard { max-width: 520px; width: min(96vw, 520px); }
.flow-inv-wiz-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px;
}
.flow-inv-wiz-top h3 { margin: 0 0 4px; }
.flow-inv-wiz-top .flow-modal-text { margin: 0; }
.flow-inv-wiz-steps {
  display: flex; gap: 6px; margin: 0 0 16px;
}
.flow-inv-wiz-steps span {
  flex: 1; height: 4px; border-radius: 999px; background: var(--flow-w10);
}
.flow-inv-wiz-steps span.is-on { background: var(--flow-accent); }
.flow-inv-wiz-steps span.is-done { background: oklch(0.72 0.14 155 / 0.55); }
.flow-inv-wiz-choices { display: flex; flex-direction: column; gap: 10px; }
.flow-inv-wiz-choice {
  appearance: none; text-align: left; cursor: pointer;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--flow-border); background: var(--flow-inset-bg);
  color: var(--flow-w90);
}
.flow-inv-wiz-choice strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.flow-inv-wiz-choice span { display: block; font-size: 0.82rem; color: var(--flow-w45); line-height: 1.4; }
.flow-inv-wiz-choice.is-on {
  border-color: oklch(0.72 0.14 155 / 0.55);
  background: oklch(0.72 0.14 155 / 0.1);
  box-shadow: inset 0 0 0 1px oklch(0.72 0.14 155 / 0.25);
}
.flow-inv-wiz-photo {
  display: block; position: relative; cursor: pointer;
  margin: 0 0 14px; border-radius: 14px; overflow: hidden;
  aspect-ratio: 16 / 9; min-height: 140px;
  border: 1px dashed var(--flow-border);
  background: var(--flow-inset-bg);
}
.flow-inv-wiz-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.flow-inv-wiz-photo span {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--flow-w45); font-size: 0.9rem; font-weight: 600;
}
.flow-inv-wiz-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px;
}
.flow-inv-wiz-chips button {
  appearance: none; border: 1px solid var(--flow-border); background: var(--flow-surface);
  color: var(--flow-w80); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: 0.75rem; font-weight: 650; cursor: pointer;
}
.flow-inv-wiz-chips button.is-on {
  border-color: oklch(0.72 0.14 155 / 0.5);
  background: oklch(0.72 0.14 155 / 0.14);
  color: #6ee7b7;
}
.flow-inv-wiz-toggle {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; margin: 4px 0 12px; border-radius: 12px;
  border: 1px solid var(--flow-border); background: var(--flow-inset-bg); cursor: pointer;
}
.flow-inv-wiz-toggle input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--flow-accent); }
.flow-inv-wiz-toggle strong { display: block; font-size: 0.9rem; color: var(--flow-w90); }
.flow-inv-wiz-toggle em { display: block; font-style: normal; font-size: 0.75rem; color: var(--flow-w45); margin-top: 2px; }
.flow-inv-tax-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--flow-w70);
  cursor: pointer;
  user-select: none;
}
.flow-inv-tax-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--flow-accent);
  margin: 0;
}
.flow-inv-tax-toggle:has(input:not(:checked)) {
  color: var(--flow-w45);
}
.flow-inv-offer-hint {
  margin: -4px 0 8px;
  font-size: 0.7rem;
  color: var(--flow-w45);
}
.flow-inv-wiz-summary {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: oklch(0.72 0.14 155 / 0.08); border: 1px solid oklch(0.72 0.14 155 / 0.2);
  color: var(--flow-w80); font-size: 0.82rem; line-height: 1.4;
}
.flow-inv-wiz-actions { margin-top: 16px; }
.flow-inv-wizard .app-form-group em { font-style: normal; font-weight: 400; color: var(--flow-w40); font-size: 0.72rem; }
.flow-inv-empty-cta {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 2.5rem 1rem; text-align: center;
}
.flow-inv-empty-cta p { margin: 0; color: var(--flow-w45); font-size: 0.9rem; }
.flow-inv-add-preview {
  margin: 0 0 12px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--flow-border); background: var(--flow-inset-bg);
  max-height: 160px;
}
.flow-inv-add-preview img {
  display: block; width: 100%; max-height: 160px; object-fit: contain; background: #111;
}
.flow-inv-add-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.flow-inv-add-modal .app-form-group { margin-bottom: 10px; }
.flow-inv-add-modal textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--flow-border); background: var(--flow-input-bg); color: var(--flow-w90);
  resize: vertical;
}
.flow-inv-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid oklch(0.72 0.14 155 / 0.45);
  background: oklch(0.72 0.14 155 / 0.12);
  color: #34d399;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.flow-inv-pill:hover { filter: brightness(1.08); }
.flow-inv-phone-modal { max-width: 420px; width: min(96vw, 420px); text-align: center; }
.flow-inv-phone-panel { margin-top: 4px; }
.flow-inv-phone-qr-wrap {
  margin: 12px auto; padding: 12px; width: fit-content;
  border-radius: 16px; background: #fff; border: 1px solid var(--flow-border);
}
.flow-inv-phone-qr-wrap img {
  display: block; width: 240px; height: 240px;
}
#inv-phone-scan-link a { color: var(--flow-cyan); }
.flow-inv-phone-live {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 8px auto 6px; padding: 8px 14px; border-radius: 999px;
  background: oklch(0.72 0.14 155 / 0.14);
  border: 1px solid oklch(0.72 0.14 155 / 0.4);
  color: #34d399; font-size: 0.82rem;
}
.flow-inv-phone-live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52,211,153,.55);
  animation: phoneLivePulse 1.4s ease-out infinite;
}
@keyframes phoneLivePulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
  70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.flow-inv-phone-live-msg {
  margin: 14px 0 6px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--flow-w95);
}
.flow-inventory-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 1.25rem;
}
.flow-inventory-search, .flow-inventory-filter {
  flex: 1; min-width: 160px; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--flow-border); background: var(--flow-surface); color: var(--flow-w90);
  font-size: 0.82rem;
}
.flow-inventory-filter { flex: 0 0 160px; }
.flow-inventory-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.flow-inv-card {
  background: var(--flow-surface); border: 1px solid var(--flow-border); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
}
.flow-inv-card.low { border-color: #f59e0b55; }
.flow-inv-card.out { border-color: #dc262655; opacity: 0.85; }
.flow-inv-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 140px;
  background: var(--flow-bg);
  border-bottom: 1px solid var(--flow-border);
  overflow: hidden;
}
.flow-inv-img-wrap img.flow-inv-img-preview,
.flow-inv-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.flow-inv-img-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--flow-w40);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(145deg, var(--flow-elevated), var(--flow-inset-bg));
}
.flow-inv-img-ph:hover { color: var(--flow-cyan); }
.flow-inv-img-file { display: none; }
.flow-inv-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  background: rgba(5, 150, 105, 0.85); color: #ecfdf5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.flow-inv-badge.ok { background: rgba(5, 150, 105, 0.88); color: #ecfdf5; }
.flow-inv-badge.low { background: rgba(217, 119, 6, 0.9); color: #fffbeb; }
.flow-inv-badge.out { background: rgba(220, 38, 38, 0.92); color: #fff; }
.flow-inv-badge.na { background: rgba(55, 65, 81, 0.9); color: #e5e7eb; }
.flow-inv-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.flow-inv-card .flow-inv-recipe-toggle {
  margin-top: 0;
}
.flow-inv-name {
  width: 100%; border: none; background: transparent; color: var(--flow-w90);
  font-weight: 600; font-size: 0.9rem; padding: 0;
}
/* Local-script name — must not inherit light text on UA white input bg */
.flow-inv-name-local {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--flow-border);
  border-radius: 8px;
  background: var(--flow-input-bg);
  color: var(--flow-w90);
  font: inherit;
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.35;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.flow-inv-name-local::placeholder {
  color: var(--flow-w40);
  opacity: 1;
}
.flow-inv-name-local:focus {
  border-color: color-mix(in oklab, var(--flow-accent) 50%, var(--flow-border));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--flow-accent) 20%, transparent);
}
.flow-inv-name-local:-webkit-autofill,
.flow-inv-name-local:-webkit-autofill:hover,
.flow-inv-name-local:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--flow-w90);
  caret-color: var(--flow-w90);
  box-shadow: 0 0 0 1000px var(--flow-input-bg) inset;
  transition: background-color 99999s ease-out;
}
.flow-inv-price-row {
  display: flex; align-items: center; gap: 4px;
}
.flow-inv-rupee { color: var(--flow-w40); font-size: 0.85rem; font-weight: 600; }
.flow-inv-price-row .inv-price {
  flex: 1; border: none; background: transparent; color: var(--flow-w80);
  font-size: 0.9rem; font-weight: 600; padding: 0;
}
.flow-inv-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.flow-inv-price-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 0;
  cursor: text;
}
.flow-inv-price-field > span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--flow-w45);
}
.flow-inv-price-input {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--flow-border);
  background: var(--flow-input-bg, var(--flow-inset-bg));
  box-sizing: border-box;
}
.flow-inv-price-input:focus-within {
  border-color: color-mix(in oklab, var(--flow-accent) 50%, var(--flow-border));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--flow-accent) 18%, transparent);
}
.flow-inv-price-input em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--flow-w45);
}
.flow-inv-price-input input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0 !important;
  outline: none;
  background: transparent !important;
  color: var(--flow-w90) !important;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.flow-inv-price-input input::-webkit-outer-spin-button,
.flow-inv-price-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.flow-inv-price-input input::placeholder {
  color: var(--flow-w35, var(--flow-w40));
  font-weight: 600;
}
.flow-inv-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.flow-inv-opt {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--flow-border);
  background: transparent;
  color: var(--flow-w50);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.flow-inv-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.flow-inv-opt.is-on {
  color: var(--flow-w90);
  border-color: color-mix(in srgb, var(--flow-accent) 45%, var(--flow-border));
  background: color-mix(in srgb, var(--flow-accent) 14%, transparent);
}
.flow-inv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding-top: 2px;
}
.flow-inv-foot-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.flow-inv-foot .flow-inv-recipe-toggle,
.flow-inv-foot .flow-inv-more-btn,
.flow-inv-foot .flow-inv-del {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.flow-inv-foot .flow-inv-recipe-toggle,
.flow-inv-foot .flow-inv-more-btn {
  color: var(--flow-w45);
}
.flow-inv-foot .flow-inv-recipe-toggle:hover,
.flow-inv-foot .flow-inv-more-btn:hover {
  color: var(--flow-cyan);
}
.flow-inv-menu-toggle.is-on .flow-inv-menu-label::before {
  content: '✓ ';
}
#inventory-grid.inv-hide-images .flow-inv-body {
  padding-top: 12px;
}
#inventory-grid.inv-hide-images .flow-inv-stock-row {
  padding: 8px;
  margin: 2px 0 0;
}
#inventory-grid.inv-hide-images .flow-inv-qty {
  font-size: 1.2rem;
}
#inventory-grid.inv-hide-images .flow-inv-adj {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 0.74rem;
}
.flow-inv-duration-row {
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 4px 0 2px;
}
.flow-inv-dur-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--flow-w50);
}
.flow-inv-dur-label input {
  width: 4.2rem;
  border: 1px solid var(--flow-border);
  border-radius: 8px;
  background: var(--flow-inset-bg, transparent);
  color: var(--flow-w85);
  padding: 4px 6px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}
.inv-kind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-bottom: 2px;
}
.inv-kind-tabs[hidden] { display: none !important; }
.inv-kind-tab {
  appearance: none;
  border: 1px solid var(--flow-border);
  background: var(--flow-inset-bg, transparent);
  color: var(--flow-w70);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.inv-kind-tab.active {
  background: var(--flow-accent);
  border-color: transparent;
  color: #111;
}
.flow-inv-kind-tag.is-svc {
  background: color-mix(in oklab, var(--flow-cyan) 18%, transparent);
  color: var(--flow-cyan);
}
.flow-inv-kind-tag.is-retail {
  background: color-mix(in oklab, var(--flow-accent, #f5c451) 22%, transparent);
  color: var(--flow-w80);
}
.inv-phone-label {
  white-space: nowrap;
}
@media (max-width: 720px) {
  #btn-inv-scan-phone .inv-phone-label {
    /* Keep readable; title/aria-label carry the full meaning if space is tight */
    font-size: 0.78rem;
  }
}
.flow-inv-card[data-kind="ingredient"] .flow-inv-price-row {
  opacity: 0.55;
}
.flow-inv-kind-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--flow-w55);
  background: var(--flow-inset-bg);
  border: 1px solid var(--flow-border);
  width: fit-content;
}
.flow-inv-kind-tag.is-dish {
  color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 10%, transparent);
  border-color: rgba(15, 118, 110, 0.28);
}
.flow-inv-kind-tag.is-dish.is-off,
.flow-inv-menu-toggle.is-off {
  color: #b45309;
  background: rgba(180, 83, 9, 0.12);
  border-color: rgba(180, 83, 9, 0.35);
  cursor: pointer;
}
.flow-inv-menu-toggle .inv-menu-enabled {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.flow-inv-menu-toggle {
  cursor: pointer;
  user-select: none;
}
.flow-inv-card.is-off-menu {
  opacity: 0.78;
}
.flow-inv-card.is-off-menu .flow-inv-img-wrap {
  filter: grayscale(0.35);
}
.flow-inv-kind-tag.is-ing {
  color: #9a3412;
  background: rgba(154, 52, 18, 0.1);
  border-color: rgba(154, 52, 18, 0.25);
}
.flow-inv-stock-row.is-recipe {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  grid-template-columns: none;
}
.flow-inv-recipe-stock {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.flow-inv-recipe-stock strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--flow-w95);
}
.flow-inv-recipe-stock span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--flow-w50);
  text-transform: none;
  letter-spacing: 0;
}
.flow-inv-recipe-line {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--flow-w60);
}
.flow-inv-recipe-hint {
  margin: 0;
  font-size: 0.68rem;
  color: var(--flow-w45);
  line-height: 1.3;
}
.flow-inv-recipe-toggle {
  align-self: flex-start;
  margin-top: 2px;
  background: none;
  border: none;
  color: var(--flow-cyan);
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0;
  cursor: pointer;
}
.flow-inv-recipe-toggle:hover { text-decoration: underline; }
.flow-inv-recipe-panel {
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-inset-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flow-inv-recipe-panel[hidden] { display: none !important; }
.flow-inv-recipe-editor-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--flow-w70);
}
.flow-inv-recipe-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.flow-inv-recipe-row {
  display: grid;
  grid-template-columns: 1fr 64px 32px;
  gap: 6px;
  align-items: center;
}
.flow-inv-recipe-row .inv-recipe-ing,
.flow-inv-recipe-row .inv-recipe-qty,
.flow-inv-recipe-cost-wrap input {
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--flow-border);
  background: var(--flow-input-bg);
  color: var(--flow-w85);
  font-size: 0.75rem;
}
.flow-inv-recipe-row .inv-recipe-rm {
  appearance: none;
  border: 1px solid var(--flow-border);
  background: transparent;
  color: var(--flow-w55);
  border-radius: 8px;
  height: 34px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.flow-inv-recipe-row .inv-recipe-rm:hover {
  color: #fb7185;
  border-color: #fb7185;
}
.flow-inv-recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.flow-inv-recipe-cost-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--flow-w55);
  font-weight: 650;
}
.flow-inv-recipe-editor-hint {
  margin: 0;
  font-size: 0.68rem;
  color: var(--flow-w45);
  line-height: 1.35;
}
.inv-add-fab {
  display: none;
}
.flow-inv-stock-row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center;
  margin: 4px 0 2px; padding: 10px; border-radius: 12px;
  background: var(--flow-inset-bg); border: 1px solid var(--flow-border);
}
.flow-inv-qty-wrap {
  display: flex; flex-direction: column; align-items: center; line-height: 1.1;
}
.flow-inv-qty {
  font-size: 1.55rem; font-weight: 700; color: var(--flow-w95); letter-spacing: -0.02em;
}
.flow-inv-qty-wrap span { font-size: 0.65rem; color: var(--flow-w40); text-transform: uppercase; letter-spacing: 0.04em; }
.flow-inv-adj {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 12px;
  min-height: 40px;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  cursor: pointer;
  line-height: 1.1;
}
.flow-inv-adj.in {
  color: #ecfdf5;
  border-color: #34d399;
  background: #047857;
}
.flow-inv-adj.out {
  color: #fff1f2;
  border-color: #fb7185;
  background: #be123c;
}
.flow-inv-adj:hover { filter: brightness(1.1); }
.flow-inv-adj:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
}
.flow-inv-more-btn {
  align-self: flex-start; background: none; border: none; color: var(--flow-w40);
  font-size: 0.72rem; padding: 0; cursor: pointer;
}
.flow-inv-more-btn:hover { color: var(--flow-cyan); }
.flow-inv-more { display: none; }
.flow-inv-card.more-open .flow-inv-more { display: block; }
.flow-inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.flow-inv-meta .inv-low { grid-column: 1 / -1; }
.flow-inv-meta .inv-subcategory { grid-column: 1 / -1; }
.flow-inv-meta input, .flow-inv-desc {
  width: 100%; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--flow-border);
  background: var(--flow-input-bg); color: var(--flow-w80); font-size: 0.75rem;
}
.flow-inv-desc { resize: vertical; min-height: 48px; margin-top: 8px; }
.flow-inv-actions { display: flex; justify-content: flex-end; margin-top: auto; }
.flow-inv-del {
  background: none; border: none; color: #dc2626; cursor: pointer; font-size: 0.72rem; padding: 4px 0;
}
.flow-inventory-empty { color: var(--flow-w40); font-size: 0.85rem; text-align: center; padding: 2rem; }
.flow-inv-empty-sm { color: var(--flow-w40); font-size: 0.78rem; margin: 8px 0 0; }

.flow-inv-attention-list, .flow-inv-movements-list {
  display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto;
}
.flow-inv-attention-row, .flow-inv-move-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--flow-inset-bg);
  border: 1px solid var(--flow-border);
}
.flow-inv-attention-row strong, .flow-inv-move-row strong {
  display: block; font-size: 0.82rem; color: var(--flow-w90);
}
.flow-inv-attention-row span, .flow-inv-move-row span:not(.flow-inv-move-qty) {
  display: block; font-size: 0.7rem; color: var(--flow-w40); margin-top: 2px;
}
.flow-inv-move-qty {
  font-weight: 800; font-size: 0.95rem; min-width: 2.4rem; text-align: center;
}
.flow-inv-move-row.in .flow-inv-move-qty { color: var(--flow-ok); }
.flow-inv-move-row.out .flow-inv-move-qty { color: #dc2626; }
.flow-inv-move-row.set .flow-inv-move-qty { color: var(--flow-w60); }
.flow-inv-table-wrap { margin: 0; }
.flow-inv-table-scroll { overflow-x: auto; }
.flow-inv-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
}
.flow-inv-table th {
  text-align: left; color: var(--flow-w40); font-weight: 600; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px;
  border-bottom: 1px solid var(--flow-border);
}
.flow-inv-table td {
  padding: 10px; border-bottom: 1px solid var(--flow-border); color: var(--flow-w80); vertical-align: middle;
}
.flow-inv-table .flow-inv-badge { position: static; }
.flow-inv-table-prod {
  display: flex; align-items: center; gap: 10px; min-width: 160px;
}
.flow-inv-table-thumb {
  width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: var(--flow-bg); border: 1px solid var(--flow-border);
}
.flow-inv-table-thumb.ph { display: inline-block; }
.flow-inv-table-actions {
  display: flex; gap: 6px; white-space: nowrap;
}
.flow-inv-table-actions .flow-inv-adj { padding: 6px 8px; font-size: 0.7rem; }
.flow-inv-barcode-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem; color: var(--flow-w70);
}
.flow-inv-meta .inv-barcode { grid-column: 1 / -1; }
#app-dialog-input-wrap { margin: 12px 0 4px; text-align: left; }
#app-dialog-input-wrap label { display: block; font-size: 0.72rem; margin-bottom: 6px; color: var(--flow-w50); }
#app-dialog-input, #app-dialog-note {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--flow-border); background: var(--flow-input-bg); color: var(--flow-w90);
}
#app-dialog-note { margin-top: 8px; }

/* Invoice page layout + live preview */
.flow-invoice-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.flow-invoice-list-card { grid-column: 1 / -1; }
.flow-inv-preview-hint { font-size: 0.68rem; color: var(--flow-w40); }
.inv-theme-form { margin: 0 0 12px; }
.inv-theme-form label { font-size: 0.72rem; margin-bottom: 6px; }
.inv-theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.inv-theme-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 6px; border-radius: 10px;
  border: 2px solid oklch(1 0 0 / 0.08);
  background: var(--flow-muted-surface);
  cursor: pointer; transition: border-color 0.15s, transform 0.15s;
}
.inv-theme-swatch:hover { border-color: oklch(1 0 0 / 0.2); transform: translateY(-1px); }
.inv-theme-swatch.is-active {
  border-color: var(--flow-accent);
  box-shadow: 0 0 0 1px oklch(0.75 0.14 195 / 0.35);
}
.inv-theme-swatch-colors {
  display: flex; gap: 3px; width: 100%; justify-content: center;
}
.inv-theme-swatch-colors i {
  display: block; width: 18px; height: 18px; border-radius: 4px;
}
.inv-theme-swatch-colors i:first-child { background: var(--swatch-accent); transform: rotate(8deg); }
.inv-theme-swatch-colors i:last-child { background: var(--swatch-navy); transform: rotate(-6deg); margin-top: 2px; }
.inv-theme-swatch-name {
  font-size: 0.58rem; color: var(--flow-w70, #cbd5e1); text-align: center; line-height: 1.2;
}
.inv-design-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.inv-design-tab {
  font-size: 0.72rem;
  border: 1px solid var(--flow-border);
  background: var(--flow-surface);
  color: var(--flow-w80);
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
}
.inv-design-tab.active {
  background: var(--flow-white);
  border-color: var(--flow-border-hi);
  color: var(--flow-cyan);
}
.inv-accent-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inv-accent-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  cursor: pointer;
  padding: 0;
}
.inv-accent-swatch.active { box-shadow: 0 0 0 2px var(--flow-cyan); }
.inv-accent-custom {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: conic-gradient(red,yellow,lime,cyan,blue,magenta,red);
}
.inv-accent-custom input[type="color"] {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 36px;
  height: 36px;
  border: none;
  cursor: pointer;
}
.inv-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.inv-logo-preview-wrap {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px dashed var(--flow-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}
.inv-logo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.inv-logo-placeholder {
  font-size: 0.62rem;
  color: var(--flow-w40);
  text-align: center;
  padding: 4px;
}
.inv-logo-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inv-logo-pick { cursor: pointer; margin: 0; }
.flow-invoice-preview-scroll {
  /* Do not use overflow-x:auto here — CSS computes the other axis to auto too,
     which forces a nested scrollbar even when the page has free space. */
  overflow: hidden;
  border-radius: 12px;
  background: oklch(0.08 0.01 255 / 0.5);
  padding: 12px;
}
.flow-invoice-preview {
  background: #e4e3df;
  color: #101113;
  border-radius: 14px;
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.35);
  font-size: 11px;
  line-height: 1.45;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding: 10px;
  width: 100%;
}
.flow-invoice-preview .inv-multi-root,
.flow-invoice-preview .inv-multi-root .design {
  width: 100%;
}
.flow-invoice-preview .inv-multi-root .sheet {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
  box-sizing: border-box;
}
.flow-invoice-preview .inv-multi-root .d1 .inner,
.flow-invoice-preview .inv-multi-root .d2 .inner,
.flow-invoice-preview .inv-multi-root .d3 .inner {
  padding-left: clamp(18px, 3.5vw, 40px);
  padding-right: clamp(18px, 3.5vw, 40px);
}
/* Invoice preview — single column, soft cards */
.inv-tpl {
  --inv-red: #d64545;
  --inv-navy: #1a2744;
  --inv-muted: #6b7280;
  --inv-line: #e8ecf1;
  --inv-surface: #f8fafc;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.inv-tpl-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--inv-line);
}
.inv-tpl-brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.inv-tpl-logo { display: flex; gap: 4px; flex-shrink: 0; }
.inv-tpl-logo span {
  display: block; width: 10px; height: 10px; background: var(--inv-red);
  transform: rotate(12deg); border-radius: 3px;
}
.inv-tpl-logo span:nth-child(2) { transform: rotate(-8deg); margin-top: 2px; }
.inv-tpl-logo span:nth-child(3) { transform: rotate(18deg); margin-top: -1px; }
.inv-tpl-brand-text h2 {
  margin: 0; font-size: 15px; font-weight: 800; color: #111827; letter-spacing: -0.01em;
  word-break: break-word;
}
.inv-tpl-tagline { margin: 3px 0 0; font-size: 9px; color: var(--inv-muted); }
.inv-tpl-title {
  margin: 0; font-size: 26px; font-weight: 800; color: var(--inv-red);
  letter-spacing: 0.06em; line-height: 1; flex-shrink: 0;
}
.inv-tpl-body {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 24px 20px;
}
.inv-tpl-card {
  background: var(--inv-surface);
  border: 1px solid var(--inv-line);
  border-radius: 14px;
  padding: 14px 16px;
}
.inv-tpl-card-label {
  font-size: 7px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #9ca3af; margin-bottom: 10px;
}
.inv-tpl-card-meta .inv-tpl-invno-num {
  font-size: 22px; font-weight: 700; color: #111827; letter-spacing: 0.04em;
  line-height: 1.1; margin-bottom: 10px;
}
.inv-tpl-meta-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-tpl-chip {
  display: inline-flex; align-items: center; padding: 5px 10px;
  border-radius: 999px; background: #fff; border: 1px solid var(--inv-line);
  font-size: 8.5px; color: #374151;
}
.inv-tpl-chip.inv-tpl-status.pending { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.inv-tpl-chip.inv-tpl-status.paid { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.inv-tpl-customer { display: block; font-size: 13px; color: #111827; margin-bottom: 6px; }
.inv-tpl-detail { margin: 0 0 5px; font-size: 9px; color: #4b5563; line-height: 1.45; }
.inv-tpl-detail span {
  display: inline-block; min-width: 52px; font-weight: 600; color: #9ca3af;
  text-transform: uppercase; font-size: 7px; letter-spacing: 0.06em; margin-right: 4px;
}
.inv-tpl-card-table { padding-bottom: 12px; }
.inv-tpl-table-wrap {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--inv-line); background: #fff;
}
.inv-tpl-thead {
  display: grid; grid-template-columns: 1fr 58px 34px 62px; gap: 6px;
  background: var(--inv-navy); color: #fff; padding: 10px 12px;
  font-size: 7.5px; font-weight: 700; letter-spacing: 0.07em;
}
.inv-tpl-thead span:last-child { text-align: right; }
.inv-tpl-row {
  display: grid; grid-template-columns: 1fr 58px 34px 62px; gap: 6px;
  padding: 10px 12px; font-size: 9px; color: #111827;
}
.inv-tpl-row + .inv-tpl-row { border-top: 1px solid #f1f5f9; }
.inv-tpl-row:nth-child(even) { background: #fafbfc; }
.inv-tpl-row .amt { text-align: right; font-weight: 600; }
.inv-tpl-card-totals .inv-tpl-tline {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 9px; color: var(--inv-muted); margin-bottom: 8px; padding: 0 2px;
}
.inv-tpl-card-totals .inv-tpl-tline strong { color: #111827; font-weight: 600; }
.inv-tpl-total-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  background: var(--inv-navy); color: #fff;
  font-size: 10px; font-weight: 700;
}
.inv-tpl-total-bar strong { font-size: 12px; }
.inv-tpl-card-terms p {
  margin: 0; font-size: 8px; color: #9ca3af; line-height: 1.6;
}
.inv-tpl-contacts-col {
  display: flex; flex-direction: column; gap: 8px;
}
.inv-tpl-contact {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--inv-red); color: #fff; border-radius: 12px;
  padding: 12px 14px;
}
.inv-tpl-contact p { margin: 0 0 3px; font-size: 8px; line-height: 1.4; word-break: break-word; }
.inv-tpl-contact-ico {
  flex-shrink: 0; width: 14px; height: 14px; margin-top: 2px;
  background: #fff;
  mask-size: contain; mask-repeat: no-repeat; mask-position: center;
  -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
}
.inv-tpl-ico-phone {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1-9.4 0-17-7.6-17-17 0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1L6.6 10.8z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1-9.4 0-17-7.6-17-17 0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1L6.6 10.8z'/%3E%3C/svg%3E");
}
.inv-tpl-ico-web {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm7.9 9h-3.4a15.9 15.9 0 0 0-1.2-5.1A8 8 0 0 1 19.9 11zM12 4c.9 1.5 2.1 4.2 2.4 7H9.6C9.9 8.2 11.1 5.5 12 4zM8.7 5.9A15.9 15.9 0 0 0 7.5 11H4.1a8 8 0 0 1 4.6-5.1zM4.1 13h3.4c.3 1.9.9 3.7 1.7 5.3A8 8 0 0 1 4.1 13zm7.5 7c-.9-1.5-2.1-4.2-2.4-7h4.8c-.3 2.8-1.5 5.5-2.4 7zm3.8-1.7c.8-1.6 1.4-3.4 1.7-5.3h3.4a8 8 0 0 1-5.1 5.3z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm7.9 9h-3.4a15.9 15.9 0 0 0-1.2-5.1A8 8 0 0 1 19.9 11zM12 4c.9 1.5 2.1 4.2 2.4 7H9.6C9.9 8.2 11.1 5.5 12 4zM8.7 5.9A15.9 15.9 0 0 0 7.5 11H4.1a8 8 0 0 1 4.6-5.1zM4.1 13h3.4c.3 1.9.9 3.7 1.7 5.3A8 8 0 0 1 4.1 13zm7.5 7c-.9-1.5-2.1-4.2-2.4-7h4.8c-.3 2.8-1.5 5.5-2.4 7zm3.8-1.7c.8-1.6 1.4-3.4 1.7-5.3h3.4a8 8 0 0 1-5.1 5.3z'/%3E%3C/svg%3E");
}
.inv-tpl-ico-pin {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.1 2 5 5.1 5 9c0 5.2 7 13 7 13s7-7.8 7-13c0-3.9-3.1-7-7-7zm0 9.5c-1.4 0-2.5-1.1-2.5-2.5S10.6 6.5 12 6.5s2.5 1.1 2.5 2.5S13.4 11.5 12 11.5z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2C8.1 2 5 5.1 5 9c0 5.2 7 13 7 13s7-7.8 7-13c0-3.9-3.1-7-7-7zm0 9.5c-1.4 0-2.5-1.1-2.5-2.5S10.6 6.5 12 6.5s2.5 1.1 2.5 2.5S13.4 11.5 12 11.5z'/%3E%3C/svg%3E");
}
.inv-tpl-footer {
  position: relative; height: 24px; background: var(--inv-navy);
  border-radius: 16px 16px 0 0; margin-top: 4px; overflow: hidden;
}
.inv-tpl-wave {
  position: absolute; left: 0; bottom: 0; width: 110px; height: 32px;
  background: var(--inv-red);
  border-top-right-radius: 70% 100%;
}
@media (max-width: 480px) {
  .inv-tpl-title { font-size: 22px; }
  .inv-tpl-card-meta .inv-tpl-invno-num { font-size: 18px; }
  .inv-tpl-body { padding: 14px 16px 16px; }
  .inv-tpl-header { padding: 18px 16px 16px; }
}

/* Mobile shell — hidden on desktop */
.app-mobile-nav,
.app-more-sheet { display: none; }
.flow-chat-back-btn { display: none; }

/* Responsive */
@media (max-width: 960px) {
  .flow-hero { grid-template-columns: 1fr; text-align: center; }
  .flow-hero-content { text-align: center; }
  .flow-hero-lead { margin-left: auto; margin-right: auto; }
  .flow-hero-actions { justify-content: center; }
  .flow-hero-visual { max-width: 480px; margin: 0 auto; }
  .flow-stats { grid-template-columns: repeat(2, 1fr); }
  .flow-features { grid-template-columns: 1fr 1fr; }
  .flow-channels { grid-template-columns: repeat(2, 1fr); }
  .flow-auth-screen { grid-template-columns: 1fr; }
  .flow-auth-brand { display: none; }
  .flow-connect-layout { grid-template-columns: 1fr; }
  .flow-inbox-layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 220px) minmax(0, 1fr); }
  .flow-bulk-grid { grid-template-columns: 1fr; }
  .flow-commerce-grid { grid-template-columns: 1fr; }
  .flow-leads-layout { grid-template-columns: 1fr; }
  .flow-catalog-row { grid-template-columns: 1fr; }
  .flow-books-grid { grid-template-columns: 1fr; }
  .flow-invoice-layout { grid-template-columns: 1fr; }
  .flow-books-stats { grid-template-columns: repeat(2, 1fr); }
  .flow-inventory-stats { grid-template-columns: repeat(3, 1fr); }
  .flow-inv-table-head { flex-direction: column; align-items: stretch; }
  .flow-inventory-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .cat-image-wrap { flex-direction: row; }
  .flow-inv-tabs { display: flex; width: 100%; }
  .flow-inv-tab { flex: 1; justify-content: center; }
}

@media (max-width: 640px) {
  .flow-features { grid-template-columns: 1fr; }
  .flow-ask-suggestions { grid-template-columns: 1fr; }
  .flow-nav-links a:not(.flow-btn) { display: none; }
  .flow-bulk-stats { grid-template-columns: repeat(2, 1fr); }
  .flow-plan-grid { grid-template-columns: 1fr; }

  /* Safe zone — no horizontal bleed on notched phones / Safari */
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
  .app-shell,
  .app-body,
  .app-main,
  .app-page,
  .app-card,
  .premium-card,
  .flow-leads-layout,
  .flow-books-grid,
  .flow-commerce-grid,
  .flow-inbox-layout {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  /* ── Legacy phone shell ──────────────────────────────────────────────
     Owned by restaurant `pos-phone-immersive` and kitchen
     `kitchen-phone-immersive` ONLY. Every other phone screen is rendered by
     platform/flow-phone.css (body.flow-phone-app), so these rules are scoped
     out of its way — two nav systems alive at once was the original bug. */
  .app-shell { height: 100dvh; height: 100svh; overflow-x: hidden; }
  body:not(.flow-phone-app) .app-topbar {
    height: auto;
    min-height: 48px;
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
    padding-bottom: 6px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    gap: 8px;
    /* Phone: solid chrome — kill inherited frosted glass */
    background: var(--flow-bg, #0c0c10);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  html[data-theme="light"] body:not(.flow-phone-app) .app-topbar {
    background: #ffffff;
  }
  .app-topbar-logo {
    font-size: 0.85rem;
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }
  .app-topbar-wordmark { display: none; }
  .app-topbar-mark { width: 26px; height: 26px; }
  .app-topbar-branch {
    max-width: none;
    flex: 1 1 auto;
    margin-left: 0;
    padding: 4px 6px 4px 10px;
    gap: 6px;
  }
  .app-topbar-branch-name {
    font-size: 0.88rem;
  }
  .app-topbar-right {
    gap: 6px;
    min-width: 0;
    flex: 0 0 auto;
    max-width: calc(100% - 40px);
  }
  .app-user-name { display: none; }
  .app-sub-pill { display: none !important; }
  .flow-alerts-mute [data-mute-label] { display: none; }
  .flow-alerts-mute {
    padding: 0 !important;
    width: 36px;
    height: 36px;
    min-width: 36px;
    justify-content: center;
    border-radius: 10px;
  }
  .app-staff-chip {
    padding: 0 8px;
    max-width: 72px;
    overflow: hidden;
  }
  .app-staff-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 4.2em;
    font-size: 0.68rem;
  }
  .app-user-widget { flex-shrink: 0; }

  .app-body { flex-direction: column; overflow: hidden; }
  .app-sidebar { display: none !important; }

  /* 5-tab bottom bar — legacy, restaurant/kitchen immersive only */
  body:not(.flow-phone-app) .app-mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    padding-top: 4px;
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-right: max(6px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--flow-bg, #0c0c10);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid var(--flow-border);
    box-shadow: none;
  }
  html[data-theme="light"] body:not(.flow-phone-app) .app-mobile-nav {
    background: #ffffff;
  }
  .app-shell.inbox-chat-open .app-mobile-nav { display: none; }

  /* Bottom tab bar already covers nav — hide floating home dock (double chrome) */
  #page-home .hd-dock {
    display: none !important;
  }

  /* Menu / inventory: stack chrome, room for cards */
  .inv-ops-top {
    gap: 10px;
    padding: 12px;
  }
  .inv-ops-title .app-page-title {
    font-size: 1.15rem;
  }
  .inv-ops-scan {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .inv-ops-scan #inv-scan-mode,
  .inv-ops-scan #inv-scan-input {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .inv-ops-scan #btn-wh-locate,
  .inv-ops-scan #btn-inv-scan-phone {
    grid-column: auto;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }
  .inv-ops-actions {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
  }
  .inv-ops-actions #btn-inv-fulfill-toggle { display: none; }
  .inv-ops-actions #btn-inv-add { grid-column: 1; }
  .inv-ops-actions #btn-save-inventory { grid-column: 2; }
  .inv-ops-actions .inv-ops-more { grid-column: 3; grid-row: 1; align-self: stretch; }
  .inv-ops-actions .inv-ops-more > summary,
  .inv-ops-actions .inv-ops-more > #btn-inv-ops-more {
    height: 100%;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    width: 100%;
  }
  .inv-ops-more-menu {
    right: 0;
    left: auto;
    min-width: min(240px, 78vw);
  }
  /* FAB duplicates + Add dish — hide to stop overlap */
  .inv-add-fab {
    display: none !important;
  }

  body:not(.flow-phone-app) .app-mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    max-width: 20%;
    padding: 6px 4px;
    border-radius: 12px;
    color: var(--flow-w40);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .app-mobile-tab span {
    font-size: 0.58rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
  }
  .app-mobile-tab.active {
    color: var(--flow-cyan);
    background: var(--flow-cyan-dim);
  }
  .app-mobile-tab.active svg { stroke: var(--flow-cyan); }

  /* More menu — legacy bottom sheet, restaurant/kitchen immersive only */
  body:not(.flow-phone-app) .app-more-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 300;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.25s;
  }
  .app-more-sheet.open {
    pointer-events: auto;
    visibility: visible;
  }
  .app-more-backdrop {
    position: absolute;
    inset: 0;
    background: oklch(0.05 0.02 255 / 0.55);
    border: none;
    opacity: 0;
    transition: opacity 0.25s;
  }
  .app-more-sheet.open .app-more-backdrop { opacity: 1; }
  .app-more-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(78dvh, 560px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--flow-elevated);
    border-radius: 20px 20px 0 0;
    padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    transform: translateY(100%);
    transition: transform 0.3s var(--flow-ease);
    border-top: 1px solid var(--flow-border);
  }
  .app-more-sheet.open .app-more-panel { transform: translateY(0); }
  .app-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-shrink: 0;
  }
  .app-more-head h3 { font-size: 1rem; font-weight: 700; }
  .app-more-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--flow-w06);
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .app-more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
  .app-more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 76px;
    padding: 12px 8px;
    border-radius: 14px;
    background: var(--flow-w06);
    border: 1px solid var(--flow-border);
    font-size: 0.68rem;
    color: var(--flow-w80);
    touch-action: manipulation;
  }
  .app-more-item.active {
    border-color: var(--flow-border-hi);
    background: var(--flow-cyan-dim);
    color: var(--flow-cyan);
  }
  body.mobile-more-open { overflow: hidden; }

  body:not(.flow-phone-app) .app-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: clip;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-top: 0.75rem;
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
    min-height: 0;
    box-sizing: border-box;
  }
  .app-shell.inbox-chat-open .app-main {
    padding: 0;
    overflow: hidden;
  }

  /* Compact page chrome */
  .app-page-header { margin-bottom: 0.75rem; }
  .app-page-title { font-size: 1.15rem; margin-bottom: 0.15rem; }
  .app-page-desc { display: none; }
  .app-card, .premium-card {
    padding: 1rem;
    border-radius: 14px;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
  }
  .app-card-title { font-size: 0.85rem; margin-bottom: 0.85rem; }

  .flow-btn {
    min-height: 48px;
    padding: 12px 18px;
    font-size: 0.88rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .app-form-group { margin-bottom: 0.9rem; min-width: 0; }
  .app-form-group input,
  .app-form-group textarea,
  .app-form-group select,
  .flow-inventory-search,
  .flow-inventory-filter,
  .flow-inv-name,
  .flow-inv-name-local,
  .flow-inv-meta input,
  .flow-inv-desc,
  .flow-catalog-row input,
  .flow-catalog-row textarea,
  .flow-chat-send input,
  .flow-books-toolbar input[type="month"],
  .flow-lead-q-row input,
  input[type="date"],
  input[type="month"],
  input[type="datetime-local"],
  select {
    font-size: 16px;
    min-height: 48px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }
  .flow-books-row2,
  .flow-books-row2 > *,
  .flow-leads-layout > *,
  .flow-commerce-grid > *,
  .flow-inventory-toolbar,
  .flow-inventory-grid,
  .flow-lead-q-row {
    min-width: 0;
    max-width: 100%;
  }
  .flow-lead-q-row {
    gap: 10px;
    align-items: stretch;
  }
  .flow-lead-q-row input { flex: 1; min-width: 0; }
  .flow-lead-q-row button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    flex-shrink: 0;
    align-self: center;
  }
  .app-card .flow-btn,
  .app-page > .flow-btn,
  .flow-modal-actions .flow-btn,
  .flow-inventory-toolbar .flow-btn,
  #btn-save-commerce {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .app-topbar .flow-btn,
  .flow-inbox-refresh-btn,
  .flow-month-btn,
  .flow-month-nav .flow-btn,
  .flow-chat-send button,
  .flow-chat-delete-btn,
  .flow-chat-back-btn,
  .app-more-close,
  .tx-del,
  .flow-inv-del,
  .flow-catalog-del,
  .cat-image-clear,
  .flow-lead-q-row button,
  .app-mobile-tab,
  .app-more-item {
    width: auto;
    max-width: none;
  }
  .app-toggle { width: 52px; height: 30px; }
  .app-toggle::after { width: 22px; height: 22px; top: 4px; left: 4px; }
  .app-toggle.on::after { transform: translateX(22px); }
  .flow-bot-toggle-row {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  /* Stats — 2-column grid on phone (no horizontal bleed) */
  .flow-books-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }
  .flow-books-stats .flow-stat-card {
    flex: none;
    width: auto;
    min-width: 0;
    padding: 12px 14px;
  }
  .flow-books-stats .flow-stat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .flow-inventory-stats {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    margin-bottom: 1rem;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    width: 100%;
    max-width: 100%;
  }
  .flow-inventory-stats .flow-stat-card {
    flex: 0 0 42vw;
    min-width: 130px;
    scroll-snap-align: start;
    padding: 12px 14px;
  }
  .flow-stat-card strong { font-size: 1.05rem; }

  /* Inbox — list OR full-screen chat (WhatsApp pattern) */
  #page-inbox.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  #page-inbox .flow-inbox-header {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
    flex-direction: row;
    align-items: center;
  }
  #page-inbox .flow-inbox-header > div { flex: 1; min-width: 0; }
  #page-inbox .flow-inbox-header .app-page-title { margin: 0; }
  .flow-inbox-refresh-btn {
    width: auto;
    min-height: 40px;
    padding: 8px 12px;
    flex-shrink: 0;
  }
  .flow-inbox-refresh-btn span { display: none; }

  .flow-inbox-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 0;
    overflow: hidden;
  }
  .flow-inbox-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    min-height: 0;
  }
  .flow-inbox-item {
    flex: none;
    width: 100%;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--flow-border);
    min-height: 68px;
    padding: 14px 16px;
  }
  .flow-chat-panel {
    display: none;
    flex: 1;
    min-height: 0;
    border-radius: 0;
    border: none;
  }

  #page-inbox.inbox-chat-open .flow-inbox-header,
  #page-inbox.inbox-chat-open .flow-inbox-list { display: none; }
  #page-inbox.inbox-chat-open .flow-inbox-layout { flex: 1; }
  #page-inbox.inbox-chat-open .flow-chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .flow-chat-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--flow-w06);
    margin-right: 4px;
  }
  .flow-chat-head {
    padding: 10px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    gap: 8px;
    flex-wrap: nowrap;
  }
  .flow-chat-head-info { flex: 1; min-width: 0; }
  .flow-chat-delete-btn span { display: none; }
  .flow-chat-delete-btn { min-width: 40px; min-height: 40px; padding: 8px; }
  .flow-chat-messages {
    flex: 1;
    padding: 12px;
    min-height: 0;
  }
  .flow-chat-bubble { max-width: 85%; font-size: 0.92rem; }
  .flow-chat-send {
    padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    gap: 8px;
    flex-shrink: 0;
  }
  .flow-chat-send input {
    width: auto;
    flex: 1;
    min-width: 0;
    min-height: 44px;
    border-radius: 24px;
    padding: 12px 16px;
  }
  .flow-chat-send button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* Tables → stacked cards */
  .flow-leads-table-wrap {
    overflow: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
  }
  .flow-leads-table { display: block; min-width: 0; width: 100%; max-width: 100%; border: none; }
  .flow-leads-table thead { display: none; }
  .flow-leads-table tbody { display: flex; flex-direction: column; gap: 10px; width: 100%; }
  .flow-leads-table tr {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--flow-card);
    border: 1px solid var(--flow-border);
    border-radius: 14px;
    padding: 12px 14px;
  }
  .flow-leads-table td {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0;
    border: none;
    font-size: 0.84rem;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }
  .flow-leads-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.65rem;
    color: var(--flow-w40);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    flex-shrink: 0;
  }
  .flow-leads-table td[data-label=""]::before { display: none; }
  .flow-leads-table td[data-label=""] {
    flex-direction: row;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--flow-border);
    margin-top: 4px;
  }
  .flow-lead-details {
    max-width: 100%;
    text-align: left;
    line-height: 1.5;
  }
  .flow-lead-detail-line {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: var(--flow-w80);
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .flow-lead-detail-line:last-child { margin-bottom: 0; }
  .flow-lead-detail-line span {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--flow-w40);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
  }

  /* Money / books */
  .flow-books-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0.75rem;
    align-items: stretch;
    width: 100%;
  }
  .flow-month-nav {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    gap: 10px;
    width: 100%;
  }
  .flow-month-nav label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    margin: 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--flow-w40);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .flow-month-nav input[type="month"] {
    width: 100%;
    text-align: center;
    padding: 10px 6px;
    margin: 0;
  }
  .flow-month-btn {
    width: 48px !important;
    height: 48px;
    min-width: 48px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    line-height: 1;
  }
  .flow-books-toolbar > .flow-btn#btn-books-refresh {
    width: 100%;
  }
  .flow-month-label {
    margin-left: 0;
    text-align: center;
    font-size: 0.75rem;
    width: 100%;
  }
  .flow-books-grid { gap: 0.75rem; }
  .flow-books-row2 { grid-template-columns: 1fr; }

  /* Inventory */
  .flow-inventory-toolbar { gap: 8px; margin-bottom: 0.75rem; }
  .flow-inventory-toolbar .flow-btn { width: 100%; }
  .flow-inventory-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Leads — form first, compact */
  .flow-leads-layout { gap: 0.75rem; }

  /* Primary actions — scroll naturally, extra space above tab bar */
  .app-page .flow-btn-primary,
  .app-page .flow-btn-outline {
    margin-bottom: 0.5rem;
  }
  .app-page .flow-btn-primary:last-child,
  #btn-save-leadform,
  #btn-save-inventory,
  #btn-save-commerce,
  #btn-save-business,
  #btn-create-invoice,
  #btn-add-transaction {
    margin-bottom: 1.25rem;
  }

  .flow-connect-layout { gap: 10px; }
  .flow-qr-body { padding: 1.25rem 1rem; }
  .flow-qr-img-wrap img { max-width: min(240px, 70vw); height: auto; }
  .flow-info-card { padding: 12px 14px; }

  .flow-modal-bg { padding: 0; align-items: flex-end; }
  .flow-modal.premium-modal,
  .flow-pay-modal {
    max-width: none;
    width: 100%;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
    margin-bottom: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .flow-auth-wrap { padding: 1.25rem 1rem; }
  .flow-auth-panel input { font-size: 16px; min-height: 48px; }
  .flow-auth-submit { min-height: 48px; width: 100%; }
}

@media (max-width: 380px) {
  .app-more-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-books-stats .flow-stat-card,
  .flow-inventory-stats .flow-stat-card { flex: 0 0 56vw; }
}

/* ── Ops cockpit UI (fx) — dashboard, orders, bulk ── */
.fx-page {
  max-width: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fx-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.fx-topbar--compact {
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: 14px;
}
.fx-topbar-main { min-width: 0; }
.fx-eyebrow {
  display: block;
  font-family: var(--flow-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--flow-w40);
  margin-bottom: 6px;
}
.fx-title {
  font-family: var(--flow-display);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}
.fx-sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--flow-w40);
}
.fx-icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--flow-border);
  border-radius: 50%;
  background: var(--flow-w06);
  color: var(--flow-w60);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.fx-icon-btn:hover { border-color: var(--flow-border-hi); color: var(--flow-white); background: var(--flow-w12); }

.fx-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 14px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}
.fx-layout--fill { min-height: calc(100dvh - 160px); }
.fx-main {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
.fx-rail { position: sticky; top: 16px; align-self: stretch; min-height: 0; }
.fx-rail--full {
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fx-rail--full .fx-rail-card {
  flex: 1;
  max-height: none;
  min-height: 0;
}

/* Roundish soft cards */
.fx-card, .fx-panel {
  background: var(--flow-panel);
  border: 1px solid var(--flow-border);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--flow-white) 4%, transparent) inset;
}
.fx-panel--rail { padding: 14px 16px; }
.fx-rail-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100dvh - 140px);
  padding: 14px 16px 16px;
}
.fx-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.fx-panel-title, .fx-rail-title {
  font-family: var(--flow-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.fx-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.fx-panel-meta {
  font-family: var(--flow-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flow-w40);
}

.fx-wa-card { border-color: oklch(0.82 0.14 195 / 0.14); padding: 14px 16px; }
.fx-wa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fx-wa-copy { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 2px; }
.fx-pulse { flex-shrink: 0; }
.fx-wa-label { font-size: 0.88rem; font-weight: 600; letter-spacing: -0.01em; }
.fx-wa-desc { font-size: 0.74rem; color: var(--flow-w40); line-height: 1.4; }
.fx-chip {
  font-family: var(--flow-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--flow-border);
  border-radius: 999px;
  color: var(--flow-w60);
  flex-shrink: 0;
}
.fx-chip--live { border-color: oklch(0.72 0.17 145 / 0.35); color: var(--flow-green); background: oklch(0.72 0.17 145 / 0.08); }
.fx-chip--warn { border-color: oklch(0.82 0.14 95 / 0.3); color: var(--flow-yellow); background: oklch(0.82 0.14 95 / 0.06); }
.fx-wa-bar {
  height: 3px;
  margin: 10px 0 0;
  background: var(--flow-w06);
  border-radius: 999px;
  overflow: hidden;
  transition: opacity 0.3s;
}
.fx-wa-bar-fill {
  height: 100%;
  background: var(--flow-cyan);
  border-radius: 999px;
  transition: width 0.4s var(--flow-ease);
}
.fx-wa-steps {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.flow-wa-step {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--flow-w06);
}
.flow-wa-step.done { background: oklch(0.82 0.14 195 / 0.35); }
.flow-wa-step.active { background: var(--flow-cyan); }
.fx-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--flow-border-hi);
  border-radius: 999px;
  background: var(--flow-cyan-dim);
  color: var(--flow-cyan);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.fx-cta:hover { background: oklch(0.82 0.14 195 / 0.18); border-color: var(--flow-cyan); transform: translateY(-1px); }
.fx-cta--inline { margin-left: auto; }

/* Bento stats — soft rounded cells, no hard grid lines */
.fx-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.fx-stat {
  background: var(--flow-nested-surface);
  border: 1px solid oklch(1 0 0 / 0.05);
  border-radius: 16px;
  padding: 12px 10px;
  text-align: center;
  transition: border-color 0.2s;
}
.fx-stat:hover { border-color: oklch(1 0 0 / 0.1); }
.fx-stat-num {
  display: block;
  font-family: var(--flow-mono);
  font-size: 1.1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--flow-white);
  letter-spacing: -0.02em;
}
.fx-stat-lbl {
  display: block;
  margin-top: 3px;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  color: var(--flow-w40);
}

.fx-stats-card { padding-bottom: 12px; }
.fx-stats-card .fx-quick { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--flow-border); }

.fx-phase2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 0;
  align-items: stretch;
}
.fx-grow-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.fx-order-widget, .fx-schedule-widget {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  margin-top: 8px;
}
.fx-pipe-pills--inline {
  margin-bottom: 4px;
  padding-top: 0;
  border-top: none;
}
.fx-feed--fill {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.fx-ow-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--flow-nested-surface);
  border: 1px solid oklch(1 0 0 / 0.04);
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.fx-ow-row:hover { border-color: oklch(1 0 0 / 0.1); }
.fx-ow-row--schedule { grid-template-columns: 1fr auto; }
.fx-ow-main { min-width: 0; }
.fx-ow-main strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fx-ow-main span {
  display: block;
  font-size: 0.72rem;
  color: var(--flow-w40);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.fx-order-btn--sm {
  padding: 5px 10px;
  font-size: 0.62rem;
  white-space: nowrap;
}

.fx-reminder-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: oklch(0.82 0.14 95 / 0.08);
  border: 1px solid oklch(0.82 0.14 95 / 0.2);
  font-size: 0.76rem;
  color: var(--flow-w60);
  line-height: 1.45;
}
.fx-reminder-banner strong { color: var(--flow-yellow); font-family: var(--flow-mono); }
.fx-reminder-banner span { color: var(--flow-w40); }
.fx-reminder-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--flow-yellow);
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 8px oklch(0.82 0.14 95 / 0.4);
}
/* Quick nav — horizontal pills inside stats card */
.fx-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fx-quick-pill {
  padding: 8px 14px;
  border: 1px solid var(--flow-border);
  border-radius: 999px;
  background: var(--flow-subtle-bg);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--flow-w60);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.fx-quick-pill:hover {
  border-color: var(--flow-border-hi);
  color: var(--flow-white);
  background: var(--flow-w06);
}

/* Legacy metric grid (bulk/orders pages) */
.fx-metric-grid {
  display: grid;
  gap: 10px;
}
.fx-metric-grid--3 { grid-template-columns: repeat(3, 1fr); }
.fx-metric {
  background: var(--flow-nested-surface);
  border: 1px solid oklch(1 0 0 / 0.05);
  border-radius: 16px;
  padding: 12px 10px;
  text-align: center;
}
.fx-metric-num {
  display: block;
  font-family: var(--flow-mono);
  font-size: 1.1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--flow-white);
}
.fx-metric-lbl {
  display: block;
  margin-top: 3px;
  font-size: 0.65rem;
  color: var(--flow-w40);
}

.fx-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fx-nav-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--flow-border);
  border-radius: 14px;
  background: var(--flow-bg);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--flow-w80);
  transition: border-color 0.2s, color 0.2s;
}
.fx-nav-tile:hover { border-color: var(--flow-border-hi); color: var(--flow-white); }
.fx-footnote {
  margin: 12px 0 0;
  font-size: 0.72rem;
  color: var(--flow-w40);
}

.fx-feed { display: flex; flex-direction: column; min-height: 0; }
.fx-feed--scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 42vh;
  margin-bottom: 12px;
  padding-right: 2px;
}
.fx-feed-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px 4px;
  border-radius: 12px;
  transition: background 0.15s;
}
.fx-feed-row:hover { background: var(--flow-w06); }
.fx-tag {
  font-family: var(--flow-mono);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 4px 6px;
  border-radius: 999px;
  text-align: center;
  border: 1px solid var(--flow-border);
  color: var(--flow-w40);
}
.fx-tag--sale { color: var(--flow-green); border-color: oklch(0.72 0.17 145 / 0.25); }
.fx-tag--lead { color: var(--flow-cyan); border-color: oklch(0.82 0.14 195 / 0.25); }
.fx-tag--message { color: var(--flow-w60); }
.fx-feed-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fx-feed-title { font-size: 0.78rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-feed-detail { font-size: 0.7rem; color: var(--flow-w40); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-feed-time { font-family: var(--flow-mono); font-size: 0.6rem; color: var(--flow-w25); padding-top: 2px; }
.fx-empty { padding: 16px 8px; margin: 0; font-size: 0.78rem; color: var(--flow-w40); text-align: center; }

.fx-pipe-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--flow-border);
}
.fx-pipe-pill {
  text-align: center;
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--flow-nested-surface);
  border: 1px solid oklch(1 0 0 / 0.05);
}
.fx-pipe-pill-num {
  display: block;
  font-family: var(--flow-mono);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
}
.fx-pipe-pill-lbl {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--flow-w40);
}
.fx-pipe-pill--warn .fx-pipe-pill-num { color: var(--flow-yellow); }
.fx-pipe-pill--ok .fx-pipe-pill-num { color: var(--flow-green); }
.fx-pipe-pill--info .fx-pipe-pill-num { color: oklch(0.78 0.08 250); }
.fx-pipe-pill--live .fx-pipe-pill-num { color: var(--flow-cyan); }

.fx-link-btn {
  border: none;
  background: none;
  color: var(--flow-cyan);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.fx-link-btn--sm { font-size: 0.72rem; opacity: 0.9; }
.fx-link-btn:hover { text-decoration: underline; }

.fx-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--flow-border);
  border-radius: 16px;
  background: var(--flow-muted-surface);
}
.fx-seg-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--flow-w40);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fx-seg-btn:hover { color: var(--flow-w80); }
.fx-seg-btn.active { background: var(--flow-card); color: var(--flow-white); box-shadow: 0 0 0 1px var(--flow-border); }

.fx-order-board {
  border: 1px solid var(--flow-border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--flow-card);
}
.fx-order-headrow {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.8fr 0.9fr 1fr;
  gap: 10px;
  padding: 10px 14px;
  font-family: var(--flow-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--flow-w40);
  border-bottom: 1px solid var(--flow-border);
  background: var(--flow-bg);
}
.fx-order-row {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.8fr 0.9fr 1fr;
  gap: 10px;
  padding: 12px 14px;
  align-items: center;
  border-bottom: 1px solid var(--flow-border);
  font-size: 0.8rem;
}
.fx-order-row:last-child { border-bottom: none; }
.fx-order-row:hover { background: var(--flow-w06); }
.fx-order-cell { min-width: 0; }
.fx-order-cell--name strong { display: block; font-weight: 600; }
.fx-order-cell--name span { display: block; font-family: var(--flow-mono); font-size: 0.68rem; color: var(--flow-w40); margin-top: 2px; }
.fx-order-cell--amt { font-family: var(--flow-mono); font-weight: 500; }
.fx-order-cell--act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.fx-status {
  display: inline-block;
  font-family: var(--flow-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 4px;
  border: 1px solid var(--flow-border);
}
.fx-status--awaiting { color: var(--flow-yellow); border-color: oklch(0.82 0.14 95 / 0.25); }
.fx-status--paid { color: var(--flow-green); border-color: oklch(0.72 0.17 145 / 0.25); }
.fx-status--packed { color: oklch(0.78 0.08 250); border-color: oklch(0.7 0.1 250 / 0.25); }
.fx-status--shipped { color: var(--flow-cyan); border-color: oklch(0.82 0.14 195 / 0.25); }
.fx-status--cancelled { color: var(--flow-red); border-color: oklch(0.62 0.2 25 / 0.25); }
.fx-order-btn {
  padding: 6px 12px;
  border: 1px solid var(--flow-border);
  border-radius: 999px;
  background: var(--flow-w06);
  color: var(--flow-cyan);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.fx-order-btn:hover { border-color: var(--flow-cyan); background: var(--flow-cyan-dim); }

.fx-queue { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.fx-queue-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--flow-border);
  border-radius: 16px;
  background: var(--flow-nested-surface);
}
.fx-queue-main strong { display: block; font-size: 0.82rem; font-weight: 600; }
.fx-queue-main span { font-size: 0.72rem; color: var(--flow-w40); }
.fx-queue-status {
  font-family: var(--flow-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--flow-border);
}
.fx-queue-status--pending { color: var(--flow-yellow); }
.fx-queue-status--active { color: var(--flow-cyan); }
.fx-queue-status--done { color: var(--flow-green); }
.fx-queue-status--running { color: var(--flow-cyan); }
.fx-queue-status--error { color: #f87171; }

.bulk-repeat-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.bulk-repeat-btn,
.bulk-day-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  border: 1px solid var(--flow-border, #e5e7eb);
  background: var(--flow-card, #fff);
  color: inherit;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
}
.bulk-repeat-btn.is-on,
.bulk-day-btn.is-on {
  border-color: color-mix(in srgb, var(--flow-accent, var(--flow-green)) 50%, transparent);
  background: color-mix(in srgb, var(--flow-accent, var(--flow-green)) 14%, transparent);
  color: var(--flow-accent, var(--flow-green));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--flow-accent, var(--flow-green)) 28%, transparent);
}
body.flow-acct-restaurant .bulk-repeat-btn.is-on,
body.flow-acct-restaurant .bulk-day-btn.is-on,
body.flow-acct-smb .bulk-repeat-btn.is-on,
body.flow-acct-smb .bulk-day-btn.is-on,
body.flow-acct-agency .bulk-repeat-btn.is-on,
body.flow-acct-agency .bulk-day-btn.is-on {
  border-color: color-mix(in srgb, var(--flow-cyan, #22d3ee) 50%, transparent);
  background: color-mix(in srgb, var(--flow-cyan, #22d3ee) 12%, transparent);
  color: inherit;
  box-shadow: none;
}
.bulk-weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.bulk-day-btn {
  min-width: 42px;
  padding: 6px 8px;
  border-radius: 10px;
}
.fx-queue-status--error { color: var(--flow-red); }
.fx-queue-cancel {
  border: none; background: none;
  font-size: 0.68rem; color: var(--flow-w40);
  text-decoration: underline; cursor: pointer;
}
.fx-bulk-progress .flow-bulk-stats { margin-bottom: 12px; }
.fx-bulk-progress .flow-bulk-stat-num { font-family: var(--flow-mono); }

/* Connect page legacy cells */
.flow-ios-info-cell {
  padding: 14px 16px;
  border-bottom: 0.5px solid oklch(1 0 0 / 0.07);
}
.flow-ios-info-cell:last-child { border-bottom: none; }
.flow-ios-info-cell h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--flow-white);
}
.flow-ios-info-cell p {
  font-size: 0.8rem;
  color: var(--flow-w40);
  line-height: 1.55;
  margin: 0;
}
.flow-ios-group {
  background: var(--flow-bg2);
  border: 1px solid var(--flow-border);
  border-radius: 10px;
  overflow: hidden;
}
.flow-wa-status-detail {
  margin: 0 18px 12px;
  font-size: 0.78rem;
  color: var(--flow-w40);
  line-height: 1.45;
}
.flow-wa-progress--connect {
  height: 3px;
  margin: 0 18px 14px;
  background: var(--flow-w06);
}
.flow-wa-progress-fill {
  height: 100%;
  background: var(--flow-cyan);
  transition: width 0.4s var(--flow-ease);
}
.flow-auth-link-btn {
  background: none; border: none; color: var(--flow-cyan);
  font-size: 0.82rem; cursor: pointer; padding: 0;
}
.flow-chat-pause-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--flow-border);
  background: transparent; color: var(--flow-w60);
  font-size: 0.72rem; cursor: pointer;
}
.flow-chat-pause-btn.paused {
  border-color: oklch(0.82 0.14 95 / 0.25);
  color: oklch(0.85 0.12 95);
  background: oklch(0.82 0.14 95 / 0.06);
}
.flow-inv-wa {
  border: none; background: oklch(1 0 0 / 0.06);
  color: var(--flow-cyan); padding: 4px 8px;
  border-radius: 6px; font-size: 0.72rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 5.5rem; position: relative; overflow: hidden;
}
.flow-inv-wa:disabled { cursor: wait; opacity: 0.92; }
.flow-inv-wa--sending { color: oklch(0.88 0.06 220); }
.flow-inv-wa--sent {
  color: oklch(0.78 0.14 145);
  background: oklch(0.78 0.14 145 / 0.12);
}
.flow-inv-wa-progress {
  flex: 0 0 2.75rem; height: 3px; border-radius: 2px;
  background: oklch(1 0 0 / 0.12); overflow: hidden;
}
.flow-inv-wa-bar {
  display: block; height: 100%; width: 35%;
  border-radius: inherit; background: var(--flow-cyan);
  animation: flow-inv-wa-indeterminate 1.1s ease-in-out infinite;
}
@keyframes flow-inv-wa-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.flow-inv-wa-lbl { white-space: nowrap; }

@media (max-width: 1100px) {
  .fx-layout, .fx-layout--fill { grid-template-columns: 1fr; min-height: auto; }
  .fx-rail--full { grid-row: auto; }
  .fx-rail { position: static; }
  .fx-rail-card { max-height: 360px; }
  .fx-feed--fill { max-height: 320px; }
  .fx-phase2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .fx-bento { grid-template-columns: repeat(2, 1fr); }
  .fx-pipe-pills { grid-template-columns: repeat(2, 1fr); }
  .fx-wa-row .fx-cta--inline { width: 100%; margin-left: 0; justify-content: center; margin-top: 6px; }
  .fx-order-headrow { display: none; }
  .fx-order-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px;
  }
  .fx-order-cell--act { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .fx-bento { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fx-card, .fx-panel { border-radius: 18px; padding: 14px; }
}

/* ── Home dashboard (hd) — command center ── */
#page-home.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.hd-dashboard {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 14px;
  flex: 1;
  min-height: 0;
  max-width: 1380px;
  width: 100%;
  padding-bottom: 8px;
}
.hd-wa-strip {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 14px 16px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--hd-surface);
  border: 1px solid var(--hd-surface-border);
  box-shadow: var(--hd-surface-shadow);
}
.hd-wa-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: oklch(0.55 0.12 255 / 0.18);
  color: oklch(0.72 0.12 255);
  border: none;
}
.hd-wa-icon--live { background: oklch(0.72 0.17 145 / 0.14); color: oklch(0.72 0.17 145); }
.hd-wa-icon--scan { background: oklch(0.55 0.12 255 / 0.18); color: oklch(0.72 0.12 255); }
.hd-wa-icon--off { background: var(--flow-w08); color: var(--flow-w40); }
.hd-wa-icon i { width: 22px; height: 22px; }
.hd-wa-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hd-wa-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hd-wa-title { font-size: 0.95rem; font-weight: 700; color: var(--hd-text-primary); }
.hd-wa-desc { font-size: 0.76rem; color: var(--hd-text-secondary); }
.hd-wa-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hd-wa-stepper {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding-top: 4px;
}
.hd-wa-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 88px;
}
.hd-wa-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  background: #f3f4f6; color: #9ca3af;
  border: 2px solid #e5e7eb;
}
.hd-wa-step-item.done .hd-wa-step-num,
.hd-wa-step-item.active .hd-wa-step-num {
  background: #2563eb; color: #fff; border-color: #2563eb;
}
.hd-wa-step-lbl {
  font-size: 0.62rem; color: #9ca3af; text-align: center; line-height: 1.2;
  max-width: 90px;
}
.hd-wa-step-item.active .hd-wa-step-lbl,
.hd-wa-step-item.done .hd-wa-step-lbl { color: #374151; font-weight: 500; }
.hd-wa-step-line {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  margin-top: 13px;
  min-width: 24px;
}
.hd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.hd-btn--primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.hd-btn--primary:hover { background: #1d4ed8; }
.hd-btn--outline {
  background: var(--flow-card);
  border-color: var(--flow-border);
  color: var(--flow-w80);
}
.hd-btn--outline:hover { background: var(--flow-w08); color: var(--flow-w95); }
.hd-btn--ghost {
  width: 36px; height: 36px; padding: 0;
  border-radius: 10px;
  background: var(--flow-w08);
  border-color: var(--flow-border);
  color: var(--flow-w60);
}
.hd-btn--ghost:hover { background: var(--flow-w12); color: var(--flow-w90); }

.hd-head {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.hd-title {
  font-family: var(--flow-display);
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.05;
  color: var(--hd-text-primary);
}
.hd-sub { margin: 5px 0 0; font-size: 0.78rem; color: var(--hd-text-muted); }
.hd-phase2-badges { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.hd-p2-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 500;
  padding: 2px 10px;
  color: #6b7280;
  background: none; border: none;
}
.hd-phase2-badges .hd-p2-badge + .hd-p2-badge { border-left: 1px solid #e5e7eb; }
.hd-phase2-badges .hd-p2-badge:first-child { padding-left: 0; }
.hd-p2-badge--warn { color: #ea580c; }
.hd-p2-badge--warn::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #f97316; flex-shrink: 0;
}
.hd-p2-badge--ok { color: #059669; }
.hd-p2-badge--ok::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #10b981; flex-shrink: 0;
}
.hd-p2-badge--remind {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  margin-left: 6px;
}

.hd-kpi-ribbon {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.hd-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--hd-surface);
  border: 1px solid var(--hd-surface-border);
  box-shadow: var(--hd-surface-shadow);
}
.hd-kpi-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hd-kpi-icon i { width: 18px; height: 18px; }
.hd-kpi-icon--msgs { background: #eff6ff; color: #3b82f6; }
.hd-kpi-icon--chats { background: #ecfdf5; color: #10b981; }
.hd-kpi-icon--leads { background: #f3f4f6; color: #6b7280; }
.hd-kpi-icon--revenue { background: #ecfdf5; color: #059669; }
.hd-kpi-icon--income { background: #f5f3ff; color: #7c3aed; }
.hd-kpi-icon--stock { background: #f3f4f6; color: #374151; }
.hd-kpi > div { min-width: 0; }
.hd-kpi-num {
  display: block;
  font-family: var(--flow-display);
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--hd-text-primary);
  line-height: 1.1;
}
.hd-kpi-lbl { display: block; margin-top: 2px; font-size: 0.68rem; color: var(--hd-text-muted); }

.hd-kanban-wrap {
  grid-column: 1;
  grid-row: 4;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--hd-surface);
  border: 1px solid var(--hd-surface-border);
  box-shadow: var(--hd-surface-shadow);
}
.hd-kanban-wrap .hd-section-head h2 {
  color: var(--hd-kb-title);
}
.hd-kanban-wrap .hd-link {
  color: var(--hd-kb-link);
}
.hd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.hd-section-head h2 {
  font-family: var(--flow-display);
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}
.hd-link {
  border: none;
  background: none;
  color: var(--hd-kb-link);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.hd-link:hover { text-decoration: underline; }

.hd-kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
}
.hd-kanban--page {
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.hd-kanban--page .hd-kanban-col {
  min-height: 0;
  height: 100%;
}
.hd-kanban--page .hd-kanban-col-body {
  max-height: none;
  flex: 1;
  min-height: 0;
}
.hd-kanban--page .hd-kanban-col:not(:last-child)::after {
  top: 0;
  transform: none;
  height: 100%;
  opacity: 0.55;
}
.hd-kanban-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  padding: 0 12px;
}
.hd-kanban-col:first-child { padding-left: 0; }
.hd-kanban-col:last-child { padding-right: 0; }
.hd-kanban-col:not(:last-child) {
  position: relative;
}
.hd-kanban-col:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 72px;
  background: var(--hd-kb-col-sep);
  border-radius: 1px;
  pointer-events: none;
}
.hd-kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hd-kb-col-head-text);
  border-bottom: none;
  background: transparent;
}
.hd-kanban-col-head em {
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--hd-kb-col-count-text);
  background: var(--hd-kb-col-count-bg);
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
.hd-kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
/* Home dashboard preview only — keep compact */
.hd-kanban-wrap .hd-kanban-col-body {
  max-height: 340px;
}
.hd-kanban-col-body:hover {
  scrollbar-color: var(--flow-scroll-thumb) transparent;
}
.hd-kanban-col-body::-webkit-scrollbar {
  width: 3px;
}
.hd-kanban-col-body::-webkit-scrollbar-track {
  background: transparent;
}
.hd-kanban-col-body::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}
.hd-kanban-col-body:hover::-webkit-scrollbar-thumb {
  background: var(--flow-scroll-thumb);
}
.hd-kanban-col-body:hover::-webkit-scrollbar-thumb:hover {
  background: var(--flow-scroll-thumb-hover);
}
.hd-kanban-card {
  padding: 10px 11px;
  border-radius: 14px;
  background: var(--hd-kb-card-bg);
  border: 1px solid var(--hd-kb-card-border);
  box-shadow: var(--hd-kb-card-shadow);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.hd-kanban-card--compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
}
.hd-kanban-card:hover {
  border-color: oklch(1 0 0 / 0.12);
}
.hd-kanban-main { flex: 1; min-width: 0; }
.hd-kanban-card-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.hd-kanban-card-top strong { font-size: 0.8rem; font-weight: 700; line-height: 1.25; color: var(--hd-kb-name); }
.hd-kanban-product { display: block; font-size: 0.68rem; color: var(--hd-kb-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-kanban-amt { display: block; font-size: 0.72rem; font-weight: 600; margin-top: 3px; color: var(--hd-kb-amt); }
.hd-kanban-dest { display: block; font-size: 0.62rem; color: var(--hd-kb-muted); margin-top: 2px; opacity: 0.85; }
.hd-kanban-icon-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hd-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.hd-icon-btn:hover { transform: scale(1.06); filter: brightness(1.05); }
.hd-icon-btn:active { transform: scale(0.94); }
.hd-icon-btn--advance {
  color: #ecfdf5;
  background: linear-gradient(180deg, oklch(0.62 0.15 155), oklch(0.48 0.12 155));
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.12) inset, 0 4px 10px oklch(0.4 0.1 155 / 0.35);
}
.hd-icon-btn--remind {
  color: #fff7ed;
  background: linear-gradient(180deg, oklch(0.72 0.14 65), oklch(0.58 0.14 55));
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.1) inset, 0 4px 10px oklch(0.5 0.1 55 / 0.3);
}
.hd-icon-btn--cancel {
  color: oklch(0.75 0.05 25);
  background: oklch(0.28 0.02 255);
  border: 1px solid var(--flow-border);
}
.hd-icon-btn--cancel:hover { color: oklch(0.7 0.18 25); border-color: oklch(0.62 0.18 25 / 0.45); }
.hd-icon-done {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: oklch(0.75 0.12 155);
  background: oklch(0.75 0.12 155 / 0.12);
}
.hd-kanban-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.hd-kanban-btn {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.12s, filter 0.12s;
}
.hd-kanban-actions .hd-kanban-btn { margin-top: 0; }
.hd-kanban-btn:hover { opacity: 0.85; filter: brightness(0.97); }
.hd-kanban-btn--advance { color: var(--hd-kb-btn-advance-fg); background: var(--hd-kb-btn-advance-bg); }
.hd-kanban-btn--cancel { color: var(--hd-kb-btn-cancel-fg); background: var(--hd-kb-btn-cancel-bg); }
.hd-kanban-btn--remind { color: var(--hd-kb-btn-remind-fg); background: var(--hd-kb-btn-remind-bg); }
.hd-kanban-remind { font-size: 0.58rem; font-weight: 600; color: var(--hd-kb-remind-tag); white-space: nowrap; }
.hd-kanban-empty { font-size: 0.72rem; color: var(--hd-kb-empty); text-align: center; padding: 12px 0; margin: 0; }

.hd-side {
  grid-column: 2;
  grid-row: 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.hd-card {
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--hd-surface);
  border: 1px solid var(--hd-surface-border);
  box-shadow: var(--hd-surface-shadow);
}
.hd-card--alert {
  background: var(--hd-alert-bg);
  border-color: var(--hd-alert-border);
}
.hd-card--bulk {
  background: var(--hd-bulk-bg);
  border-color: var(--hd-bulk-border);
}
.hd-feed {
  flex: 1; overflow-y: auto; min-height: 0;
  position: relative;
  padding-left: 4px;
}
.hd-feed::before {
  content: '';
  position: absolute;
  left: 19px; top: 20px; bottom: 12px;
  width: 1px;
  background: #e5e7eb;
}
.hd-feed-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  padding: 8px 4px;
  border-radius: 10px;
  align-items: start;
  position: relative;
}
.hd-feed-row:hover { background: rgba(0,0,0,0.02); }
.hd-feed-av {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 700; color: #fff;
  flex-shrink: 0; letter-spacing: 0;
  position: relative; z-index: 1;
  border: 2px solid var(--hd-surface);
}
.hd-feed-copy { min-width: 0; }
.hd-feed-name-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 1px; min-width: 0;
}
.hd-card--grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hd-feed-title { font-size: 0.76rem; font-weight: 700; color: var(--hd-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-feed-detail { display: block; font-size: 0.67rem; color: var(--hd-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-feed-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.hd-feed-meta time { font-size: 0.58rem; color: var(--hd-text-muted); white-space: nowrap; }
.hd-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hd-accent); flex-shrink: 0; }
.hd-tag {
  font-size: 0.5rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.hd-tag--sale { color: #059669; background: #ecfdf5; border: none; }
.hd-tag--lead { color: #2563eb; background: #eff6ff; border: none; }
.hd-tag--paid { color: #059669; background: #d1fae5; border: none; }
.hd-empty { padding: 8px 0; margin: 0; font-size: 0.72rem; color: var(--hd-text-muted); text-align: left; }

.hd-reminder { display: flex; gap: 12px; align-items: flex-start; }
.hd-reminder-bell {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fef3c7; color: #d97706;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hd-reminder-body { flex: 1; min-width: 0; }
.hd-reminder strong { display: block; font-size: 0.82rem; font-weight: 700; color: var(--hd-text-primary); }
.hd-reminder p { margin: 4px 0 0; font-size: 0.68rem; color: var(--hd-text-secondary); line-height: 1.45; }
.hd-reminder-sub { font-size: 0.65rem !important; color: var(--hd-text-muted) !important; }
.hd-bulk-row { display: flex; align-items: flex-start; gap: 12px; }
.hd-bulk-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: #f3e8ff; color: #7c3aed;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hd-bulk-copy { flex: 1; min-width: 0; }
.hd-bulk-copy strong { display: block; font-size: 0.82rem; font-weight: 700; color: var(--hd-text-primary); margin-bottom: 4px; }
.hd-bulk-copy .hd-empty { text-align: left; padding: 0; }
.hd-kanban-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 28px 0;
  color: var(--hd-kb-empty); font-size: 0.7rem;
  flex: 1;
}
.hd-kanban-empty-state i { opacity: 0.45; color: var(--hd-kb-empty); }
.hd-card-icon { display: inline-block; vertical-align: middle; margin-right: 4px; color: var(--flow-w40); }

.hd-schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 14px;
  background: var(--flow-nested-surface);
  border: 1px solid oklch(1 0 0 / 0.04);
  margin-bottom: 8px;
}
.hd-schedule-row strong { display: block; font-size: 0.78rem; }
.hd-schedule-row span { display: block; font-size: 0.68rem; color: var(--flow-w40); margin-top: 2px; }
.hd-schedule-cancel {
  border: none; background: none;
  font-size: 0.68rem; color: var(--flow-w40);
  text-decoration: underline; cursor: pointer; flex-shrink: 0;
}

.hd-dock {
  grid-column: 1 / -1;
  grid-row: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--hd-surface);
  border: 1px solid var(--hd-surface-border);
  box-shadow: var(--hd-surface-shadow);
  justify-content: center;
  max-width: 540px;
  margin: 4px auto 0;
  width: fit-content;
  justify-self: center;
}
.hd-dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--hd-text-muted);
  cursor: pointer;
  transition: color 0.15s;
  position: relative;
}
.hd-dock-btn svg { width: 16px; height: 16px; }
.hd-dock-btn:hover { color: var(--hd-text-primary); }
.hd-dock-btn.active { color: var(--hd-accent); }
.hd-dock-btn.active::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 18px; height: 2px; border-radius: 2px;
  background: var(--hd-accent);
}

.app-main:has(#page-orders.active) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 16px;
  background: var(--flow-bg);
}
.app-main:has(#page-orders.active)::before {
  display: none;
}
#page-orders.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  max-width: none;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
#page-orders.active #wm-floor,
#page-orders.active #kitchen-board {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
}
.hd-orders-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
}
.hd-orders-page .hd-head {
  flex-shrink: 0;
  margin-bottom: 12px;
}

@media (max-width: 1100px) {
  .hd-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: auto;
  }
  .hd-kanban-wrap { grid-column: 1; grid-row: auto; }
  .hd-side { grid-column: 1; grid-row: auto; }
  .hd-kanban { min-height: 280px; }
  .hd-kpi-ribbon { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .hd-kpi-ribbon { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hd-kanban { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hd-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .app-user-name { display: none; }

  /* WhatsApp strip: stack so buttons never cover the copy */
  .hd-wa-strip {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto;
    gap: 12px;
    padding: 14px;
  }
  .hd-wa-left {
    grid-column: 1;
    align-items: flex-start;
  }
  .hd-wa-right {
    grid-column: 1;
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }
  .hd-wa-right .hd-btn:not(.hd-btn--ghost) {
    flex: 1 1 auto;
    min-height: 42px;
    justify-content: center;
  }
  .hd-wa-stepper {
    display: none;
  }
  .hd-wa-title { font-size: 0.92rem; }
  .hd-wa-desc { font-size: 0.78rem; line-height: 1.35; }
}

/* ══ Light mode ══════════════════════════════════════════════════════════════ */
/* NOTE: prefixed with html[...] (not bare [data-theme]) so specificity always
   beats landing-premium.css's ".flow-app .xxx" rules, which load after this
   file and would otherwise win ties and keep things dark. */
html[data-theme="light"] {
  --flow-bg: #eef0f7;
  --flow-bg2: #e4e7f2;
  --flow-bg3: #d8dcee;
  --flow-surface: rgba(255,255,255,0.92);
  --flow-card: #ffffff;
  --flow-white: #0c0c18;
  --flow-w95: rgba(12,12,24,0.95);
  --flow-w90: rgba(12,12,24,0.9);
  --flow-w80: rgba(12,12,24,0.82);
  --flow-w70: rgba(12,12,24,0.7);
  --flow-w60: rgba(12,12,24,0.6);
  --flow-w55: rgba(12,12,24,0.55);
  --flow-w45: rgba(12,12,24,0.45);
  --flow-w40: rgba(12,12,24,0.42);
  --flow-w25: rgba(12,12,24,0.28);
  --flow-w20: rgba(12,12,24,0.2);
  --flow-w15: rgba(12,12,24,0.14);
  --flow-w12: rgba(12,12,24,0.1);
  --flow-w10: rgba(12,12,24,0.08);
  --flow-w08: rgba(12,12,24,0.06);
  --flow-w06: rgba(12,12,24,0.045);
  --flow-w04: rgba(12,12,24,0.03);
  --flow-border: rgba(12,12,24,0.12);
  --flow-border-hi: oklch(0.45 0.14 195 / 0.4);
  --flow-accent: oklch(0.48 0.14 195);
  --flow-cyan: oklch(0.48 0.14 195);
  --flow-ok: #059669;
  --flow-danger: #dc2626;
  --flow-panel: #ffffff;
  --flow-elevated: #ffffff;
  --flow-overlay: rgba(15, 23, 42, 0.4);
  --flow-scroll-thumb: rgba(0,0,0,0.18);
  --flow-scroll-thumb-hover: rgba(0,0,0,0.28);
  --flow-shadow: 0 8px 40px rgba(0,0,40,0.12);
  --flow-glow: 0 0 60px oklch(0.55 0.14 195 / 0.06);
  --flow-cyan-dim: oklch(0.55 0.14 195 / 0.1);
  /* Form & inset surfaces (light) */
  --flow-input-bg: #ffffff;
  --flow-inset-bg: #f4f6fb;
  --flow-bar-bg: #ffffff;
  --flow-subtle-bg: #f3f5fa;
  --flow-bubble-in-bg: #eef1f8;
  --flow-preview-bg: #f8f9fc;
  --flow-muted-surface: #f3f5fa;
  --flow-nested-surface: #f8f9fc;
  color-scheme: light;
  --hd-kb-col-shadow: 0 2px 10px rgba(12,12,24,0.06);
  --hd-surface: #fff;
  --hd-surface-border: rgba(12,12,24,0.08);
  --hd-surface-shadow: 0 1px 3px rgba(12,12,24,0.04);
  --hd-text-primary: #111827;
  --hd-text-secondary: #6b7280;
  --hd-text-muted: #9ca3af;
  --hd-accent: #2563eb;
  --hd-alert-bg: #fffbeb;
  --hd-alert-border: #fde68a;
  --hd-bulk-bg: #faf5ff;
  --hd-bulk-border: #e9d5ff;
  /* Order pipeline kanban (light) */
  --hd-kb-wrap-bg: transparent;
  --hd-kb-wrap-border: transparent;
  --hd-kb-wrap-shadow: none;
  --hd-kb-title: #111827;
  --hd-kb-link: #2563eb;
  --hd-kb-col-bg: transparent;
  --hd-kb-col-border: transparent;
  --hd-kb-col-shadow: none;
  --hd-kb-col-head-bg: transparent;
  --hd-kb-col-head-text: #374151;
  --hd-kb-col-count-bg: #f3f4f6;
  --hd-kb-col-count-text: #6b7280;
  --hd-kb-col-divider: transparent;
  --hd-kb-col-sep: rgba(12, 12, 24, 0.08);
  --hd-kb-card-bg: #fff;
  --hd-kb-card-border: #f3f4f6;
  --hd-kb-card-shadow: 0 1px 2px rgba(12,12,24,0.03);
  --hd-kb-name: #111827;
  --hd-kb-muted: #9ca3af;
  --hd-kb-amt: #374151;
  --hd-kb-btn-advance-fg: #059669;
  --hd-kb-btn-advance-bg: #ecfdf5;
  --hd-kb-btn-cancel-fg: #2563eb;
  --hd-kb-btn-cancel-bg: #eff6ff;
  --hd-kb-btn-remind-fg: #d97706;
  --hd-kb-btn-remind-bg: #fffbeb;
  --hd-kb-remind-tag: #f97316;
  --hd-kb-empty: #9ca3af;
}
html[data-theme="light"] body {
  background: var(--flow-bg);
  color: var(--flow-white);
}
/* landing-premium.css's ".flow-app" rule sets a hardcoded dark bg/text on
   body — neutralize it explicitly since it shares the .flow-app class. */
html[data-theme="light"] body.flow-app {
  background: var(--flow-bg);
  color: var(--flow-white);
}
html[data-theme="light"] .app-topbar {
  background: #ffffff;
  border-bottom-color: var(--flow-border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-theme="light"] .app-topbar-branch-name {
  color: #111827;
}
html[data-theme="light"] .app-topbar-branch-kicker {
  color: #6b7280;
}
html[data-theme="light"] .app-topbar-branch:hover,
html[data-theme="light"] .app-topbar-branch:focus-visible {
  background: rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .app-sidebar {
  background: rgba(255,255,255,0.8);
  border-right-color: var(--flow-border);
}
html[data-theme="light"] .app-sidebar-toggle {
  color: var(--flow-w60);
}
html[data-theme="light"] .app-sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111;
}
html[data-theme="light"] .app-nav-item.active {
  background: color-mix(in srgb, var(--flow-accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--flow-accent) 22%, transparent);
  color: var(--flow-accent);
}
html[data-theme="light"] .app-nav-item:hover:not(.active) {
  background: rgba(0,0,0,0.045);
}
html[data-theme="light"] .app-nav-label { color: var(--flow-w40); }
html[data-theme="light"] .app-sidebar-footer a { color: var(--flow-w40); }
html[data-theme="light"] .app-user-name { color: var(--flow-w80); }

/* Auth — light mode: dark brand rail + white form card (no floating ghost panels) */
html[data-theme="light"] .flow-auth-brand {
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, oklch(0.55 0.14 195 / 0.18), transparent 55%),
    linear-gradient(160deg, #12141c, #0a0c12);
  border-right-color: rgba(255, 255, 255, 0.06);
}
html[data-theme="light"] .flow-auth-brand h1,
html[data-theme="light"] .flow-auth-brand .flow-logo,
html[data-theme="light"] .flow-auth-brand-text { color: #f5f5f7; }
html[data-theme="light"] .flow-auth-brand h1 em,
html[data-theme="light"] .flow-auth-brand-text > span { color: #5eead4; }
html[data-theme="light"] .flow-auth-brand p,
html[data-theme="light"] .flow-auth-brand-text small,
html[data-theme="light"] .flow-auth-perks li { color: rgba(245, 245, 247, 0.72); }
html[data-theme="light"] .flow-auth-panel-wrap {
  background:
    radial-gradient(700px 420px at 80% 0%, #dce8ff 0%, transparent 55%),
    #eef0f7;
}
html[data-theme="light"] .flow-auth-wrap {
  background: #ffffff !important;
  border: 1px solid rgba(12, 12, 24, 0.08) !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .flow-auth-tabs {
  background: rgba(12, 12, 24, 0.04) !important;
  border-color: rgba(12, 12, 24, 0.08) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .flow-auth-tab { color: rgba(12, 12, 24, 0.45); }
html[data-theme="light"] .flow-auth-tab.active {
  background: #fff !important;
  color: oklch(0.42 0.12 195) !important;
  box-shadow: 0 1px 3px rgba(12, 12, 24, 0.08) !important;
}
html[data-theme="light"] .flow-auth-demo-card {
  background: #fff !important;
  border-color: rgba(12, 12, 24, 0.1) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .flow-auth-demo-card:hover {
  border-color: oklch(0.55 0.12 195 / 0.45) !important;
  background: oklch(0.55 0.12 195 / 0.06) !important;
}
html[data-theme="light"] .app-page-title,
html[data-theme="light"] .hd-title,
html[data-theme="light"] .hd-section-head h2 { color: var(--flow-white); }
html[data-theme="light"] .app-page-desc { color: var(--flow-w60); }
html[data-theme="light"] .app-card,
html[data-theme="light"] .premium-card,
html[data-theme="light"] .flow-qr-card,
html[data-theme="light"] .flow-inbox-list,
html[data-theme="light"] .flow-chat-panel,
html[data-theme="light"] .flow-info-card,
html[data-theme="light"] .flow-connect-info,
html[data-theme="light"] .fx-panel,
html[data-theme="light"] .fx-card,
html[data-theme="light"] .flow-ios-group {
  background: rgba(255,255,255,0.9);
  border-color: var(--flow-border);
}
html[data-theme="light"] .flow-modal.premium-modal {
  background: #ffffff;
  border-color: var(--flow-border);
}

/* Command-center dashboard */
html[data-theme="light"] .hd-wa-strip {
  background: var(--hd-surface);
  border-color: var(--hd-surface-border);
}
html[data-theme="light"] .hd-wa-icon--off { background: rgba(0,0,20,0.05); }
html[data-theme="light"] .hd-kpi {
  background: var(--hd-surface);
  border-color: var(--hd-surface-border);
}
html[data-theme="light"] .hd-kpi-num { color: var(--hd-text-primary); }
html[data-theme="light"] .hd-kanban-card:hover { box-shadow: 0 2px 12px rgba(0,0,40,0.08); }
html[data-theme="light"] .hd-side .hd-card {
  background: var(--hd-surface);
  border-color: var(--hd-surface-border);
}
html[data-theme="light"] .hd-dock {
  background: var(--hd-surface);
  border-color: var(--hd-surface-border);
}
html[data-theme="light"] .hd-dock-btn:hover {
  background: rgba(0,0,20,0.05);
  color: var(--flow-white);
}
html[data-theme="light"] .hd-schedule-row {
  background: rgba(0,0,20,0.03);
  border-color: rgba(0,0,20,0.07);
}
html[data-theme="light"] .app-user-avatar {
  background: rgba(0,0,20,0.07);
  border-color: var(--flow-border);
}
html[data-theme="light"] .app-user-avatar:hover { background: rgba(0,0,20,0.1); }
html[data-theme="light"] .app-user-dropdown {
  background: rgba(255,255,255,0.99);
  border-color: var(--flow-border);
  box-shadow: 0 8px 32px rgba(0,0,40,0.14);
}
html[data-theme="light"] .hd-feed-row:hover { background: rgba(0,0,20,0.04); }
html[data-theme="light"] .hd-btn--ghost {
  background: rgba(0,0,20,0.06);
  color: rgba(12,12,24,0.6);
}
html[data-theme="light"] .hd-btn--ghost:hover { color: var(--flow-white); }
html[data-theme="light"] .hd-btn--primary {
  background: oklch(0.55 0.14 195 / 0.12);
  border-color: oklch(0.55 0.14 195 / 0.3);
  color: oklch(0.42 0.14 195);
}
html[data-theme="light"] .hd-chip { color: var(--flow-w60); border-color: var(--flow-border); }
/* KPI icons keep pastel colors in both themes */
html[data-theme="light"] .hd-wa-bar { background: rgba(0,0,20,0.08); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--flow-scroll-thumb); }
html[data-theme="light"] .hd-wa-icon {
  background: #eff6ff;
  color: #2563eb;
}
html[data-theme="light"] .hd-wa-icon--live { background: #ecfdf5; color: #059669; }
html[data-theme="light"] .hd-wa-icon--scan { background: #eff6ff; color: #2563eb; }
html[data-theme="light"] .hd-wa-icon--off { background: #f3f4f6; color: #9ca3af; }
html[data-theme="light"] .hd-btn--outline {
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
}
html[data-theme="light"] .hd-btn--outline:hover { background: #f9fafb; }
html[data-theme="light"] .hd-btn--ghost {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
}
html[data-theme="light"] .hd-btn--ghost:hover { background: #e5e7eb; color: #374151; }
html[data-theme="light"] .app-main {
  background: #eef0f7;
}
html[data-theme="light"] #page-home {
  background: transparent;
}
/* Dark dashboard — ensure page bg shows through floating kanban */
html[data-theme="dark"] .app-main,
:root:not([data-theme="light"]) .app-main {
  background: var(--flow-bg);
}
html[data-theme="dark"] .app-main:has(#page-orders.active),
:root:not([data-theme="light"]) .app-main:has(#page-orders.active),
html:not([data-theme="light"]) .app-main:has(#page-orders.active) {
  background: var(--flow-bg) !important;
}
html[data-theme="dark"] .hd-wa-step-num,
:root:not([data-theme="light"]) .hd-wa-step-num {
  background: oklch(1 0 0 / 0.06);
  color: var(--flow-w40);
  border-color: oklch(1 0 0 / 0.1);
}
html[data-theme="dark"] .hd-wa-step-item.active .hd-wa-step-num,
html[data-theme="dark"] .hd-wa-step-item.done .hd-wa-step-num,
:root:not([data-theme="light"]) .hd-wa-step-item.active .hd-wa-step-num,
:root:not([data-theme="light"]) .hd-wa-step-item.done .hd-wa-step-num {
  background: var(--hd-accent);
  color: #fff;
  border-color: var(--hd-accent);
}
html[data-theme="dark"] .hd-wa-step-lbl,
:root:not([data-theme="light"]) .hd-wa-step-lbl { color: var(--flow-w40); }
html[data-theme="dark"] .hd-wa-step-item.active .hd-wa-step-lbl,
html[data-theme="dark"] .hd-wa-step-item.done .hd-wa-step-lbl,
:root:not([data-theme="light"]) .hd-wa-step-item.active .hd-wa-step-lbl,
:root:not([data-theme="light"]) .hd-wa-step-item.done .hd-wa-step-lbl {
  color: var(--flow-w80);
}
html[data-theme="dark"] .hd-wa-step-line,
:root:not([data-theme="light"]) .hd-wa-step-line { background: oklch(1 0 0 / 0.08); }
html[data-theme="dark"] .hd-kpi-icon--msgs,
:root:not([data-theme="light"]) .hd-kpi-icon--msgs { background: oklch(0.55 0.12 255 / 0.18); color: oklch(0.72 0.12 255); }
html[data-theme="dark"] .hd-kpi-icon--chats,
:root:not([data-theme="light"]) .hd-kpi-icon--chats { background: oklch(0.72 0.17 145 / 0.14); color: oklch(0.72 0.17 145); }
html[data-theme="dark"] .hd-kpi-icon--leads,
:root:not([data-theme="light"]) .hd-kpi-icon--leads { background: oklch(1 0 0 / 0.06); color: var(--flow-w40); }
html[data-theme="dark"] .hd-kpi-icon--revenue,
:root:not([data-theme="light"]) .hd-kpi-icon--revenue { background: oklch(0.72 0.17 145 / 0.14); color: oklch(0.72 0.17 145); }
html[data-theme="dark"] .hd-kpi-icon--income,
:root:not([data-theme="light"]) .hd-kpi-icon--income { background: oklch(0.55 0.15 305 / 0.18); color: oklch(0.72 0.12 305); }
html[data-theme="dark"] .hd-kpi-icon--stock,
:root:not([data-theme="light"]) .hd-kpi-icon--stock { background: oklch(1 0 0 / 0.06); color: var(--flow-w60); }

/* Light mode — form controls, chat chrome, nested surfaces */
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: rgba(12, 12, 24, 0.38);
}
html[data-theme="light"] .flow-inbox-refresh-btn:hover {
  background: var(--flow-cyan-dim);
  color: oklch(0.42 0.14 195);
}
html[data-theme="light"] .flow-chat-send {
  border-top-color: var(--flow-border);
}
html[data-theme="light"] .flow-btn-primary {
  background: var(--flow-accent);
  color: var(--flow-on-accent, #fff);
}
html[data-theme="light"] .flow-btn-primary:hover {
  background: color-mix(in srgb, var(--flow-accent) 88%, #000);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--flow-accent) 22%, transparent);
}
html[data-theme="light"] .flow-btn-outline {
  background: #fff;
  color: var(--flow-w80);
}
html[data-theme="light"] .flow-btn-outline:hover {
  background: var(--flow-cyan-dim);
  color: oklch(0.42 0.14 195);
}
html[data-theme="light"] .fx-stat,
html[data-theme="light"] .fx-metric,
html[data-theme="light"] .fx-ow-row {
  border-color: var(--flow-border);
}
html[data-theme="light"] .fx-stat:hover,
html[data-theme="light"] .fx-ow-row:hover {
  border-color: var(--flow-border-hi);
}
html[data-theme="light"] .inv-theme-swatch {
  border-color: var(--flow-border);
}
html[data-theme="light"] .inv-theme-swatch:hover {
  border-color: rgba(12, 12, 24, 0.18);
}
html[data-theme="light"] select,
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="month"],
html[data-theme="light"] input[type="datetime-local"] {
  background: var(--flow-input-bg);
  color: var(--flow-white);
}
@media (max-width: 900px) {
  html[data-theme="light"] .app-mobile-nav {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -2px 16px rgba(0, 0, 40, 0.08);
    border-top-color: var(--flow-border);
  }
  html[data-theme="light"] .app-mobile-tab { color: var(--flow-w40); }
  html[data-theme="light"] .app-mobile-tab.active {
    color: var(--flow-accent);
    background: var(--flow-cyan-dim);
  }
  html[data-theme="light"] .app-more-panel {
    background: rgba(255, 255, 255, 0.99);
  }
  html[data-theme="light"] .app-more-sheet-scrim {
    background: var(--flow-overlay);
  }
}

/* ── Light mode — global surfaces that were still hardcoding dark paints ── */
html[data-theme="light"] .flow-toast {
  color: var(--flow-w95);
  background: #fff;
  border-color: var(--flow-border);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .flow-app-dialog {
  background: #fff;
  border-color: var(--flow-border);
  color: var(--flow-w90);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}
html[data-theme="light"] .flow-modal-bg,
html[data-theme="light"] .flow-app-dialog-bg {
  background: var(--flow-overlay);
}
html[data-theme="light"] .app-form-group input,
html[data-theme="light"] .app-form-group select,
html[data-theme="light"] .app-form-group textarea,
html[data-theme="light"] .flow-inventory-search,
html[data-theme="light"] .flow-inventory-filter,
html[data-theme="light"] .flow-inv-name-local,
html[data-theme="light"] .flow-pos-crm-field,
html[data-theme="light"] .flow-pos-input,
html[data-theme="light"] #pos-panel-billing input,
html[data-theme="light"] #pos-panel-billing select,
html[data-theme="light"] #pos-panel-reports input,
html[data-theme="light"] #pos-panel-reports select,
html[data-theme="light"] #pos-panel-rights input,
html[data-theme="light"] #pos-panel-rights select,
html[data-theme="light"] #pos-panel-menu input,
html[data-theme="light"] #pos-panel-crm input,
html[data-theme="light"] #pos-panel-brand input,
html[data-theme="light"] #pos-panel-tables input {
  background: #fff !important;
  color: var(--flow-w90) !important;
  border-color: var(--flow-border) !important;
}
html[data-theme="light"] select option {
  background: #fff;
  color: #0c0c18;
}

/* POS */
html[data-theme="light"] .flow-pos-tab {
  color: var(--flow-w55);
}
html[data-theme="light"] .flow-pos-tab.active {
  color: var(--flow-w95);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--flow-border);
}
html[data-theme="light"] .flow-pos-menu-pane,
html[data-theme="light"] .flow-pos-cart-pane,
html[data-theme="light"] .flow-pos-table-card,
html[data-theme="light"] .flow-pos-online-card,
html[data-theme="light"] .flow-pos-crm-card,
html[data-theme="light"] .flow-pos-menu-manage-card,
html[data-theme="light"] .flow-pos-bill-row,
html[data-theme="light"] .flow-pos-staff-row {
  background: #fff;
  border-color: var(--flow-border);
  color: var(--flow-w90);
}
html[data-theme="light"] .flow-pos-menu-item {
  background: #f7f8fc;
  border-color: var(--flow-border);
  color: var(--flow-w90);
}
html[data-theme="light"] .flow-pos-menu-item:hover:not(:disabled) {
  border-color: var(--flow-accent);
  background: #fff;
}
html[data-theme="light"] .flow-pos-cat {
  background: #fff;
  border-color: var(--flow-border);
  color: var(--flow-w70);
}
html[data-theme="light"] .flow-pos-cat.active {
  background: var(--flow-accent);
  color: #fff;
  border-color: transparent;
}
html[data-theme="light"] .flow-pos-cart-lines {
  background: #f4f6fb;
  border-color: var(--flow-border);
}
html[data-theme="light"] .flow-pos-cart-line {
  border-bottom-color: rgba(12, 12, 24, 0.08);
}
html[data-theme="light"] .flow-pos-cart-line strong {
  color: var(--flow-w95);
}
html[data-theme="light"] .flow-pos-cart-line span {
  color: var(--flow-w55, #64748b);
}
html[data-theme="light"] .flow-pos-cart-line-actions button {
  background: #fff;
  border-color: var(--flow-border);
  color: var(--flow-w90);
}
html[data-theme="light"] .flow-pos-brand-preset {
  background: #fff;
  border-color: var(--flow-border);
  color: var(--flow-w80);
}
html[data-theme="light"] .flow-pos-brand-media {
  background: #f4f6fb;
  border-color: var(--flow-border);
}
html[data-theme="light"] .flow-stat-card {
  background: #fff;
  border-color: var(--flow-border);
}
html[data-theme="light"] .flow-stat-card span { color: var(--flow-w45); }
html[data-theme="light"] .flow-stat-card strong { color: var(--flow-w95); }

@media (max-width: 960px) {
  html[data-theme="light"] .flow-pos-tab {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--flow-border);
    color: var(--flow-w60);
  }
  html[data-theme="light"] .flow-pos-tab.active {
    background: var(--flow-accent);
    color: #fff;
    box-shadow: none;
  }
  html[data-theme="light"] .flow-pos-mobile-billbar,
  html[data-theme="light"] .flow-pos-cart-pane {
    background: #fff;
    border-color: var(--flow-border);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.14);
  }
  html[data-theme="light"] .flow-pos-phone-sessionbar {
    background: var(--flow-bg, #eef0f7);
    border-color: rgba(12, 12, 24, 0.08);
    box-shadow: none;
  }
  html[data-theme="light"] .flow-pos-menu-item.flow-pos-menu-item-dense,
  html[data-theme="light"] .flow-pos-menu-item-dense {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }
  html[data-theme="light"] .flow-pos-menu-item.flow-pos-menu-item-dense:hover:not(:disabled),
  html[data-theme="light"] .flow-pos-menu-item-dense:hover:not(:disabled) {
    background: transparent !important;
    border-color: transparent !important;
  }
  html[data-theme="light"] #pos-panel-billing.pos-phone-session .flow-pos-menu-pane,
  html[data-theme="light"] #pos-panel-billing.pos-phone-session .flow-pos-menu-grid {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  html[data-theme="light"] .flow-pos-mbar-main {
    background: #f4f6fb;
    color: var(--flow-w95);
    border-color: rgba(12, 12, 24, 0.12);
  }
  html[data-theme="light"] .flow-pos-phone-back {
    background: #f4f6fb;
    color: var(--flow-w95);
  }
  html[data-theme="light"] .flow-pos-cart-close {
    background: #f4f6fb;
    color: var(--flow-w70);
  }
  html[data-theme="light"] .flow-pos-phone-billbtn {
    color: #fff;
    box-shadow: none;
    background: oklch(0.48 0.14 195);
    border: 0;
  }
  html[data-theme="light"] .flow-pos-phone-billbtn.is-disabled,
  html[data-theme="light"] .flow-pos-phone-billbtn:disabled {
    color: rgba(255, 255, 255, 0.92);
    border: 0;
    background: oklch(0.72 0.06 195);
  }
  html[data-theme="light"] .flow-pos-mobile-billbar {
    background: #fff;
    border-top-color: rgba(12, 12, 24, 0.1);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }
  html[data-theme="light"] .flow-pos-mbar-settle,
  html[data-theme="light"] .flow-pos-makebill-row #btn-pos-make-bill {
    border-color: var(--flow-accent) !important;
    background: color-mix(in srgb, var(--flow-accent) 14%, #fff) !important;
    color: var(--flow-accent) !important;
  }
  html[data-theme="light"] .flow-pos-floor-card {
    background: #fff;
  }
  html[data-theme="light"] .flow-pos-open-card {
    background: #fff7ed;
    border-color: color-mix(in srgb, #b45309 28%, #e5e7ef);
  }
  html[data-theme="light"] .flow-pos-open-card.active,
  html[data-theme="light"] .flow-pos-open-card:hover {
    background: #fff;
    border-color: var(--flow-accent);
  }
}

html[data-theme="light"] .kitchen-col {
  background: #f7f8fc;
  border-color: var(--flow-border);
  color: var(--flow-w90);
  box-shadow: none;
}
html[data-theme="light"] .kitchen-pay.paid { background: #ecfdf5; color: #047857; }
html[data-theme="light"] .kitchen-pay.unpaid { background: #fffbeb; color: #b45309; }

/*
 * Page shells must stay transparent — painting .wm-floor / panes white+shadow
 * turns the whole Floor/Inventory view into a small floating card on grey.
 */
html[data-theme="light"] .wm-floor,
html[data-theme="light"] .kitchen-board,
html[data-theme="light"] .inv-ops,
html[data-theme="light"] .inv-premium,
html[data-theme="light"] .inv-ops-pane,
html[data-theme="light"] .inv-ops-rail,
html[data-theme="light"] .inv-ops-center,
html[data-theme="light"] .inv-ops-fulfill,
html[data-theme="light"] .inv-place-grid,
html[data-theme="light"] .wm-putaway-grid,
html[data-theme="light"] #page-orders,
html[data-theme="light"] #page-commerce {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* Toolbars / tabs — flush bars, not mini cards */
html[data-theme="light"] .inv-ops-top,
html[data-theme="light"] .wm-station-bar,
html[data-theme="light"] .wm-tabs,
html[data-theme="light"] .inv-prem-tabs,
html[data-theme="light"] .inv-ops-modes {
  background: #fff !important;
  border: 1px solid var(--flow-border) !important;
  box-shadow: none !important;
  color: var(--flow-w90) !important;
}

/* Kitchen chrome: flush on page bg — never white floating cards */
html[data-theme="light"] .kitchen-board,
html[data-theme="light"] .kitchen-board-chrome,
html[data-theme="light"] .kitchen-board-top,
html[data-theme="light"] .kitchen-kpis,
html[data-theme="light"] #page-orders.active #kitchen-board {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
html[data-theme="light"] .kitchen-board-chrome {
  border: none !important;
  border-bottom: 1px solid rgba(12, 12, 24, 0.08) !important;
}
html[data-theme="light"] .kitchen-board-top,
html[data-theme="light"] .kitchen-kpis {
  border: none !important;
}
html[data-theme="light"] .kitchen-kpis span {
  background: rgba(12, 12, 24, 0.04) !important;
  border: 1px solid rgba(12, 12, 24, 0.08) !important;
  color: rgba(12, 12, 24, 0.72) !important;
}
html[data-theme="light"] .kitchen-kpis em {
  color: #0c0c18 !important;
}
html[data-theme="light"] .kitchen-batch {
  border-color: rgba(180, 120, 40, 0.28);
  background: linear-gradient(180deg, rgba(255, 236, 200, 0.95), rgba(255, 248, 235, 0.8));
}
html[data-theme="light"] .kitchen-batch-toggle:hover {
  background: rgba(180, 120, 40, 0.08);
}
html[data-theme="light"] .kitchen-batch-toggle-main strong,
html[data-theme="light"] .kitchen-batch-head strong { color: #8a5a12; }
html[data-theme="light"] .kitchen-batch-summary,
html[data-theme="light"] .kitchen-batch-hint,
html[data-theme="light"] .kitchen-batch-head span { color: #6b7280; }
html[data-theme="light"] .kitchen-batch-chevron {
  border-color: #8a5a12;
}
html[data-theme="light"] .kitchen-batch-row {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .kitchen-batch-row.is-multi {
  border-color: rgba(180, 120, 40, 0.35);
  background: #fff8eb;
}
html[data-theme="light"] .kitchen-batch-row strong { color: #111; }
html[data-theme="light"] .kitchen-batch-row em { color: #8a5a12; }
html[data-theme="light"] .kitchen-batch-row span { color: #6b7280; }
html[data-theme="light"] .app-main:has(#page-orders.active) {
  background: #eef0f7 !important;
}

/* Real content cards only */
html[data-theme="light"] .inv-site-pill,
html[data-theme="light"] .inv-place-side,
html[data-theme="light"] .inv-place-form,
html[data-theme="light"] .inv-locate-card,
html[data-theme="light"] .inv-transit-card,
html[data-theme="light"] .inv-dispatch-card,
html[data-theme="light"] .inv-feed-row,
html[data-theme="light"] .inv-fulfill-chip,
html[data-theme="light"] .inv-stepper li,
html[data-theme="light"] .inv-rack-aisle,
html[data-theme="light"] .inv-rack-shelf,
html[data-theme="light"] .inv-rack-bin,
html[data-theme="light"] .inv-geo-map,
html[data-theme="light"] .inv-map-legend-row,
html[data-theme="light"] .inv-bin-card,
html[data-theme="light"] .flow-inv-card,
html[data-theme="light"] .flow-commerce-card,
html[data-theme="light"] .flow-wh-locate-result,
html[data-theme="light"] .flow-wh-side,
html[data-theme="light"] .flow-wh-tray-card,
html[data-theme="light"] .flow-wh-item,
html[data-theme="light"] .flow-wh-loc-item,
html[data-theme="light"] .wm-pick-card,
html[data-theme="light"] .wm-putaway-panel,
html[data-theme="light"] .wm-putaway-card,
html[data-theme="light"] .wm-form-card,
html[data-theme="light"] .wm-wave-card,
html[data-theme="light"] .wm-wave-line,
html[data-theme="light"] .wm-ex-row,
html[data-theme="light"] .wm-locate-result,
html[data-theme="light"] .wm-bin-btn,
html[data-theme="light"] .wm-bin,
html[data-theme="light"] .wm-card,
html[data-theme="light"] .kitchen-card {
  background: #fff !important;
  border-color: var(--flow-border) !important;
  color: var(--flow-w90) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .kitchen-timer {
  background: #f3f4f6;
  color: #111827;
}
html[data-theme="light"] .kitchen-timer.is-warn {
  background: #fffbeb;
  color: #b45309;
}
html[data-theme="light"] .kitchen-timer.is-late {
  background: #fef2f2;
  color: #b91c1c;
}
html[data-theme="light"] .kitchen-call-name {
  background: color-mix(in srgb, var(--flow-accent) 10%, #fff);
  border-color: color-mix(in srgb, var(--flow-accent) 35%, var(--flow-border));
}
html[data-theme="light"] .kitchen-call-name span {
  color: color-mix(in srgb, var(--flow-accent) 70%, #0f172a);
}
html[data-theme="light"] .kitchen-call-name strong {
  color: #0f172a;
}
html[data-theme="light"] .inv-rack-bin.has-stock,
html[data-theme="light"] .inv-rack-bin:hover,
html[data-theme="light"] .wm-bin-btn.has-stock,
html[data-theme="light"] .wm-bin-btn:hover {
  background: #f4f6fb !important;
  border-color: color-mix(in srgb, var(--flow-accent) 35%, var(--flow-border)) !important;
  color: var(--flow-w95) !important;
}
html[data-theme="light"] .inv-prem-tabs button,
html[data-theme="light"] .inv-ops-modes button,
html[data-theme="light"] .wm-tabs button,
html[data-theme="light"] .wm-tab {
  color: var(--flow-w70) !important;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-theme="light"] .inv-prem-tabs button.active,
html[data-theme="light"] .inv-ops-modes button.active,
html[data-theme="light"] .wm-tabs button.active,
html[data-theme="light"] .wm-tab.active {
  background: var(--flow-cyan-dim) !important;
  color: var(--flow-accent) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .inv-site-pill,
html[data-theme="light"] .inv-site-pill.active {
  background: #fff !important;
  border-color: var(--flow-border) !important;
  color: var(--flow-w90) !important;
}
html[data-theme="light"] .inv-site-pill.active {
  border-color: var(--flow-accent) !important;
  color: var(--flow-accent) !important;
  background: var(--flow-cyan-dim) !important;
}
html[data-theme="light"] .flow-wh-locate-bins li,
html[data-theme="light"] .flow-wh-locate-head .ph,
html[data-theme="light"] .inv-ops-kpis,
html[data-theme="light"] .wm-field > span {
  color: var(--flow-w60) !important;
}
html[data-theme="light"] .wm-field .flow-inventory-filter,
html[data-theme="light"] .wm-field .flow-inventory-search,
html[data-theme="light"] .wm-field input,
html[data-theme="light"] .wm-putaway-qty input,
html[data-theme="light"] .inv-ops-scan .flow-inventory-search,
html[data-theme="light"] .inv-ops-scan .flow-inventory-filter,
html[data-theme="light"] .inv-place-form input,
html[data-theme="light"] .inv-place-form select,
html[data-theme="light"] .flow-wh input,
html[data-theme="light"] .flow-wh select {
  background: #fff !important;
  color: var(--flow-w90) !important;
  border-color: var(--flow-border) !important;
}
html[data-theme="light"] #inv-pane-map .leaflet-popup-content-wrapper,
html[data-theme="light"] #inv-pane-map .leaflet-popup-tip {
  background: #fff !important;
  color: var(--flow-w90) !important;
}
html[data-theme="light"] .kitchen-col {
  background: #f7f8fc !important;
}
html[data-theme="light"] .kitchen-bill-sent,
html[data-theme="light"] .kitchen-round {
  background: #ecfdf5 !important;
  color: #047857 !important;
}
/* Agency / SMB / restaurant shared finance cards */
html[data-theme="light"] .flow-books-grid .app-card,
html[data-theme="light"] .flow-leads-layout .app-card,
html[data-theme="light"] .flow-invoice-toolbar,
html[data-theme="light"] .flow-gst-card,
html[data-theme="light"] .fx-layout .fx-panel,
html[data-theme="light"] .fx-layout .fx-card,
html[data-theme="light"] .fx-rail-card,
html[data-theme="light"] .fx-feed,
html[data-theme="light"] .fx-bento > * {
  background: #fff !important;
  border-color: var(--flow-border) !important;
  color: var(--flow-w90) !important;
}

/* Inbox / leads leftovers */
html[data-theme="light"] .flow-chat-bubble.out {
  background: var(--flow-cyan-dim);
  color: var(--flow-w95);
}
html[data-theme="light"] .flow-chat-bubble.in {
  background: var(--flow-bubble-in-bg);
  color: var(--flow-w95);
}
html[data-theme="light"] .flow-lead-card,
html[data-theme="light"] .flow-books-card,
html[data-theme="light"] .flow-invoice-row {
  background: #fff;
  border-color: var(--flow-border);
}

/* Dropdowns / menus */
html[data-theme="light"] .app-user-dropdown,
html[data-theme="light"] .flow-dropdown,
html[data-theme="light"] .flow-popover {
  background: #fff;
  border-color: var(--flow-border);
  color: var(--flow-w90);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .app-user-dropdown button {
  background: transparent;
  color: var(--flow-w80);
}
html[data-theme="light"] .app-user-dropdown button:hover,
html[data-theme="light"] .app-user-dropdown button:focus-visible {
  background: rgba(0, 0, 20, 0.05);
  color: var(--flow-white);
}

/* Non-blocking toast — top-right so it doesn’t cover the calendar / desk */
.flow-toast-host {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 24px));
}
.flow-toast {
  pointer-events: auto;
  cursor: pointer;
  max-width: min(92vw, 360px);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--flow-w95);
  background: var(--flow-elevated);
  border: 1px solid color-mix(in srgb, var(--flow-accent) 28%, var(--flow-border));
  box-shadow: var(--flow-shadow);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateX(12px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.flow-toast.is-in {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.flow-toast--ok { border-color: oklch(0.72 0.17 145 / 0.55); }
.flow-toast--warn { border-color: oklch(0.82 0.14 95 / 0.6); }
.flow-toast--err { border-color: oklch(0.62 0.2 25 / 0.6); }

/* Floating Fill photos progress */
.flow-fill-prog {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 100050;
  width: min(320px, calc(100vw - 28px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.flow-fill-prog.is-on {
  opacity: 1;
  transform: translateY(0);
}
.flow-fill-prog[hidden] { display: none !important; }
.flow-fill-prog-card {
  pointer-events: auto;
  padding: 12px 14px 11px;
  border-radius: 14px;
  background: var(--flow-elevated, #14141c);
  border: 1px solid var(--flow-border);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}
.flow-fill-prog-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.flow-fill-prog-top strong {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--flow-w95);
}
.flow-fill-prog-count {
  font-family: var(--flow-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  color: var(--flow-w55);
}
.flow-fill-prog-track {
  height: 6px;
  border-radius: 999px;
  background: var(--flow-w08, rgba(255,255,255,0.08));
  overflow: hidden;
}
.flow-fill-prog-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--flow-accent, #2dd4bf), color-mix(in srgb, var(--flow-accent, #2dd4bf) 70%, #34d399));
  transition: width 0.35s ease;
}
.flow-fill-prog-bar.is-indeterminate {
  width: 38% !important;
  animation: flow-fill-prog-slide 1.15s ease-in-out infinite;
}
@keyframes flow-fill-prog-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.flow-fill-prog-label {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--flow-w60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-theme="light"] .flow-fill-prog-card {
  background: #fff;
  border-color: rgba(12, 12, 24, 0.12);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
}
html[data-theme="light"] .flow-fill-prog-top strong { color: #0c0c18; }
html[data-theme="light"] .flow-fill-prog-label { color: rgba(12, 12, 24, 0.55); }
html[data-theme="light"] .flow-fill-prog-track { background: rgba(12, 12, 24, 0.08); }

@media (max-width: 640px) {
  .flow-fill-prog {
    left: 14px;
    right: 14px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}

/* Non-blocking "already in inventory" popup (with product image) */
.flow-inv-exists-pop {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 4, 8, 0.62);
  backdrop-filter: blur(6px);
}
.flow-inv-exists-pop.open {
  display: flex;
  animation: flowExistsFade 0.18s ease;
}
@keyframes flowExistsFade { from { opacity: 0; } to { opacity: 1; } }
.flow-inv-exists-card {
  position: relative;
  width: min(94vw, 380px);
  padding: 22px 20px 18px;
  border-radius: 20px;
  text-align: center;
  color: var(--flow-white, #eef);
  background: var(--flow-elevated);
  border: 1px solid color-mix(in srgb, var(--flow-yellow) 35%, var(--flow-border));
  box-shadow: var(--flow-shadow);
  animation: flowExistsPop 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes flowExistsPop {
  from { transform: translateY(16px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.flow-inv-exists-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--flow-white, #eef);
  background: var(--flow-inset-bg);
}
.flow-inv-exists-media {
  width: 128px;
  height: 128px;
  margin: 4px auto 14px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--flow-inset-bg);
  border: 1px solid var(--flow-border);
}
.flow-inv-exists-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.flow-inv-exists-ph {
  font-size: 52px;
  font-weight: 700;
  color: oklch(0.82 0.14 195);
}
.flow-inv-exists-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: oklch(0.82 0.14 95);
}
.flow-inv-exists-name {
  display: block;
  margin: 6px 0 4px;
  font-size: 20px;
  line-height: 1.25;
}
.flow-inv-exists-meta {
  display: block;
  font-size: 13px;
  opacity: 0.8;
}
.flow-inv-exists-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.flow-inv-exists-actions .flow-btn { flex: 1; }

/* ── Restaurant POS ── */
.flow-pos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1rem;
}
.flow-pos-tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 0.55rem 0.9rem; border-radius: 10px; font: inherit; font-weight: 600;
  color: var(--flow-w50); font-size: 0.88rem;
  white-space: nowrap;
}
.flow-pos-tab .pos-tab-sm { display: none; }
.flow-pos-tab:hover { color: var(--flow-w80); background: var(--flow-w10); }
.flow-pos-tab.active {
  color: var(--flow-w95); background: var(--flow-w12);
  box-shadow: inset 0 0 0 1px var(--flow-w15);
}
/* Floor mode: Team stays owner-PIN only. Reports / Bills follow Access checkboxes (applyStaffAccess). */
body.flow-owner-locked .flow-pos-tab[data-pos-tab="rights"],
body.flow-owner-locked #pos-panel-rights {
  display: none !important;
}

/* Day / month period toolbar (Money ledger + POS reports) */
.flow-period-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin: 0 0 14px;
}
.flow-period-toggle {
  display: inline-flex;
  padding: 2px;
  border-radius: 10px;
  background: var(--flow-w08, rgba(255,255,255,0.06));
  border: 1px solid var(--flow-w12, rgba(255,255,255,0.1));
}
.flow-period-btn {
  border: 0;
  background: transparent;
  color: var(--flow-w60, rgba(255,255,255,0.55));
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.flow-period-btn.is-active {
  background: var(--flow-w14, rgba(255,255,255,0.12));
  color: var(--flow-w95, #fff);
}
.flow-period-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.flow-period-pickers label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--flow-w55, rgba(255,255,255,0.5));
}
.flow-period-day-wrap[hidden],
.flow-period-month-wrap[hidden],
.flow-month-nav[hidden] {
  display: none !important;
}
.flow-money-panel[hidden] { display: none !important; }
.flow-money-panel { margin-top: 4px; }
.flow-pos-bill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
}
.flow-pos-bill-sent {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #86efac;
}
.flow-pos-bills-list--all {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(70vh, 720px);
  overflow: auto;
}
/* Never squash bill cards — scroll the list instead */
.flow-pos-bills-list--all > .flow-pos-bill-row {
  flex: 0 0 auto;
}
.flow-pos-chrome-btn {
  display: none;
  position: relative;
  margin-left: 0;
  padding: 0.45rem !important;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px !important;
  overflow: visible;
}
.flow-pos-chrome-btn.is-open {
  color: var(--flow-w95);
  border-color: var(--flow-w20);
  background: var(--flow-muted-surface);
}
.flow-pos-chrome-btn .flow-pos-alerts-badge {
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 0.58rem;
  box-shadow: 0 0 0 2px var(--flow-bar-bg, #0c0c10);
}
.flow-pos-chrome-cluster {
  display: none;
  margin-left: auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}
#btn-pos-refresh-mini {
  display: inline-flex;
}
.flow-pos-panel { display: none; }
.flow-pos-panel.active { display: block; }
.flow-pos-mobile-billbar,
.flow-pos-cart-backdrop,
.flow-pos-cart-sheet-handle { display: none; }

/* Hide accidental FlowSelect wrappers around sync-only selects */
#pos-panel-billing > .flow-select,
#pos-panel-billing > select[hidden] { display: none !important; }

.flow-pos-floor-wrap {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flow-pos-floor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.flow-pos-floor-tables,
.flow-pos-floor-channels {
  display: contents;
}
.flow-pos-floor-empty {
  grid-column: 1 / -1;
}
.flow-pos-phone-sessionbar,
.flow-pos-phone-floorhead,
.flow-pos-more-toggle {
  display: none;
}
.flow-pos-floor-card {
  appearance: none;
  border: 1px solid var(--flow-border);
  background: var(--flow-card);
  color: var(--flow-w90);
  border-radius: 10px;
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.flow-pos-floor-card:hover {
  border-color: color-mix(in srgb, var(--flow-accent) 50%, transparent);
}
.flow-pos-floor-card.active {
  border-color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 16%, var(--flow-card));
  font-weight: 700;
}
.flow-pos-floor-card.occupied:not(.active) {
  border-color: color-mix(in srgb, #b45309 45%, var(--flow-border));
}
.flow-pos-floor-card.has-pending {
  box-shadow: inset 0 0 0 1.5px rgba(180, 83, 9, 0.45);
}
.flow-pos-floor-card.occupied.has-pending .floor-sub {
  color: #c2410c;
  font-weight: 750;
}
.flow-pos-floor-card .floor-no {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}
.flow-pos-floor-card .floor-sub {
  font-size: 0.68rem;
  color: var(--flow-w45);
  font-weight: 600;
}
.flow-pos-floor-card.free .floor-sub { display: none; }
.flow-pos-floor-card.occupied .floor-sub { color: #b45309; }
.flow-pos-floor-card.channel { padding: 0 14px; }
.flow-pos-floor-card.channel .floor-sub { display: none; }
.flow-pos-floor-card.split .floor-party-bits {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}
.flow-pos-floor-card .floor-party {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--flow-w12, rgba(255,255,255,.12));
  color: var(--flow-w80, #cbd5e1);
  cursor: pointer;
}
.flow-pos-floor-card .floor-party.on {
  background: #b45309;
  color: #fff7ed;
}
.flow-pos-party-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 8px;
}
.flow-pos-party-chip {
  border: 1px solid var(--flow-w15, rgba(255,255,255,.15));
  background: var(--flow-w08, rgba(255,255,255,.06));
  color: var(--flow-w90, #e2e8f0);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}
.flow-pos-party-chip.active {
  border-color: #b45309;
  background: rgba(180, 83, 9, 0.25);
  color: #ffedd5;
}
.flow-pos-cart-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  flex: 0 1 auto;
  min-height: 40px;
  height: auto;
  max-width: 100%;
  justify-content: flex-end;
}
.flow-pos-cart-actions #btn-pos-split-table[hidden],
.flow-pos-cart-actions #btn-pos-move-bill[hidden] {
  display: none !important;
}
.flow-pos-cart-actions #btn-pos-move-bill {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.flow-pos-cart-close,
.flow-pos-cart-actions #btn-pos-split-table {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
/* Sheet-only control — desktop cart is a side panel, not a dismissible sheet */
.flow-pos-cart-close {
  display: none;
  appearance: none;
  border: 1px solid transparent;
  background: var(--flow-w10);
  color: var(--flow-w80);
}
.flow-pos-cart-actions #btn-pos-split-table {
  border: 1px solid var(--flow-border);
  background: var(--flow-w06);
  color: var(--flow-w90);
}
.flow-pos-floor-sep {
  width: 1px;
  height: 22px;
  background: var(--flow-border);
  margin: 0 2px;
  flex: 0 0 1px;
}
.flow-pos-open-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.flow-pos-open-panel[hidden] { display: none !important; }
.flow-pos-open-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 0;
}
.flow-pos-open-head strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--flow-w90);
}
.flow-pos-open-head span {
  font-size: 0.72rem;
  color: var(--flow-w50);
  font-weight: 600;
}
.flow-pos-open-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flow-pos-open-card {
  appearance: none;
  border: 1px solid color-mix(in srgb, #b45309 35%, var(--flow-border));
  background: color-mix(in srgb, #b45309 7%, var(--flow-card));
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--flow-w90);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: left;
  width: 100%;
}
.flow-pos-open-card.active,
.flow-pos-open-card:hover {
  border-color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 10%, var(--flow-card));
}
.flow-pos-open-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.flow-pos-open-card-top strong {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.flow-pos-open-card-top em {
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 800;
  color: #b45309;
}
.flow-pos-open-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-pos-open-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--flow-w75);
  line-height: 1.25;
}
.flow-pos-open-items li span { flex: 1 1 auto; min-width: 0; }
.flow-pos-open-items li em {
  font-style: normal;
  font-weight: 700;
  color: var(--flow-w55);
  flex: 0 0 auto;
}
.flow-pos-open-rm {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid oklch(0.55 0.15 25 / 0.45);
  background: oklch(0.35 0.08 25 / 0.35);
  color: #f87171;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.flow-pos-open-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--flow-w40);
}
.flow-pos-open-items .flow-pos-open-more {
  color: var(--flow-w45);
  font-size: 0.72rem;
  font-weight: 600;
}
.flow-pos-open-empty-items {
  margin: 0;
  font-size: 0.78rem;
  color: var(--flow-w50);
}
.flow-pos-open-meta {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--flow-w50);
}

.flow-pos-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 14px;
  min-height: min(70vh, 720px);
}
.flow-pos-menu-pane,
.flow-pos-cart-pane {
  background: var(--flow-card);
  border: 1px solid var(--flow-border);
  border-radius: 16px;
  padding: 14px;
}
.flow-pos-dest-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 10px;
  height: 28px;
  border-radius: 999px;
  background: var(--flow-subtle-bg);
  color: var(--flow-w70);
  white-space: nowrap;
  line-height: 1;
}
.flow-pos-dest-chip[hidden] { display: none !important; }
.flow-pos-cart-meta-slim {
  grid-template-columns: 1fr 1fr !important;
}
/* Staff picker removed from bill sheet — session already identifies staff */
.flow-pos-cart-meta #pos-staff,
.flow-pos-cart-meta-slim #pos-staff,
#pos-cart-pane #pos-staff {
  display: none !important;
}
/* Hidden via JS when cart is empty */
#btn-pos-kitchen[hidden],
#btn-pos-mbar-kitchen[hidden] {
  display: none !important;
}
  .flow-pos-makebill-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr auto;
    gap: 8px;
  }
  .flow-pos-makebill { font-weight: 700; }
  /* Phone/cart sheet: kitchen is the primary action */
  .flow-pos-makebill-row #btn-pos-kitchen { font-weight: 700; }
.flow-pos-ordered {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 6px;
}
.flow-pos-ordered-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0 8px;
  font-size: 0.78rem;
  color: var(--flow-w55);
  border-bottom: 1px solid var(--flow-border);
  margin-bottom: 2px;
}
.flow-pos-ordered-head strong { color: var(--flow-w80); font-size: 0.8rem; }
.flow-pos-ordered-head-new { border-bottom: 0; margin-top: 8px; }
.flow-pos-cart-line-sent { opacity: 0.95; }
.flow-pos-cart-line-sent strong { font-weight: 600; }
.flow-pos-cart-line-sent .flow-pos-cart-line-actions button {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--flow-border);
  background: var(--flow-inset-bg, var(--flow-w06));
  color: var(--flow-w90);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.flow-pos-cart-line-sent .flow-pos-sent-remove {
  color: #f87171;
  border-color: oklch(0.55 0.15 25 / 0.45);
}
.flow-pos-pay-grid.is-open {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--flow-accent) 45%, var(--flow-border));
  background: color-mix(in srgb, var(--flow-accent) 10%, var(--flow-card));
}
.flow-pos-pay-label {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--flow-w80);
}
.flow-pos-pay-sub {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.72rem;
  color: var(--flow-w50);
}
.flow-pos-pay-choice {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.flow-pos-pay-choice .flow-btn {
  min-height: 44px;
  width: 100%;
  font-weight: 700;
}
.flow-pos-pay-upi {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.flow-pos-pay-upi .flow-pos-pay-sub {
  grid-column: 1 / -1;
}
.flow-pos-pay-upi #btn-pos-pay-back {
  grid-column: 1 / -1;
}
.flow-pos-pay-upi[hidden],
.flow-pos-pay-choice[hidden] { display: none !important; }
.flow-pos-pay-grid.is-open #btn-pos-pay-cancel { grid-column: 1 / -1; }
.flow-pos-pay-grid.is-open.pos-pay-upi-open {
  grid-template-columns: 1fr 1fr;
}
.pos-upi-qr-bg {
  z-index: 1300 !important;
}
.pos-upi-qr-bg .flow-modal {
  max-width: 340px;
  text-align: center;
}
.pos-upi-qr-amount {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--flow-w95, #f2f5fb);
  text-align: center;
}
.pos-upi-qr-meta {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--flow-w50);
  word-break: break-all;
  text-align: center;
}
.pos-upi-qr-img {
  display: block;
  width: min(220px, 70vw);
  height: auto;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}
.pos-upi-qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.flow-pos-pay-upi-qr {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.flow-pos-pay-upi-qr[hidden] { display: none !important; }
.flow-pos-pay-upi-qr .pos-upi-qr-img {
  width: min(200px, 56vw);
  margin-bottom: 4px;
}
.flow-pos-pay-upi-qr #btn-pos-pay-upi-received {
  min-height: 44px;
  font-weight: 700;
}
/* Alerts / cash prompt must sit above the portaled bill sheet */
body.pos-cart-open #app-dialog.flow-modal-bg {
  z-index: 1400 !important;
}
/* Success/error dialog must beat the settle spinner (otherwise UI deadlocks) */
body.pos-pay-loading #app-dialog.flow-modal-bg {
  z-index: 5000 !important;
}
body.pos-pay-open .flow-pos-makebill-row {
  display: none !important;
}
#pos-pay-methods .flow-btn.is-busy,
#pos-pay-methods .flow-btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}
/* Below #app-dialog so success/error alerts are never trapped under the spinner */
.flow-pos-pay-loading {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, #0b0d12 72%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.flow-pos-pay-loading[hidden] { display: none !important; }
.flow-pos-pay-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: min(260px, 88%);
  padding: 28px 22px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--flow-accent) 42%, var(--flow-border));
  background: var(--flow-card, #1a1d24);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.flow-pos-pay-loading-card .flow-loading-ring,
.flow-pos-pay-loading-card .flow-wa-radial {
  width: 52px;
  height: 52px;
  border-width: 3px;
  border-color: oklch(0.82 0.14 195 / 0.22);
  border-top-color: var(--flow-accent, #2dd4bf);
}
.flow-pos-pay-loading-card .flow-loading-label {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--flow-w90, #e8ecf4);
}
#pos-cart-pane { position: relative; }
body.pos-pay-loading {
  overflow: hidden;
}
body.pos-pay-loading #pos-pay-methods,
body.pos-pay-loading .flow-pos-makebill-row,
body.pos-pay-loading #page-pos {
  pointer-events: none;
}
html[data-theme="light"] .flow-pos-pay-loading {
  background: color-mix(in srgb, #f4f6f8 78%, transparent);
}
html[data-theme="light"] .flow-pos-pay-loading-card {
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
html[data-theme="light"] .flow-pos-pay-loading-card .flow-loading-label {
  color: #0f172a;
}
.flow-pos-menu-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.flow-pos-menu-tools { width: 100%; }
.flow-pos-search-toggle { display: none !important; }
.flow-pos-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-pos-subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.flow-pos-subcats[hidden] { display: none !important; }
.flow-pos-cat {
  appearance: none; border: 1px solid var(--flow-w12); background: transparent;
  color: var(--flow-w70); border-radius: 999px; padding: 0.3rem 0.7rem;
  font: inherit; font-size: 0.78rem; cursor: pointer;
}
.flow-pos-cat.active { background: var(--flow-accent); color: #111; border-color: transparent; font-weight: 700; }
.flow-pos-subcat {
  appearance: none;
  border: 1px solid var(--flow-w12);
  background: var(--flow-w06);
  color: var(--flow-w60);
  border-radius: 8px;
  padding: 0.22rem 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}
.flow-pos-subcat.active {
  background: color-mix(in srgb, var(--flow-accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--flow-accent) 55%, transparent);
  color: var(--flow-w90);
  font-weight: 600;
}
.flow-pos-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: min(68vh, 780px);
  overflow: auto;
}
.flow-pos-oos {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--flow-card, #1a1d24) 88%, #000);
  border: 1px solid var(--flow-w12, rgba(255,255,255,0.12));
  color: var(--flow-w60, #9aa3b2);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
}
.flow-pos-oos-input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #ef4444;
  cursor: pointer;
}
.flow-pos-oos:has(.flow-pos-oos-input:checked) {
  color: #fca5a5;
  border-color: color-mix(in srgb, #ef4444 45%, var(--flow-border, #333));
}
/* Never overlay Out on phone dense +/− steppers */
.flow-pos-menu-item-dense .flow-pos-oos { display: none !important; }
@media (max-width: 720px) {
  .flow-pos-oos { display: none !important; }
}
.flow-pos-menu-item {
  position: relative;
  appearance: none; border: 1px solid var(--flow-border); background: var(--flow-subtle-bg);
  border-radius: 14px; padding: 0 0 12px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; color: var(--flow-w90); font: inherit;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s ease;
  box-sizing: border-box;
}
.flow-pos-menu-item:hover:not(:disabled):not(.has-sizes) { border-color: var(--flow-accent); transform: translateY(-1px); }
.flow-pos-menu-item.has-sizes { cursor: default; }
.flow-pos-menu-item.has-sizes:hover { border-color: var(--flow-accent); }
.flow-pos-menu-item:disabled,
.flow-pos-menu-item.out { opacity: 0.72; }
.flow-pos-menu-item.out em { color: #f87171; font-weight: 600; }
.flow-pos-menu-thumb {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  background: var(--flow-w08); margin-bottom: 2px;
}
.flow-pos-menu-thumb.ph {
  background:
    linear-gradient(135deg, var(--flow-subtle-bg), var(--flow-inset-bg)),
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--flow-accent) 18%, transparent), transparent 55%);
}
.flow-pos-menu-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  min-width: 0;
}
.flow-pos-menu-copy strong { font-size: 1rem; line-height: 1.3; margin-top: 6px; }
.flow-pos-menu-copy em { font-style: normal; font-size: 0.75rem; color: var(--flow-w45); }
.flow-pos-menu-price {
  padding: 0 12px;
  color: var(--flow-accent);
  font-weight: 700;
  font-size: 0.98rem;
}

/* Move bill / move item picker — must sit above POS chrome */
.pos-move-table-bg {
  z-index: 1300;
}
.pos-move-table-bg.open {
  display: flex !important;
}
.pos-move-table-modal { max-width: min(520px, 94vw); width: 100%; }
.pos-move-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-height: min(50vh, 360px);
  overflow: auto;
}
.pos-move-table-btn {
  appearance: none;
  border: 1px solid var(--flow-border);
  background: var(--flow-subtle-bg);
  color: var(--flow-w90);
  border-radius: 10px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.pos-move-table-btn:hover { border-color: var(--flow-accent); }
.pos-move-table-btn.is-occ { border-color: color-mix(in srgb, #b45309 40%, var(--flow-border)); }
.pos-move-table-btn.is-split { border-color: color-mix(in srgb, var(--flow-accent) 35%, var(--flow-border)); }
.pos-move-table-btn strong { font-size: 0.88rem; font-weight: 750; }
.pos-move-table-btn span { font-size: 0.72rem; color: var(--flow-w50); font-weight: 600; }
.flow-pos-sent-move {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 0;
  background: color-mix(in srgb, var(--flow-accent) 14%, transparent);
  color: var(--flow-accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.flow-pos-sent-move:hover {
  background: color-mix(in srgb, var(--flow-accent) 24%, transparent);
}
#btn-pos-move-bill[hidden] { display: none !important; }

/* Owner HQ — sidebar page (not POS more-hub) */
.flow-owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  max-width: 960px;
  width: 100%;
}
.flow-owner-card {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  min-height: 132px;
  width: 100%;
  margin: 0;
  padding: 18px 16px 16px;
  border-radius: 16px;
  border: 1px solid var(--flow-border, rgba(255,255,255,0.12));
  background: var(--flow-surface, rgba(255,255,255,0.04));
  color: var(--flow-w95, #f5f5f7);
  text-align: left;
  cursor: pointer;
  font: inherit;
  box-shadow: none;
}
.flow-owner-card:hover {
  border-color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 10%, var(--flow-surface, transparent));
}
.flow-owner-card i,
.flow-owner-card svg {
  color: var(--flow-accent);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.flow-owner-card strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
}
.flow-owner-card span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--flow-w50, rgba(255,255,255,0.5));
}
html[data-theme="light"] .flow-owner-card {
  background: #ffffff;
  border-color: rgba(12, 12, 24, 0.12);
  color: #0c0c18;
  box-shadow: 0 1px 2px rgba(12, 12, 24, 0.05);
}
html[data-theme="light"] .flow-owner-card:hover {
  border-color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 8%, #ffffff);
}
html[data-theme="light"] .flow-owner-card span {
  color: rgba(12, 12, 24, 0.52);
}

.app-sidebar {
  height: 100%;
  max-height: 100%;
}

/* Restaurant POS — lean top strip; Setup hub holds QR / look / desk */
@media (min-width: 901px) {
  body.flow-acct-restaurant .flow-pos-tab.flow-pos-tab-more {
    display: none !important;
  }
  body.flow-acct-restaurant .flow-pos-tab.flow-pos-tab-more.active {
    display: inline-flex !important;
  }
  body.flow-acct-restaurant .flow-pos-more-toggle,
  body.flow-acct-restaurant #btn-pos-more-tabs {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  body.flow-acct-restaurant #btn-pos-more-tabs .pos-tab-lg {
    display: inline !important;
  }
  body.flow-acct-restaurant #btn-pos-more-tabs .pos-tab-sm {
    display: none !important;
  }
  body.flow-acct-restaurant .flow-pos-more-toggle.active {
    background: var(--flow-accent) !important;
    color: #111 !important;
  }
  body.flow-acct-restaurant .flow-pos-more-hub {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 8px 4px 20px;
    min-height: min(60vh, 520px);
  }
  body.flow-acct-restaurant .flow-pos-more-hub-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  body.flow-acct-restaurant .flow-pos-more-hub-head strong {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--flow-w95);
    letter-spacing: -0.02em;
  }
  body.flow-acct-restaurant .flow-pos-more-hub-head span {
    font-size: 0.82rem;
    color: var(--flow-w50);
    font-weight: 600;
  }
  body.flow-acct-restaurant .flow-pos-more-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-width: 880px;
    width: 100%;
  }
  body.flow-acct-restaurant .flow-pos-more-card {
    appearance: none;
    border: 1px solid var(--flow-border);
    background: var(--flow-subtle-bg);
    border-radius: 14px;
    padding: 18px 16px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 4px;
    text-align: left;
    cursor: pointer;
    color: var(--flow-w90);
    font: inherit;
  }
  body.flow-acct-restaurant .flow-pos-more-card:hover {
    border-color: var(--flow-accent);
    background: color-mix(in srgb, var(--flow-accent) 10%, var(--flow-subtle-bg));
  }
  body.flow-acct-restaurant .flow-pos-more-card i {
    color: var(--flow-accent);
    margin-bottom: 8px;
  }
  body.flow-acct-restaurant .flow-pos-more-card strong {
    font-size: 0.98rem;
    font-weight: 800;
  }
  body.flow-acct-restaurant .flow-pos-more-card span {
    font-size: 0.75rem;
    color: var(--flow-w50);
    font-weight: 600;
    line-height: 1.3;
  }
}

/* Restaurant POS — one category, large readable tiles, breathing room (Petpooja density) */
body.flow-acct-restaurant .app-main:has(#page-pos.active) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 14px;
}
body.flow-acct-restaurant #page-pos.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
/*
 * Billing needs the lock above so menu/cart nest-scroll. Setup hub tabs
 * (QR, reports, team, CRM…) are normal page content with no inner scroller —
 * without this, they clip and feel unscrollable.
 */
body.flow-acct-restaurant .app-main:has(#page-pos.active):not(:has(#pos-panel-billing.active)) {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
body.flow-acct-restaurant #page-pos.active:not(:has(#pos-panel-billing.active)) {
  height: auto;
  min-height: 100%;
  overflow: visible;
}
body.flow-acct-restaurant #page-pos .flow-pos-tabs {
  flex: 0 0 auto;
  margin-bottom: 10px;
  gap: 6px;
}
@media (min-width: 901px) {
  body.flow-acct-restaurant #pos-panel-billing.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
  }
  body.flow-acct-restaurant .flow-pos-floor-wrap {
    flex: 0 0 auto;
    margin-bottom: 10px;
    gap: 6px;
  }
  body.flow-acct-restaurant .flow-pos-floor-card {
    height: 38px;
    min-width: 44px;
    padding: 0 12px;
    border-radius: 9px;
  }
  body.flow-acct-restaurant .flow-pos-desk {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 12px;
  }
  body.flow-acct-restaurant .flow-pos-menu-pane,
  body.flow-acct-restaurant .flow-pos-cart-pane {
    padding: 14px;
    border-radius: 14px;
    min-height: 0;
  }
  body.flow-acct-restaurant .flow-pos-menu-pane {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 12px 14px;
    align-content: stretch;
  }
  body.flow-acct-restaurant .flow-pos-menu-toolbar {
    display: contents;
    margin: 0;
    gap: 0;
  }
  body.flow-acct-restaurant .flow-pos-menu-tools {
    grid-column: 2;
    grid-row: 1;
    width: auto;
  }
  body.flow-acct-restaurant .flow-pos-menu-tools #pos-menu-search {
    height: 40px;
    padding: 8px 14px;
    font-size: 0.9rem;
    border-radius: 10px;
  }
  body.flow-acct-restaurant .flow-pos-cats {
    grid-column: 1;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 6px 0 0;
    min-height: 0;
    scrollbar-width: thin;
  }
  body.flow-acct-restaurant .flow-pos-cat {
    width: 100%;
    border-radius: 10px;
    padding: 11px 12px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: break-word;
  }
  body.flow-acct-restaurant .flow-pos-subcats {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    gap: 6px;
  }
  body.flow-acct-restaurant .flow-pos-menu-grid,
  body.flow-acct-restaurant .flow-pos-menu-grid.flow-pos-menu-grid-text {
    grid-column: 2;
    grid-row: 2 / -1;
    /* ~3 columns of large tiles — empty space below is intentional breathing room */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow: auto;
    align-content: start;
    scrollbar-width: thin;
    padding: 2px;
  }
  body.flow-acct-restaurant .flow-pos-menu-pane:has(.flow-pos-subcats:not([hidden])) .flow-pos-menu-grid,
  body.flow-acct-restaurant .flow-pos-menu-pane:has(.flow-pos-subcats:not([hidden])) .flow-pos-menu-grid.flow-pos-menu-grid-text {
    grid-row: 3 / -1;
  }
  body.flow-acct-restaurant .flow-pos-menu-grid.flow-pos-menu-grid-text,
  body.flow-acct-restaurant .flow-pos-menu-sec-grid {
    display: grid !important;
    align-items: stretch;
    grid-auto-rows: max-content;
    gap: 12px !important;
  }
  /* Flat text tiles — button IS the card (no nested hit height bugs) */
  body.flow-acct-restaurant .flow-pos-menu-item.flow-pos-menu-item-text,
  body.flow-acct-restaurant button.flow-pos-menu-item-text {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 14px 16px !important;
    margin: 0 !important;
    min-height: 72px !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    position: relative !important;
    contain: none !important;
    isolation: auto !important;
    transform: none !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    background: var(--flow-subtle-bg) !important;
    border: 1px solid var(--flow-border) !important;
    color: var(--flow-w90) !important;
    font: inherit !important;
    text-align: left !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
  }
  body.flow-acct-restaurant .flow-pos-menu-item.flow-pos-menu-item-text:hover:not(:disabled):not(.has-sizes),
  body.flow-acct-restaurant button.flow-pos-menu-item-text:hover:not(:disabled):not(.has-sizes) {
    transform: none !important;
    border-color: var(--flow-accent) !important;
    background: color-mix(in srgb, var(--flow-accent) 8%, var(--flow-subtle-bg)) !important;
  }
  body.flow-acct-restaurant .flow-pos-menu-item-text .flow-pos-menu-hit {
    display: contents !important;
  }
  body.flow-acct-restaurant .flow-pos-menu-item-text .flow-pos-menu-thumb,
  body.flow-acct-restaurant .flow-pos-menu-item-text .flow-pos-menu-copy {
    display: none !important;
  }
  body.flow-acct-restaurant .flow-pos-menu-item-text .flow-pos-menu-name {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.92rem !important;
    font-weight: 650 !important;
    line-height: 1.35 !important;
    max-height: 2.7em !important;
    overflow: hidden !important;
    white-space: normal !important;
    word-break: break-word !important;
    color: inherit !important;
  }
  body.flow-acct-restaurant .flow-pos-menu-item-text .flow-pos-menu-price {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    color: var(--flow-accent) !important;
    text-decoration: none !important;
  }
  body.flow-acct-restaurant .flow-pos-menu-item-text.in-cart {
    border-color: color-mix(in srgb, var(--flow-accent) 55%, var(--flow-border));
    background: color-mix(in srgb, var(--flow-accent) 14%, var(--flow-subtle-bg));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--flow-accent) 30%, transparent);
  }
  html[data-theme="light"] body.flow-acct-restaurant .flow-pos-menu-item-text.in-cart {
    background: color-mix(in srgb, var(--flow-accent) 10%, #fff);
  }
  body.flow-acct-restaurant .flow-pos-menu-item-text.has-sizes {
    min-height: 0 !important;
    padding-bottom: 10px !important;
  }
  body.flow-acct-restaurant .flow-pos-menu-item-text.has-sizes .flow-pos-size-pills {
    width: 100%;
    padding: 0 10px 10px !important;
    margin-top: 0;
    box-sizing: border-box;
  }
  body.flow-acct-restaurant .flow-pos-portion-pills .flow-pos-size-pill {
    min-height: 36px;
  }
  body.flow-acct-restaurant .flow-pos-menu-grid.flow-pos-menu-grid-all {
    display: flex;
    flex-direction: column;
    gap: 22px;
    align-content: start;
    grid-template-columns: none;
  }
  body.flow-acct-restaurant .flow-pos-menu-sec {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }
  body.flow-acct-restaurant .flow-pos-menu-sec-h {
    margin: 0;
    padding: 2px 2px 0;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--flow-w45);
  }
  body.flow-acct-restaurant .flow-pos-menu-sec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    align-content: start;
  }
  body.flow-acct-restaurant .flow-pos-cart-pane {
    gap: 10px;
    display: flex;
    flex-direction: column;
  }
  body.flow-acct-restaurant .flow-pos-cart-lines {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }
}
@media (min-width: 1280px) {
  body.flow-acct-restaurant .flow-pos-menu-pane {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  body.flow-acct-restaurant .flow-pos-menu-grid.flow-pos-menu-grid-text {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }
  body.flow-acct-restaurant .flow-pos-menu-sec-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }
}
@media (min-width: 1600px) {
  body.flow-acct-restaurant .flow-pos-menu-grid.flow-pos-menu-grid-text {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* POS inputs — theme-aware (never hardcode dark boxes) */
.flow-pos-input,
#pos-panel-billing input:not([type="checkbox"]):not([type="radio"]),
#pos-panel-billing select,
#pos-panel-reports input:not([type="checkbox"]):not([type="radio"]),
#pos-panel-reports select,
#pos-panel-rights input:not([type="checkbox"]):not([type="radio"]),
#pos-panel-rights select,
#pos-panel-menu input[type="number"],
#pos-panel-crm input:not([type="checkbox"]):not([type="radio"]),
#pos-panel-brand input:not([type="checkbox"]):not([type="radio"]),
#pos-panel-brand select,
#pos-panel-tables input:not([type="checkbox"]):not([type="radio"]),
#pos-panel-tables select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--flow-border);
  background: var(--flow-input-bg);
  color: var(--flow-w90);
  font: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.flow-pos-input:focus,
#pos-panel-billing input:not([type="checkbox"]):not([type="radio"]):focus,
#pos-panel-billing select:focus,
#pos-panel-reports input:not([type="checkbox"]):not([type="radio"]):focus,
#pos-panel-reports select:focus,
#pos-panel-rights input:not([type="checkbox"]):not([type="radio"]):focus,
#pos-panel-rights select:focus,
#pos-panel-menu input:focus,
#pos-panel-crm input:not([type="checkbox"]):not([type="radio"]):focus,
#pos-panel-brand input:not([type="checkbox"]):not([type="radio"]):focus,
#pos-panel-tables input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: color-mix(in srgb, var(--flow-accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--flow-accent) 16%, transparent);
}
.flow-pos-input::placeholder { color: var(--flow-w40); }
.flow-pos-input-sm { width: 88px !important; max-width: 100%; text-align: right; }
select.flow-pos-input {
  background-color: var(--flow-input-bg);
  background-image: linear-gradient(45deg, transparent 50%, var(--flow-w45) 50%),
    linear-gradient(135deg, var(--flow-w45) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
select.flow-pos-input option {
  background: var(--flow-card);
  color: var(--flow-w90);
}

.flow-pos-cart-pane { display: flex; flex-direction: column; gap: 10px; }
.flow-pos-cart-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}
.flow-pos-cart-head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}
.flow-pos-cart-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flow-pos-cart-meta input,
.flow-pos-cart-meta select { width: 100%; }
.flow-pos-table-open {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--flow-accent, #c4a35a) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--flow-accent, #c4a35a) 40%, transparent);
  font-size: 0.82rem;
}
.flow-pos-table-open[hidden] { display: none !important; }
.flow-pos-table-open strong { font-size: 0.85rem; }
.flow-pos-table-open span { color: var(--flow-w45); font-size: 0.78rem; }
.flow-pos-table-badge {
  display: inline-block;
  margin: 4px 0 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #b45309;
  color: #fff7ed;
}
.flow-pos-table-badge.free {
  background: color-mix(in srgb, #16a34a 22%, transparent);
  color: #166534;
}
.flow-pos-table-badge.is-pending {
  background: #fff7ed;
  color: #c2410c;
}
.flow-pos-table-card.has-pending {
  box-shadow: inset 0 0 0 1.5px rgba(180, 83, 9, 0.4);
}
.flow-pos-table-card.occupied {
  border-color: color-mix(in srgb, #b45309 55%, transparent);
}
.flow-pos-cart-lines {
  flex: 1; min-height: 140px; max-height: 280px; overflow: auto;
  border: 1px solid var(--flow-w10); border-radius: 12px; padding: 8px;
  background: oklch(0.14 0.02 255 / 0.4);
}
.flow-pos-cart-line {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid var(--flow-w08);
}
.flow-pos-cart-line:last-child { border-bottom: 0; }
.flow-pos-cart-line strong { display: block; font-size: 0.88rem; }
.flow-pos-cart-line span { font-size: 0.75rem; color: var(--flow-w45); }
.flow-pos-cart-line-actions { display: flex; align-items: center; gap: 6px; }
.flow-pos-cart-line-actions button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--flow-w15);
  background: var(--flow-w08); color: var(--flow-w90); cursor: pointer; font: inherit;
}
.flow-pos-cart-totals { display: flex; flex-direction: column; gap: 8px; }
.flow-pos-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.88rem; color: var(--flow-w70);
}
.flow-pos-total-row label { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: space-between; }
.flow-pos-grand { font-size: 1.05rem; color: var(--flow-w95); margin-top: 4px; }
.flow-pos-grand strong { color: var(--flow-accent); font-size: 1.25rem; }
.flow-pos-loyalty-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.flow-pos-loyalty-hint {
  flex: 1 1 100%;
  font-size: 0.72rem;
  color: var(--flow-w45);
  line-height: 1.3;
}
.flow-pos-pay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.flow-pos-pay-grid[hidden] { display: none !important; }
.flow-pos-pay-grid #btn-pos-kitchen {
  grid-column: 1 / -1;
  min-height: 46px;
  font-weight: 700;
}
.flow-pos-pay-grid [data-pos-pay] {
  min-height: 44px;
  font-weight: 600;
}
.flow-pos-pay-grid #btn-pos-clear {
  grid-column: 1 / -1;
  min-height: 40px;
}

.flow-pos-brand-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 320px);
  gap: 18px;
  align-items: start;
}
@media (max-width: 960px) {
  .flow-pos-brand-desk { grid-template-columns: 1fr; }
}
.flow-pos-cat-order {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}
.flow-pos-cat-order-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--flow-border);
  border-radius: 10px;
  background: var(--flow-elevated, var(--flow-card));
  cursor: grab;
}
.flow-pos-cat-order-row.is-dragging { opacity: 0.55; }
.flow-pos-cat-order-row.is-drop-target { border-color: var(--flow-accent); }
.flow-pos-cat-order-grip {
  color: var(--flow-w40);
  font-size: 0.75rem;
  letter-spacing: -0.12em;
  user-select: none;
}
.flow-pos-cat-order-row strong {
  font-size: 0.88rem;
  font-weight: 600;
}
.flow-pos-cat-order-actions {
  display: inline-flex;
  gap: 4px;
}
.flow-pos-cat-order-actions .flow-btn {
  min-width: 34px;
  padding: 4px 8px;
}

html.tm-theme-live .chip,
html.tm-theme-live button.cat[data-cat],
html.tm-theme-live .cats button[data-cat],
html.tm-theme-live nav.chips .chip {
  border-radius: 999px !important;
}
.flow-pos-brand-culture {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
@media (max-width: 720px) {
  .flow-pos-brand-culture { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.flow-pos-brand-culture-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--flow-w15);
  background: var(--flow-w06);
  color: var(--flow-w90);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.flow-pos-brand-culture-card:hover {
  border-color: var(--flow-accent, #e8b86d);
  transform: translateY(-1px);
}
.flow-pos-brand-culture-card.active {
  border-color: var(--flow-accent, #e8b86d);
  box-shadow: 0 0 0 1px var(--flow-accent, #e8b86d);
}
.flow-pos-brand-culture-swatch {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 10px;
  margin-bottom: 4px;
  background-size: cover;
  background-position: center;
}
.tm-swatch-classic {
  background:
    linear-gradient(160deg, rgba(10,9,8,0.55), rgba(196,30,58,0.35)),
    url("https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=400&q=60") center/cover;
}
.tm-swatch-jp {
  background:
    linear-gradient(135deg, rgba(28,61,90,0.55), rgba(155,44,44,0.35)),
    url("https://images.unsplash.com/photo-1579584425555-c3ce17fd4351?w=400&q=60") center/cover;
}
.tm-swatch-in {
  background:
    linear-gradient(135deg, rgba(42,10,14,0.55), rgba(201,168,76,0.4)),
    url("https://images.unsplash.com/photo-1585937421612-70a008356fbe?w=400&q=60") center/cover;
}
.tm-swatch-cn {
  background:
    linear-gradient(135deg, rgba(10,9,8,0.7), rgba(212,175,55,0.35)),
    url("https://images.unsplash.com/photo-1559339352-11d035aa65de?w=400&q=60") center/cover;
}
.tm-swatch-cn2 {
  background:
    linear-gradient(135deg, rgba(240,235,227,0.35), rgba(198,40,40,0.75)),
    url("/flow/assets/chinese2-hero-collage.png") center/cover;
}
.tm-swatch-np {
  background:
    linear-gradient(135deg, rgba(61,43,31,0.5), rgba(232,163,23,0.35)),
    url("https://images.unsplash.com/photo-1544735716-392fe2489ffa?w=400&q=60") center/cover;
}
.tm-swatch-np2 {
  background:
    linear-gradient(135deg, rgba(10,9,8,0.55), rgba(212,175,55,0.4)),
    url("https://images.unsplash.com/photo-1544735716-392fe2489ffa?w=400&q=60") center/cover;
}
.tm-swatch-it {
  background:
    linear-gradient(135deg, rgba(61,74,46,0.5), rgba(196,92,38,0.4)),
    url("https://images.unsplash.com/photo-1551183053-bf91a1d81141?w=400&q=60") center/cover;
}
.tm-swatch-us {
  background:
    linear-gradient(135deg, rgba(26,26,26,0.45), rgba(200,16,46,0.4)),
    url("https://images.unsplash.com/photo-1568901346375-23c9450c58cd?w=400&q=60") center/cover;
}
.flow-pos-brand-culture-card strong {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}
.flow-pos-brand-culture-card em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--flow-w55);
}
.flow-pos-brand-presets {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.flow-pos-brand-preset {
  border: 1px solid var(--flow-w15);
  background: var(--flow-w06);
  color: var(--flow-w90);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
}
.flow-pos-brand-preset.active,
.flow-pos-brand-preset:hover {
  border-color: var(--flow-accent, #e8b86d);
  color: #fff;
}
.flow-pos-brand-advanced {
  margin: 8px 0 14px;
  border: 1px solid var(--flow-w12);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--flow-w04);
}
.flow-pos-brand-advanced > summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--flow-w70);
  list-style: none;
}
.flow-pos-brand-advanced > summary::-webkit-details-marker { display: none; }
.flow-pos-brand-phone[data-tm-theme="japanese"] { font-family: "Shippori Mincho", Georgia, serif; }
.flow-pos-brand-phone[data-tm-theme="indian"] { font-family: "Tiro Devanagari Hindi", Georgia, serif; }
.flow-pos-brand-phone[data-tm-theme="chinese"] { font-family: "Noto Serif SC", Georgia, serif; }
.flow-pos-brand-phone[data-tm-theme="chinese2"] { font-family: "Noto Serif SC", "Noto Sans SC", Georgia, serif; }
.flow-pos-brand-phone[data-tm-theme="nepali"] { font-family: "Tiro Devanagari Hindi", Georgia, serif; }
.flow-pos-brand-phone[data-tm-theme="italian"] { font-family: "Playfair Display", Georgia, serif; }
.flow-pos-brand-phone[data-tm-theme="american"] { font-family: "Oswald", Impact, sans-serif; }
.flow-pos-brand-media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .flow-pos-brand-media-row { grid-template-columns: 1fr; }
}
.flow-pos-brand-media {
  min-height: 96px;
  border-radius: 12px;
  border: 1px dashed var(--flow-w15);
  background: var(--flow-w04);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
}
.flow-pos-brand-media img {
  width: 100%; height: 110px; object-fit: cover; display: block;
}
.flow-pos-brand-media-logo img {
  width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 12px;
}
.flow-pos-brand-media-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.flow-pos-brand-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.flow-pos-brand-colors label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.72rem; color: var(--flow-w55);
}
.flow-pos-brand-colors input[type="color"] {
  width: 100%; height: 36px; border: none; border-radius: 8px;
  background: transparent; padding: 0; cursor: pointer;
}
.flow-pos-brand-toggles {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 4px 0 16px;
}
.flow-pos-brand-check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--flow-w80);
  cursor: pointer;
  min-height: 32px;
}
.flow-pos-brand-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 46px !important;
  max-width: 46px !important;
  min-width: 46px;
  height: 26px !important;
  margin: 0;
  padding: 0 !important;
  border-radius: 999px;
  border: 1.5px solid rgba(12, 12, 24, 0.28);
  background: #c8ceda;
  position: relative;
  flex: 0 0 46px;
  box-sizing: border-box;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.flow-pos-brand-check input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}
.flow-pos-brand-check input[type="checkbox"]:checked {
  background: var(--flow-cyan);
  border-color: color-mix(in oklab, var(--flow-cyan) 70%, #000);
}
.flow-pos-brand-check input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}
.flow-pos-brand-check input[type="checkbox"]:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--flow-cyan) 55%, transparent);
  outline-offset: 2px;
}
html:not([data-theme="light"]) .flow-pos-brand-check input[type="checkbox"] {
  background: oklch(0.35 0.02 255);
  border-color: oklch(0.55 0.02 255 / 0.55);
}
html:not([data-theme="light"]) .flow-pos-brand-check input[type="checkbox"]:checked {
  background: var(--flow-cyan);
  border-color: color-mix(in oklab, var(--flow-cyan) 60%, #fff);
}
.flow-pos-brand-save-row { display: flex; flex-wrap: wrap; gap: 10px; }
.flow-pos-brand-preview-wrap { position: sticky; top: 12px; }
.flow-pos-brand-phone {
  border-radius: 28px;
  border: 1px solid var(--flow-w15);
  background: #0a0908;
  color: var(--tm-text, #1a1612);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  min-height: 520px;
  display: flex; flex-direction: column;
}
.flow-pos-brand-phone--live {
  padding: 0;
  height: min(72vh, 680px);
  min-height: 560px;
  background: #111;
}
.flow-pos-brand-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0a0908;
}
.tm-prev-hero {
  min-height: 170px;
  padding: 16px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  color: #faf6ef;
  background:
    linear-gradient(160deg, rgba(28, 22, 16, 0.9), rgba(48, 36, 24, 0.82)),
    var(--tm-hero-img) center/cover;
}
.tm-prev-logo {
  width: 44px; height: 44px; object-fit: contain; border-radius: 10px;
  background: rgba(255,255,255,0.92); padding: 4px; margin-bottom: 8px;
}
.tm-prev-badge {
  margin: 0; align-self: flex-start; font-size: 0.65rem; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.2);
}
.tm-prev-hero strong { font-size: 1.25rem; line-height: 1.2; }
.tm-prev-hero span { font-size: 0.78rem; opacity: 0.85; }
.tm-prev-welcome {
  margin: 10px 12px 0; font-size: 0.78rem; color: var(--tm-text);
  opacity: 0.8;
}
.tm-prev-card {
  margin: 12px;
  padding: 10px;
  border-radius: 14px;
  background: var(--tm-card, #fffaf2);
  border: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-direction: column; gap: 8px;
}
.tm-prev-item {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center;
  font-size: 0.8rem;
}
.tm-prev-item span {
  width: 36px; height: 36px; border-radius: 8px;
  background: color-mix(in srgb, var(--tm-highlight, #e8b86d) 35%, #fff);
}
.tm-prev-actions {
  margin: auto 12px 10px; display: flex; flex-direction: column; gap: 8px;
}
.tm-prev-btn {
  border: none; border-radius: 12px; padding: 11px 12px; font-weight: 600; font-size: 0.82rem;
}
.tm-prev-btn.primary { background: var(--tm-accent, #2c241c); color: #faf6ef; }
.tm-prev-btn.secondary { background: var(--tm-highlight, #e8b86d); color: var(--tm-accent, #2c241c); }
.tm-prev-btn[hidden] { display: none !important; }
.tm-prev-footer {
  margin: 0 12px 14px; font-size: 0.7rem; opacity: 0.65; text-align: center; min-height: 1em;
}

.flow-pos-tables-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px;
}
.flow-pos-tables-toolbar label {
  display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--flow-w55);
}
.flow-pos-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.flow-pos-table-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-card);
  text-align: left;
  color: var(--flow-w90);
}
.flow-pos-table-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.flow-pos-table-card-head strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--flow-w95);
}
.flow-pos-table-orders {
  min-height: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--flow-inset-bg);
  border: 1px solid var(--flow-border);
}
.flow-pos-table-orders:empty { display: none; }
.flow-pos-table-card.free .flow-pos-table-orders { display: none; }
.flow-pos-table-orders ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-pos-table-orders li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--flow-w80);
}
.flow-pos-table-orders li em {
  font-style: normal;
  font-weight: 700;
  color: var(--flow-w50);
}
.flow-pos-table-orders-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--flow-w50);
}
.flow-pos-table-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--flow-w50);
}
.flow-pos-table-card img {
  display: none;
}
.flow-pos-table-link {
  display: none;
}
.flow-pos-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}
.flow-pos-menu-save-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.flow-pos-menu-dirty {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fbbf24;
}
#btn-pos-menu-save.is-dirty,
#btn-save-inventory.is-dirty {
  box-shadow: 0 0 0 2px color-mix(in srgb, #fbbf24 55%, transparent);
}
.flow-pos-qr-card {
  gap: 10px;
}
.flow-pos-takeaway-qr-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--flow-accent) 30%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--flow-accent) 10%, var(--flow-card)) 0%, var(--flow-card) 60%);
}
.flow-pos-takeaway-qr-copy {
  flex: 1 1 220px;
  min-width: 0;
}
.flow-pos-takeaway-qr-eyebrow {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flow-w40);
  margin-bottom: 4px;
}
.flow-pos-takeaway-qr-copy > strong {
  display: block;
  font-size: 1.05rem;
  color: var(--flow-w95);
}
.flow-pos-online-link-value {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--flow-w12);
  border-radius: 10px;
  background: var(--flow-w04);
  color: var(--flow-w75);
  font: inherit;
  font-size: 0.78rem;
  text-overflow: ellipsis;
}
.flow-pos-online-link-value:focus {
  border-color: color-mix(in srgb, var(--flow-accent) 55%, transparent);
  outline: none;
}
.flow-pos-takeaway-qr-actions .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.flow-pos-takeaway-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.flow-pos-takeaway-qr-visual {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.flow-pos-takeaway-qr-visual .flow-pos-qr-thumb {
  width: 140px;
  height: 140px;
}
.flow-pos-qr-thumb {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--flow-w12);
  align-self: center;
}
.flow-pos-qr-thumb.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--flow-w40);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--flow-w06);
}
/* .ph { display:flex } beats the native [hidden] rule — force hide */
.flow-pos-qr-thumb[hidden],
.flow-pos-takeaway-qr-visual .flow-pos-qr-thumb[hidden] {
  display: none !important;
}
.flow-pos-qr-url {
  font-size: 0.68rem !important;
  word-break: break-all;
  color: var(--flow-w45);
}
.flow-pos-table-actions .flow-btn {
  flex: 1 1 auto;
  min-width: 0;
}
.flow-pos-cart-pane.is-focus {
  outline: 2px solid var(--flow-accent);
  outline-offset: 2px;
  transition: outline-color 0.2s;
}

.flow-pos-kpi-row {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.flow-pos-kpi-row .flow-stat-card { flex: 1 1 140px; }
.flow-pos-online-list,
.flow-pos-bills-list,
.flow-pos-crm-list,
.flow-pos-staff-list { display: flex; flex-direction: column; gap: 8px; }
.flow-pos-online-card,
.flow-pos-bill-row,
.flow-pos-staff-row,
.flow-pos-crm-card {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--flow-w10);
  background: var(--flow-w06);
}
.flow-pos-bill-row {
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: clip;
  overflow-y: visible;
}
.flow-pos-bill-main {
  flex: 1 1 auto;
  min-width: 0;
}
.flow-pos-bill-main > span,
.flow-pos-bill-main .flow-pos-bill-meta,
.flow-pos-bill-main .flow-pos-bill-gst {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.flow-pos-online-card strong,
.flow-pos-bill-row strong,
.flow-pos-crm-card strong { display: block; }
.flow-pos-online-card span,
.flow-pos-bill-row span,
.flow-pos-staff-row span,
.flow-pos-crm-card span { font-size: 0.78rem; color: var(--flow-w45); }
.flow-pos-bill-gst {
  display: block !important;
  margin-top: 4px;
  font-size: 0.75rem !important;
  color: var(--flow-accent, #e8b86d) !important;
  font-variant-numeric: tabular-nums;
}
.flow-pos-bill-meta { display: block; margin-top: 2px; }
.flow-pos-bill-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 7.5rem;
  width: 7.5rem;
  max-width: 7.5rem;
  min-width: 7.5rem;
}
.flow-pos-bill-total {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  width: 100%;
  font-size: 0.95rem;
  line-height: 1.2;
}
.flow-pos-bill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  width: 100%;
  margin-top: 0;
}
.flow-pos-bill-dl,
.flow-pos-bill-send {
  white-space: nowrap;
}
.flow-pos-online-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.flow-pos-online-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.flow-pos-online-note { display: block; margin-top: 2px; font-style: italic; }
.flow-pos-rapido-otp {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--flow-accent, #e8b86d);
}
.flow-pos-rapido-wait {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(232, 184, 109, 0.18);
  color: #e8b86d;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
}
.flow-pos-status-paid_waiting_confirm {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(232, 184, 109, 0.22); color: #e8b86d; font-size: 0.72rem; font-style: normal; font-weight: 600;
}
.flow-pos-status-awaiting_payment {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: var(--flow-w60); font-size: 0.72rem; font-style: normal;
}
.flow-pos-status-confirmed {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(80, 200, 120, 0.18); color: #6dcea0; font-size: 0.72rem; font-style: normal;
}
.flow-pos-status-rejected {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(220, 80, 80, 0.16); color: #e88; font-size: 0.72rem; font-style: normal;
}
.flow-pos-status-failed {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(220, 80, 80, 0.14); color: #f0a0a0; font-size: 0.72rem; font-style: normal; font-weight: 600;
}
.flow-pos-online-card.is-failed { opacity: 0.82; }
.flow-pos-online-age {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--flow-w45);
}
.flow-pos-staff-mods-line {
  display: block !important;
  margin-top: 2px;
  font-size: 0.72rem !important;
  color: var(--flow-accent) !important;
  text-transform: none;
}
.flow-pos-staff-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.flow-pos-staff-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-w06);
}
.flow-pos-staff-mod {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 0 0 auto !important;
  min-height: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 600;
  color: var(--flow-w80) !important;
  cursor: pointer;
}
.flow-pos-staff-mod input {
  width: 16px !important;
  height: 16px;
  accent-color: var(--flow-accent);
}
.app-staff-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 10%, var(--flow-card));
  border: 1px solid color-mix(in srgb, var(--flow-accent) 24%, transparent);
  max-width: 140px;
  cursor: pointer;
}
.app-staff-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html:not([data-theme="light"]) .app-staff-chip {
  color: #6ee7b7;
  background: oklch(0.35 0.08 160 / 0.35);
  border-color: oklch(0.55 0.12 160 / 0.4);
}
body.flow-staff-mode .app-nav-label { opacity: 0.7; }
.flow-staff-unlock .app-form-group { margin-bottom: 10px; text-align: left; }
.flow-staff-unlock .flow-pos-input { width: 100%; }
.flow-pos-online-meta { text-align: right; }
.flow-pos-online-meta em { display: block; font-style: normal; font-size: 0.72rem; text-transform: capitalize; color: var(--flow-accent); }
.flow-pos-bill-row.void { opacity: 0.45; text-decoration: line-through; }

.flow-pos-reports-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.flow-pos-bar-list { display: flex; flex-direction: column; gap: 8px; }
.flow-pos-bar-row {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: center;
  font-size: 0.82rem;
}
.flow-pos-bar-track {
  height: 8px; border-radius: 999px; background: var(--flow-w10); overflow: hidden;
}
.flow-pos-bar-track i {
  display: block; height: 100%; background: var(--flow-accent); border-radius: inherit;
}
.pos-staff-work-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 10px;
  font-size: .8rem;
  color: var(--flow-muted, #6b7280);
}
.pos-staff-work-summary b {
  color: var(--flow-ink, #111);
  font-weight: 700;
}
.pos-staff-work-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pos-staff-work-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.pos-staff-work-table th,
.pos-staff-work-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, var(--flow-border, #e5e7eb) 80%, transparent);
  white-space: nowrap;
}
.pos-staff-work-table th {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--flow-muted, #6b7280);
}
.pos-staff-work-table td:nth-child(2),
.pos-staff-work-table td:nth-child(3),
.pos-staff-work-table td:nth-child(4),
.pos-staff-work-table td:nth-child(5),
.pos-staff-work-table th:nth-child(2),
.pos-staff-work-table th:nth-child(3),
.pos-staff-work-table th:nth-child(4),
.pos-staff-work-table th:nth-child(5) {
  text-align: right;
}
.pos-staff-work-name {
  font-weight: 650;
}
.pos-staff-work-mix {
  color: var(--flow-muted, #6b7280);
  font-size: .78rem;
  white-space: normal;
  max-width: 160px;
}
.flow-pos-staff-form,
.flow-pos-settings-mini {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: end;
}
.flow-pos-upi-favs {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 2px 0 4px;
}
.flow-pos-upi-fav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 28px;
}
.flow-pos-upi-fav-empty {
  font-size: 0.78rem;
  color: var(--flow-w45, rgba(255,255,255,0.45));
  line-height: 1.35;
}
.flow-pos-upi-fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 8px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--flow-w15, rgba(255,255,255,0.15));
  background: var(--flow-w06, rgba(255,255,255,0.06));
  color: var(--flow-w90, #e2e8f0);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  line-height: 1.2;
}
.flow-pos-upi-fav-chip:hover {
  border-color: var(--flow-w25, rgba(255,255,255,0.25));
  background: var(--flow-w08, rgba(255,255,255,0.08));
}
.flow-pos-upi-fav-chip.is-active {
  border-color: oklch(0.72 0.14 145 / 0.55);
  background: oklch(0.72 0.14 145 / 0.12);
  color: oklch(0.9 0.06 145);
}
.flow-pos-upi-fav-vpa {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.flow-pos-upi-fav-name {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--flow-w50, rgba(255,255,255,0.5));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}
.flow-pos-upi-fav-chip.is-active .flow-pos-upi-fav-name {
  color: oklch(0.82 0.05 145 / 0.85);
}
.flow-pos-upi-fav-x {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 2px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  color: var(--flow-w50, rgba(255,255,255,0.5));
}
.flow-pos-upi-fav-chip:hover .flow-pos-upi-fav-x,
.flow-pos-upi-fav-x:hover {
  color: var(--flow-w90, #e2e8f0);
  background: var(--flow-w10, rgba(255,255,255,0.1));
}
#btn-pos-upi-fav-add {
  align-self: flex-start;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.78rem;
}
.flow-pos-crm-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 4px 0 20px;
}
.flow-pos-crm-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: stretch;
}
.flow-pos-crm-field {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-input-bg, var(--flow-w06));
  color: var(--flow-w90);
  font: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.flow-pos-crm-field::placeholder { color: var(--flow-w40); }
.flow-pos-crm-field:focus {
  outline: none;
  border-color: oklch(0.78 0.12 85 / 0.55);
  box-shadow: 0 0 0 3px oklch(0.78 0.12 85 / 0.12);
}
#btn-pos-crm-add {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  border-radius: 12px;
  white-space: nowrap;
}
.flow-pos-crm-list { gap: 12px !important; }
.flow-pos-crm-card {
  padding: 16px 18px !important;
  gap: 16px !important;
  border-radius: 14px !important;
  align-items: flex-start !important;
}
.flow-pos-crm-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.flow-pos-crm-info strong { font-size: 1.02rem; color: var(--flow-w95); }
.flow-pos-crm-meta { display: block; font-size: 0.82rem !important; color: var(--flow-w45); line-height: 1.35; }
.flow-pos-crm-pts {
  text-align: right;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 10px !important;
  flex-shrink: 0;
}
.flow-pos-crm-pts-val {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.flow-pos-crm-pts-val strong { font-size: 1.25rem; color: var(--flow-accent); line-height: 1.1; }
.flow-pos-crm-pts-val span { font-size: 0.72rem; color: var(--flow-w45); text-transform: uppercase; letter-spacing: 0.04em; }
.flow-pos-crm-plus {
  min-height: 40px !important;
  padding: 10px 16px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  line-height: 1.2 !important;
}
.flow-pos-crm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.flow-pos-crm-del {
  min-height: 40px !important;
  padding: 8px 12px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: var(--flow-w45) !important;
  border-radius: 10px !important;
}
.flow-pos-crm-del:hover {
  color: #c45c5c !important;
}
@media (max-width: 720px) {
  .flow-pos-crm-add-row { grid-template-columns: 1fr; }
  #btn-pos-crm-add { width: 100%; }
}
.flow-pos-staff-form .flow-pos-input,
.flow-pos-staff-form select.flow-pos-input { flex: 1 1 120px; min-width: 110px; width: auto; }
.flow-pos-settings-mini label {
  display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; color: var(--flow-w55);
  flex: 1 1 100px;
}
.flow-pos-settings-check {
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 44px;
  cursor: pointer;
  color: var(--flow-w80) !important;
  font-size: 0.88rem !important;
  font-weight: 600;
  flex: 1 1 160px !important;
}
.flow-pos-settings-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 46px !important;
  height: 26px !important;
  margin: 0;
  border-radius: 999px;
  border: 1.5px solid rgba(12, 12, 24, 0.28);
  background: #c8ceda;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}
.flow-pos-settings-check input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}
.flow-pos-settings-check input:checked {
  background: var(--flow-cyan);
  border-color: color-mix(in oklab, var(--flow-cyan) 70%, #000);
}
.flow-pos-settings-check input:checked::after {
  transform: translateX(20px);
}
.flow-pos-settings-check input:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--flow-cyan) 55%, transparent);
  outline-offset: 2px;
}
.flow-pos-settings-check span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.flow-pos-settings-check span::after {
  content: 'Off';
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--flow-w45);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--flow-w08);
  border: 1px solid var(--flow-w15);
}
.flow-pos-settings-check:has(input:checked) span::after {
  content: 'On';
  color: #047857;
  background: color-mix(in oklab, #059669 14%, #fff);
  border-color: color-mix(in oklab, #059669 35%, transparent);
}
html:not([data-theme="light"]) .flow-pos-settings-check input {
  background: oklch(0.35 0.02 255);
  border-color: oklch(0.55 0.02 255 / 0.55);
}
html:not([data-theme="light"]) .flow-pos-settings-check input:checked {
  background: var(--flow-cyan);
  border-color: color-mix(in oklab, var(--flow-cyan) 60%, #fff);
}
html:not([data-theme="light"]) .flow-pos-settings-check:has(input:checked) span::after {
  color: #6ee7b7;
  background: oklch(0.35 0.08 160 / 0.35);
  border-color: oklch(0.55 0.12 160 / 0.4);
}
.flow-pos-menu-qty {
  display: none;
}
.flow-pos-settings-mini .flow-pos-input-sm { width: 100% !important; text-align: left; }
.flow-pos-staff-row .flow-btn-ghost,
.flow-pos-staff-row button {
  color: #fca5a5 !important;
  border-color: oklch(0.55 0.15 25 / 0.45) !important;
  background: oklch(0.35 0.08 25 / 0.25) !important;
}

.flow-pos-inv-table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--flow-w10); }
.flow-pos-ing-tag {
  font-style: normal; font-size: 0.68rem; margin-left: 6px;
  padding: 2px 6px; border-radius: 999px; background: var(--flow-w10); color: var(--flow-w55);
}
.flow-pos-menu-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 12px;
}
.flow-pos-menu-manage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.flow-pos-menu-manage-toolbar #pos-menu-manage-search {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 420px;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 0.95rem;
}
.flow-pos-menu-manage-toolbar #pos-menu-manage-count {
  margin: 0;
  font-size: 0.78rem;
  color: var(--flow-w50);
}
#btn-pos-menu-add {
  min-height: 48px;
  padding: 14px 28px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  border-radius: 14px;
  letter-spacing: 0.01em;
}
.flow-pos-menu-manage { display: flex; flex-direction: column; gap: 8px; }
.flow-pos-menu-manage-card {
  display: grid; grid-template-columns: 56px 1fr auto auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--flow-w10); background: var(--flow-w06);
}
.flow-pos-menu-manage-card.no-thumb,
body.flow-acct-restaurant .flow-pos-menu-manage-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
}
body.flow-acct-restaurant .flow-pos-menu-manage-card .flow-pos-manage-meta,
.flow-pos-menu-manage-card.no-thumb .flow-pos-manage-meta {
  grid-column: 1;
  grid-row: 1;
}
body.flow-acct-restaurant .flow-pos-menu-manage-card .flow-pos-manage-toggles,
.flow-pos-menu-manage-card.no-thumb .flow-pos-manage-toggles {
  grid-column: 2;
  grid-row: 1;
}
body.flow-acct-restaurant .flow-pos-menu-manage-card .flow-pos-stock-field,
.flow-pos-menu-manage-card.no-thumb .flow-pos-stock-field {
  grid-column: 1 / -1;
  grid-row: 2;
}
body.flow-acct-restaurant .flow-pos-menu-manage-card .flow-pos-half-field,
.flow-pos-menu-manage-card.no-thumb .flow-pos-half-field {
  grid-column: 1;
  grid-row: 3;
}
body.flow-acct-restaurant .flow-pos-menu-manage-card .flow-pos-recipe-field,
.flow-pos-menu-manage-card.no-thumb .flow-pos-recipe-field {
  grid-column: 2;
  grid-row: 3;
  justify-self: end;
}
.flow-pos-menu-manage-card.is-out { border-color: oklch(0.55 0.15 25 / 0.4); }
.flow-pos-manage-thumb {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  background: var(--flow-w08);
}
body.flow-acct-restaurant .flow-pos-manage-thumb { display: none !important; }
.flow-pos-manage-thumb.ph {
  background: linear-gradient(135deg, oklch(0.28 0.03 255), oklch(0.22 0.02 255));
}
.flow-pos-manage-meta span { display: block; font-size: 0.78rem; color: var(--flow-w45); }
.flow-pos-local-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  width: 100%;
}
.flow-pos-local-name > span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--flow-w40);
}
.flow-pos-local-name .pos-name-local,
.flow-pos-local-name .flow-pos-input {
  color: var(--flow-w90);
  background: var(--flow-input-bg);
  -webkit-text-fill-color: var(--flow-w90);
}
.flow-pos-menu-manage-card.is-out .flow-pos-manage-meta span { color: #f87171; }
.flow-pos-manage-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-self: end;
  align-self: start;
}
.flow-pos-stock-field {
  min-width: 7.5rem;
}
.flow-pos-stock-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.flow-pos-stock-adj {
  appearance: none;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--flow-w15);
  background: var(--flow-w06);
  color: var(--flow-w90);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.flow-pos-stock-adj:hover:not(:disabled) {
  border-color: var(--flow-accent);
  color: var(--flow-accent);
}
.flow-pos-stock-adj:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.flow-pos-stock-step .pos-menu-stock {
  width: 4.25rem;
  text-align: center;
  padding: 0.4rem 0.35rem;
}
.flow-pos-stock-unlimited {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--flow-w55);
  font-style: normal;
}
.flow-pos-soldout-btn,
.flow-pos-size-toggle,
.flow-pos-stock-toggle {
  appearance: none; border: 1px solid var(--flow-w15); border-radius: 999px;
  padding: 0.45rem 0.85rem; font: inherit; font-size: 0.75rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.flow-pos-soldout-btn.is-on {
  background: color-mix(in srgb, var(--flow-ok) 13%, transparent);
  color: var(--flow-ok);
  border-color: color-mix(in srgb, var(--flow-ok) 33%, transparent);
}
.flow-pos-soldout-btn.is-off { background: #f59e0b22; color: #fbbf24; border-color: #f59e0b55; }
.flow-pos-soldout-btn:disabled,
.flow-pos-size-toggle:disabled,
.flow-pos-stock-toggle:disabled { opacity: 0.55; cursor: wait; }
.flow-pos-size-toggle.is-on {
  background: color-mix(in srgb, var(--flow-accent) 13%, transparent);
  color: var(--flow-accent);
  border-color: color-mix(in srgb, var(--flow-accent) 33%, transparent);
}
.flow-pos-size-toggle.is-off {
  background: var(--flow-w06, rgba(255,255,255,0.06));
  color: var(--flow-w55);
  border-color: var(--flow-w12, rgba(255,255,255,0.12));
}
.flow-pos-stock-toggle.is-on {
  background: #7c3aed22;
  color: #c4b5fd;
  border-color: #7c3aed55;
}
.flow-pos-stock-toggle.is-off {
  background: var(--flow-w06, rgba(255,255,255,0.06));
  color: var(--flow-w55);
  border-color: var(--flow-w12, rgba(255,255,255,0.12));
}
.flow-pos-menu-manage-card.is-sold-out .flow-pos-manage-meta strong { opacity: 0.7; }
.flow-pos-toggle, .flow-pos-cost {
  display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--flow-w70);
}
.flow-pos-cost { flex-direction: column; align-items: flex-start; gap: 4px; }
.flow-pos-cost .flow-pos-input { width: 100px; }
.flow-pos-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 18px 8px;
}
.flow-pos-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Account-type workspace chrome */
.flow-acct-hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--flow-w55);
  line-height: 1.45;
}
.flow-auth-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.flow-auth-demo-card {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
  text-align: left !important;
  padding: 12px 14px !important;
  height: auto !important;
  white-space: normal !important;
}
.flow-auth-demo-card strong { font-size: 0.88rem; }
.flow-auth-demo-card span { font-size: 0.72rem; opacity: 0.65; font-weight: 400; }
@media (max-width: 480px) {
  .flow-auth-demo-grid { grid-template-columns: 1fr; }
}
body.flow-acct-salon_spa #page-appointments .app-card-title svg,
body.flow-acct-salon_spa #salon-floor-wrap .app-card-title svg {
  color: var(--salon-muted);
}

.salon-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.salon-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  margin: 0 0 16px;
  border-radius: 14px;
  background: var(--salon-rail, var(--flow-inset-bg));
  border: 1px solid var(--salon-line, var(--flow-border));
  width: 100%;
  box-sizing: border-box;
}
.salon-tab {
  border: none;
  background: transparent;
  color: var(--salon-muted, var(--flow-w55));
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s var(--flow-ease, ease), color 0.18s var(--flow-ease, ease);
}
.salon-tab:hover {
  color: var(--salon-ink, var(--flow-white));
  background: color-mix(in srgb, var(--salon-ink, var(--flow-white)) 6%, transparent);
}
.salon-tab.active {
  background: color-mix(in srgb, var(--salon-accent, var(--flow-green)) 18%, transparent);
  color: var(--salon-accent, var(--flow-green));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--salon-accent, var(--flow-green)) 35%, transparent);
}
.salon-pane[hidden] { display: none !important; }
.salon-pane.active { width: 100%; }
.salon-section { margin-bottom: 16px; }
.salon-pane .salon-section:last-child { margin-bottom: 0; }
.salon-setup-card { max-width: none; width: 100%; }
.salon-setup-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px 28px;
  align-items: start;
}
.salon-setup-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.salon-setup-span { grid-column: 1 / -1; }
.salon-setup-offer-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.salon-setup-form .salon-book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--flow-border, #2a2a32) 80%, transparent);
}
@media (min-width: 960px) {
  .salon-setup-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .salon-setup-offer-row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}
.salon-two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
@media (max-width: 960px) { .salon-two-col { grid-template-columns: 1fr; } }
.salon-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.salon-board-card {
  border: 0;
  border-radius: 14px; padding: 14px 16px;
  background: var(--salon-surface, var(--flow-card));
  box-shadow: inset 0 0 0 1px var(--salon-line, var(--flow-border));
  display: flex; flex-direction: column; gap: 10px;
  color: var(--salon-ink, var(--flow-white));
}
.salon-board-card.is-free {
  background: color-mix(in srgb, var(--salon-free, var(--flow-green)) 16%, var(--flow-card, #15151a));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--salon-free, var(--flow-green)) 40%, transparent);
}
.salon-board-card.is-busy {
  background: color-mix(in srgb, var(--salon-busy, var(--flow-red)) 14%, var(--flow-card, #15151a));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--salon-busy, var(--flow-red)) 35%, transparent);
}
.salon-board-card header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.salon-board-card header strong { color: var(--salon-ink, var(--flow-white)); font-weight: 700; letter-spacing: -0.02em; }
.salon-board-card header span { font-size: 0.72rem; color: var(--salon-muted); text-transform: capitalize; }
.salon-board-card.is-free header span { color: var(--salon-free, var(--flow-green)); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.salon-board-card.is-busy header span { color: var(--salon-busy, var(--flow-red)); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.salon-arrival-dialog {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--flow-overlay, #0b1020) 55%, transparent);
}
.salon-arrival-dialog[hidden] { display: none !important; }
.salon-arrival-card {
  width: min(420px, 100%);
  padding: 22px 20px 18px;
  border-radius: 16px;
  background: var(--flow-elevated);
  color: var(--flow-w90);
  border: 1px solid color-mix(in srgb, var(--flow-accent) 28%, transparent);
  box-shadow: var(--flow-shadow);
}
.salon-arrival-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--salon-muted, #9aa3b5);
}
.salon-arrival-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.salon-arrival-meta {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--salon-muted, #9aa3b5);
}
.salon-arrival-actions { display: grid; gap: 8px; }
.salon-board-role { font-size: 0.72rem; color: var(--salon-muted); text-transform: capitalize; margin-top: -4px; }
.salon-label { display: block; font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--salon-muted, var(--flow-w55)); margin-bottom: 2px; }
.salon-board-now, .salon-board-next { font-size: 0.85rem; }
.salon-board-now strong, .salon-board-next strong { display: block; color: var(--salon-ink, var(--flow-white)); }
.salon-svc-line { display: inline; }
.salon-svc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  max-width: 100%;
}
.salon-svc-sep { color: var(--salon-muted, var(--flow-w55)); }
.salon-svc-ico,
.salon-svc i.salon-svc-ico,
.salon-svc svg.salon-svc-ico,
.salon-svc i[data-lucide],
.salon-svc svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--salon-muted, var(--flow-w55));
  stroke-width: 2;
}
.salon-svc-ico--fill,
svg.salon-svc-ico--fill {
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}
.salon-board-card.is-free .salon-svc svg {
  color: var(--salon-free, var(--flow-green));
}
.salon-appt-guest { color: var(--salon-ink, var(--flow-white)); }
.salon-board-card .muted { color: var(--salon-muted); font-size: 0.8rem; }
.salon-board-card.is-free .muted { color: var(--salon-free, var(--flow-green)); font-weight: 650; }
.salon-board-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.salon-board-card footer { font-size: 0.7rem; color: var(--salon-muted); }
.salon-appt-rows { display: flex; flex-direction: column; gap: 8px; }
.salon-appt-row {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--salon-line, var(--flow-border));
  background: transparent;
}
.salon-appt-main { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.salon-appt-main strong { color: var(--salon-ink, var(--flow-white)); }
.salon-appt-meta { font-size: 0.8rem; color: var(--salon-muted); }
.salon-appt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.salon-book-form { display: flex; flex-direction: column; gap: 8px; }
.salon-guest-book {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--salon-glow);
  border: 1px solid var(--salon-line);
}
.salon-guest-book-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--salon-muted);
}
.salon-guest-book-link {
  display: block;
  word-break: break-all;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--salon-accent, var(--flow-green));
  margin-bottom: 8px;
}
.salon-guest-book .app-field-hint { margin-bottom: 0; }
.salon-day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 6px 2px;
}
.salon-day-nav-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  min-width: 0;
}
.salon-day-nav-label strong {
  font-size: 1.05rem;
  color: var(--salon-ink, var(--flow-white));
  letter-spacing: 0.02em;
}
.salon-slot-block { margin-top: 4px; }
.salon-slot-hint {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--salon-muted);
}
.salon-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}
.salon-slot-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--salon-line, var(--flow-border));
  background: transparent;
  color: inherit;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.salon-slot-chip strong { font-size: 0.92rem; color: var(--salon-ink, var(--flow-white)); }
.salon-slot-chip span { font-size: 0.68rem; color: var(--salon-muted); }
.salon-slot-chip:hover {
  border-color: color-mix(in srgb, var(--salon-accent, var(--flow-green)) 40%, transparent);
  background: color-mix(in srgb, var(--salon-accent, var(--flow-green)) 10%, transparent);
}
.salon-slot-chip.is-on {
  border-color: color-mix(in srgb, var(--salon-accent, var(--flow-green)) 55%, transparent);
  background: color-mix(in srgb, var(--salon-accent, var(--flow-green)) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--salon-accent, var(--flow-green)) 35%, transparent);
}
.salon-book-date-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--salon-muted);
}
.salon-subhead { margin: 14px 0 6px; font-size: 0.85rem; }
.salon-walkin-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.salon-day-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.salon-day-stats div {
  display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px;
  background: transparent;
  border: 1px solid var(--salon-line);
}
.salon-day-stats span { font-size: 0.68rem; color: var(--salon-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.salon-day-stats strong { color: var(--salon-ink, var(--flow-white)); }
.salon-comm-list { margin-top: 12px; }
.salon-comm-list h4 { margin: 0 0 6px; font-size: 0.8rem; color: var(--salon-ink, var(--flow-white)); }
.salon-comm-list div { display: flex; gap: 8px; align-items: baseline; font-size: 0.85rem; padding: 4px 0; }
.salon-comm-list em { color: var(--salon-muted); font-style: normal; font-size: 0.75rem; }
.salon-floor-wrap { padding: 0 0 24px; }
body.flow-acct-salon_spa [data-resto-only] { display: none !important; }
body:not(.flow-acct-salon_spa) [data-salon-only] { display: none !important; }
body.flow-salon-mode-salon [data-zone-spa],
body.flow-salon-mode-spa [data-zone-salon] { display: none !important; }

.salon-mode-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--salon-muted);
}
.salon-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 10px;
}
.salon-room-row,
.salon-rooms-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.salon-room-row .salon-room-name-input,
.salon-rooms-add #salon-room-name {
  flex: 1 1 140px;
  min-width: 120px;
}
.salon-room-row .salon-room-zone-input,
.salon-rooms-add #salon-room-zone {
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
}
.salon-booking-bg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.salon-booking-bg-count {
  font-size: 0.75rem;
  color: var(--salon-muted, var(--flow-w55));
  font-weight: 600;
}
.salon-booking-bg-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.salon-booking-bg-thumb {
  position: relative;
  border: 1px solid var(--salon-line, var(--flow-border));
  border-radius: 12px;
  overflow: hidden;
  background: var(--salon-surface-soft, var(--flow-subtle-bg));
}
.salon-booking-bg-thumb.is-cover {
  border-color: color-mix(in srgb, var(--salon-accent, var(--flow-accent)) 45%, var(--salon-line, var(--flow-border)));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--salon-accent, var(--flow-accent)) 18%, transparent);
}
.salon-booking-bg-thumb img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  background: var(--salon-surface, #fff);
}
.salon-booking-bg-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--salon-accent, var(--flow-accent));
  color: var(--salon-on-accent, #fff);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.salon-booking-bg-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
}
.salon-booking-bg-tools .flow-btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.68rem;
}
.salon-mode-toggle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.salon-mode-btn {
  text-align: left;
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--salon-line, var(--flow-border));
  background: var(--salon-surface, var(--flow-card));
  border-radius: 12px;
  padding: 12px 14px;
  color: inherit;
  font: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.salon-mode-btn strong { display: block; font-size: 0.95rem; margin-bottom: 2px; color: var(--salon-ink, var(--flow-white)); }
.salon-mode-btn span { display: block; font-size: 0.75rem; color: var(--salon-muted); }
.salon-mode-btn:hover {
  border-color: color-mix(in srgb, var(--salon-accent, var(--flow-green)) 40%, transparent);
}
.salon-mode-btn.is-on {
  border-color: color-mix(in srgb, var(--salon-accent, var(--flow-green)) 55%, transparent);
  background: color-mix(in srgb, var(--salon-accent, var(--flow-green)) 12%, transparent);
  box-shadow: inset 3px 0 0 var(--salon-accent, var(--flow-green));
}
.salon-mode-btn.is-on strong { color: var(--salon-accent, var(--flow-green)); }
@media (min-width: 720px) {
  .salon-mode-toggle { grid-template-columns: repeat(3, 1fr); }
}

body.flow-acct-salon_spa #kitchen-board { display: none !important; }

/* Salon desk — strip restaurant floor / delivery chrome */
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="tables"],
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="online"],
body.flow-acct-salon_spa #btn-pos-goto-kitchen,
body.flow-acct-salon_spa #pos-panel-tables,
body.flow-acct-salon_spa #pos-panel-online,
body.flow-acct-salon_spa .flow-pos-floor-tables,
body.flow-acct-salon_spa .flow-pos-floor-sep,
body.flow-acct-salon_spa #pos-qr-grid,
body.flow-acct-salon_spa #btn-pos-tables-print-all,
body.flow-acct-salon_spa #pos-qr-hint,
body.flow-acct-salon_spa #btn-pos-split-table,
body.flow-acct-salon_spa #btn-pos-share-menu-poster {
  display: none !important;
}
body.flow-acct-salon_spa .flow-pos-floor-channels {
  display: none !important;
}
body.flow-acct-salon_spa #pos-panel-billing .flow-pos-phone-floorhead strong::after {
  content: none;
}
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="menu"] .pos-tab-lg { font-size: 0; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="menu"] .pos-tab-lg::after { content: "Services"; font-size: 0.85rem; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="menu"] .pos-tab-sm { font-size: 0; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="menu"] .pos-tab-sm::after { content: "Svc"; font-size: 0.72rem; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="qr"] .pos-tab-lg { font-size: 0; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="qr"] .pos-tab-lg::after { content: "Booking QR"; font-size: 0.85rem; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="qr"] .pos-tab-sm { font-size: 0; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="qr"] .pos-tab-sm::after { content: "Book"; font-size: 0.72rem; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="billing"] .pos-tab-sm { font-size: 0; }
body.flow-acct-salon_spa .flow-pos-tab[data-pos-tab="billing"] .pos-tab-sm::after { content: "Desk"; font-size: 0.72rem; }

/* Hide restaurant POS chrome unless Retail / WhatsApp stage */
body.flow-salon-desk:not(.flow-salon-desk-retail) #pos-floor-wrap,
body.flow-salon-desk:not(.flow-salon-desk-retail) .flow-pos-desk,
body.flow-salon-desk:not(.flow-salon-desk-retail) #pos-mobile-billbar,
body.flow-salon-desk:not(.flow-salon-desk-retail) #pos-cart-backdrop {
  display: none !important;
}
body.flow-salon-desk:not(.flow-salon-desk-retail):not(.flow-salon-crm) #salon-desk:not([hidden]) {
  display: block !important;
}
/* [hidden] must beat display:block !important or CRM / retail stages paint over the panel */
body.flow-salon-desk #salon-desk[hidden],
#salon-desk[hidden] {
  display: none !important;
}
/* CRM deep-link (Bulk → Edit CRM): keep desk from covering the clients panel */
body.flow-salon-desk.flow-salon-crm #salon-desk,
body.flow-salon-desk.flow-salon-crm #salon-desk-retail-bar {
  display: none !important;
}
body.flow-salon-desk:not(.flow-salon-desk-retail) #salon-desk-retail-bar,
#salon-desk-retail-bar[hidden] {
  display: none !important;
}
body.flow-salon-desk.flow-salon-desk-retail #salon-desk {
  display: none !important;
}
body.flow-salon-desk.flow-salon-desk-retail #pos-floor-wrap {
  display: none !important;
}
/* Desktop only — phone must stay single-column (see max-width:960 override).
   Forcing grid here reused desktop minmax(300px) cart track and crushed the
   menu into a ~70px left strip while the fixed cart sheet left a black void. */
body.flow-salon-desk.flow-salon-desk-retail .flow-pos-desk {
  display: grid !important;
}
body.flow-salon-desk.flow-salon-desk-retail #salon-desk-retail-bar {
  display: flex !important;
}

.sd-root {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 4px 0 32px;
}
.sd-stage { width: 100%; }

.sd-retail-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--sd-line);
  color: var(--sd-ink);
}
.sd-retail-bar strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--sd-ink);
}
.sd-mode-tog {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--sd-ink) 8%, transparent);
  min-width: 168px;
}
.sd-mode-b {
  appearance: none;
  border: 0;
  border-radius: 11px;
  min-height: 38px;
  padding: 0 14px;
  background: transparent;
  color: var(--sd-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}
.sd-mode-b.is-on {
  background: var(--sd-paper);
  color: var(--sd-accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.sd-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.sd-head-row {
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}
.sd-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--sd-ink);
  line-height: 1.15;
}
.sd-sub {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--sd-muted);
}
.sd-head-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sd-head-grow {
  flex: 1 1 auto;
  min-width: 0;
}
.sd-alerts-btn {
  appearance: none;
  position: relative;
  border: 0;
  background: transparent;
  color: var(--sd-accent);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  flex: 0 0 auto;
}
.sd-alerts-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
/* Topbar owns the green alerts bell — desk headers no longer duplicate it */
.sd-alerts-btn:hover { opacity: 0.85; }
.sd-alerts-btn.is-muted { opacity: 0.65; }
.sd-alerts-btn .flow-alerts-badge {
  top: 0;
  right: -2px;
}
.sd-retail-bar .sd-alerts-btn {
  margin-left: auto;
}
.sd-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--sd-accent);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}
.sd-link:hover { opacity: 0.85; }
.sd-link-block {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 14px;
}
.sd-link-danger {
  color: #b42318;
  margin-top: 16px;
}
.sd-link-danger + .sd-link-block {
  margin-top: 8px;
}
.sd-back {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--sd-accent);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  flex-shrink: 0;
}

.sd-staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.sd-staff {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  min-height: 140px;
  padding: 18px 18px 16px;
  margin: 0;
  border: 0;
  border-radius: 16px;
  background: var(--sd-paper);
  color: var(--sd-ink);
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--sd-line);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.sd-staff:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-ink) 18%, transparent);
}
.sd-staff.is-free {
  background: var(--sd-free-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-free) 40%, transparent);
}
.sd-staff.is-busy {
  background: var(--sd-busy-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-busy) 35%, transparent);
}
.sd-staff-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.sd-staff-name {
  font-size: 1.22rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.sd-staff-badge {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.sd-staff.is-free .sd-staff-badge { color: var(--sd-free); }
.sd-staff.is-busy .sd-staff-badge { color: var(--sd-busy); }
.sd-staff.has-pending {
  box-shadow: inset 0 0 0 1.5px rgba(180, 83, 9, 0.45);
}
.sd-staff-pending {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  background: #fff7ed;
  color: #c2410c;
}
.sd-staff-pending.is-ok {
  background: #ecfdf5;
  color: #047857;
}
.sd-staff-line {
  font-size: 0.82rem;
  color: var(--sd-muted);
  line-height: 1.35;
}
.sd-staff-cta {
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.sd-staff.is-free .sd-staff-cta { color: var(--sd-free); }
.sd-staff.is-busy .sd-staff-cta { color: var(--sd-busy); }
.sd-staff-foot {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
}
.sd-staff-extend {
  display: inline-flex;
  gap: 6px;
}
.sd-board-extend {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 7px 11px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: var(--sd-busy);
  background: color-mix(in srgb, var(--sd-busy) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-busy) 32%, transparent);
}
.sd-board-extend:hover {
  background: color-mix(in srgb, var(--sd-busy) 22%, transparent);
}
.sd-board-extend:disabled {
  opacity: 0.45;
  cursor: wait;
}
article.sd-staff .sd-staff-cta {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: var(--sd-busy);
}

.sd-upcoming {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--sd-line);
}
.sd-up-label {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sd-muted);
  margin-bottom: 8px;
}
.sd-up-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--sd-line);
  font-size: 0.9rem;
  color: var(--sd-ink);
}
.sd-up-row:last-child { border-bottom: 0; }
.sd-up-row strong {
  font-variant-numeric: tabular-nums;
  color: var(--sd-accent);
}
.sd-up-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-up-row em {
  font-style: normal;
  color: var(--sd-muted);
  font-size: 0.82rem;
}
.sd-up-empty,
.sd-empty {
  color: var(--sd-muted);
  font-size: 0.9rem;
  padding: 8px 0;
}

.sd-closed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  min-height: min(52vh, 420px);
  padding: 28px 8px 40px;
}
.sd-closed-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sd-muted);
}
.sd-closed-title {
  margin: 0;
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--sd-ink);
}
.sd-closed-sub {
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--sd-muted);
  max-width: 28ch;
}
.sd-closed-access {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--sd-accent);
  cursor: pointer;
  touch-action: manipulation;
}
.sd-closed-access:hover { filter: brightness(1.06); }
.sd-closed-access:active { transform: scale(0.98); }

.sd-start-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: start;
}
.sd-start-services,
.sd-ticket,
.sd-settle-card {
  background: var(--sd-paper);
  border-radius: 16px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
.sd-search,
.sd-input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 12px;
  background: var(--sd-paper-2);
  color: var(--sd-ink);
  font: inherit;
  min-height: 44px;
  padding: 0 14px;
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
.sd-search { margin-bottom: 12px; }
.sd-search::placeholder,
.sd-input::placeholder {
  color: var(--sd-muted);
  opacity: 1;
}
.sd-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.sd-cat {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--sd-paper-2);
  color: var(--sd-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}
.sd-cat.is-on {
  background: color-mix(in srgb, var(--sd-accent) 22%, var(--sd-paper-2));
  color: var(--sd-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-accent) 45%, transparent);
}
.sd-svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.sd-svc-tone-default { --svc-accent: var(--salon-category-default, var(--flow-accent)); }
.sd-svc-tone-nail { --svc-accent: var(--salon-category-nail, var(--flow-accent)); }
.sd-svc-tone-wellness { --svc-accent: var(--salon-category-wellness, var(--flow-accent)); }
.sd-svc-tone-beauty { --svc-accent: var(--salon-category-beauty, var(--flow-accent)); }
.sd-svc-tone-grooming { --svc-accent: var(--salon-category-grooming, var(--flow-accent)); }
.sd-svc {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  text-align: left;
  min-height: 104px;
  padding: 12px;
  margin: 0;
  border: 0;
  border-radius: 14px;
  background: var(--sd-paper-2);
  color: var(--sd-ink);
  font: inherit;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.sd-svc:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-ink) 14%, transparent);
}
.sd-svc.is-on {
  background: var(--sd-free-bg);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sd-free) 55%, transparent);
}
.sd-svc em {
  font-style: normal;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sd-muted);
}
.sd-svc strong {
  font-size: 0.94rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.sd-svc-name {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
}
.sd-svc-name .salon-svc-ico,
.sd-svc-name svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--sd-muted, var(--flow-w55));
  stroke-width: 2;
}
.sd-svc-name .salon-svc-ico--fill,
.sd-svc-name svg.salon-svc-ico--fill {
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}
.sd-svc.is-on .sd-svc-name svg {
  color: var(--sd-free, var(--flow-green));
}
.sd-svc-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  margin-top: auto;
}
.sd-svc-meta i {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--sd-muted);
}
.sd-svc-meta b {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--sd-accent);
}
.sd-genders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.sd-gender {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--sd-muted, rgba(255,255,255,0.7));
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}
.sd-gender.is-on {
  border-color: color-mix(in srgb, var(--sd-free, var(--flow-green)) 55%, transparent);
  background: color-mix(in srgb, var(--sd-free, var(--flow-green)) 18%, transparent);
  color: var(--sd-ink, #fff);
}

.flow-inv-gender {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 8px 0 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
}
.flow-inv-gender-label {
  font-size: 0.76rem;
  font-weight: 750;
  color: var(--muted, #666);
}
.flow-inv-gender-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}
.flow-inv-gender-wiz {
  background: transparent;
  padding: 0;
}
.sd-dur-chips {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  margin: 8px 0 4px;
  padding: 3px;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--sd-line) 88%, var(--sd-ink));
  border-radius: 13px;
  background: color-mix(in srgb, var(--sd-paper-2) 18%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 2px 5px color-mix(in srgb, var(--sd-ink) 13%, transparent),
    0 1px 0 rgba(255,255,255,.9);
}
.sd-dur-chips-ticket {
  margin-top: 6px;
  max-width: 220px;
}
.sd-dur {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sd-muted);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.9);
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.sd-dur span {
  display: none;
}
.sd-dur.is-on {
  border-color: color-mix(in srgb, var(--sd-accent) 46%, var(--sd-line));
  color: var(--sd-accent);
  background: linear-gradient(
    180deg,
    #fff 0%,
    color-mix(in srgb, var(--sd-accent) 5%, var(--sd-paper)) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -2px 0 color-mix(in srgb, var(--sd-accent) 14%, transparent),
    0 2px 0 color-mix(in srgb, var(--sd-accent) 24%, var(--sd-line)),
    0 5px 12px color-mix(in srgb, var(--sd-accent) 24%, transparent);
  transform: translateY(-2px);
}
.sd-dur:not(.is-on):hover {
  color: var(--sd-ink);
  background: color-mix(in srgb, var(--sd-paper) 62%, transparent);
}
.sd-dur.is-on:active {
  box-shadow:
    inset 0 1px 3px color-mix(in srgb, var(--sd-ink) 14%, transparent),
    0 1px 2px color-mix(in srgb, var(--sd-ink) 10%, transparent);
  transform: translateY(1px);
}
.sd-svc.is-on .sd-dur:not(.is-on) {
  opacity: 1;
}

/* Salon start — service browser, dense catalog instead of a wall of cards */
.sd-start-services {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.sd-search-wrap {
  position: relative;
}
.sd-search-wrap > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--sd-muted);
  pointer-events: none;
  transform: translateY(-50%);
}
body.flow-salon-desk #pos-panel-billing .sd-search-wrap > input.sd-search {
  min-height: 48px;
  margin: 0;
  padding: 0 14px 0 42px;
  border-radius: 13px;
  background: var(--sd-paper);
}
.sd-write-svc {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border: 1px dashed var(--sd-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--sd-paper-2) 88%, var(--sd-accent) 12%);
}
.sd-write-svc > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sd-write-svc > header h3 {
  margin: 0;
  color: var(--sd-ink);
  font-size: .88rem;
  letter-spacing: -.015em;
}
.sd-write-svc > header span {
  color: var(--sd-muted);
  font-size: .66rem;
}
.sd-write-svc-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(72px, .55fr) minmax(64px, .45fr) auto;
  gap: 8px;
  align-items: end;
}
.sd-write-svc .sd-field {
  margin: 0;
  font-size: .68rem;
  color: var(--sd-muted);
}
.sd-write-svc .sd-input {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
}
.sd-write-add {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--sd-accent);
  border-radius: 11px;
  background: var(--sd-accent);
  color: var(--sd-paper);
  font-weight: 650;
  cursor: pointer;
}
.sd-write-add:hover { filter: brightness(1.05); }
.sd-ticket-line.is-custom .sd-mem-tag:not(.is-special) {
  opacity: .85;
}
@media (max-width: 720px) {
  .sd-write-svc-row {
    grid-template-columns: 1fr 1fr;
  }
  .sd-write-name { grid-column: 1 / -1; }
  .sd-write-add { grid-column: 1 / -1; width: 100%; }
}
body.flow-salon-desk #pos-panel-billing input.sd-input,
body.flow-salon-desk #pos-panel-billing select.sd-input {
  border: 1px solid var(--sd-line);
  background: var(--sd-paper-2);
  color: var(--sd-ink);
  box-shadow: none;
}
.sd-genders {
  flex-wrap: nowrap;
  gap: 7px;
  margin: 12px 0 20px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sd-genders::-webkit-scrollbar,
.sd-svc-popular-track::-webkit-scrollbar,
.sd-cats::-webkit-scrollbar { display: none; }
.sd-gender {
  flex: none;
  min-width: 58px;
  padding: 7px 13px;
  border-color: var(--sd-line);
  background: transparent;
}
.sd-gender.is-on {
  border-color: var(--sd-accent);
  background: var(--sd-accent);
  color: var(--sd-paper);
  box-shadow: none;
}
.sd-service-section {
  min-width: 0;
  margin-top: 20px;
}
.sd-service-section > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.sd-service-section > header h3 {
  margin: 0;
  color: var(--sd-ink);
  font-size: .92rem;
  letter-spacing: -.015em;
}
.sd-service-section > header span {
  color: var(--sd-muted);
  font-size: .66rem;
}
.sd-svc-popular-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 9px;
  padding: 1px 1px 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.sd-svc.sd-svc-popular {
  min-height: 158px;
  padding: 12px;
  border: 1px solid var(--sd-line);
  border-radius: 13px;
  background: var(--sd-paper);
  box-shadow: var(--salon-shadow-soft, none);
}
.sd-svc.sd-svc-popular:hover {
  border-color: color-mix(in srgb, var(--sd-accent) 35%, var(--sd-line));
  box-shadow: none;
}
.sd-svc.sd-svc-popular.is-on {
  border-color: color-mix(in srgb, var(--sd-free) 65%, var(--sd-line));
  background: color-mix(in srgb, var(--sd-free) 7%, var(--sd-paper));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-free) 28%, transparent);
}
.sd-svc-popular-icon,
.sd-svc-row-icon {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sd-accent) 9%, transparent);
  color: var(--sd-accent);
}
.sd-svc-popular-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 3px;
}
.sd-svc-popular-icon .salon-svc-ico,
.sd-svc-popular-icon svg {
  width: 18px;
  height: 18px;
}
.sd-svc-popular > strong {
  min-height: 2.35em;
  font-size: .84rem;
}
.sd-svc-popular .sd-dur-chips {
  margin: 4px 0;
}
.sd-svc-popular .sd-dur {
  min-height: 27px;
  border-radius: 999px;
  font-size: .68rem;
}
.sd-service-all {
  margin-top: 16px;
}
.sd-cats {
  flex-wrap: nowrap;
  gap: 18px;
  margin: 0 0 9px;
  border-bottom: 1px solid var(--sd-line);
  overflow-x: auto;
  scrollbar-width: none;
}
.sd-cat {
  flex: none;
  padding: 8px 1px 9px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: .69rem;
}
.sd-cat.is-on {
  border-bottom-color: var(--sd-accent);
  background: transparent;
  color: var(--sd-accent);
  box-shadow: none;
}
.sd-svc-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 5px 8px;
}
.sd-svc.sd-svc-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto 8px;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 7px 9px;
  border: 1px solid var(--sd-line);
  border-radius: 9px;
  background: var(--sd-paper);
  box-shadow: none;
}
.sd-svc.sd-svc-row:hover {
  border-color: color-mix(in srgb, var(--sd-accent) 35%, var(--sd-line));
  background: color-mix(in srgb, var(--sd-accent) 3%, var(--sd-paper));
  box-shadow: none;
}
.sd-svc.sd-svc-row.is-on {
  border-color: color-mix(in srgb, var(--sd-free) 55%, var(--sd-line));
  background: color-mix(in srgb, var(--sd-free) 8%, var(--sd-paper));
  box-shadow: none;
}
.sd-svc-row-icon {
  width: 30px;
  height: 30px;
}
.sd-svc-row-icon .salon-svc-ico,
.sd-svc-row-icon svg {
  width: 15px;
  height: 15px;
}
.sd-svc-row-copy {
  min-width: 0;
}
.sd-svc-row-copy strong,
.sd-svc-row-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-svc-row-copy strong {
  color: var(--sd-ink);
  font-size: .73rem;
  line-height: 1.2;
}
.sd-svc-row-copy em {
  margin-top: 2px;
  color: var(--sd-muted);
  font-size: .55rem;
  font-style: normal;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sd-svc-row-duration {
  color: var(--sd-muted);
  font-size: .61rem;
  font-style: normal;
  white-space: nowrap;
}
.sd-svc-row > b {
  color: var(--sd-accent);
  font-size: .67rem;
  white-space: nowrap;
}
.sd-svc-row-arrow {
  color: var(--sd-muted);
  font-size: 1rem;
  line-height: 1;
}

.sd-ticket-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--sd-line);
}
.sd-ticket-line-main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.sd-ticket-line.is-mem strong {
  color: var(--sd-free, var(--flow-green));
}
.sd-ticket-line.is-special > .sd-ticket-line-main > strong {
  color: var(--sd-special);
}
.sd-mem-tag {
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sd-free, var(--flow-green));
  margin-left: 6px;
}
.sd-mem-tag.is-special {
  color: var(--sd-special);
}
.sd-line-cover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 5px 0 2px;
  padding: 8px 9px;
  border: 1px solid var(--sd-line);
  border-radius: 9px;
}
.sd-line-cover > span {
  min-width: 0;
}
.sd-line-cover strong,
.sd-line-cover small {
  display: block;
}
.sd-line-cover strong {
  color: var(--sd-ink) !important;
  font-size: .69rem;
  line-height: 1.25;
}
.sd-line-cover small {
  margin-top: 2px;
  color: var(--sd-muted);
  font-size: .61rem;
}
.sd-line-cover.is-included {
  border-color: color-mix(in srgb, var(--sd-free) 42%, var(--sd-line));
  background: color-mix(in srgb, var(--sd-free) 8%, transparent);
}
.sd-line-cover.is-included strong {
  color: var(--sd-free) !important;
}
.sd-line-cover.is-not-included {
  border-color: color-mix(in srgb, var(--sd-warning) 42%, var(--sd-line));
  background: color-mix(in srgb, var(--sd-warning) 7%, transparent);
}
.sd-line-cover.is-not-included strong {
  color: var(--sd-warning) !important;
}
.sd-line-cover.is-special {
  border-color: color-mix(in srgb, var(--sd-special) 42%, var(--sd-line));
  background: color-mix(in srgb, var(--sd-special) 8%, transparent);
}
.sd-line-cover.is-special strong {
  color: var(--sd-special) !important;
}
.sd-line-cover button {
  flex: none;
  appearance: none;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .65rem;
  font-weight: 800;
  cursor: pointer;
}
.sd-line-cover.is-not-included button { color: var(--sd-warning); }
.sd-line-cover.is-special button { color: var(--sd-special); }
.sd-line-dur {
  font-size: 0.72rem;
  color: var(--sd-muted);
}
.sd-ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--sd-muted);
  margin: 4px 0;
}
.sd-ticket-row.is-mem {
  color: var(--sd-free, var(--flow-green));
}
.sd-ticket-row.is-special {
  color: var(--sd-special);
}
.sd-mem-wrap {
  margin: 0 0 10px;
}
.sd-mem-hint {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--sd-muted);
}
.sd-mem-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--sd-free, var(--flow-green)) 50%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--sd-free, var(--flow-green)) 10%, transparent);
}
.sd-mem-match div { min-width: 0; }
.sd-mem-match strong,
.sd-mem-match span { display: block; }
.sd-mem-match strong { font-size: .76rem; font-weight: 600; }
.sd-mem-match span { margin-top: 3px; color: var(--sd-muted); font-size: .68rem; }
.sd-mem-match button {
  flex: none;
  appearance: none;
  border: 1px solid var(--sd-free, var(--flow-green));
  border-radius: 999px;
  background: var(--sd-free, var(--flow-green));
  color: var(--salon-on-accent, #fff);
  padding: 7px 10px;
  font: inherit;
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
}
.sd-client-lookup {
  position: relative;
}
.sd-client-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--flow-border);
  border-radius: 12px;
  background: var(--flow-elevated);
  box-shadow: var(--flow-shadow);
}
.sd-client-results button {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--flow-border);
  background: transparent;
  color: var(--flow-w90);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.sd-client-results button:last-child { border-bottom: 0; }
.sd-client-results button:hover,
.sd-client-results button:focus-visible {
  background: var(--flow-subtle-bg);
  outline: none;
}
.sd-client-results span,
.sd-client-results strong,
.sd-client-results small { display: block; }
.sd-client-results strong { font-size: .79rem; }
.sd-client-results small { margin-top: 2px; color: var(--flow-w55); font-size: .7rem; }
.sd-client-results em {
  flex: none;
  color: var(--flow-accent);
  font-size: .65rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}
.sd-mem-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--sd-line);
  background: var(--sd-paper);
  margin-bottom: 10px;
}
.sd-mem-card.is-on {
  border-color: color-mix(in srgb, var(--sd-accent) 28%, var(--sd-line));
  background: color-mix(in srgb, var(--sd-accent) 4%, var(--sd-paper));
}
.sd-mem-card.is-dim {
  opacity: .55;
}
.sd-old-mem-card.is-on {
  border-color: color-mix(in srgb, #6b8f5e 40%, var(--sd-line));
  background: color-mix(in srgb, #6b8f5e 8%, var(--sd-paper));
}
.sd-ticket-line.is-old-mem {
  border-color: color-mix(in srgb, #6b8f5e 30%, var(--sd-line));
}
.sd-mem-card-head,
.sd-mem-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sd-mem-card-head {
  padding: 10px 12px;
}
.sd-mem-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sd-free, var(--flow-green));
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.sd-mem-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.sd-mem-card-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sd-mem-card-text strong {
  font-size: 0.9rem;
  font-weight: 750;
  color: var(--sd-ink);
  line-height: 1.25;
}
.sd-mem-card-text span {
  font-size: 0.72rem;
  color: var(--sd-muted);
  line-height: 1.3;
}
.sd-mem-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sd-ink, #fff);
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
  padding: 2px 0;
  line-height: 1.2;
}
.sd-mem-toggle input {
  accent-color: var(--sd-accent);
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
}
.sd-mem-wa-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 12px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--sd-accent, #c4a574) 35%, transparent);
  background: color-mix(in srgb, var(--sd-accent, #c4a574) 10%, transparent);
  cursor: pointer;
}
.sd-mem-wa-toggle input {
  accent-color: var(--sd-accent);
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
}
.sd-mem-wa-toggle span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sd-mem-wa-toggle strong {
  font-size: .82rem;
  font-weight: 750;
  color: var(--sd-ink, #fff);
}
.sd-mem-wa-toggle small {
  font-size: .68rem;
  color: var(--sd-muted);
  line-height: 1.35;
}
.sd-mem-card-body {
  padding: 2px 12px 13px;
}
.sd-mem-identity { min-width: 0; }
.sd-mem-identity strong,
.sd-mem-identity small { display: block; }
.sd-mem-identity strong {
  color: var(--sd-ink, #fff);
  font-size: .96rem;
  line-height: 1.25;
  text-wrap: pretty;
}
.sd-mem-identity small {
  margin-top: 4px;
  color: var(--sd-muted);
  font-size: .64rem;
  letter-spacing: .035em;
}
.sd-mem-balances {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--flow-border);
}
.sd-mem-balances p { margin: 0; color: var(--sd-muted); font-size: .72rem; }
.sd-mem-balance-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--flow-border);
}
.sd-mem-balance-row:last-child { border-bottom: 0; }
.sd-mem-balance-row > strong {
  color: var(--sd-ink);
  font-size: .78rem;
  font-weight: 750;
}
.sd-mem-balance-row.is-empty { opacity: .64; }
.sd-mem-balance-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
}
.sd-mem-balance-flow > span {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 9px;
  background: var(--flow-subtle-bg);
}
.sd-mem-balance-flow small,
.sd-mem-balance-flow b { display: block; }
.sd-mem-balance-flow small {
  color: var(--sd-muted);
  font-size: .56rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sd-mem-balance-flow b {
  margin-top: 4px;
  color: var(--sd-ink);
  font-size: 1.25rem;
  line-height: 1;
}
.sd-mem-balance-flow > span.is-today {
  background: var(--salon-accent-soft, color-mix(in srgb, var(--flow-accent) 12%, transparent));
}
.sd-mem-balance-flow > span.is-today b,
.sd-mem-balance-flow > span.is-after b { color: var(--flow-accent); }
.sd-mem-balance-flow > i {
  align-self: center;
  color: var(--sd-muted);
  font-size: .76rem;
  font-style: normal;
}
.sd-mem-substitutions {
  display: grid;
  gap: 5px;
  padding: 9px 12px;
  border-top: 1px solid var(--flow-border);
  background: color-mix(in srgb, var(--flow-accent) 6%, transparent);
}
.sd-mem-substitution {
  margin: 0;
  color: var(--sd-muted);
  font-size: .64rem;
  line-height: 1.35;
}
.sd-mem-substitution strong { color: var(--sd-ink); }
@media (max-width: 430px) {
  .sd-mem-balance-flow { gap: 5px; }
  .sd-mem-balance-flow > span { padding: 7px 6px; }
  .sd-mem-balance-flow small { font-size: .5rem; }
  .sd-mem-balance-flow b { font-size: 1.08rem; }
}

.sd-mem-history-bg {
  z-index: 65000;
  padding: 18px;
}
.sd-mem-history-modal {
  width: min(760px, 100%);
  max-height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--flow-border-hi, var(--flow-border));
  border-radius: 16px;
  background: var(--flow-card);
  box-shadow: var(--flow-shadow, 0 24px 70px rgba(0,0,0,.42));
  color: var(--flow-w90);
}
.sd-mem-history-modal > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--flow-border);
}
.sd-mem-history-modal > header span {
  display: block;
  color: var(--flow-accent);
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sd-mem-history-modal > header h3 {
  margin: 3px 0 0;
  font-size: 1rem;
}
.sd-mem-history-modal > header p {
  margin: 4px 0 0;
  color: var(--flow-w45);
  font-size: .7rem;
}
.sd-mem-history-modal > header button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--flow-border);
  border-radius: 8px;
  background: var(--flow-surface);
  color: var(--flow-w65);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}
.sd-mem-history-table-wrap {
  overflow: auto;
  min-height: 130px;
}
.sd-mem-history-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}
.sd-mem-history-table th,
.sd-mem-history-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--flow-border);
  text-align: left;
}
.sd-mem-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--flow-surface);
  color: var(--flow-w45);
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.sd-mem-history-table td {
  color: var(--flow-w65);
  font-size: .75rem;
}
.sd-mem-history-table td strong { color: var(--flow-w90); }
.sd-mem-history-table th:nth-child(1) { width: 120px; }
.sd-mem-history-table th:nth-child(2) { width: 88px; }
.sd-mem-history-table th:nth-child(4) { width: 140px; }
.sd-mem-history-table th:nth-child(5) { width: 150px; }
.sd-mem-history-table th:nth-child(6) { width: 110px; }
.sd-mem-history-extra.is-on {
  color: var(--sd-busy, #b42318);
  font-weight: 700;
}
.sd-mem-history-used {
  color: var(--flow-w80);
  font-weight: 650;
}
.sd-mem-history-table tbody tr:last-child td { border-bottom: 0; }
.sd-mem-history-empty,
.sd-mem-history-loading {
  padding: 26px 14px !important;
  color: var(--flow-w45) !important;
  text-align: center !important;
}
.sd-mem-history-loading { margin: 0; font-size: .75rem; }
.sd-mem-card-foot {
  min-height: 36px;
  padding: 7px 8px;
  border-top: 1px solid var(--flow-border);
  color: var(--sd-muted);
  font-size: .67rem;
  line-height: 1.3;
}
.sd-mem-history-link,
.sd-mem-guest {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--flow-accent);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: .68rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.sd-mem-history-link:hover,
.sd-mem-guest:hover { background: var(--flow-subtle-bg); }
.sd-ticket-line-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sd-line-staff {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 140px;
}
.sd-line-staff-lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--flow-w45, #64748b);
  flex-shrink: 0;
}
.sd-line-staff-sel {
  flex: 1;
  min-width: 0;
  max-width: 168px;
  padding: 4px 6px !important;
  font-size: 0.78rem !important;
  min-height: 28px !important;
}
.sd-settle-siblings {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  font-size: 0.82rem;
}
.sd-settle-siblings strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f766e;
}
.sd-settle-siblings em {
  font-style: normal;
  color: var(--flow-w45, #64748b);
  font-size: 0.75rem;
}
.sd-dur-chips-ticket {
  flex: 1 1 auto;
  max-width: 160px;
  margin-top: 0;
}
.sd-qty {
  display: inline-grid;
  grid-template-columns: 28px 28px 28px;
  align-items: center;
  justify-items: center;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  margin-left: auto;
}
.sd-qty-btn {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,0.04);
  color: var(--sd-ink, #fff);
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.sd-qty-btn:hover {
  background: rgba(255,255,255,0.1);
}
.sd-qty-val {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--sd-ink, #fff);
  min-width: 28px;
  text-align: center;
}
.sd-friend-hint {
  margin: 6px 0 0;
  padding: 0 2px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--flow-muted, rgba(255,255,255,0.55));
}
.sd-disc-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 8px 0 12px;
}
.sd-extend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sd-extend-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--sd-muted);
  min-width: 4.5rem;
}
.sd-extend-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sd-extend-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--sd-ink, #fff);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.sd-extend-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.sd-extend-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}
.sd-disc-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--sd-muted);
}
.sd-disc-modes {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  overflow: hidden;
}
.sd-disc-mode {
  border: 0;
  background: transparent;
  color: var(--sd-muted);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 10px;
  cursor: pointer;
}
.sd-disc-mode.is-on {
  background: color-mix(in srgb, var(--sd-free, var(--flow-green)) 22%, transparent);
  color: var(--sd-ink, #fff);
}
.sd-disc-input {
  min-width: 0;
}

.sd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--sd-muted);
  margin-bottom: 10px;
}
.sd-ticket-lines {
  min-height: 110px;
  margin: 8px 0 12px;
}
.sd-ticket-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 100px;
  padding: 14px;
  border-radius: 12px;
  background: var(--sd-paper-2);
}
.sd-ticket-empty strong {
  font-size: 0.98rem;
  color: var(--sd-ink);
}
.sd-ticket-empty span {
  font-size: 0.84rem;
  color: var(--sd-muted);
  line-height: 1.35;
}
.sd-ticket-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sd-paper-2);
  margin-bottom: 8px;
}
.sd-ticket-line-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}
.sd-ticket-line strong {
  font-size: 0.9rem;
  color: var(--sd-ink);
}
.sd-ticket-line-main span {
  font-weight: 750;
  color: var(--sd-accent);
}
.sd-ticket-line button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--sd-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.sd-ticket-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--sd-ink);
}
.sd-ticket-total strong {
  font-size: 1.15rem;
  color: var(--sd-accent);
}
.sd-primary,
.sd-secondary {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  font: inherit;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
}
.sd-primary {
  background: var(--sd-accent);
  color: var(--salon-on-accent, #fff);
}
.sd-primary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.sd-secondary {
  background: var(--sd-paper-2);
  color: var(--sd-ink);
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
.sd-settle-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.pos-pay-method-prompt {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 14, 18, 0.48);
}
.pos-pay-method-prompt-card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 20px 18px 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}
.pos-pay-method-prompt-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.pos-pay-method-prompt-card p {
  margin: 0 0 14px;
  color: #5b6470;
  font-size: 0.92rem;
}
.pos-pay-method-prompt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.salon-daysheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 0;
}
.salon-daysheet-toolbar label {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted, #667);
}
.salon-daysheet-toolbar .salon-ds-upload-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.salon-daysheet-toolbar .salon-ds-upload-btn input {
  display: none;
}
#salon-daysheet-import-status.is-ok { color: #047857; }
#salon-daysheet-import-status.is-err { color: #b42318; }

/* Day sheet — full-width immersive register */
.app-main:has(#page-day-sheet.active) {
  padding: 0.5rem 0.65rem 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#page-day-sheet.active {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.salon-ds-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0 !important;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.salon-ds-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.salon-ds-dayclose {
  border: 1px solid var(--line, #e6e8ec);
  border-radius: 12px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}
.salon-ds-dayclose > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  user-select: none;
}
.salon-ds-dayclose > summary::-webkit-details-marker { display: none; }
.salon-ds-dayclose > summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.salon-ds-dayclose > summary em {
  font-style: normal;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted, #667);
}
.salon-ds-dayclose[open] > summary {
  border-bottom: 1px solid var(--line, #eef0f3);
}
.salon-ds-dayclose > #salon-day-close {
  padding: 12px 16px 16px;
}
.salon-ds-register {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  border: 1px solid var(--line, #e6e8ec);
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px 12px;
}
#salon-day-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#salon-day-sheet > .salon-daysheet-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#salon-day-sheet .salon-daysheet-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#salon-day-sheet .salon-ds-workbook {
  flex: 1;
  min-height: 0;
}
#salon-day-sheet .salon-daysheet-table-wrap {
  flex: 1;
  min-height: 180px;
  max-height: none;
}
.salon-daysheet-side-below {
  flex-shrink: 0;
}
.salon-ds-register-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 16px;
}
.salon-ds-register-title h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.salon-ds-register-title p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted, #667);
}
.salon-ds-edit-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted, #667);
}
.salon-daysheet-layout {
  display: grid;
  gap: 14px;
}
.salon-daysheet-wide {
  grid-template-columns: 1fr;
}
.salon-daysheet-main {
  min-width: 0;
}
.salon-ds-workbook {
  border: 1px solid #217346;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.salon-ds-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: linear-gradient(#217346, #1a5c38);
  color: #fff;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  flex-shrink: 0;
}
.salon-ds-ribbon-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.salon-ds-ribbon strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.salon-ds-ribbon-left span {
  font-size: 12px;
  opacity: 0.92;
}
.salon-ds-ribbon-actions {
  display: flex;
  gap: 8px;
}
.salon-ds-ribbon-btn {
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
}
.salon-ds-ribbon-btn:hover {
  background: rgba(255,255,255,0.24);
}

.salon-ds-sheet-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.salon-ds-sheet-stage .salon-daysheet-table-wrap {
  flex: 1;
  min-height: 0;
}
.salon-ds-editbar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.salon-ds-card-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.salon-ds-chip {
  border: 1px solid #c6c6c6;
  background: #fff;
  color: #333;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
}
.salon-ds-chip.is-on {
  background: #217346;
  border-color: #217346;
  color: #fff;
}
.salon-ds-bottom-panels {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 10px 10px 8px;
  background: #f3f3f3;
  border-top: 1px solid #c6c6c6;
  max-height: min(42vh, 420px);
  overflow: auto;
}
.salon-ds-bottom-panels:empty,
.salon-ds-bottom-panels:not(:has(.salon-ds-panel:not([hidden]))) {
  display: none;
}
.salon-ds-panel {
  background: #fff;
  border: 1px solid #c6c6c6;
  border-radius: 10px;
  overflow: hidden;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  min-width: 0;
}
.salon-ds-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #217346;
  color: #fff;
}
.salon-ds-panel > header strong {
  font-size: 13px;
}
.salon-ds-fcard-x {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.salon-ds-panel-body {
  padding: 10px;
  max-height: 220px;
  overflow: auto;
}
.salon-ds-panel-dayclose .salon-ds-panel-body {
  max-height: 280px;
}
.salon-ds-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 6px 0 8px;
  font-size: 11px;
  color: #333;
  white-space: nowrap;
}
.salon-ds-zoom input[type="range"] {
  width: 88px;
  height: 18px;
  margin: 0;
  accent-color: #217346;
}
.salon-ds-zoom-btn {
  border: 1px solid #c6c6c6;
  background: #fff;
  color: #217346;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}
.salon-ds-zoom-label {
  min-width: 36px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.salon-ds-excel-wrap {
  zoom: var(--salon-ds-zoom, 1);
}
.salon-ds-totals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.salon-ds-totals-grid div {
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 8px;
}
.salon-ds-totals-grid small {
  display: block;
  font-size: 11px;
  color: #666;
  margin-bottom: 2px;
}
.salon-ds-totals-grid b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.salon-ds-dayclose-source { display: none !important; }
body.page-day-sheet-on .salon-ds-register-title { display: none; }

/* ── True full-bleed Day Register ─────────────────────────────── */
body.page-day-sheet-on.salon-ds-fullscreen .app-header,
body.page-day-sheet-on.salon-ds-fullscreen .app-mobile-nav,
body.page-day-sheet-on.salon-ds-fullscreen .fp-header,
body.page-day-sheet-on.salon-ds-fullscreen .fp-deck,
body.page-day-sheet-on.salon-ds-fullscreen .app-sidebar {
  display: none !important;
}
body.page-day-sheet-on.salon-ds-fullscreen .app-shell,
body.page-day-sheet-on.salon-ds-fullscreen .app-body,
body.page-day-sheet-on.salon-ds-fullscreen .app-main {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}
body.page-day-sheet-on .app-main {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  min-height: 0 !important;
}
body.page-day-sheet-on #page-day-sheet.active {
  flex: 1 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  gap: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
body.page-day-sheet-on .salon-ds-register {
  flex: 1 !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #fff !important;
}
.salon-ds-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: #217346;
  color: #fff;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
}
.salon-ds-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.salon-ds-topbar-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.salon-ds-date-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.95;
}
.salon-ds-date-label input {
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 0;
  color: #111;
  background: #fff;
  font-size: 13px;
}
.salon-ds-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.salon-ds-topbar-actions .flow-btn {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}
.salon-ds-topbar-actions .flow-btn-primary {
  background: #fff;
  color: #217346;
  border-color: #fff;
  font-weight: 800;
}
body.page-day-sheet-on #salon-day-sheet {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
body.page-day-sheet-on .salon-ds-workbook {
  flex: 1 !important;
  min-height: 0 !important;
  border: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
body.page-day-sheet-on .salon-ds-formula-bar {
  flex-shrink: 0;
  display: grid !important;
  grid-template-columns: 64px 26px minmax(80px, 1fr) auto auto;
  align-items: center;
  height: 30px;
  border-bottom: 1px solid #b1b1b1;
  background: #f3f3f3;
}
body.page-day-sheet-on .salon-ds-namebox,
body.page-day-sheet-on .salon-ds-formula {
  height: 30px;
  font-size: 12px;
}
body.page-day-sheet-on .salon-ds-formula-bar .salon-ds-card-toggles {
  margin: 0 8px 0 0;
  justify-content: flex-end;
}
body.page-day-sheet-on .salon-ds-chip {
  padding: 3px 8px;
  font-size: 11px;
  background: #fff;
}
body.page-day-sheet-on .salon-ds-chip.is-on {
  background: #217346;
  color: #fff;
}
body.page-day-sheet-on .salon-ds-sheet-stage {
  flex: 1 !important;
  min-height: 0 !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
}
body.page-day-sheet-on .salon-daysheet-table-wrap {
  flex: 1 !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow: auto !important;
}
body.page-day-sheet-on .salon-ds-status {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 4px 10px;
  min-height: 26px;
  align-items: center;
  background: #217346;
  color: #fff;
  font-size: 12px;
}
body.page-day-sheet-on .salon-ds-ribbon,
body.page-day-sheet-on .salon-ds-sheet-tabs,
body.page-day-sheet-on .salon-daysheet-editbar,
body.page-day-sheet-on .salon-ds-page-head,
body.page-day-sheet-on .salon-ds-register-toolbar {
  display: none !important;
}
body.page-day-sheet-on .salon-ds-bottom-panels {
  flex-shrink: 0;
}

/* Full screen Day sheet — whole monitor for the register */
body.salon-ds-fullscreen .app-header,
body.salon-ds-fullscreen .app-mobile-nav,
body.salon-ds-fullscreen .fp-header,
body.salon-ds-fullscreen .fp-deck {
  display: none !important;
}
body.salon-ds-fullscreen .app-sidebar {
  display: none !important;
}
body.salon-ds-fullscreen .app-shell {
  height: 100dvh;
}
body.salon-ds-fullscreen .app-body {
  height: 100dvh;
}
body.salon-ds-fullscreen .app-main {
  padding: 0 !important;
  overflow: hidden !important;
  height: 100dvh;
}
body.salon-ds-fullscreen #page-day-sheet.active {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  gap: 0;
  border-radius: 0;
}
body.salon-ds-fullscreen .salon-ds-page-head .app-page-desc,
body.salon-ds-fullscreen .salon-ds-dayclose,
body.salon-ds-fullscreen .salon-ds-register-title p,
body.salon-ds-fullscreen .salon-daysheet-side-below,
body.salon-ds-fullscreen .salon-ds-edit-hint,
body.salon-ds-fullscreen .salon-ds-sheet-hint {
  display: none !important;
}
body.salon-ds-fullscreen .salon-ds-page-head {
  padding: 8px 12px;
  margin: 0 !important;
  background: #217346;
  color: #fff;
  border-radius: 0;
  align-items: center;
}
body.salon-ds-fullscreen .salon-ds-page-head .app-page-title {
  color: #fff;
  font-size: 1.1rem;
  margin: 0;
}
body.salon-ds-fullscreen .salon-ds-page-actions .flow-btn {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.45);
  color: #fff;
}
body.salon-ds-fullscreen .salon-ds-register {
  flex: 1;
  border: 0;
  border-radius: 0;
  padding: 6px 8px 0;
  min-height: 0;
}
body.salon-ds-fullscreen .salon-ds-register-toolbar {
  padding: 0 4px 6px;
  gap: 8px;
  flex-shrink: 0;
}
body.salon-ds-fullscreen .salon-ds-workbook {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  flex: 1;
}
body.salon-ds-fullscreen .salon-daysheet-table-wrap {
  max-height: none !important;
  flex: 1;
}
body.salon-ds-fullscreen .salon-daysheet-editbar {
  margin-bottom: 6px;
  flex-shrink: 0;
}
body.salon-ds-fullscreen #btn-sidebar-toggle-ds {
  display: inline-flex;
}
body.salon-ds-fullscreen .salon-ds-ribbon {
  display: flex;
}
.salon-ds-formula-bar {
  display: grid;
  grid-template-columns: 72px 28px minmax(0, 1fr);
  gap: 0;
  border-bottom: 1px solid #b1b1b1;
  background: #f3f3f3;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
}
.salon-ds-namebox,
.salon-ds-formula {
  height: 28px;
  border: 0;
  border-right: 1px solid #c6c6c6;
  background: #fff;
  padding: 0 8px;
  font-size: 13px;
  color: #000;
  font-family: inherit;
}
.salon-ds-formula {
  border-right: 0;
}
.salon-ds-fx {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  color: #666;
  background: #f3f3f3;
  border-right: 1px solid #c6c6c6;
}
.salon-ds-sheet-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  background: #e6e6e6;
  border-top: 1px solid #b1b1b1;
  min-height: 32px;
}
.salon-ds-sheet-tab {
  border: 1px solid #b1b1b1;
  border-bottom: 0;
  background: #fff;
  color: #217346;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px 5px;
  margin-top: 4px;
  cursor: default;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
}
.salon-ds-sheet-tab.is-on {
  border-top: 2px solid #217346;
}
.salon-ds-sheet-hint {
  font-size: 11px;
  color: #666;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
}
.salon-ds-status {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 10px;
  background: #217346;
  color: #fff;
  font-size: 11px;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
}
.salon-daysheet-table-wrap {
  overflow: auto;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.salon-ds-excel-wrap {
  font-family: "Segoe UI", Calibri, Candara, Arial, sans-serif;
}
.salon-daysheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
  background: #fff;
  color: #000;
  table-layout: fixed;
}
.salon-daysheet-table.is-excel {
  min-width: 1480px;
}
.salon-daysheet-table th,
.salon-daysheet-table td {
  padding: 0;
  border: 1px solid #c6c6c6;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  height: 32px;
  background: #fff;
}
.salon-daysheet-table thead th {
  position: sticky;
  z-index: 3;
  text-align: center;
  font-weight: 600;
  color: #333;
  border-color: #b1b1b1;
}
.salon-daysheet-table tr.salon-ds-letters th {
  top: 0;
  height: 22px;
  background: #e6e6e6;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  letter-spacing: 0;
  text-transform: none;
}
.salon-daysheet-table tr.salon-ds-letters th.is-active-col {
  background: #c6efce;
  color: #006100;
}
.salon-daysheet-table tr.salon-ds-colnames th {
  top: 22px;
  height: 28px;
  background: #f2f2f2;
  font-size: 12px;
  font-weight: 700;
  color: #222;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 1px solid #9c9c9c;
  padding: 0 6px;
}
.salon-daysheet-table .salon-ds-corner,
.salon-daysheet-table .salon-ds-rownum {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  background: #e6e6e6 !important;
  color: #555;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  border-color: #b1b1b1;
  user-select: none;
}
.salon-daysheet-table tr.salon-ds-colnames .salon-ds-corner {
  top: 22px;
  z-index: 5;
  background: #dcdcdc !important;
}
.salon-daysheet-table tr.salon-ds-letters .salon-ds-corner {
  top: 0;
  z-index: 5;
  background: #dcdcdc !important;
}
.salon-daysheet-table tbody .salon-ds-rownum {
  z-index: 2;
  background: #f3f3f3 !important;
  border-right: 1px solid #b1b1b1;
}
.salon-daysheet-table tbody tr.is-active-row .salon-ds-rownum {
  background: #c6efce !important;
  color: #006100;
}
.salon-daysheet-editbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.salon-daysheet-editbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.salon-daysheet-table.is-editable td {
  padding: 0;
}
.salon-daysheet-table .salon-ds-cell {
  display: block;
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 2px 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 28px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #000;
}
.salon-daysheet-table .salon-ds-cell::placeholder {
  color: transparent;
}
.salon-daysheet-table .salon-ds-cell:focus {
  outline: none;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px #217346 !important;
  background: #fff !important;
}
.salon-daysheet-table select.salon-ds-pay-select {
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
  padding-right: 4px;
  line-height: 1.2;
}
/* If FlowSelect ever wraps a day-sheet cell, unwrap layout so menus don't stack in-cell */
.salon-daysheet-table .flow-select {
  display: block;
  width: 100%;
  height: 32px;
}
.salon-daysheet-table .flow-select-menu {
  position: fixed !important;
  z-index: 4000 !important;
}
.salon-daysheet-table td:focus-within,
.salon-daysheet-table td.is-active {
  outline: 2px solid #217346;
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}
.salon-daysheet-table tr.is-draft .salon-ds-cell {
  background: transparent !important;
}
.salon-ds-draft-mark {
  display: block;
  width: 100%;
  height: 28px;
}
.salon-ds-col-act { width: 32px; min-width: 32px; }
.salon-ds-col-type { width: 70px; min-width: 70px; }
.salon-ds-col-client { width: 140px; min-width: 140px; }
.salon-ds-col-phone { width: 110px; min-width: 110px; }
.salon-ds-col-svc { width: 170px; min-width: 170px; }
.salon-ds-col-staff { width: 100px; min-width: 100px; }
.salon-ds-col-room { width: 80px; min-width: 80px; }
.salon-ds-col-min { width: 52px; min-width: 52px; }
.salon-ds-col-time { width: 96px; min-width: 96px; }
.salon-ds-col-pay { width: 100px; min-width: 100px; }
.salon-ds-col-mem { width: 88px; min-width: 88px; }
.salon-ds-col-money { width: 80px; min-width: 80px; }
.salon-ds-col-bal { width: 84px; min-width: 84px; }
.salon-ds-col-note { width: 140px; min-width: 140px; }
.salon-daysheet-table .salon-ds-cell[data-ds-field="service"],
.salon-daysheet-table .salon-ds-cell[data-ds-field="remark"],
.salon-daysheet-table .salon-ds-cell[data-ds-field="clientName"] {
  min-width: 0;
}
.salon-daysheet-table .salon-ds-ro {
  color: #333;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  padding: 0 8px;
  height: 32px;
  line-height: 32px;
  font-size: 14px;
}
.salon-daysheet-table .salon-ds-ro.is-pending {
  color: #c00000;
  font-weight: 700;
}
.salon-daysheet-table tr.is-member td {
  background: #e8f8f2;
}
.salon-daysheet-table tr.is-mem-on [data-ds-field="membershipCode"],
.salon-daysheet-table tr.is-mem-on [data-ds-field="payModes"] {
  background: #c6efce !important;
  font-weight: 600;
}
.salon-daysheet-table tr.is-mem-sale td {
  background: #e8eef8;
}
.salon-daysheet-table tr.is-mem-sale [data-ds-field="service"],
.salon-daysheet-table tr.is-mem-sale [data-ds-field="collected"],
.salon-daysheet-table tr.is-mem-sale [data-ds-field="category"] {
  font-weight: 650;
}
.salon-daysheet-table tr.has-balance td {
  background: #fff2cc;
}
.salon-ds-actions {
  width: 32px;
  min-width: 32px;
  padding: 0 !important;
  text-align: center;
}
.salon-ds-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 28px;
  min-width: 0;
  padding: 0 !important;
  margin: 0;
  border: 0;
  background: transparent;
  color: #c00000 !important;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.salon-ds-del:hover {
  background: #ffe5e5;
}
.salon-daysheet-side-below {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .salon-daysheet-side-below {
    grid-template-columns: 1fr;
  }
}
.salon-daysheet-panel {
  border: 1px solid var(--line, #e6e8ec);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
.salon-daysheet-panel h4 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 750;
}
.salon-ds-float-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  align-items: end;
}
.salon-ds-float-row label {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  color: #667;
}
.salon-ds-kv-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: #667;
}
.salon-ds-kv-inline strong {
  color: inherit;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.salon-ds-float-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.salon-ds-kv-compact {
  margin-top: 8px;
  gap: 4px 8px;
  font-size: 0.78rem;
}
.salon-daysheet-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  font-size: 0.88rem;
}
.salon-daysheet-kv span { color: #667; }
.salon-daysheet-kv strong { font-variant-numeric: tabular-nums; }
.salon-daysheet-form {
  display: grid;
  gap: 8px;
}
.salon-daysheet-form .flow-pos-input {
  width: 100%;
}
.salon-daysheet-expense-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.82rem;
}
.salon-daysheet-expense-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
.salon-ds-clock-cell {
  min-width: 132px;
  padding: 2px 4px !important;
}
.salon-ds-clock {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
}
.salon-ds-clock-sep {
  font-size: 0.75rem;
  opacity: 0.55;
  flex-shrink: 0;
}
.salon-ds-clock .flow-pos-input,
.salon-ds-clock select {
  padding: 2px 4px;
  font-size: 0.72rem;
  min-height: 26px;
  width: auto;
}
.salon-ds-clock-h { width: 42px; }
.salon-ds-clock-m { width: 44px; }
.salon-ds-clock-ap { width: 48px; }

html[data-theme="light"] .salon-ds-dayclose,
html[data-theme="light"] .salon-ds-register,
html[data-theme="light"] .salon-daysheet-panel {
  background: #fff;
}
html[data-theme="dark"] .salon-ds-dayclose,
html[data-theme="dark"] .salon-ds-register,
html[data-theme="dark"] .salon-daysheet-panel {
  background: var(--flow-surface, #14161c);
  border-color: var(--flow-border);
}
/* Excel grid always stays light (spreadsheet look) */
html[data-theme="dark"] .salon-ds-excel-wrap,
html[data-theme="dark"] .salon-daysheet-table.is-excel,
html[data-theme="dark"] .salon-daysheet-table.is-excel th,
html[data-theme="dark"] .salon-daysheet-table.is-excel td {
  color: #000;
}
html[data-theme="dark"] .salon-daysheet-table.is-excel .salon-ds-cell {
  color: #000 !important;
  background: transparent !important;
}
.sd-settle-card {
  max-width: 420px;
}
.sd-settle-svc {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--sd-ink);
}
.sd-settle-client {
  margin: 0 0 16px;
  color: var(--sd-muted);
}
.sd-settle-extra {
  margin: -8px 0 14px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--sd-busy, #b42318);
  background: color-mix(in srgb, var(--sd-busy, #b42318) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-busy, #b42318) 22%, transparent);
}
.sd-settle-mem {
  margin: -8px 0 12px;
  font-size: 0.82rem;
  color: var(--sd-accent);
}
.salon-mem-plan {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sd-line, rgba(255,255,255,0.08));
  font-size: 0.88rem;
}
.salon-mem-plan strong { flex: 1; min-width: 0; }
.salon-mem-plan span { color: var(--flow-w45); font-size: 0.8rem; }
.flow-pos-crm-mem { color: var(--flow-accent, #c9a227) !important; }
.sd-settle-due {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--sd-line);
  border-bottom: 1px solid var(--sd-line);
  font-size: 0.95rem;
}
.sd-settle-due strong {
  font-size: 1.35rem;
  color: var(--sd-accent);
}
.sd-settle-items {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.sd-settle-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--sd-ink);
  border-bottom: 1px solid var(--sd-line);
}
.sd-settle-items em {
  font-style: normal;
  color: var(--sd-muted);
}
.sd-hint {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--sd-muted);
}

@media (max-width: 960px) {
  /* Retail / WhatsApp on phone: undo desktop grid — full-width menu column */
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-desk {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    grid-template-columns: none !important;
  }
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-pane {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0;
    padding: 0;
  }
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-grid,
  body.flow-salon-desk.flow-salon-desk-retail #pos-menu-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
  }
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-item,
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-item-dense,
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-item.flow-pos-menu-item-dense {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 12px !important;
    background: color-mix(in srgb, var(--sd-paper, #1a1d24) 88%, transparent) !important;
    box-shadow: inset 0 0 0 1px var(--sd-line, rgba(255, 255, 255, 0.08)) !important;
  }
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-main {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    padding: 10px 10px 6px;
  }
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-main strong {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.82rem;
    line-height: 1.25;
    width: 100%;
  }
  body.flow-salon-desk.flow-salon-desk-retail .rx-svc-meta,
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-price {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.8rem;
  }
  body.flow-salon-desk.flow-salon-desk-retail .flow-pos-menu-stepper {
    width: 100%;
    justify-content: flex-end;
    padding: 0 8px 8px;
    box-sizing: border-box;
  }

  /* Dense receptionist board — more staff + Coming in above the fold */
  .sd-root {
    padding: 0 0 12px;
  }
  .sd-head {
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
  }
  .sd-title {
    font-size: 1rem;
    letter-spacing: -0.02em;
  }
  .sd-sub {
    margin: 0;
    font-size: 0.68rem;
  }
  .sd-head-actions {
    gap: 8px;
  }
  .sd-alerts-btn {
    min-height: 36px;
    min-width: 34px;
    padding: 6px 2px;
  }
  .sd-link {
    font-size: 0.74rem;
    min-height: 36px;
    padding: 6px 2px;
  }
  .sd-retail-bar {
    gap: 8px;
    margin: 0 0 6px;
    padding: 6px 0;
  }
  .sd-retail-bar strong {
    font-size: 0.9rem;
  }

  .sd-start-layout {
    grid-template-columns: 1fr;
  }
  .sd-staff-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .sd-staff {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    min-height: 44px;
    padding: 8px 8px 8px 10px;
    border-radius: 10px;
  }
  .sd-staff:hover {
    transform: none;
  }
  .sd-staff-main {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
  }
  .sd-staff-name {
    font-size: 0.92rem;
    letter-spacing: -0.015em;
    line-height: 1.2;
  }
  .sd-staff-badge {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
  }
  .sd-staff-line {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.7rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  button.sd-staff .sd-staff-cta {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    margin-top: 0;
    padding: 0 10px;
    min-height: 34px;
    min-width: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 0.68rem;
    letter-spacing: 0.01em;
    background: color-mix(in srgb, var(--sd-ink) 8%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-ink) 12%, transparent);
  }
  .sd-staff.is-free .sd-staff-cta {
    background: color-mix(in srgb, var(--sd-free) 22%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-free) 40%, transparent);
  }
  article.sd-staff.is-busy .sd-staff-foot {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 4px;
    padding-top: 0;
  }
  article.sd-staff.is-busy .sd-board-extend {
    padding: 6px 10px;
    font-size: 0.68rem;
    min-height: 32px;
  }
  article.sd-staff.is-busy .sd-staff-cta {
    margin-top: 0;
    padding: 0 12px;
    min-height: 32px;
    border-radius: 7px;
    font-size: 0.68rem;
    background: color-mix(in srgb, var(--sd-busy) 18%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd-busy) 35%, transparent);
  }

  .sd-upcoming {
    margin-top: 8px;
    padding-top: 8px;
  }
  .sd-up-label {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
  }
  .sd-up-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 4px 6px;
    padding: 4px 0;
    font-size: 0.76rem;
    line-height: 1.2;
  }
  .sd-up-row em {
    grid-column: 2;
    font-size: 0.7rem;
  }
  .sd-up-empty,
  .sd-empty {
    font-size: 0.8rem;
    padding: 4px 0;
  }

  .sd-start-services,
  .sd-ticket,
  .sd-settle-card {
    border-radius: 12px;
    padding: 12px;
  }
  .sd-svc {
    min-height: 88px;
    padding: 10px;
    border-radius: 10px;
  }
  .sd-start-services {
    padding: 0;
    border-radius: 0;
  }
  .sd-svc.sd-svc-popular {
    min-height: 150px;
    padding: 11px;
    border-radius: 12px;
  }
  .sd-svc-list {
    grid-template-columns: 1fr;
  }
  .sd-svc.sd-svc-row {
    grid-template-columns: 30px minmax(0, 1fr) auto 8px;
    min-height: 50px;
    padding: 7px 9px;
    border-radius: 9px;
  }
  .sd-svc-row-duration {
    display: none;
  }
}

/* Kitchen board — flush page chrome, never a floating white shell */
.kitchen-board {
  padding: 0;
  margin: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.kitchen-board-chrome {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 18px;
  padding: 0 0 16px;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--flow-border);
  box-shadow: none !important;
  border-radius: 0 !important;
}
.kitchen-board-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.kitchen-board-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kitchen-wa-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--flow-border);
  background: var(--flow-w08);
  color: var(--flow-w70);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.kitchen-wa-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--flow-accent);
  margin: 0;
  cursor: pointer;
}
body.kitchen-wa-off .kitchen-wa-toggle {
  color: var(--flow-w45);
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}
.kitchen-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kitchen-board-top .hd-title { margin: 0 0 4px; color: var(--flow-white); }
.kitchen-board-top .hd-sub { margin: 0; color: var(--flow-w55); font-size: 0.85rem; }
.kitchen-kpis {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.kitchen-kpis span {
  padding: 6px 11px; border-radius: 8px; background: var(--flow-w08);
  border: 1px solid var(--flow-border); font-size: 0.8rem; color: var(--flow-w70);
}
.kitchen-kpis em { font-style: normal; font-weight: 700; color: var(--flow-white); margin-right: 4px; }
.kitchen-batch {
  margin: 0 0 12px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(232, 184, 109, 0.35);
  background: linear-gradient(180deg, rgba(232, 184, 109, 0.12), rgba(232, 184, 109, 0.04));
  overflow: hidden;
}
.kitchen-batch[hidden] { display: none !important; }
.kitchen-batch-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kitchen-batch-toggle:hover {
  background: rgba(232, 184, 109, 0.08);
}
.kitchen-batch-toggle-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
}
.kitchen-batch-toggle-main strong {
  font-size: 0.92rem;
  color: #f0d19a;
  letter-spacing: 0.02em;
}
.kitchen-batch-summary {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--flow-w55);
}
.kitchen-batch-chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #f0d19a;
  border-bottom: 2px solid #f0d19a;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  opacity: 0.85;
}
.kitchen-batch.is-open .kitchen-batch-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.kitchen-batch-body {
  padding: 0 14px 12px;
}
.kitchen-batch-body[hidden] { display: none !important; }
.kitchen-batch-hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--flow-w55);
  line-height: 1.35;
}
.kitchen-batch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 10px;
}
.kitchen-batch-head strong {
  font-size: 0.92rem;
  color: #f0d19a;
  letter-spacing: 0.02em;
}
.kitchen-batch-head span {
  font-size: 0.75rem;
  color: var(--flow-w55);
}
.kitchen-batch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.kitchen-batch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--flow-border);
}
.kitchen-batch-row.is-multi {
  border-color: rgba(232, 184, 109, 0.45);
  background: rgba(232, 184, 109, 0.1);
}
.kitchen-batch-row strong {
  font-size: 0.9rem;
  color: var(--flow-white);
  line-height: 1.25;
}
.kitchen-batch-row em {
  font-style: normal;
  font-weight: 800;
  font-size: 1.05rem;
  color: #f0d19a;
  justify-self: end;
}
.kitchen-batch-row span {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--flow-w55);
  line-height: 1.3;
}
.kitchen-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.kitchen-kanban[hidden],
.kitchen-board-chrome[hidden],
.kitchen-phone-tabs[hidden] {
  display: none !important;
}
.kitchen-off-panel[hidden] {
  display: none !important;
}
/* Full-page empty state when kitchen display is disabled */
#kitchen-board:has(.kitchen-off-panel:not([hidden])) {
  min-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
}
.kitchen-off-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: min(62vh, 560px);
  padding: 32px 20px;
  margin: 0;
  border: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, color-mix(in srgb, var(--flow-accent) 12%, transparent), transparent 70%);
  text-align: center;
  box-sizing: border-box;
}
.kitchen-off-inner {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: kitchen-off-in 0.35s ease both;
}
@keyframes kitchen-off-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.kitchen-off-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: color-mix(in srgb, var(--flow-accent) 90%, #fff);
  background: color-mix(in srgb, var(--flow-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--flow-accent) 28%, transparent);
}
.kitchen-off-title {
  margin: 0;
  font-family: "Cabinet Grotesk", "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--flow-white, #f2f5fb);
  line-height: 1.15;
}
.kitchen-off-copy {
  margin: 0;
  max-width: 32ch;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--flow-w55, rgba(242, 245, 251, 0.55));
}
.kitchen-off-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.kitchen-off-actions .flow-btn {
  min-width: 120px;
}
.kitchen-col {
  background: var(--flow-panel);
  border: 1px solid var(--flow-w10);
  border-radius: 14px;
  min-height: 280px;
  display: flex; flex-direction: column;
}
.kitchen-col > header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--flow-w08);
  font-size: 0.88rem;
}
.kitchen-col > header span { color: var(--flow-w45); font-size: 0.78rem; }
.kitchen-col-cards {
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  max-height: min(70vh, 720px); overflow: auto;
}
.kitchen-card {
  background: var(--flow-w06);
  border: 1px solid var(--flow-w10);
  border-radius: 12px;
  padding: 12px;
}
.kitchen-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px;
}
.kitchen-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kitchen-card-head strong { font-size: 1rem; }
.kitchen-card-head span { font-size: 0.72rem; color: var(--flow-w45); }
.kitchen-card-head .kitchen-token {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.kitchen-timer {
  flex: 0 0 auto;
  align-self: flex-start;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--flow-w08, rgba(255, 255, 255, 0.08));
  color: var(--flow-w85);
  line-height: 1;
}
.kitchen-timer.is-warn {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}
.kitchen-timer.is-late {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.kitchen-call-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--flow-accent, #14b8a6) 40%, var(--flow-w10));
  background: color-mix(in srgb, var(--flow-accent, #14b8a6) 14%, transparent);
}
.kitchen-call-name span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--flow-accent, #14b8a6) 85%, #fff);
}
.kitchen-call-name strong {
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--flow-w95);
  word-break: break-word;
}
.kitchen-card.has-call-name.is-parcel {
  border-color: color-mix(in srgb, var(--flow-accent, #14b8a6) 55%, var(--flow-w10));
}
.kitchen-card.is-parcel {
  border-color: color-mix(in srgb, var(--flow-accent, #d4af37) 45%, var(--flow-w10));
}

/* Takeaway size pills on menu cards (dal / gravy only) */
.flow-pos-menu-item.has-sizes {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  cursor: default;
  padding-bottom: 10px;
}
.flow-pos-menu-hit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.flow-pos-menu-hit:disabled { cursor: default; }
.flow-pos-menu-item.has-sizes .flow-pos-size-pills {
  padding: 0 10px 2px;
}
.flow-pos-menu-price small {
  font-size: 0.65em;
  font-weight: 500;
  opacity: 0.55;
  margin-left: 2px;
}
.flow-pos-size-pills {
  display: flex;
  gap: 6px;
  padding: 0 2px;
}
.flow-pos-size-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--flow-w15, rgba(255,255,255,0.14));
  background: var(--flow-w06, rgba(255,255,255,0.06));
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
}
.flow-pos-size-pill:hover {
  border-color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 12%, transparent);
}
.flow-pos-size-pill:active { transform: scale(0.98); }
.flow-pos-size-pill em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.flow-pos-size-pill span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--flow-accent);
}
.flow-pos-menu-item-dense.has-sizes {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding-bottom: 8px;
}
.flow-pos-menu-item-dense .flow-pos-dense-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.flow-pos-menu-item-dense .flow-pos-dense-top .flow-pos-menu-main {
  flex: 1 1 auto;
  min-width: 0;
}
.flow-pos-menu-item-dense .flow-pos-size-pills {
  padding: 0 4px 2px;
}
html[data-theme="light"] .flow-pos-size-pill {
  background: #f3f4f6;
  border-color: rgba(12, 12, 24, 0.1);
}
html[data-theme="light"] .flow-pos-size-pill:hover {
  background: #fff;
  border-color: oklch(0.55 0.12 195 / 0.4);
}
html[data-theme="light"] .flow-pos-size-pill span {
  color: oklch(0.42 0.12 195);
}

/* Counter parcel token popup — above pay loading (1250) so Done is always tappable */
.pos-parcel-token-bg {
  z-index: 1300 !important;
}
.pos-parcel-token-bg.open { display: flex; }
.pos-parcel-token-modal {
  text-align: center;
  max-width: min(360px, 92vw);
  padding: 28px 24px 22px;
}
.pos-parcel-token-label {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flow-w55);
}
.pos-parcel-token-num {
  margin: 0;
  font-size: clamp(3.4rem, 14vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--hd-text-primary, var(--flow-white));
}
.pos-parcel-token-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--flow-accent) 40%, var(--flow-w10));
  background: color-mix(in srgb, var(--flow-accent) 12%, transparent);
}
.pos-parcel-token-call[hidden] { display: none !important; }
.pos-parcel-token-call span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--flow-accent);
}
.pos-parcel-token-call strong {
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--flow-w95);
  word-break: break-word;
  text-align: center;
}
.pos-parcel-token-hint {
  margin: 12px 0 4px;
  font-size: 0.95rem;
  color: var(--flow-w70);
}
.pos-parcel-token-sub {
  margin: 0 0 18px;
  font-size: 0.8rem;
  color: var(--flow-w45);
}
.pos-parcel-token-modal .flow-btn {
  min-width: 120px;
}
.pos-parcel-token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}
.kitchen-card-items {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 0.78rem; line-height: 1.3; color: var(--flow-w85); margin-bottom: 6px;
}
.kitchen-card-items span em { font-style: normal; color: var(--flow-w45); font-weight: 600; }
.kitchen-guest {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 0.7rem; color: var(--flow-w55); margin-bottom: 6px;
}
.kitchen-guest-phone {
  font-weight: 650; color: var(--flow-w80); font-variant-numeric: tabular-nums;
}
.kitchen-guest-name { color: var(--flow-w45); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kitchen-bill-sent {
  font-style: normal; font-size: 0.65rem; font-weight: 650;
  padding: 1px 6px; border-radius: 999px;
  background: #05966922; color: #34d399;
}
.kitchen-round {
  display: inline-block; font-style: normal; font-size: 0.68rem; font-weight: 650;
  margin-bottom: 6px; padding: 2px 8px; border-radius: 999px;
  background: #3b82f622; color: #93c5fd;
}
.kitchen-note { margin: 0 0 8px; font-size: 0.75rem; color: var(--flow-w50); font-style: italic; }
.kitchen-rapido {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(232, 184, 109, 0.14);
  border: 1px solid rgba(232, 184, 109, 0.28);
}
.kitchen-rapido strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #e8b86d;
}
.kitchen-rapido span {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--flow-w55);
}
.kitchen-rapido.is-wait {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.kitchen-rapido.is-wait strong { color: var(--flow-w70); }
.kitchen-card.is-rapido .kitchen-card-head span { color: #e8b86d; }
.kitchen-card-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px;
}
.kitchen-pay {
  font-style: normal; font-size: 0.7rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}
.kitchen-pay.paid { background: #05966922; color: #34d399; }
.kitchen-pay.unpaid { background: #f59e0b22; color: #fbbf24; }
.kitchen-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 960px) {
  .kitchen-kanban { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .kitchen-kanban { grid-template-columns: 1fr; }
}

/* ── Phone kitchen board (restaurant only) ── */
@media (max-width: 960px) {
  .kitchen-phone-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 10px;
    padding: 0 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .kitchen-phone-tabs::-webkit-scrollbar { display: none; }
  .kitchen-phone-tabs[hidden] { display: none !important; }
  .kitchen-phone-tab {
    appearance: none;
    border: 0;
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px;
    border-radius: 10px;
    background: var(--flow-w06);
    box-shadow: inset 0 0 0 1px var(--flow-w10);
    color: var(--flow-w60);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    touch-action: manipulation;
  }
  .kitchen-phone-tab em {
    font-style: normal;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--flow-w90);
  }
  .kitchen-phone-tab.active {
    background: var(--flow-accent);
    color: #111;
    box-shadow: none;
  }
  .kitchen-phone-tab.active em { color: #111; }

  .kitchen-kanban-phone {
    display: block !important;
    grid-template-columns: none !important;
  }
  .kitchen-phone-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
  .kitchen-kanban-phone .kitchen-card {
    padding: 10px 12px;
    border-radius: 12px;
  }
  .kitchen-kanban-phone .kitchen-card-head strong {
    font-size: 1.05rem;
  }
  .kitchen-kanban-phone .kitchen-timer {
    font-size: 1.05rem;
    padding: 5px 9px;
  }
  .kitchen-kanban-phone .kitchen-call-name {
    padding: 12px 12px;
    margin-bottom: 8px;
  }
  .kitchen-kanban-phone .kitchen-call-name strong {
    font-size: 1.55rem;
  }
  .kitchen-kanban-phone .kitchen-card-items {
    font-size: 0.82rem;
    gap: 6px 12px;
    margin-bottom: 8px;
  }
  .kitchen-kanban-phone .kitchen-card-actions {
    display: grid;
    grid-template-columns: 1.4fr 1fr auto;
    gap: 6px;
  }
  .kitchen-kanban-phone .kitchen-card-actions .flow-btn {
    min-height: 42px;
    font-size: 0.78rem;
    padding: 8px 10px;
  }
  .kitchen-kanban-phone .kitchen-card-actions [data-kt-advance] {
    font-weight: 800;
  }

  body.kitchen-phone-immersive .app-topbar,
  body.kitchen-phone-immersive .app-mobile-nav {
    display: none !important;
  }
  body.kitchen-phone-immersive .app-main {
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  body.kitchen-phone-immersive .kitchen-board-top {
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
  }
  body.kitchen-phone-immersive .kitchen-board-title {
    flex: 1 1 auto;
    min-width: 0;
  }
  body.kitchen-phone-immersive .kitchen-board-top .hd-sub { display: none; }
  body.kitchen-phone-immersive .kitchen-board-top .hd-title {
    font-size: 1.2rem;
    margin: 0;
  }
  body.kitchen-phone-immersive .kitchen-board-chrome {
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  /* Phone tabs already show New/Prep/Ready/Done — drop duplicate KPI strip */
  body.kitchen-phone-immersive .kitchen-kpis {
    display: none !important;
  }
  body.kitchen-phone-immersive .kitchen-batch {
    margin: 0 0 10px;
    border-radius: 12px;
  }
  body.kitchen-phone-immersive .kitchen-batch-toggle {
    padding: 10px 12px;
  }
  body.kitchen-phone-immersive .kitchen-batch-body {
    padding: 0 12px 10px;
  }
  body.kitchen-phone-immersive .kitchen-batch-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  body.kitchen-phone-immersive .kitchen-batch-row {
    padding: 8px 10px;
  }
  body.kitchen-phone-immersive .kitchen-batch-hint {
    font-size: 0.7rem;
  }
  body.kitchen-phone-immersive .kitchen-board-actions {
    flex-wrap: nowrap;
    gap: 6px;
    flex: 0 0 auto;
  }
  body.kitchen-phone-immersive .kitchen-board-actions .flow-btn {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.72rem;
  }
  body.kitchen-phone-immersive .kitchen-icon-btn {
    width: 36px;
    min-width: 36px;
    padding: 6px;
    justify-content: center;
  }
  body.kitchen-phone-immersive .kitchen-icon-btn .kitchen-action-label {
    display: none;
  }
  body.kitchen-phone-immersive .kitchen-exit-btn {
    border-color: var(--flow-border);
    background: var(--flow-card);
    color: var(--flow-w90);
    font-weight: 800;
  }
  body.kitchen-phone-immersive .kitchen-phone-tabs {
    margin-bottom: 12px;
  }

  .kitchen-off-panel {
    min-height: min(58vh, 480px);
    padding: 28px 16px;
  }
  .kitchen-off-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }
}

.flow-pos-settings-hint {
  flex: 1 1 100%;
  margin: 0 0 4px;
  font-size: 0.72rem;
}
.flow-pos-owner-pin-box {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-w06);
}
.flow-pos-owner-pin-box strong {
  font-size: 0.88rem;
  color: var(--flow-w90);
}
.flow-pos-owner-pin-box label {
  flex: 1 1 auto !important;
}

@media (max-width: 960px) {
  /* Immersive phone POS — solid opaque chrome (no frosted blur overlay) */
  body.pos-phone-immersive:not(.flow-salon-phone) .app-mobile-nav,
  body.pos-phone-immersive:not(.flow-salon-phone) .flow-demo-banner {
    display: none !important;
  }
  /* No floating top bar. It held a single bell, cost 52px of stations, and
     being position:fixed it sat over the content — that pale band is what got
     reported as a "blur overlay". The POS tab row already carries a chrome
     cluster (kitchen / alerts / refresh / exit), so the bell lives there. */
  body.pos-phone-immersive:not(.flow-salon-phone) .app-topbar {
    display: none !important;
  }
  /* One bell only — the POS chrome cluster owns it, inline with the tabs */
  body.pos-phone-immersive:not(.flow-salon-phone) #btn-pos-session-alerts,
  body.pos-phone-immersive:not(.flow-salon-phone) .sd-alerts-btn {
    display: none !important;
  }
  body.pos-phone-immersive:not(.flow-salon-phone) #btn-pos-alerts {
    color: var(--flow-accent);
  }
  /* Banners always above session chrome / desk — staff can dismiss + stop alarm */
  body.pos-phone-immersive .flow-alerts-stack,
  body.flow-salon-desk.pos-phone-immersive .flow-alerts-stack,
  body.flow-salon-desk .flow-alerts-stack {
    z-index: 150000;
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    display: flex !important;
    visibility: visible !important;
    opacity: 1;
    pointer-events: none;
    touch-action: manipulation;
  }
  body.pos-phone-immersive .flow-alerts-stack .flow-alerts-banner,
  body.pos-phone-immersive .flow-alerts-stack .flow-alerts-clear-all,
  body.flow-salon-desk .flow-alerts-stack .flow-alerts-banner,
  body.flow-salon-desk .flow-alerts-stack .flow-alerts-clear-all {
    pointer-events: auto;
    touch-action: manipulation;
  }
  @media (max-width: 960px) {
    .flow-alerts-stack {
      z-index: 150000 !important;
      left: max(10px, env(safe-area-inset-left, 0px));
      right: max(10px, env(safe-area-inset-right, 0px));
      width: auto;
      max-width: none;
    }
    .flow-alerts-banner.is-in {
      opacity: 1 !important;
      transform: translateY(0) !important;
    }
    .flow-alerts-clear-all {
      pointer-events: auto;
      min-height: 44px;
      font-size: 16px;
    }
  }
  body.pos-phone-immersive .flow-alerts-banner-x {
    width: 40px;
    height: 40px;
    opacity: 1;
  }
  body.pos-phone-immersive .flow-alerts-panel,
  body.flow-salon-desk .flow-alerts-panel {
    max-width: calc(100vw - 20px);
    touch-action: manipulation;
  }
  body.pos-phone-immersive .flow-alerts-panel-btn {
    font-size: 16px;
    min-height: 40px;
    touch-action: manipulation;
  }
  body.pos-phone-immersive .app-main {
    /* No fixed chrome above any more — stations start at the top of the screen */
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
  body.pos-phone-immersive .flow-pos-phone-floorhead {
    display: none !important;
  }
  /* In a table session: hide Floor/Online/QR tabs — only menu */
  body.pos-phone-session-open .flow-pos-tabs {
    display: none !important;
  }
  body.pos-phone-immersive .flow-pos-tabs {
    margin-bottom: 0.35rem;
    padding-bottom: 4px;
  }
  body.pos-phone-immersive .flow-pos-floor-wrap {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  /*
   * Phone session chrome (sticky sessionbar + cats) was built around ONE scroller:
   * .app-main. Restaurant desk CSS locks that to overflow:hidden + #page-pos
   * height:100% so the desktop menu grid can scroll internally — on phone that
   * clips the dense list (worse once Half/Full rows grew taller).
   *
   * Fix: in a phone table session only, restore page scroll. Do NOT nest-scroll
   * the menu grid (that fights sticky cats and breaks when the flex height
   * chain is incomplete). Floor mode keeps the restaurant lock + floor-wrap scroll.
   */
  body.flow-acct-restaurant.pos-phone-session-open .app-main:has(#page-pos.active) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    /* Natural document flow — content height drives scroll, not a nested pane */
    display: block !important;
  }
  body.flow-acct-restaurant.pos-phone-session-open #page-pos.active {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    flex: none !important;
    overflow: visible !important;
  }
  body.flow-acct-restaurant.pos-phone-session-open #pos-panel-billing.pos-phone-session.active {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  body.pos-phone-immersive #pos-panel-billing.pos-phone-session .flow-pos-menu-grid {
    /* Grow with items; .app-main scrolls. Clear fixed bill bar + Half/Full pills. */
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }

  /*
   * Sticky session chrome must OWN the top safe-area. If .app-main keeps
   * padding-top: safe-area, scrolled menu rows paint through that gap above
   * the sticky bar (see "Peri Peri…" behind Table header on iPhone).
   */
  body.pos-phone-session-open.pos-phone-immersive .app-main,
  body.pos-phone-session-open.pos-phone-immersive .app-main:has(#page-pos.active) {
    padding-top: 0 !important;
  }
  body.pos-phone-session-open .flow-pos-phone-sessionbar {
    top: 0;
    z-index: 50;
    margin: 0;
    /* Pull into horizontal padding so no side slits show scrolled text */
    margin-left: calc(-1 * max(10px, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(10px, env(safe-area-inset-right, 0px)));
    padding: calc(6px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 10px
      max(10px, env(safe-area-inset-left, 0px));
    background: var(--flow-bg, #08080a) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    /* Extra opaque cover so nothing bleeds through while sticky */
    box-shadow: 0 1px 0 var(--flow-bg, #08080a);
  }
  body.pos-phone-session-open #pos-panel-billing.pos-phone-session .flow-pos-menu-toolbar {
    z-index: 45;
    /* Stick just under sessionbar: back btn 34 + paddings ≈ 50, + safe-area */
    top: calc(50px + env(safe-area-inset-top, 0px));
    margin-left: calc(-1 * max(10px, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(10px, env(safe-area-inset-right, 0px)));
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    background: var(--flow-bg, #08080a) !important;
    box-shadow: 0 8px 12px -8px rgba(0, 0, 0, 0.45);
  }
  html[data-theme="light"] body.pos-phone-session-open .flow-pos-phone-sessionbar,
  html[data-theme="light"] body.pos-phone-session-open #pos-panel-billing.pos-phone-session .flow-pos-menu-toolbar {
    background: var(--flow-bg, #eef0f7) !important;
    box-shadow: 0 1px 0 var(--flow-bg, #eef0f7);
    border-bottom-color: rgba(12, 12, 24, 0.08);
  }

  /* ── Phone POS rethink: floor-first, dense session — desktop rules above stay untouched ── */
  #page-pos {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
  }
  #page-pos button,
  #page-pos a,
  #page-pos input,
  #page-pos select,
  #page-pos label,
  #page-pos .flow-pos-menu-item,
  #page-pos .flow-pos-floor-card,
  #page-pos .flow-pos-cat,
  #page-pos .flow-pos-tab {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .flow-pos-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    margin: 0 -4px 0.55rem;
    padding: 2px 4px 8px;
    overscroll-behavior-x: contain;
  }
  .flow-pos-tabs::-webkit-scrollbar { display: none; }
  .flow-pos-tab {
    flex: 0 0 auto;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 999px;
    background: var(--flow-w06);
    box-shadow: inset 0 0 0 1px var(--flow-w10);
  }
  .flow-pos-tab .pos-tab-lg { display: none; }
  .flow-pos-tab .pos-tab-sm { display: inline; }
  .flow-pos-tab.active {
    background: var(--flow-accent);
    color: #111;
    box-shadow: none;
  }
  .flow-pos-chrome-cluster {
    display: inline-flex;
    margin-left: auto;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding-left: 6px;
  }
  .flow-pos-chrome-btn {
    display: none;
    margin-left: 0;
    padding: 0.35rem !important;
    width: 34px;
    min-width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
  }
  .flow-pos-chrome-btn + .flow-pos-chrome-btn {
    margin-left: 0;
  }
  .flow-pos-more-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  body.pos-phone-immersive .flow-pos-chrome-cluster {
    display: inline-flex !important;
  }
  body.pos-phone-immersive .flow-pos-chrome-btn {
    display: inline-flex !important;
  }
  #btn-pos-goto-kitchen[hidden] {
    display: none !important;
  }
  /* More sections live in the hub cards — keep the top strip lean */
  .flow-pos-tab-more { display: none !important; }
  .flow-pos-more-toggle.active {
    background: var(--flow-accent) !important;
    color: #111 !important;
    box-shadow: none !important;
  }

  .flow-pos-more-hub {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    min-height: min(70vh, 560px);
    padding: 12px 8px 24px;
    gap: 16px;
  }
  .flow-pos-more-hub-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
  }
  .flow-pos-more-hub-head strong {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--flow-w95);
    letter-spacing: -0.02em;
  }
  .flow-pos-more-hub-head span {
    font-size: 0.78rem;
    color: var(--flow-w50);
    font-weight: 600;
  }
  .flow-pos-more-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
  }
  .flow-pos-more-card {
    appearance: none;
    border: 1px solid var(--flow-w12);
    background: var(--flow-w06);
    border-radius: 16px;
    padding: 16px 12px;
    min-height: 108px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 4px;
    text-align: left;
    cursor: pointer;
    color: var(--flow-w90);
    font: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  .flow-pos-more-card i {
    color: var(--flow-accent);
    margin-bottom: 6px;
  }
  .flow-pos-more-card strong {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
  }
  .flow-pos-more-card span {
    font-size: 0.72rem;
    color: var(--flow-w50);
    font-weight: 600;
    line-height: 1.25;
  }
  .flow-pos-more-card:active {
    border-color: var(--flow-accent);
    background: color-mix(in srgb, var(--flow-accent) 12%, var(--flow-w06));
  }
  #pos-panel-more[hidden] { display: none !important; }
  #pos-panel-more.active {
    display: block;
  }

  /* Hide secondary POS chrome while on floor/session billing */
  #page-pos.pos-phone-on-session .flow-pos-tabs {
    display: none;
  }

  .flow-pos-phone-sessionbar {
    display: flex;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0 0 4px;
    padding: 4px 0 10px;
    border-radius: 0;
    background: var(--flow-bg, #eef0f7);
    border: 0;
    border-bottom: 1px solid rgba(12, 12, 24, 0.08);
    box-shadow: none;
    backdrop-filter: none;
  }
  .flow-pos-phone-sessionbar[hidden] { display: none !important; }
  .flow-pos-phone-back {
    appearance: none;
    border: 0;
    background: var(--flow-w08);
    color: var(--flow-w90);
    border-radius: 10px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    justify-content: center;
  }
  .flow-pos-phone-back span { display: none; }
  .flow-pos-phone-session-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
  .flow-pos-phone-session-meta strong {
    font-size: 0.95rem;
    line-height: 1.1;
    color: var(--flow-w95);
    font-weight: 800;
  }
  .flow-pos-phone-session-meta span {
    font-size: 0.7rem;
    color: var(--flow-w50);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .flow-pos-phone-session-meta span[hidden] { display: none !important; }
  .flow-pos-phone-alerts {
    appearance: none;
    position: relative;
    border: 0;
    background: var(--flow-w08);
    color: var(--flow-w90);
    border-radius: 10px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    cursor: pointer;
  }
  .flow-pos-phone-alerts.is-muted { opacity: 0.65; }
  .flow-pos-phone-alerts .flow-alerts-badge {
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 0.58rem;
  }
  .flow-pos-phone-billbtn {
    appearance: none;
    border: 0;
    background: oklch(0.48 0.14 195);
    color: #fff;
    box-shadow: none;
    border-radius: 10px;
    padding: 9px 16px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    flex: 0 0 auto;
    min-width: 72px;
    min-height: 36px;
    line-height: 1;
  }
  .flow-pos-phone-billbtn.is-disabled,
  .flow-pos-phone-billbtn:disabled {
    opacity: 1;
    color: rgba(255, 255, 255, 0.92);
    border: 0;
    background: oklch(0.72 0.06 195);
    cursor: default;
  }

  .flow-pos-phone-floorhead {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 8px;
  }
  .flow-pos-phone-floorhead strong {
    font-size: 1.05rem;
    color: var(--flow-w95);
    letter-spacing: -0.02em;
  }
  .flow-pos-phone-floorhead span {
    font-size: 0.72rem;
    color: var(--flow-w50);
  }
  #pos-panel-billing.pos-phone-session .flow-pos-phone-floorhead { display: none; }

  /* Floor-first: big table map; hide menu until a table is picked */
  #pos-panel-billing.pos-phone-floor.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  #pos-panel-billing.pos-phone-floor:not(.active),
  #pos-panel-billing.pos-phone-floor[hidden] {
    display: none !important;
  }
  #pos-panel-billing.pos-phone-floor .flow-pos-desk { display: none; }

  .flow-pos-floor-wrap {
    margin-bottom: 0;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  #pos-panel-billing.pos-phone-session .flow-pos-floor-wrap {
    display: none;
    padding-bottom: 0;
  }
  .flow-pos-floor {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: stretch;
    overflow: visible;
    flex: 0 0 auto;
  }
  .flow-pos-floor-tables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 8px;
    width: 100%;
  }
  .flow-pos-floor-channels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .flow-pos-floor-sep {
    width: 100%;
    height: 1px;
    margin: 0;
    flex: none;
    background: var(--flow-border);
  }
  .flow-pos-floor-card {
    flex: none;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 60px;
    padding: 8px 4px;
    border-radius: 12px;
    flex-direction: column;
    gap: 2px;
    touch-action: manipulation;
  }
  .flow-pos-floor-card .floor-no {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
  }
  .flow-pos-floor-card .floor-sub {
    display: block;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.1;
  }
  .flow-pos-floor-card.free .floor-sub {
    display: block;
    color: var(--flow-w40);
    font-weight: 600;
  }
  .flow-pos-floor-card.channel {
    min-height: 48px;
    padding: 8px 6px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .flow-pos-floor-card.channel .floor-no { font-size: 0.72rem; }
  .flow-pos-floor-card.channel .floor-sub {
    display: none;
  }
  /* Grow with the bill — don't clip mid-item (floor wrap scrolls if needed) */
  .flow-pos-open-panel {
    display: flex;
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    gap: 10px;
  }
  .flow-pos-open-panel[hidden],
  .flow-pos-open-panel:empty {
    display: none !important;
    flex: 0;
    min-height: 0;
    max-height: 0;
  }
  .flow-pos-open-list {
    gap: 10px;
    padding-bottom: 8px;
  }
  .flow-pos-open-card {
    padding: 14px 14px 12px;
    border-radius: 16px;
    gap: 10px;
  }
  .flow-pos-open-card-top strong {
    font-size: 1.05rem;
  }
  .flow-pos-open-card-top em {
    font-size: 1.05rem;
  }
  .flow-pos-open-items li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
  }
  .flow-pos-open-items li span {
    flex: 1 1 auto;
    min-width: 0;
  }
  .flow-pos-open-items li em {
    flex: 0 0 auto;
    font-style: normal;
    color: var(--flow-w50);
  }
  .flow-pos-open-rm {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid oklch(0.55 0.15 25 / 0.45);
    background: oklch(0.35 0.08 25 / 0.35);
    color: #f87171;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .flow-pos-open-hint {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    color: var(--flow-w40);
  }

  .flow-pos-desk {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
  }
  .flow-pos-menu-pane {
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-width: 0;
  }
  #pos-panel-billing.pos-phone-session .flow-pos-menu-pane {
    margin: 0;
    background: transparent !important;
  }
  .flow-pos-menu-toolbar {
    gap: 6px;
    margin-bottom: 0;
    position: sticky;
    top: 36px;
    z-index: 30;
    padding: 4px 0 8px;
    background: var(--flow-bg, #eef0f7);
    border: 0;
    box-shadow: none;
  }
  .flow-pos-menu-tools {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .flow-pos-search-toggle {
    display: none;
  }
  #pos-menu-search {
    min-height: 36px;
    font-size: 0.82rem;
    border-radius: 10px;
    padding: 6px 10px;
  }
  .flow-pos-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0;
    gap: 4px;
  }
  .flow-pos-cats::-webkit-scrollbar { display: none; }
  .flow-pos-cat {
    flex: 0 0 auto;
    padding: 0.22rem 0.55rem;
    font-size: 0.68rem;
    background: transparent;
    border-color: var(--flow-w15);
  }

  /* One flat list — no nested cards; page (.app-main) scrolls in phone session */
  .flow-pos-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 0 0 calc(132px + env(safe-area-inset-bottom, 0px));
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .flow-pos-menu-item,
  .flow-pos-menu-item-dense {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 0;
    border-radius: 0 !important;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }
  .flow-pos-menu-item-dense,
  .flow-pos-menu-item.flow-pos-menu-item-dense {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    border: 0 !important;
    border-bottom: 1px solid rgba(12, 12, 24, 0.08) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--flow-w90);
    padding: 4px 2px;
    transform: none !important;
  }
  /* Half/Full (and 500/750) — stack under the name, don't squash into the row */
  .flow-pos-menu-item-dense.has-sizes,
  .flow-pos-menu-item.flow-pos-menu-item-dense.has-sizes {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding: 6px 2px 10px !important;
    min-height: 0;
  }
  .flow-pos-menu-item-dense .flow-pos-dense-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }
  .flow-pos-menu-item-dense.has-sizes .flow-pos-dense-top {
    width: 100%;
  }
  .flow-pos-menu-item-dense.has-sizes .flow-pos-menu-main {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 4px 0;
  }
  .flow-pos-menu-item-dense.has-sizes .flow-pos-menu-main:disabled {
    opacity: 1;
    cursor: default;
  }
  .flow-pos-menu-item-dense.has-sizes .flow-pos-size-pills,
  .flow-pos-menu-item-dense .flow-pos-portion-pills {
    display: flex !important;
    width: 100%;
    flex: 0 0 auto;
    gap: 8px;
    padding: 0 2px 2px;
    box-sizing: border-box;
  }
  .flow-pos-menu-item-dense.has-sizes .flow-pos-size-pill {
    flex: 1 1 0;
    min-height: 38px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    touch-action: manipulation;
  }
  .flow-pos-menu-item-dense.has-sizes .flow-pos-size-pill em {
    font-size: 0.78rem;
  }
  .flow-pos-menu-item-dense.has-sizes .flow-pos-size-pill span {
    font-size: 0.78rem;
  }
  .flow-pos-menu-item-dense:last-child,
  .flow-pos-menu-item.flow-pos-menu-item-dense:last-child {
    border-bottom: 0 !important;
  }
  .flow-pos-menu-item:hover:not(:disabled) {
    transform: none !important;
    border-color: transparent !important;
    background: transparent !important;
  }
  .flow-pos-menu-item .flow-pos-menu-thumb {
    display: none;
  }
  .flow-pos-menu-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
  }
  .flow-pos-menu-stepper:not(.is-on) .flow-pos-menu-step:not(.flow-pos-menu-step-plus),
  .flow-pos-menu-stepper:not(.is-on) .flow-pos-menu-qty {
    display: none;
  }
  .flow-pos-menu-step {
    appearance: none;
    border: 0;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
    color: var(--flow-w80);
    font: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
  }
  .flow-pos-menu-step:disabled {
    opacity: 0.25;
    cursor: default;
  }
  .flow-pos-menu-step-plus {
    background: color-mix(in srgb, var(--flow-accent) 18%, transparent);
    color: var(--flow-w95);
  }
  .flow-pos-menu-main {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 4px;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
  }
  .flow-pos-menu-main:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .flow-pos-menu-main strong {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .flow-pos-menu-item .flow-pos-menu-copy {
    display: none;
  }
  .flow-pos-menu-item .flow-pos-menu-price {
    flex: 0 0 auto;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--flow-w55);
  }
  .flow-pos-menu-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 22px;
    padding: 0 2px;
    border-radius: 0;
    background: transparent;
    color: var(--flow-w95);
    font-size: 0.8rem;
    font-weight: 800;
    flex: 0 0 auto;
    margin: 0;
  }
  .flow-pos-menu-qty[hidden] { display: none !important; }
  .flow-pos-menu-item.in-cart,
  .flow-pos-menu-item-dense.in-cart {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .flow-pos-menu-item.in-cart .flow-pos-menu-price {
    color: var(--flow-accent);
  }

  /* Phone session: search icon until opened */
  #pos-panel-billing.pos-phone-session .flow-pos-search-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--flow-w70);
    cursor: pointer;
    flex: 0 0 auto;
  }
  #pos-panel-billing.pos-phone-session .flow-pos-search-toggle.is-on {
    color: var(--flow-accent);
    background: color-mix(in srgb, var(--flow-accent) 12%, transparent);
  }
  #pos-panel-billing.pos-phone-session .flow-pos-menu-tools:not(.is-searching) #pos-menu-search {
    display: none;
  }
  #pos-panel-billing.pos-phone-session .flow-pos-menu-tools.is-searching {
    width: 100%;
  }
  #pos-panel-billing.pos-phone-session .flow-pos-menu-tools.is-searching #pos-menu-search {
    display: block;
    flex: 1;
    min-height: 34px;
    font-size: 0.85rem;
    padding: 6px 10px;
  }
  #pos-panel-billing.pos-phone-session .flow-pos-menu-tools.is-searching + .flow-pos-cats {
    display: none;
  }

  /* Cart sheet: guest/totals compact — items dominate */
  .flow-pos-cart-meta-slim {
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
    margin: 0 !important;
  }
  .flow-pos-cart-meta-slim #pos-staff { display: none !important; }
  .flow-pos-cart-meta-slim .flow-pos-input {
    min-height: 32px !important;
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    border-radius: 8px !important;
  }

  /* Mobile bill sheet — portaled to <body> only while open; must not block menu taps when closed */
  .flow-pos-cart-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    pointer-events: none !important;
    transition: opacity 0.2s ease;
  }
  #pos-cart-backdrop[hidden] {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
  body.pos-cart-open .flow-pos-cart-backdrop,
  body.pos-cart-open #pos-cart-backdrop {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .flow-pos-cart-pane {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    z-index: 1210 !important;
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    max-width: 100vw !important;
    max-height: min(94dvh, 820px) !important;
    height: min(88dvh, 720px) !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    background: #12151c !important;
    border-color: rgba(255, 255, 255, 0.1);
    padding: 4px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    gap: 6px !important;
    transform: translate3d(0, 110%, 0) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
  }
  /* Closed sheet must never steal taps from the menu (was covering the viewport) */
  body:not(.pos-cart-open) #pos-cart-pane.flow-pos-cart-pane {
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate3d(0, 110%, 0) !important;
  }
  body.pos-cart-open .flow-pos-cart-pane,
  body.pos-cart-open #pos-cart-pane.flow-pos-cart-pane {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  html[data-theme="light"] .flow-pos-cart-pane {
    background: #ffffff;
    border-color: rgba(12, 12, 24, 0.1);
    box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.18);
  }
  html[data-theme="light"] .flow-pos-cart-backdrop {
    background: rgba(15, 23, 42, 0.45);
  }
  html[data-theme="light"] .flow-pos-pay-grid,
  html[data-theme="light"] .flow-pos-pay-grid.is-open {
    background: #ffffff;
    border-color: rgba(12, 12, 24, 0.1);
  }
  html[data-theme="light"] .flow-pos-mobile-billbar {
    background: #ffffff;
    border-top-color: rgba(12, 12, 24, 0.1);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
  }
  .flow-pos-cart-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 auto;
    min-height: 20px;
    margin: 0;
  }
  .flow-pos-cart-sheet-handle > span {
    width: 36px;
    height: 3px;
    border-radius: 999px;
    background: var(--flow-w20);
  }
  .flow-pos-cart-head {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px !important;
    margin: 0 !important;
    align-items: center;
    min-height: 40px;
  }
  .flow-pos-cart-head h3 {
    font-size: 1rem !important;
    margin: 0 !important;
    line-height: 1.15 !important;
  }
  .flow-pos-cart-actions {
    gap: 6px;
    height: 40px;
  }
  .flow-pos-cart-close {
    display: inline-flex !important;
  }
  .flow-pos-cart-close,
  .flow-pos-cart-actions #btn-pos-split-table,
  .flow-pos-cart-head .flow-btn {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 14px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    line-height: 1 !important;
  }
  .flow-pos-cart-head select {
    min-height: 32px;
    max-width: 100%;
  }
  .flow-pos-cart-meta {
    flex: 0 0 auto;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .flow-pos-party-row { flex: 0 0 auto; margin: 0 !important; }

  /* ITEMS — primary surface of the sheet */
  .flow-pos-cart-lines {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px !important;
    padding: 4px 6px !important;
    border-width: 1px !important;
  }
  .flow-pos-cart-line,
  .flow-pos-cart-line-sent {
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 6px !important;
    min-height: 58px;
    border-bottom-color: var(--flow-w10) !important;
  }
  .flow-pos-cart-line > div:first-child,
  .flow-pos-cart-line-sent > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }
  .flow-pos-cart-line strong,
  .flow-pos-cart-line-sent strong {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: var(--flow-w95) !important;
  }
  .flow-pos-cart-line span,
  .flow-pos-cart-line-sent span {
    font-size: 0.86rem !important;
    color: var(--flow-w55) !important;
    margin-top: 2px;
    display: block;
  }
  .flow-pos-cart-line-actions {
    gap: 8px !important;
    flex: 0 0 auto;
  }
  .flow-pos-cart-line-actions strong {
    font-size: 1.02rem !important;
    min-width: 3.2rem;
    text-align: right;
  }
  .flow-pos-cart-line-actions button,
  .flow-pos-cart-line-sent .flow-pos-cart-line-actions button {
    min-width: 44px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 1.25rem !important;
    border-radius: 11px !important;
  }

  /* Totals + pay — keep short */
  .flow-pos-cart-totals {
    flex: 0 0 auto !important;
    gap: 1px !important;
    margin: 0 !important;
    padding: 2px 0 0 !important;
  }
  .flow-pos-cart-totals .flow-pos-total-row {
    font-size: 0.68rem !important;
    min-height: 22px;
    padding: 1px 0 !important;
    color: var(--flow-w55) !important;
  }
  .flow-pos-cart-totals .flow-pos-total-row strong {
    font-size: 0.72rem !important;
    font-weight: 600;
  }
  .flow-pos-cart-totals .flow-pos-input-sm {
    width: 64px !important;
    min-height: 26px !important;
    height: 26px !important;
    padding: 2px 6px !important;
    font-size: 0.72rem !important;
    border-radius: 6px !important;
  }
  .flow-pos-cart-totals .flow-pos-grand {
    font-size: 0.85rem !important;
    margin-top: 2px !important;
    padding-top: 4px !important;
  }
  .flow-pos-cart-totals .flow-pos-grand strong {
    font-size: 1.1rem !important;
  }
  /* Collapse GST detail rows — total already includes tax */
  .flow-pos-cart-totals #pos-cgst-row,
  .flow-pos-cart-totals #pos-sgst-row,
  .flow-pos-cart-totals #pos-tax-row {
    display: none !important;
  }
  .flow-pos-pay-grid {
    flex: 0 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    position: relative;
    bottom: auto;
    padding-top: 4px;
    margin: 0;
    background: transparent;
  }
  .flow-pos-pay-grid.is-open {
    background: transparent;
    border-color: transparent;
  }
  .flow-pos-pay-grid .flow-btn,
  .flow-pos-pay-grid #btn-pos-kitchen,
  .flow-pos-pay-grid #btn-pos-make-bill {
    min-height: 38px !important;
    height: 38px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
  }
  .flow-pos-pay-hint { display: none; }

  .flow-pos-mobile-billbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 210;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    background: #12151c;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  }
  body.pos-phone-immersive .flow-pos-mobile-billbar {
    bottom: 0;
  }
  .flow-pos-mobile-billbar[hidden] { display: none !important; }
  body.pos-cart-open .flow-pos-mobile-billbar { display: none !important; }
  body:not(.pos-phone-session-open) .flow-pos-mobile-billbar { display: none !important; }
  .flow-pos-mbar-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    appearance: none;
    border: 1.5px solid var(--flow-border);
    border-radius: 12px;
    background: var(--flow-inset-bg, var(--flow-w08));
    color: var(--flow-w95);
    padding: 0 12px;
    min-height: 48px;
    height: 48px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
  }
  .flow-pos-mbar-count {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--flow-w55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .flow-pos-mbar-total {
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 800;
    color: var(--flow-accent);
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
  .flow-pos-mbar-pay,
  .flow-pos-mbar-settle {
    flex: 0 0 auto;
    align-self: stretch;
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 14px !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .flow-pos-mbar-pay[hidden],
  .flow-pos-mbar-settle[hidden] {
    display: none !important;
  }
  .flow-pos-mbar-pay {
    min-width: 5.75rem;
    max-width: 42%;
  }
  .flow-pos-mbar-settle {
    min-width: 4.5rem;
  }
  .flow-pos-mbar-settle {
    min-width: 5.5rem;
    border: 1.5px solid var(--flow-accent) !important;
    background: color-mix(in srgb, var(--flow-accent) 14%, #fff) !important;
    color: var(--flow-accent) !important;
  }
  .flow-pos-mbar-pay.is-disabled,
  .flow-pos-mbar-pay:disabled {
    opacity: 0.45;
    cursor: default;
  }
  .flow-pos-mbar-settle[hidden] { display: none !important; }

  /* Phone cart sheet: kitchen full width, settle full width below — same weight */
  .flow-pos-makebill-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .flow-pos-makebill-row #btn-pos-kitchen {
    grid-column: 1 / -1;
    min-height: 48px;
    order: -1;
    width: 100%;
  }
  .flow-pos-makebill-row #btn-pos-make-bill {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 48px;
    font-weight: 800;
    border: 1.5px solid var(--flow-accent) !important;
    background: color-mix(in srgb, var(--flow-accent) 12%, #fff) !important;
    color: var(--flow-accent) !important;
  }
  .flow-pos-makebill-row #btn-pos-clear {
    grid-column: 1 / -1;
    width: 100%;
  }

  .flow-pos-reports-grid { grid-template-columns: 1fr; }
  .flow-pos-menu-manage-card { grid-template-columns: 56px 1fr; }
  body.flow-acct-restaurant .flow-pos-menu-manage-card,
  .flow-pos-menu-manage-card.no-thumb { grid-template-columns: 1fr; }
  .flow-pos-menu-manage-card .flow-pos-soldout-btn,
  .flow-pos-menu-manage-card .flow-pos-size-toggle,
  .flow-pos-menu-manage-card .flow-pos-stock-toggle,
  .flow-pos-menu-manage-card .flow-pos-manage-toggles,
  .flow-pos-menu-manage-card .flow-pos-toggle,
  .flow-pos-menu-manage-card .flow-pos-cost,
  .flow-pos-menu-manage-card .flow-pos-stock-field { grid-column: 1 / -1; }
  .flow-pos-manage-toggles { flex-direction: row; flex-wrap: wrap; }
  .flow-pos-staff-form,
  .flow-pos-settings-mini {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-pos-staff-form .flow-pos-input,
  .flow-pos-staff-form select.flow-pos-input,
  .flow-pos-settings-mini .flow-pos-input {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }
  .flow-pos-tables-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-pos-tables-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .flow-pos-brand-preview-wrap { position: static; }
  .flow-pos-brand-phone { min-height: 440px; max-width: 320px; margin: 0 auto; }
  .flow-pos-crm-card {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .flow-pos-crm-pts {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100%;
  }
  .flow-pos-kpi-row .flow-stat-card { flex: 1 1 calc(50% - 8px); min-width: 0; }
}

@media (max-width: 420px) {
  .flow-pos-floor-tables { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .flow-pos-floor-channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-pos-cart-meta { grid-template-columns: 1fr; }
  .flow-pos-tables-grid { grid-template-columns: 1fr; }
  .flow-pos-pay-grid { grid-template-columns: 1fr 1fr; }
}

/* Multi-warehouse / bin locations */
.flow-wh { padding: 18px; }
.flow-wh-locate { margin-bottom: 18px; }
.flow-wh-locate-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
}
.flow-wh-locate-result.is-miss { border-color: oklch(0.62 0.2 25 / 0.45); }
.flow-wh-locate-result.is-hit { border-color: oklch(0.72 0.17 145 / 0.4); }
.flow-wh-locate-head {
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
}
.flow-wh-locate-head img,
.flow-wh-locate-head .ph {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--flow-elevated);
  font-size: 22px;
  font-weight: 700;
}
.flow-wh-locate-head strong { display: block; font-size: 17px; margin: 4px 0; }
.flow-wh-locate-head span { display: block; font-size: 13px; opacity: 0.85; }
.flow-wh-locate-bins {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.flow-wh-locate-bins li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--flow-elevated);
  border: 1px solid oklch(0.82 0.14 195 / 0.18);
}
.flow-wh-locate-bins li.is-empty {
  border-style: dashed;
  opacity: 0.9;
}
.flow-wh-locate-bins strong { display: block; font-size: 14px; }
.flow-wh-locate-bins span { display: block; font-size: 12px; opacity: 0.8; }
.flow-wh-locate-bins em {
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
  color: oklch(0.82 0.14 195);
  white-space: nowrap;
}
.flow-wh-locate-card { width: min(94vw, 420px); text-align: left; }
.flow-wh-locate-card .flow-inv-exists-body { text-align: center; }
.flow-wh-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .flow-wh-layout { grid-template-columns: 1fr; }
}
.flow-wh-side {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
}
.flow-wh-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.flow-wh-inline-form {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.flow-wh-inline-form .flow-btn { width: 100%; }

/* Drag products → bins */
.flow-wh-dnd-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.flow-wh-dnd-qty input {
  width: 72px;
}
.flow-wh-tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 2px;
}
.flow-wh-tray-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-elevated);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.flow-wh-tray-card:active { cursor: grabbing; }
.flow-wh-tray-card.is-dragging { opacity: 0.45; }
.flow-wh-tray-card img,
.flow-wh-tray-card .ph {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--flow-elevated);
  font-weight: 700;
}
.flow-wh-tray-card strong { display: block; font-size: 13px; line-height: 1.25; }
.flow-wh-tray-card span { display: block; font-size: 11px; opacity: 0.75; }
.flow-wh-drop {
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.flow-wh-drop .flow-wh-drop-hint {
  display: none;
  font-style: normal;
  font-size: 11px;
  color: oklch(0.82 0.14 195);
  margin-top: 2px;
}
body.flow-wh-dragging .flow-wh-drop {
  border-color: oklch(0.82 0.14 195 / 0.45) !important;
  outline: 1px dashed oklch(0.82 0.14 195 / 0.5);
}
body.flow-wh-dragging .flow-wh-drop .flow-wh-drop-hint { display: block; }
.flow-wh-drop.is-over {
  background: oklch(0.82 0.14 195 / 0.14) !important;
  border-color: oklch(0.82 0.14 195 / 0.7) !important;
  transform: scale(1.02);
}
.flow-wh-fulfill-kanban {
  min-height: 180px;
}
.flow-wh-fulfill-panel code {
  font-size: 12px;
  opacity: 0.9;
}

/* ── Unified Inventory ops console ── */
#page-commerce.active {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
}
/* Thumb Deck More owns the scroller — do not keep commerce painted over it */
body.flow-phone-app.fp-more-open #page-commerce.active,
body.flow-phone-app.fp-more-open #page-commerce.app-page.active {
  display: none !important;
}
.inv-ops {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}
.inv-ops-top {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
}
.inv-ops-title { min-width: 160px; }
.inv-ops-title .app-page-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
}
.inv-ops-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  opacity: 0.9;
}
.inv-ops-kpis em {
  font-style: normal;
  font-weight: 700;
  margin-right: 4px;
}
.inv-ops-kpis .warn em { color: oklch(0.82 0.14 95); }
.inv-ops-kpis .bad em { color: oklch(0.62 0.2 25); }
.inv-ops-scan {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 360px;
  min-width: 260px;
  max-width: 560px;
}
.inv-ops-scan .flow-inventory-search {
  flex: 1;
  min-width: 0;
  min-height: 42px;
}
.inv-ops-scan .flow-inventory-filter { min-height: 42px; }
.inv-ops-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.inv-ops-more {
  position: relative;
}
.inv-ops-more > summary,
.inv-ops-more > #btn-inv-ops-more {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.inv-ops-more > summary::-webkit-details-marker { display: none; }
.inv-ops-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-elevated, var(--flow-panel));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
.inv-ops-more-menu[hidden] {
  display: none !important;
}
.inv-ops-more-menu .flow-btn {
  width: 100%;
  justify-content: flex-start;
}
.inv-ops-locate {
  max-height: 180px;
  overflow: auto;
}
.inv-ops-locate[hidden],
.flow-inv-scan-result[hidden] { display: none !important; }

/* 2-column roomy layout; fulfillment is a drawer */
.inv-ops-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.inv-ops-rail,
.inv-ops-center {
  border-radius: 18px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  padding: 16px;
}
.inv-ops-rail {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 120px);
  overflow: auto;
}
.inv-ops-center {
  min-width: 0;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.inv-ops-fulfill {
  display: none;
  grid-column: 1 / -1;
  border-radius: 18px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  padding: 16px;
}
.inv-ops.is-fulfill-open .inv-ops-fulfill:not([hidden]) {
  display: block;
}
.inv-ops-fulfill[hidden] {
  display: none !important;
}
.inv-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}
#page-commerce [hidden],
.inv-ops [hidden] {
  display: none !important;
}
.inv-ops-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.inv-ops-rail-head strong { font-size: 15px; }
.inv-ops-add-forms { margin-bottom: 12px; }
.inv-ops-drop-qty {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid oklch(1 0 0 / 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.inv-ops-drop-qty input {
  width: 72px;
  min-height: 36px;
  flex: 0 0 auto;
}

/* Hide multi-warehouse chrome unless account type is warehouse */
body:not(.flow-acct-warehouse) .inv-ops-body {
  grid-template-columns: minmax(0, 1fr);
}
body:not(.flow-acct-warehouse) [data-wh-only] {
  display: none !important;
}
/* Premium ops console for warehouse accounts */
body.flow-acct-warehouse .inv-ops-classic,
body.flow-acct-warehouse .inv-ops-classic-only {
  display: none !important;
}
body:not(.flow-acct-warehouse) .inv-premium {
  display: none !important;
}
.inv-premium {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  padding-bottom: 40px;
}
.inv-prem-top {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: flex-end;
  justify-content: space-between;
}
.inv-prem-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  opacity: 0.9;
  margin-top: 6px;
}
.inv-prem-kpis em {
  font-style: normal;
  font-weight: 800;
  margin-right: 4px;
  color: oklch(0.88 0.08 195);
}
.inv-prem-kpis .warn em { color: oklch(0.82 0.14 95); }
.inv-prem-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 320px;
  justify-content: flex-end;
}
.inv-prem-search .flow-inventory-search {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 420px;
  min-height: 42px;
}
.inv-prem-sub {
  margin: 0 0 8px;
  font-size: 13px;
  opacity: 0.72;
  max-width: 48ch;
}
.inv-site-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inv-site-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-right: 4px;
}
.inv-site-pill {
  border: 1px solid var(--flow-border);
  background: var(--flow-elevated);
  color: inherit;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.inv-site-pill.active {
  border-color: oklch(0.82 0.14 195 / 0.55);
  background: oklch(0.82 0.14 195 / 0.16);
  color: oklch(0.92 0.08 195);
}
.inv-panel-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}
.inv-place-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .inv-place-layout { grid-template-columns: 1fr; }
}
.inv-place-side {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
}
.inv-rack-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.inv-rack-board {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}
.inv-rack-aisle {
  flex: 1 1 280px;
  min-width: 260px;
  max-width: 420px;
  border-radius: 16px;
  border: 1px solid var(--flow-border);
  background: linear-gradient(180deg, var(--flow-elevated), var(--flow-inset-bg));
  padding: 14px;
}
.inv-rack-aisle-h {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--flow-accent);
}
.inv-rack-shelf {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--flow-inset-bg);
  border: 1px solid var(--flow-border);
}
.inv-rack-shelf-label {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.55;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.inv-rack-bins {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inv-rack-bin {
  text-align: left;
  border: 1px solid var(--flow-border);
  background: var(--flow-elevated);
  color: inherit;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  width: 100%;
}
.inv-rack-bin:hover {
  border-color: color-mix(in srgb, var(--flow-accent) 45%, var(--flow-border));
}
.inv-rack-bin.has-stock {
  border-color: color-mix(in srgb, var(--flow-accent) 35%, var(--flow-border));
  background: color-mix(in srgb, var(--flow-accent) 12%, var(--flow-elevated));
}
.inv-rack-bin-h {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.inv-rack-bin-h strong { font-size: 14px; }
.inv-rack-bin-h em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--flow-accent);
}
.inv-rack-sku {
  display: block;
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}
.inv-rack-sku b { font-weight: 700; opacity: 1; }
.inv-rack-empty {
  display: block;
  font-size: 12px;
  opacity: 0.45;
}
.inv-rack-more {
  display: block;
  font-size: 11px;
  opacity: 0.5;
  margin-top: 4px;
}
.inv-geo-details {
  margin-top: 20px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  padding: 10px 14px;
  max-width: 960px;
  opacity: 0.85;
}
.inv-geo-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
}
.inv-geo-details[open] summary { margin-bottom: 12px; }
.inv-prem-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: var(--flow-inset-bg);
  width: 100%;
  box-sizing: border-box;
}
.inv-prem-tab {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.inv-prem-tab.active {
  opacity: 1;
  background: var(--flow-cyan-dim);
  color: var(--flow-accent);
}
.inv-prem-pane[hidden] { display: none !important; }
.inv-prem-pane.active { width: 100%; }
.inv-place-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  max-width: 800px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  margin-bottom: 16px;
  align-content: start;
}
.inv-place-form .wm-field--wide,
.inv-place-form .wm-form-actions { grid-column: 1 / -1; }
.inv-floor-map-wrap { margin-top: 8px; max-width: 960px; }
.inv-geo-map { height: min(36vh, 320px) !important; min-height: 220px !important; }
.inv-locate-cards { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.inv-locate-card {
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  padding: 14px 16px;
}
.inv-locate-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.inv-locate-head img, .inv-locate-head .ph {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--flow-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.inv-locate-head strong { display: block; }
.inv-locate-head span { font-size: 12px; opacity: 0.7; }
.inv-locate-card ul { list-style: none; margin: 0; padding: 0; }
.inv-locate-card li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 12px;
  padding: 10px 0;
  border-top: 1px solid oklch(1 0 0 / 0.06);
  font-size: 13px;
  align-items: center;
}
.inv-locate-card li span { grid-column: 1; opacity: 0.75; font-size: 12px; }
.inv-locate-card li em { font-style: normal; font-weight: 800; color: oklch(0.82 0.14 195); }
.inv-transit-list, .inv-dispatch-list, .inv-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
}
.inv-transit-card, .inv-dispatch-card {
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  padding: 14px 16px;
}
.inv-transit-card > header strong { display: block; }
.inv-transit-card > header span { font-size: 12px; opacity: 0.7; }
.inv-stepper {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
  padding: 0;
}
.inv-stepper li {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--flow-inset-bg);
  opacity: 0.45;
}
.inv-stepper li.done { opacity: 0.85; background: oklch(0.82 0.14 195 / 0.15); }
.inv-stepper li.current { opacity: 1; color: oklch(0.9 0.1 195); }
.inv-transit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-dispatch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.inv-dispatch-card strong { display: block; }
.inv-dispatch-card span { display: block; font-size: 12px; opacity: 0.75; margin-top: 2px; }
.inv-dispatch-bin { color: oklch(0.82 0.12 195) !important; opacity: 1 !important; }
.inv-dispatch-done { font-size: 12px; font-weight: 700; opacity: 0.7; }
.inv-feed-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.inv-feed-filter {
  border: 1px solid var(--flow-border);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
}
.inv-feed-filter.active {
  opacity: 1;
  border-color: oklch(0.82 0.14 195 / 0.45);
  background: oklch(0.82 0.14 195 / 0.12);
}
.inv-feed-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 8px 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  font-size: 13px;
}
.inv-feed-row em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
  align-self: center;
}
.inv-feed-row strong { display: block; }
.inv-feed-row small { opacity: 0.6; font-size: 11px; }
.inv-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
body.flow-acct-restaurant #inv-pane-catalog .inv-ops-hint {
  color: var(--flow-w55);
}
.inv-ops-modes {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--flow-inset-bg);
  margin-bottom: 14px;
  align-self: flex-start;
}
.inv-ops-mode {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.inv-ops-mode.active {
  opacity: 1;
  background: oklch(0.82 0.14 195 / 0.18);
  color: oklch(0.9 0.1 195);
}
/* Critical: don't let display:flex override [hidden] */
.inv-ops-pane {
  display: none;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.inv-ops-pane.active:not([hidden]) {
  display: flex;
}
.inv-ops-pane[hidden] {
  display: none !important;
}
.inv-ops-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.inv-images-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--flow-border);
  background: var(--flow-w06, rgba(255, 255, 255, 0.04));
  color: var(--flow-w70);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.inv-images-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.inv-images-toggle-ui {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--flow-w15, rgba(255, 255, 255, 0.18));
  transition: background 0.18s ease;
  flex: 0 0 auto;
}
.inv-images-toggle-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}
.inv-images-toggle:has(input:checked) {
  color: var(--flow-w90);
  border-color: color-mix(in srgb, var(--flow-accent) 45%, var(--flow-border));
  background: color-mix(in srgb, var(--flow-accent) 12%, transparent);
}
.inv-images-toggle:has(input:checked) .inv-images-toggle-ui {
  background: var(--flow-accent);
}
.inv-images-toggle:has(input:checked) .inv-images-toggle-ui::after {
  transform: translateX(14px);
}
#inventory-grid.inv-hide-images .flow-inv-img-wrap {
  display: none !important;
}
#inventory-grid.inv-hide-images {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
#inventory-grid.inv-hide-images .flow-inv-card {
  min-height: 0;
}
.inv-ops-cat-row {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}
.inv-ops-cat-row .flow-inventory-filter {
  flex: 1 1 140px;
  min-width: 120px;
}
.inv-ops-toolbar .flow-inventory-search {
  flex: 1;
  min-height: 42px;
}
.inv-ops-hint {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: 0.72;
  line-height: 1.4;
}
.inv-ops-scroll {
  flex: 1;
  min-height: 420px;
}
.inv-ops-scroll .flow-inventory-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.inv-ops-activity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.inv-fulfill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.inv-fulfill-chip {
  border: 1px solid var(--flow-border);
  background: var(--flow-elevated);
  color: inherit;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 110px;
}
.inv-fulfill-chip em {
  font-style: normal;
  margin-left: 8px;
  opacity: 0.8;
}
.inv-fulfill-chip.active {
  border-color: oklch(0.82 0.14 195 / 0.5);
  background: oklch(0.82 0.14 195 / 0.12);
}
.inv-fulfill-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}
#inventory-grid .flow-inv-card {
  cursor: grab;
  min-height: 280px;
}
#inventory-grid .flow-inv-card.is-dragging { opacity: 0.45; }

/* Warehouse geo map */
.inv-geo-map {
  width: 100%;
  height: min(58vh, 520px);
  min-height: 320px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  overflow: hidden;
  background: var(--flow-inset-bg);
  z-index: 1;
}
.inv-map-side { margin-top: 12px; }
.inv-map-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow: auto;
}
.inv-map-legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  border: 1px solid oklch(1 0 0 / 0.06);
  background: var(--flow-elevated);
  color: inherit;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.inv-map-legend-row:hover,
.inv-map-legend-row.active {
  border-color: oklch(0.82 0.14 195 / 0.45);
  background: oklch(0.82 0.14 195 / 0.1);
}
.inv-map-legend-row em {
  font-style: normal;
  font-weight: 800;
  font-size: 15px;
  min-width: 36px;
  text-align: center;
  opacity: 0.85;
}
.inv-map-legend-row em.is-stock { color: oklch(0.82 0.14 195); }
.inv-map-legend-row strong { display: block; font-size: 13px; }
.inv-map-legend-row small { display: block; font-size: 11px; opacity: 0.7; margin-top: 2px; }
.inv-map-pin-wrap { background: transparent !important; border: none !important; }
.inv-map-pin {
  width: 40px;
  height: 40px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.55 0.12 230);
  border: 2px solid oklch(0.92 0.04 230);
  box-shadow: 0 6px 16px oklch(0 0 0 / 0.35);
}
.inv-map-pin span {
  transform: rotate(45deg);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.inv-map-pin.is-stock {
  background: oklch(0.62 0.16 155);
  border-color: oklch(0.9 0.08 155);
}
.inv-map-pin.is-muted {
  background: oklch(0.35 0.02 255);
  border-color: oklch(0.55 0.02 255);
  opacity: 0.75;
}
.inv-map-pin.is-wide {
  width: 48px;
  height: 48px;
  border-radius: 50% 50% 50% 6px;
}
.inv-map-pin.is-wide span { font-size: 10px; }
#inv-pane-map .leaflet-container {
  font: inherit;
  background: var(--flow-inset-bg);
}
#inv-pane-map .leaflet-popup-content-wrapper {
  background: var(--flow-elevated);
  color: inherit;
  border-radius: 12px;
}
#inv-pane-map .leaflet-popup-tip { background: var(--flow-elevated); }
#inv-pane-map .leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
#inv-pane-map .leaflet-control-attribution {
  background: var(--flow-inset-bg);
  color: oklch(1 0 0 / 0.45);
  font-size: 10px;
}

.flow-wh-item,
.flow-wh-loc-item {
  padding: 12px 14px !important;
  margin-bottom: 6px;
}
.flow-wh-item strong { font-size: 14px !important; }

@media (max-width: 900px) {
  .inv-ops-body { grid-template-columns: 1fr; }
  .inv-ops-rail {
    position: static;
    max-height: none;
  }
  .inv-ops-activity { grid-template-columns: 1fr; }
}
.flow-wh-list,
.flow-wh-loc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.flow-wh-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 8px 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--flow-elevated);
  color: inherit;
  text-align: left;
}
.flow-wh-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  padding: 2px 0;
}
.flow-wh-item strong { font-size: 14px; }
.flow-wh-item span { font-size: 12px; opacity: 0.75; }
.flow-wh-item .flow-wh-del,
.flow-wh-item .flow-wh-edit,
.flow-wh-loc-actions .flow-wh-edit,
.flow-wh-loc-actions .flow-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  color: var(--flow-w45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.flow-wh-item .flow-wh-edit:hover,
.flow-wh-loc-actions .flow-wh-edit:hover {
  color: var(--flow-green, #16a34a);
  background: rgba(22, 163, 74, 0.1);
}
.flow-wh-item .flow-wh-del:hover,
.flow-wh-loc-actions .flow-btn:hover {
  color: var(--flow-danger, #dc2626);
  background: rgba(220, 38, 38, 0.08);
}
.flow-wh-loc-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
#wh-loc-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.wh-edit-modal { width: min(420px, 100%); }
.wh-edit-form { display: flex; flex-direction: column; gap: 14px; }
.wh-edit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wh-edit-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.wh-edit-fields label span { opacity: 0.75; }
.wh-edit-fields input,
.wh-edit-fields select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--flow-border, #e5e7eb);
  background: var(--flow-elevated, #fff);
  color: inherit;
  font: inherit;
}
.wh-edit-fields .wh-edit-wide { grid-column: 1 / -1; }
.wh-edit-fields .flow-inv-empty-sm { grid-column: 1 / -1; margin: 0; }
.flow-wh-item.active {
  border-color: oklch(0.82 0.14 195 / 0.45);
  background: oklch(0.82 0.14 195 / 0.1);
}
.wms-saas .flow-wh-item {
  background: var(--wms-card);
  border-color: var(--wms-line);
}
.wms-saas .flow-wh-item.active {
  border-color: rgba(22,163,74,.4);
  background: var(--wms-soft);
}
.flow-wh-loc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--flow-inset-bg);
}
.flow-wh-loc-item strong { display: block; font-size: 13px; }
.flow-wh-loc-item span { display: block; font-size: 11px; opacity: 0.75; }
.flow-wh-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.flow-wh-putaway {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.9fr 0.6fr auto;
  gap: 8px;
  align-items: center;
}
@media (max-width: 1100px) {
  .flow-wh-putaway { grid-template-columns: 1fr 1fr; }
}
.flow-wh-prod-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flow-wh-prod-cell img,
.flow-wh-prod-cell .ph {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--flow-elevated);
  flex-shrink: 0;
}
.flow-btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* ── Warehouse Floor manager ── */
.wm-floor {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding: 0 0 32px;
  box-sizing: border-box;
  background: transparent;
  box-shadow: none;
  border: none;
}
.wm-floor-top {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: flex-end;
  justify-content: space-between;
}
.wm-floor-title { flex: 1 1 200px; min-width: 0; }
.wm-floor-title .hd-title { margin: 0 0 6px; }
.wm-floor-title .hd-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.78;
  max-width: 42ch;
}
.wm-floor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1 1 280px;
  justify-content: flex-end;
}
.wm-floor-actions .flow-inventory-search {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 360px;
  min-height: 42px;
}
/* SMB / agency: no warehouse desk chrome */
body.flow-acct-floor-simple .wm-station-bar,
body.flow-acct-floor-simple #wm-floor [data-wm-wh-only] {
  display: none !important;
}
body.flow-acct-floor-simple #wm-floor .wm-tabs {
  gap: 4px;
}

/* Shared Flow loading animation */
.flow-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 160px;
  padding: 28px 16px;
  width: 100%;
  box-sizing: border-box;
}
.flow-loading[hidden] {
  display: none !important;
}
.flow-loading--compact {
  min-height: 72px;
  padding: 16px;
  gap: 10px;
}
.flow-loading-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid oklch(0.82 0.14 195 / 0.22);
  border-top-color: var(--flow-green, #16a34a);
  animation: flow-spin 0.7s linear infinite;
}
.flow-loading--compact .flow-loading-ring {
  width: 26px;
  height: 26px;
  border-width: 2px;
}
.flow-loading-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--flow-muted, #6b7280);
}
@keyframes flow-spin {
  to { transform: rotate(360deg); }
}
html[data-theme="light"] .flow-loading-ring {
  border-color: rgba(22, 163, 74, 0.18);
  border-top-color: #16a34a;
}
html[data-theme="light"] .flow-loading-label {
  color: #6b7280;
}

.wm-station-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
}
.wm-station-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-end;
}
.wm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.wm-field > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
}
.wm-field .flow-inventory-filter,
.wm-field .flow-inventory-search,
.wm-field input[type="number"],
.wm-putaway-qty input {
  flex: 0 0 auto !important;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  height: 42px;
  max-height: 42px;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--flow-border);
  background: var(--flow-surface);
  color: var(--flow-w90);
  font-size: 0.86rem;
  appearance: none;
  -webkit-appearance: none;
}
.wm-field select.flow-inventory-filter {
  background-image: linear-gradient(45deg, transparent 50%, var(--flow-w60) 50%),
    linear-gradient(135deg, var(--flow-w60) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.wm-field--wide { grid-column: 1 / -1; }
.wm-field--qty { max-width: 110px; }
.wm-putaway-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
}
.wm-putaway-qty input { width: 96px; }
.wm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: var(--flow-inset-bg);
  width: 100%;
  box-sizing: border-box;
}
.wm-tab {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.wm-tab.active {
  opacity: 1;
  background: var(--flow-cyan-dim);
  color: var(--flow-accent);
}
.wm-pane[hidden] { display: none !important; }
.wm-pane.active { width: 100%; }
.wm-floor .hd-kanban--page {
  height: auto;
  min-height: 480px;
  flex: none;
}
.wm-hint {
  margin: 0 0 12px;
  font-size: 13px;
  opacity: 0.72;
}
.wm-pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: none;
}
.wm-pick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
}
.wm-pick-main { flex: 1; min-width: 0; }
.wm-pick-main strong { display: block; font-size: 14px; }
.wm-pick-product, .wm-pick-bin, .wm-pick-status {
  display: block;
  font-size: 12px;
  opacity: 0.75;
  margin-top: 3px;
}
.wm-pick-bin {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
  color: oklch(0.82 0.12 195);
}
.wm-pick-status { font-weight: 600; opacity: 0.85; }
.wm-putaway-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 14px;
}
@media (max-width: 800px) {
  .wm-putaway-grid { grid-template-columns: 1fr; }
}
.wm-putaway-product, .wm-putaway-bins {
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  padding: 14px;
  min-height: 120px;
}
.wm-putaway-selected {
  display: flex;
  gap: 12px;
  align-items: center;
}
.wm-putaway-selected img, .wm-putaway-selected .ph {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--flow-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.wm-putaway-selected strong { display: block; font-size: 15px; }
.wm-putaway-selected span { display: block; font-size: 12px; opacity: 0.7; margin-top: 3px; }
.wm-bin-btn {
  display: flex;
  width: 100%;
  text-align: left;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  border: 1px solid var(--flow-border);
  background: var(--flow-elevated);
  color: inherit;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
}
.wm-bin-btn:hover {
  border-color: color-mix(in srgb, var(--flow-accent) 45%, var(--flow-border));
  background: color-mix(in srgb, var(--flow-accent) 12%, var(--flow-elevated));
}
.wm-bin-btn strong { font-size: 14px; }
.wm-bin-btn span { font-size: 12px; opacity: 0.7; }
.wm-locate-result {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  max-width: 560px;
}
.wm-locate-result strong { display: block; font-size: 16px; margin-bottom: 4px; }
.wm-locate-result span { display: block; font-size: 13px; opacity: 0.8; }
.wm-locate-result ul { list-style: none; margin: 10px 0 0; padding: 0; }
.wm-locate-result li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid oklch(1 0 0 / 0.06);
  font-size: 13px;
}
.wm-locate-result em {
  font-style: normal;
  font-weight: 800;
  min-width: 36px;
  color: oklch(0.82 0.14 195);
}
.wm-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.wm-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.wm-form-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  align-content: start;
  align-self: start;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  box-sizing: border-box;
}
.wm-form-card .wm-form-pair,
.wm-form-card .wm-form-actions,
.wm-form-card .wm-field--wide {
  grid-column: 1 / -1;
}
.wm-form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .wm-form-pair { grid-template-columns: 1fr; }
}
.wm-form-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}
.wm-wave-list,
.wm-receive-list,
.wm-transfer-list,
.wm-cycle-list,
.wm-exception-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: none;
}
.wm-wave-card {
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  padding: 12px 14px;
}
.wm-wave-card > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 13px;
}
.wm-wave-card > header span { opacity: 0.7; }
.wm-wave-lines { display: flex; flex-direction: column; gap: 6px; }
.wm-wave-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--flow-inset-bg);
}
.wm-wave-line.done { opacity: 0.55; }
.wm-wave-line > div { flex: 1; min-width: 0; }
.wm-wave-line strong { display: block; font-size: 13px; }
.wm-wave-line span { display: block; font-size: 12px; opacity: 0.75; margin-top: 2px; }
.wm-ex-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-panel);
  font-size: 13px;
}
.wm-ex-row em {
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: oklch(0.78 0.12 55);
  grid-row: span 2;
  align-self: center;
}
.wm-ex-row small { opacity: 0.65; grid-column: 2; }
.wm-label-preview { max-width: none; }
.wm-label-count { margin: 0 0 12px; }
.wm-ship-label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.wm-ship-label-card {
  border: 1px solid oklch(0.82 0.02 240);
  border-radius: 12px;
  padding: 14px 14px 12px;
  background: oklch(0.99 0.005 240);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 168px;
}
.wm-ship-label-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.wm-ship-label-card header em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}
.wm-ship-label-card strong {
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
}
.wm-ship-addr {
  margin: 4px 0 2px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-line;
  color: oklch(0.35 0.02 240);
}
.wm-ship-meta {
  font-size: 12px;
  opacity: 0.78;
}
.wm-ship-meta.muted { opacity: 0.55; font-size: 11px; }
.wm-offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: oklch(0.72 0.16 55 / 0.18);
  color: oklch(0.88 0.12 55);
  border: 1px solid oklch(0.72 0.16 55 / 0.35);
}
.wm-offline-badge em { font-style: normal; font-weight: 800; }
.hd-icon-done {
  display: inline-flex;
  color: oklch(0.78 0.12 155);
  opacity: 0.85;
}
body.wm-kiosk .app-sidebar,
body.wm-kiosk .app-mobile-tabs,
body.wm-kiosk .app-topbar { display: none !important; }
body.wm-kiosk .app-main { margin: 0; padding: 16px; max-width: none; }

/* ===== Warehouse WMS SaaS (StockMap-style) ===== */
body.flow-acct-warehouse #page-commerce .inv-ops {
  max-width: none;
}
.inv-premium.wms-saas {
  --wms-bg: var(--flow-bg);
  --wms-card: var(--flow-elevated, var(--flow-card));
  --wms-ink: var(--flow-white);
  --wms-mute: var(--flow-w60);
  --wms-faint: var(--flow-w40);
  --wms-line: var(--flow-border);
  --wms-soft-bg: var(--flow-inset-bg, oklch(0.14 0.015 255 / 0.9));
  --wms-hover: var(--flow-w10);
  --wms-green: #16a34a;
  --wms-green-600: #22c55e;
  --wms-soft: oklch(0.72 0.17 145 / 0.12);
  --wms-shadow: 0 1px 2px rgba(0,0,0,.2), 0 4px 14px rgba(0,0,0,.18);
  display: block;
  background: var(--wms-bg);
  color: var(--wms-ink);
  border-radius: 16px;
  padding: 18px 18px 28px;
  margin: -4px -4px 0;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[data-theme="light"] .inv-premium.wms-saas {
  --wms-bg: #f4f5f7;
  --wms-card: #ffffff;
  --wms-ink: #111827;
  --wms-mute: #6b7280;
  --wms-faint: #9ca3af;
  --wms-line: #e5e7eb;
  --wms-soft-bg: #fafbfc;
  --wms-hover: #f9fafb;
  --wms-green: #16a34a;
  --wms-green-600: #15803d;
  --wms-soft: #ecfdf3;
  --wms-shadow: 0 1px 2px rgba(17,24,39,.04), 0 4px 14px rgba(17,24,39,.04);
}
.wms-saas .wms-top {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 14px; margin-bottom: 12px;
}
.wms-saas .wms-title {
  margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.03em; color: var(--wms-ink);
}
.wms-saas .wms-sub { margin: 4px 0 0; font-size: 13px; color: var(--wms-mute); font-weight: 450; max-width: 48ch; }
.wms-saas .wms-top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wms-saas .wms-scan-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--wms-card); border: 1px solid var(--wms-line); box-shadow: var(--wms-shadow);
}
.wms-saas .wms-select {
  height: 38px; border: 1px solid var(--wms-line); border-radius: 10px;
  padding: 0 10px; background: var(--wms-soft-bg); color: var(--wms-ink); font: inherit; font-size: 13px; font-weight: 550;
}
.wms-saas .wms-search-grow { flex: 1 1 220px; min-width: 180px; }
.wms-saas .wms-nav {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px;
  padding: 4px; border-radius: 12px; background: var(--wms-soft-bg); border: 1px solid var(--wms-line);
}
.wms-saas .wms-nav button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--wms-mute);
  border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 13px; font-weight: 550;
  cursor: pointer;
}
.wms-saas .wms-nav button:hover { background: var(--wms-hover); color: var(--wms-ink); }
.wms-saas .wms-nav button.on {
  background: var(--wms-card); color: var(--wms-green-600); font-weight: 650;
  box-shadow: var(--wms-shadow);
}
.wms-saas .wms-pane { display: grid; gap: 14px; }
.wms-saas .wms-pane[hidden] { display: none !important; }
.wms-saas .wms-pane-hint {
  margin: 0; padding: 16px 18px; border-radius: 12px;
  background: var(--wms-card); border: 1px dashed var(--wms-line);
  color: var(--wms-mute); font-size: 13px; line-height: 1.45;
}
.wms-saas .wms-pane-hint strong { color: var(--wms-ink); font-weight: 650; }
.wms-saas .wms-form-card .wms-form-inline { padding: 0 16px 16px; }
.wms-saas .wms-search {
  display: flex; align-items: center; gap: 8px; height: 38px; min-width: 240px;
  padding: 0 12px; border-radius: 10px; background: var(--wms-card);
  border: 1px solid var(--wms-line); box-shadow: var(--wms-shadow);
}
.wms-saas .wms-scan-bar .wms-search {
  box-shadow: none; background: var(--wms-soft-bg);
}
.wms-saas .wms-search input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font: inherit; font-size: 13px; color: var(--wms-ink);
}
.wms-saas .wms-search svg { color: var(--wms-faint); }
.wms-saas .wms-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--wms-line); background: var(--wms-card); color: #374151;
  border-radius: 10px; padding: 9px 13px; font: inherit; font-size: 13px; font-weight: 550;
  cursor: pointer; box-shadow: var(--wms-shadow);
}
.wms-saas .wms-btn:hover { background: var(--wms-hover); }
.wms-saas .wms-btn-primary {
  background: var(--wms-green); border-color: var(--wms-green); color: #fff;
}
.wms-saas .wms-btn-primary:hover { background: var(--wms-green-600); }
.wms-saas .wms-btn-block { width: 100%; justify-content: center; margin-top: 10px; }
.wms-saas .wms-wa-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 14px; border-radius: 12px;
  background: var(--wms-card); border: 1px solid var(--wms-line); box-shadow: var(--wms-shadow);
  font-size: 13px;
}
.wms-saas .wms-wa-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}
.wms-saas .wms-wa-banner strong { font-weight: 650; }
.wms-saas .wms-wa-banner span { color: var(--wms-mute); }
.wms-saas .wms-wa-banner .wms-btn { margin-left: auto; }
.wms-saas .wms-kpis {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px;
}
.wms-saas .wms-kpi {
  background: var(--wms-card); border: 1px solid var(--wms-line); border-radius: 14px;
  padding: 14px 15px; box-shadow: var(--wms-shadow);
}
.wms-saas .wms-kpi-h {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 550; color: var(--wms-mute);
}
.wms-saas .wms-kpi-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--wms-soft); color: var(--wms-green);
}
.wms-saas .wms-kpi-ico.warn { background: oklch(0.82 0.14 75 / 0.16); color: oklch(0.82 0.14 75); }
.wms-saas .wms-kpi-ico.blue { background: oklch(0.55 0.12 255 / 0.18); color: oklch(0.72 0.12 255); }
html[data-theme="light"] .wms-saas .wms-kpi-ico.warn { background: #fffbeb; color: #d97706; }
html[data-theme="light"] .wms-saas .wms-kpi-ico.blue { background: #eff6ff; color: #2563eb; }
.wms-saas .wms-kpi-v {
  margin-top: 10px; font-size: 24px; font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; color: var(--wms-ink);
}
.wms-saas .wms-kpi-d { margin-top: 4px; font-size: 12px; color: var(--wms-faint); font-weight: 450; }
.wms-saas .wms-resolve {
  margin-bottom: 14px; padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(120deg, var(--wms-soft), var(--wms-card) 55%);
  border: 1px solid rgba(22,163,74,.28); box-shadow: var(--wms-shadow);
}
.wms-saas .wms-resolve-grid {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
}
.wms-saas .wms-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--wms-green);
}
.wms-saas .wms-resolve h3 { margin: 6px 0 0; font-size: 18px; font-weight: 650; }
.wms-saas .wms-stock-hero {
  display: flex; gap: 8px; align-items: stretch;
}
.wms-saas .wms-stock-hero-main,
.wms-saas .wms-stock-hero-bin {
  min-width: 110px; padding: 12px 14px; border-radius: 12px; text-align: center;
  border: 1px solid rgba(22,163,74,.25); background: var(--wms-card);
}
.wms-saas .wms-stock-hero-main {
  background: var(--wms-green); border-color: var(--wms-green); color: #fff;
}
.wms-saas .wms-stock-hero b {
  display: block; font-size: 32px; font-weight: 750; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.wms-saas .wms-stock-hero-bin b { color: var(--wms-ink); font-size: 28px; }
.wms-saas .wms-stock-hero span {
  display: block; margin-top: 4px; font-size: 11px; font-weight: 650;
  letter-spacing: .02em; text-transform: uppercase; opacity: .9;
}
.wms-saas .wms-stock-hero-bin span { color: var(--wms-mute); }
.wms-saas .wms-path-row {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(22,163,74,.18);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
}
.wms-saas .wms-path .huge {
  font-size: 28px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; text-align: left;
}
.wms-saas .wms-path .huge em { font-style: normal; color: var(--wms-green); }
.wms-saas .wms-path .huge i { font-style: normal; color: var(--wms-faint); margin: 0 3px; }
.wms-saas .wms-path p { margin: 0; font-size: 13px; color: var(--wms-mute); text-align: left; }
.wms-saas .wms-path p strong { color: var(--wms-ink); font-weight: 650; }
.wms-saas .wms-resolve-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wms-saas .wms-alt { list-style: none; margin: 12px 0 0; padding: 0; }
.wms-saas .wms-alt li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--wms-line); font-size: 13px;
}
.wms-saas .wms-alt li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wms-saas .wms-alt .mono { color: var(--wms-mute); font-variant-numeric: tabular-nums; font-size: 12px; }
.wms-saas .wms-alt-qty {
  flex: 0 0 auto; font-style: normal; text-align: right;
  padding: 6px 10px; border-radius: 10px; background: var(--wms-soft-bg); color: var(--wms-ink);
}
.wms-saas .wms-alt-qty b {
  display: block; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.wms-saas .wms-alt-qty { font-size: 11px; font-weight: 650; color: var(--wms-mute); }
@media (max-width: 720px) {
  .wms-saas .wms-resolve-grid { grid-template-columns: 1fr; }
  .wms-saas .wms-stock-hero { width: 100%; }
  .wms-saas .wms-stock-hero-main,
  .wms-saas .wms-stock-hero-bin { flex: 1; }
}
.wms-saas .wms-row2 {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 14px; margin-bottom: 14px;
}
.wms-saas .wms-row3 {
  display: grid; grid-template-columns: 1.35fr .65fr; gap: 14px; margin-bottom: 14px;
}
.wms-saas .wms-card {
  background: var(--wms-card); border: 1px solid var(--wms-line); border-radius: 14px;
  box-shadow: var(--wms-shadow); overflow: hidden; min-width: 0;
}
.wms-saas .wms-card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--wms-line);
}
.wms-saas .wms-card-h h3 { margin: 0; font-size: 14px; font-weight: 650; }
.wms-saas .wms-card-h-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wms-saas .wms-meta { font-size: 12px; color: var(--wms-faint); font-weight: 450; margin: 0; }
.wms-saas .wms-card-b { padding: 14px 16px; }
.wms-saas .wms-charts { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; align-items: center; }
.wms-saas .wms-chart-box { height: 180px; position: relative; }
.wms-saas .wms-status-legend {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.wms-saas .wms-status-legend div {
  background: var(--wms-hover); border: 1px solid var(--wms-line); border-radius: 10px; padding: 10px;
}
.wms-saas .wms-status-legend b { display: block; font-size: 18px; font-weight: 700; }
.wms-saas .wms-status-legend span { font-size: 11px; color: var(--wms-mute); }
.wms-saas .wms-map-card {
  position: relative; min-height: 300px; overflow: hidden;
  isolation: isolate;
}
.wms-saas .wms-geo-map {
  height: 260px; width: 100%; background: #eef2f6;
  border-radius: 0 0 14px 14px; z-index: 1; position: relative;
}
.wms-saas .wms-map-float {
  position: absolute; left: 12px; top: 56px; z-index: 5; width: min(200px, 42%);
  max-height: calc(100% - 72px); overflow: auto;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.wms-saas .wms-sites-layout {
  display: block;
  border-top: 1px solid var(--wms-line); min-height: 240px;
}
.wms-saas .wms-sites-layout .inv-ops-rail {
  display: flex !important; flex-direction: column; gap: 8px;
  padding: 14px 16px; background: var(--wms-soft-bg);
  max-height: 70vh; overflow: auto;
}
.wms-saas .wms-sites-layout .inv-ops-add-forms { display: none !important; }
.wms-saas .wms-wh-wizard {
  padding: 14px 16px 18px; border-top: 1px solid var(--wms-line);
  background: var(--wms-soft-bg); display: grid; gap: 14px;
}
.wms-saas .wms-wh-wizard[hidden] { display: none !important; }
.wms-saas .wms-wh-wizard-steps {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.wms-saas .wms-wh-wizard-steps span {
  font-size: 12px; font-weight: 650; color: var(--wms-faint);
  padding: 5px 10px; border-radius: 999px; background: var(--wms-card); border: 1px solid var(--wms-line);
}
.wms-saas .wms-wh-wizard-steps span.on {
  color: var(--wms-green-600); background: var(--wms-soft); border-color: rgba(22,163,74,.35);
}
.wms-saas .wms-wh-map-wrap {
  border: 1px solid var(--wms-line); border-radius: 14px; overflow: hidden; background: var(--wms-card);
}
.wms-saas .wms-sites-map {
  height: 280px; width: 100%; background: #eef2f6; cursor: crosshair;
}
.wms-saas .wms-wh-pin-hint {
  margin: 0; padding: 10px 12px; font-size: 13px; font-weight: 550;
  color: var(--wms-mute); border-top: 1px solid var(--wms-line); background: var(--wms-card);
}
.wms-saas .wms-wh-pin-hint.is-set { color: var(--wms-green-600); }
.wms-saas .wms-wh-create-form { display: grid; gap: 14px; }
.wms-saas .wms-wh-fields {
  display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 10px;
}
.wms-saas .wms-wh-fields .wms-wh-wide { grid-column: 1 / -1; }
.wms-saas .wms-wh-fields label,
.wms-saas .wms-wh-aisle-grid label {
  display: grid; gap: 5px; font-size: 12px; font-weight: 550; color: var(--wms-mute);
}
.wms-saas .wms-wh-fields input,
.wms-saas .wms-wh-aisle-grid input,
.wms-saas .wms-wh-aisle-grid select {
  border: 1px solid var(--wms-line); border-radius: 10px; padding: 10px 12px;
  background: var(--wms-card); color: var(--wms-ink); font: inherit; font-size: 14px;
}
.wms-saas .wms-wh-aisles h4 {
  margin: 0 0 4px; font-size: 14px; font-weight: 650; color: var(--wms-ink);
}
.wms-saas .wms-wh-aisle-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px;
}
.wms-saas .wms-wh-preview {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 10px;
  background: var(--wms-soft); color: var(--wms-green-600);
  font-size: 13px; font-weight: 600;
}
.wms-saas .wms-wh-actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
}
@media (max-width: 900px) {
  .wms-saas .wms-wh-fields { grid-template-columns: 1fr; }
  .wms-saas .wms-wh-aisle-grid { grid-template-columns: 1fr 1fr; }
}
.wms-saas .wms-catalog-mount,
.wms-saas .wms-activity-mount { padding: 0 0 12px; }
.wms-saas .wms-catalog-mount .inv-ops-pane,
.wms-saas .wms-activity-mount .inv-ops-pane {
  display: block !important; padding: 12px 16px; min-height: 280px;
}
.wms-saas .wms-catalog-mount .inv-ops-scroll { max-height: 62vh; overflow: auto; }
.wms-saas #wms-fulfill-mount .inv-ops-fulfill {
  display: block !important; margin-top: 12px;
  background: var(--wms-card); border: 1px solid var(--wms-line);
  border-radius: 14px; padding: 12px; box-shadow: var(--wms-shadow);
}
.wms-saas .wms-kpi[id],
.wms-saas #inv-kpi-sites { cursor: default; }
.wms-saas .wms-kpi:has(#inv-kpi-sites) { cursor: pointer; }
.wms-saas .wms-form-card { position: relative; z-index: 1; }
.wms-saas .wms-drawer { display: none !important; }
.wms-saas .wms-wh-card {
  pointer-events: auto; background: var(--wms-card); border: 1px solid var(--wms-line);
  border-radius: 10px; padding: 10px 12px; box-shadow: var(--wms-shadow); cursor: pointer;
}
.wms-saas .wms-wh-card.on { border-color: rgba(22,163,74,.45); box-shadow: 0 0 0 2px rgba(22,163,74,.12); }
.wms-saas .wms-wh-card strong { display: block; font-size: 12.5px; font-weight: 650; }
.wms-saas .wms-wh-card span { font-size: 11px; color: var(--wms-mute); }
.wms-saas .wms-util {
  margin-top: 6px; display: flex; justify-content: space-between; font-size: 11px; color: var(--wms-mute);
}
.wms-saas .wms-bar { height: 4px; background: var(--wms-soft-bg); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.wms-saas .wms-bar i { display: block; height: 100%; background: var(--wms-green); }
.wms-saas .wms-wh-card em { display: block; margin-top: 5px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--wms-green); }
.wms-saas .wms-site-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.wms-saas .wms-site-pill {
  border: 1px solid var(--wms-line); background: var(--wms-hover); color: var(--wms-mute);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.wms-saas .wms-site-pill.on { background: var(--wms-soft); color: var(--wms-green-600); border-color: rgba(22,163,74,.35); }
.wms-saas .wms-tabs { display: flex; gap: 2px; background: var(--wms-soft-bg); padding: 3px; border-radius: 9px; }
.wms-saas .wms-tabs button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 7px;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--wms-mute); cursor: pointer;
}
.wms-saas .wms-tabs button.on { background: var(--wms-card); color: var(--wms-ink); font-weight: 600; box-shadow: var(--wms-shadow); }
.wms-saas .wms-table-wrap { overflow: auto; max-height: 420px; }
.wms-saas .wms-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wms-saas .wms-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--wms-faint);
  letter-spacing: .04em; text-transform: uppercase; padding: 10px 12px;
  background: var(--wms-soft-bg); border-bottom: 1px solid var(--wms-line); position: sticky; top: 0;
}
.wms-saas .wms-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--wms-line); color: #374151;
}
.wms-saas .wms-table tr:hover td { background: var(--wms-soft-bg); }
.wms-saas .wms-prod { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--wms-ink); }
.wms-saas .wms-pic {
  width: 32px; height: 32px; border-radius: 8px; background: var(--wms-soft-bg); border: 1px solid var(--wms-line);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--wms-mute);
}
.wms-saas .mono { font-variant-numeric: tabular-nums; color: var(--wms-mute); }
.wms-saas .loc { font-weight: 600; color: var(--wms-ink); }
.wms-saas .wms-pill {
  display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 650;
}
.wms-saas .wms-pill.ok { background: var(--wms-soft); color: var(--wms-green-600); }
.wms-saas .wms-pill.low { background: oklch(0.82 0.14 75 / 0.16); color: oklch(0.82 0.14 75); }
.wms-saas .wms-pill.out { background: oklch(0.62 0.2 25 / 0.16); color: oklch(0.75 0.14 25); }
html[data-theme="light"] .wms-saas .wms-pill.low { background: #fffbeb; color: #b45309; }
html[data-theme="light"] .wms-saas .wms-pill.out { background: #fff1f2; color: #be123c; }
.wms-saas .wms-link {
  border: 0; background: transparent; color: var(--wms-green); font: inherit; font-size: 12px;
  font-weight: 650; cursor: pointer;
}
.wms-saas .wms-empty, .wms-saas .wms-empty-pad {
  padding: 20px; text-align: center; color: var(--wms-mute); font-size: 13px;
}
.wms-saas .wms-alerts { padding: 4px 14px 10px; max-height: 280px; overflow: auto; }
.wms-saas .wms-alert {
  display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--wms-line); font-size: 12px;
}
.wms-saas .wms-alert-ico {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--wms-soft-bg); color: var(--wms-mute);
}
.wms-saas .wms-alert-ico.wa { background: var(--wms-soft); color: var(--wms-green); }
.wms-saas .wms-alert-ico.ops { background: oklch(0.55 0.12 255 / 0.18); color: oklch(0.72 0.12 255); }
html[data-theme="light"] .wms-saas .wms-alert-ico.ops { background: #eff6ff; color: #2563eb; }
.wms-saas .wms-alert strong { display: block; font-weight: 650; color: var(--wms-ink); }
.wms-saas .wms-alert span { color: var(--wms-mute); }
.wms-saas .wms-order {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--wms-line); font-size: 13px;
}
.wms-saas .wms-order strong { display: block; font-weight: 650; }
.wms-saas .wms-floor-card { margin-bottom: 8px; }
.wms-saas .wms-legend { display: flex; gap: 12px; font-size: 11px; color: var(--wms-mute); font-weight: 500; }
.wms-saas .wms-legend i {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px;
}
.wms-saas .wms-legend i.avail { background: #4ade80; }
.wms-saas .wms-legend i.empty { background: #d1d5db; }
.wms-saas .wms-legend i.low { background: #fbbf24; }
.wms-saas .wms-floor {
  display: grid; grid-template-columns: 140px 1fr 220px; min-height: 300px;
}
.wms-saas .wms-zones {
  border-right: 1px solid var(--wms-line); padding: 12px; background: var(--wms-soft-bg);
}
.wms-saas .wms-zones h4 {
  margin: 0 0 8px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--wms-faint); font-weight: 650;
}
.wms-saas .wms-zones button {
  width: 100%; text-align: left; border: 0; background: transparent; color: var(--wms-mute);
  padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 550;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.wms-saas .wms-zones button.on { background: var(--wms-soft); color: var(--wms-green-600); }
.wms-saas .wms-plan {
  padding: 14px; background:
    linear-gradient(var(--wms-line) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--wms-line) 1px, transparent 1px) 0 0 / 22px 22px, var(--wms-soft-bg);
  overflow: auto;
}
.wms-saas .wms-rack-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px;
}
.wms-saas .wms-rack {
  border: 0; border-radius: 10px; padding: 10px 8px; cursor: pointer; text-align: left;
  color: #14532d; font: inherit; min-height: 78px;
  display: flex; flex-direction: column; gap: 2px;
}
.wms-saas .wms-rack strong { font-size: 12px; font-weight: 700; }
.wms-saas .wms-rack small {
  font-size: 10px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wms-saas .wms-rack em { font-style: normal; font-size: 11px; font-weight: 700; margin-top: auto; }
.wms-saas .wms-rack.avail { background: #86efac; }
.wms-saas .wms-rack.empty { background: var(--wms-line); color: var(--wms-mute); }
.wms-saas .wms-rack.low { background: #fcd34d; color: #78350f; }
.wms-saas .wms-rack.on { box-shadow: 0 0 0 2px var(--wms-ink); }
.wms-saas .wms-loc-detail {
  border-left: 1px solid var(--wms-line); padding: 14px; background: var(--wms-card);
}
.wms-saas .wms-loc-detail h4 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.wms-saas .wms-stat3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.wms-saas .wms-stat3 div {
  background: var(--wms-soft-bg); border: 1px solid var(--wms-line); border-radius: 10px;
  padding: 8px; text-align: center;
}
.wms-saas .wms-stat3 b { display: block; font-size: 15px; font-weight: 700; }
.wms-saas .wms-stat3 span { font-size: 10px; color: var(--wms-faint); }
.wms-saas .wms-sku-line {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--wms-line); font-size: 12px;
}
.wms-saas .wms-drawer {
  position: fixed; inset: 0; z-index: 80; background: rgba(15,23,42,.35);
  display: grid; place-items: center; padding: 20px;
}
.wms-saas .wms-drawer[hidden] { display: none !important; }
.wms-saas .wms-drawer-panel {
  width: min(420px, 100%); max-height: min(88vh, 720px); overflow: auto;
  background: var(--wms-card); border-radius: 16px; padding: 18px; box-shadow: 0 20px 50px rgba(15,23,42,.2);
  color: var(--wms-ink);
}
.wms-saas .wms-drawer-wide { width: min(560px, 100%); }
.wms-saas .wms-drawer-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px;
}
.wms-saas .wms-drawer-h h3 { margin: 0; font-size: 16px; font-weight: 650; }
.wms-saas .wms-form { display: grid; gap: 10px; }
.wms-saas .wms-form label { display: grid; gap: 5px; font-size: 12px; font-weight: 550; color: var(--wms-mute); }
.wms-saas .wms-form input, .wms-saas .wms-form select {
  border: 1px solid var(--wms-line); border-radius: 10px; padding: 10px 12px;
  background: var(--wms-soft-bg); color: var(--wms-ink); font: inherit; font-size: 14px;
}
.wms-saas .wms-loc-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.wms-saas .wms-xfer {
  border: 1px solid var(--wms-line); border-radius: 12px; padding: 12px; margin-top: 10px;
}
.wms-saas .wms-pipe { display: flex; gap: 4px; margin: 8px 0; }
.wms-saas .wms-pipe i {
  flex: 1; height: 4px; border-radius: 99px; background: var(--wms-line); display: block;
}
.wms-saas .wms-pipe i.on { background: var(--wms-green); }
.wms-saas .wms-xfer-acts { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1200px) {
  .wms-saas .wms-kpis { grid-template-columns: repeat(3, 1fr); }
  .wms-saas .wms-row2, .wms-saas .wms-row3 { grid-template-columns: 1fr; }
  .wms-saas .wms-floor { grid-template-columns: 120px 1fr; }
  .wms-saas .wms-loc-detail { display: none; }
}
@media (max-width: 720px) {
  .wms-saas .wms-kpis { grid-template-columns: 1fr 1fr; }
  .wms-saas .wms-floor { grid-template-columns: 1fr; }
  .wms-saas .wms-zones { border-right: 0; border-bottom: 1px solid var(--wms-line); display: flex; flex-wrap: wrap; gap: 4px; }
  .wms-saas .wms-zones h4 { width: 100%; }
  .wms-saas .wms-zones button { width: auto; }
}

/* ── FlowSelect (custom dropdown, software-wide) ── */
:root {
  --flow-select-bg: var(--flow-input-bg, var(--flow-card));
  --flow-select-border: var(--flow-border);
  --flow-select-text: var(--flow-white);
  --flow-select-mute: var(--flow-w45);
  --flow-select-menu-bg: var(--flow-elevated, var(--flow-card));
  --flow-select-on-bg: #2563eb;
  --flow-select-on-text: #ffffff;
  --flow-select-hover: var(--flow-w06);
  --flow-select-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  --flow-select-radius: 10px;
}
html[data-theme="light"] {
  --flow-select-bg: #ffffff;
  --flow-select-border: #e5e7eb;
  --flow-select-text: #111827;
  --flow-select-mute: #6b7280;
  --flow-select-menu-bg: #ffffff;
  --flow-select-on-bg: #2563eb;
  --flow-select-on-text: #ffffff;
  --flow-select-hover: #f3f4f6;
  --flow-select-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.flow-select {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  min-width: 0;
  max-width: 100%;
  font: inherit;
  z-index: 1;
}
.flow-select.is-open { z-index: 90; }
.flow-select.from-wms-select,
.flow-select.flow-select--wms,
.flow-select.flow-select--filter,
.flow-select.from-flow-inventory-filter,
.flow-select.from-flow-pos-input,
.app-form-group .flow-select,
.wms-form .flow-select,
.wms-scan-bar .flow-select {
  width: auto;
  flex: 0 0 auto;
}
.app-form-group .flow-select,
.wms-form label .flow-select,
.flow-pos-cart-meta .flow-select,
.wm-field .flow-select {
  display: flex;
  width: 100%;
}
.flow-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid var(--flow-select-border);
  border-radius: var(--flow-select-radius);
  background: var(--flow-select-bg);
  color: var(--flow-select-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.flow-select-trigger:hover {
  border-color: color-mix(in srgb, var(--flow-select-border) 60%, var(--flow-select-on-bg));
}
.flow-select.is-open .flow-select-trigger,
.flow-select-trigger:focus-visible {
  outline: none;
  border-color: var(--flow-select-on-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--flow-select-on-bg) 22%, transparent);
}
.flow-select-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-select-trigger.is-placeholder .flow-select-label {
  color: var(--flow-select-mute);
  font-weight: 500;
}
.flow-select-chevron {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border-right: 2px solid var(--flow-select-mute);
  border-bottom: 2px solid var(--flow-select-mute);
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.85;
  transition: transform .15s ease;
}
.flow-select.is-open:not(.is-open-up) .flow-select-chevron {
  transform: rotate(225deg) translateY(-1px);
}
.flow-select.is-open-up .flow-select-chevron {
  transform: rotate(-135deg) translateY(1px);
}
.wm-station-bar,
.wm-station-fields,
.wm-field,
.wms-scan-bar,
.wms-form,
.app-form-group {
  overflow: visible;
}
.flow-select.is-disabled .flow-select-trigger {
  opacity: 0.55;
  cursor: not-allowed;
}
.flow-select-menu {
  margin: 0 !important;
  padding: 6px;
  border: 1px solid var(--flow-select-border);
  border-radius: 12px;
  background: var(--flow-select-menu-bg);
  box-shadow: var(--flow-select-shadow);
  max-height: min(280px, 50vh);
  overflow: auto;
  box-sizing: border-box;
}
.flow-select-menu[hidden] { display: none !important; }
.flow-select-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--flow-select-text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
}
.flow-select-option:hover,
.flow-select-option:focus-visible {
  outline: none;
  background: var(--flow-select-hover);
}
.flow-select-option.is-on,
.flow-select-option.is-on:hover,
.flow-select-option.is-on:focus-visible {
  background: var(--flow-select-on-bg);
  color: var(--flow-select-on-text);
}
.flow-select-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.flow-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Hide raw selects once enhanced; unenhanced still show until init */
select.flow-select-native { appearance: none; }
.wms-saas .flow-select--wms .flow-select-trigger,
.wms-saas .wms-scan-bar .flow-select-trigger {
  min-height: 38px;
  font-weight: 600;
  box-shadow: none;
  background: var(--wms-soft-bg);
}
.wms-saas .flow-select-option.is-on {
  background: #2563eb;
}

/* ===== Barcodes page ===== */
#page-barcodes .bc-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.bc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bc-toolbar .flow-inventory-search {
  min-width: 220px;
  flex: 1 1 200px;
}
.bc-stats {
  font-size: 13px;
  color: var(--flow-w55);
  margin: 0 0 12px;
}
.bc-table-wrap {
  overflow: auto;
  border: 1px solid var(--flow-border);
  border-radius: 14px;
  background: var(--flow-card);
  color: var(--flow-w90);
}
.bc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: inherit;
}
.bc-table th,
.bc-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--flow-border);
  vertical-align: middle;
  color: inherit;
}
.bc-table th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--flow-w50);
  font-weight: 700;
  background: var(--flow-inset-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}
.bc-table tbody tr:hover {
  background: var(--flow-w06);
}
.bc-table tbody tr.is-missing {
  background: color-mix(in srgb, oklch(0.75 0.12 85) 12%, transparent);
}
.bc-col-check { width: 40px; }
.bc-col-preview { min-width: 180px; }
.bc-col-actions { width: 88px; text-align: right; }
.bc-prod-name {
  font-weight: 650;
  display: block;
  color: var(--flow-w95);
}
.bc-prod-meta {
  font-size: 12px;
  color: var(--flow-w50);
  margin-top: 2px;
}
.bc-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--flow-w90);
}
.bc-code.is-empty {
  color: oklch(0.72 0.14 55);
  font-family: inherit;
  font-weight: 600;
}
.bc-svg-wrap {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--flow-border);
  width: fit-content;
  max-width: 100%;
}
.bc-svg-wrap svg {
  max-width: 100%;
  height: 48px;
}
.bc-badge-miss {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, oklch(0.75 0.12 85) 28%, transparent);
  color: oklch(0.78 0.12 55);
}
html[data-theme="light"] .bc-code.is-empty {
  color: oklch(0.45 0.12 55);
}
html[data-theme="light"] .bc-badge-miss {
  background: oklch(0.92 0.08 85);
  color: oklch(0.4 0.1 55);
}
@media (max-width: 720px) {
  .bc-col-preview,
  .bc-table th:nth-child(3),
  .bc-table td:nth-child(3) { display: none; }
  .bc-toolbar .flow-inventory-search { min-width: 100%; }
}

/* ===== Menu import (photo / PDF) ===== */
#menu-import-modal.flow-modal-bg.open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.menu-import-modal {
  max-width: 640px;
  width: min(640px, 96vw);
  text-align: left;
  margin: 0 auto;
  max-height: min(90vh, 820px);
  overflow: auto;
}
.menu-import-modal .flow-inv-wiz-top {
  text-align: left;
  align-items: flex-start;
}
.menu-import-modal .flow-modal-text {
  text-align: left;
  margin-bottom: 0.35rem;
}
.menu-import-modal .flow-modal-actions {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.menu-import-modal .flow-modal-actions .flow-btn {
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
}
.menu-import-upload {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 12px 0 8px;
  text-align: left;
}
.menu-import-upload .flow-file-btn {
  align-self: flex-start;
}
#menu-import-status:empty { display: none; }
@media (max-width: 640px) {
  #menu-import-modal.flow-modal-bg.open {
    align-items: flex-end;
    padding: 0;
  }
  .menu-import-modal {
    width: 100%;
    max-width: none;
    border-radius: 20px 20px 0 0;
    max-height: 92dvh;
  }
  .menu-import-modal .flow-modal-actions {
    justify-content: stretch;
  }
  .menu-import-modal .flow-modal-actions .flow-btn {
    flex: 1 1 auto;
  }
}
.menu-import-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.menu-import-count { font-size: 12px; opacity: 0.65; }
.menu-import-list {
  max-height: min(48vh, 420px);
  overflow: auto;
  border: 1px solid var(--flow-border, rgba(12,12,24,.12));
  border-radius: 12px;
  background: #f7f8fc;
}
html:not([data-theme="light"]) .menu-import-list {
  background: oklch(0.18 0.02 255 / 0.5);
}
.menu-import-row {
  display: grid;
  grid-template-columns: 28px 1.4fr 88px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(12, 12, 24, 0.06);
}
.menu-import-row:last-child { border-bottom: 0; }
.menu-import-row input[type="text"],
.menu-import-row input[type="number"] {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--flow-border, rgba(12,12,24,.14));
  background: #fff;
  color: inherit;
}
html:not([data-theme="light"]) .menu-import-row input[type="text"],
html:not([data-theme="light"]) .menu-import-row input[type="number"] {
  background: oklch(0.22 0.02 255);
  border-color: var(--flow-w15);
}
.flow-pos-menu-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
@media (max-width: 560px) {
  .menu-import-row {
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto;
  }
  .menu-import-row .mi-price,
  .menu-import-row .mi-cat { grid-column: 2; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE REDESIGN 2026-07 — phone only (≤640 / POS ≤960). Do not affect desktop.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* —— App main breathing room above tab bar —— */
  .app-main {
    padding-left: max(12px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(12px, env(safe-area-inset-right, 0px)) !important;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .app-page {
    max-width: 100%;
    min-width: 0;
  }
  .app-page-header {
    margin-bottom: 0.85rem;
    gap: 8px;
  }
  .app-page-title {
    font-size: 1.25rem;
    line-height: 1.2;
  }
  .app-page-desc {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  /* —— Soften oversized global buttons inside dense toolbars —— */
  .inv-ops .flow-btn,
  .inv-ops-classic-only .flow-btn,
  .wms-saas .wms-btn {
    min-height: 42px;
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  /* —— Shop / Menu catalog filters —— */
  .inv-ops-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .inv-kind-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 6px !important;
    width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .inv-kind-tabs::-webkit-scrollbar { display: none; }
  .inv-kind-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .inv-ops-toolbar .flow-inventory-search,
  .inv-ops-toolbar .flow-inventory-filter,
  .inv-ops-toolbar .flow-select,
  .inv-ops-toolbar select {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    min-width: 0 !important;
  }
  .inv-ops-cat-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
    width: 100%;
  }
  .inv-ops-hint {
    font-size: 0.72rem;
    line-height: 1.4;
    margin-bottom: 10px;
  }
  .inv-ops-scroll {
    min-height: 0 !important;
    padding-bottom: 1.25rem;
  }
  .inv-ops-scroll .flow-inventory-grid,
  #inventory-grid.flow-inventory-grid,
  .flow-inventory-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #inventory-grid .flow-inv-card,
  .flow-inv-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .inv-ops-body,
  .inv-ops-center,
  .inv-ops-pane {
    min-width: 0;
    max-width: 100%;
  }
  .inv-ops-modes {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  /* —— WMS scan bar (warehouse accounts on phone) —— */
  .wms-saas .wms-scan-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .wms-saas .wms-scan-bar .wms-select,
  .wms-saas .wms-scan-bar .wms-search,
  .wms-saas .wms-scan-bar .wms-search-grow {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .wms-saas .wms-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    scrollbar-width: none;
  }
  .wms-saas .wms-nav::-webkit-scrollbar { display: none; }
  .wms-saas .wms-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* —— Home KPIs & pipeline —— */
  .hd-kpi-ribbon .hd-kpi,
  .hd-kpi-ribbon > * {
    min-width: 0;
    padding: 10px 12px;
  }
  .hd-pipeline,
  .hd-kanban-wrap {
    min-width: 0;
  }
  .hd-kanban-col,
  #dash-kanban > * {
    min-width: 0;
  }
  .hd-phase2-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* —— Money —— */
  #page-money .flow-books-toolbar {
    gap: 10px;
  }
  #page-money .flow-books-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  #page-money .flow-gst-collected-split {
    grid-template-columns: 1fr;
  }
  #page-money .flow-gst-collected-total {
    font-size: 1.55rem;
  }
  #page-money .flow-books-stats .flow-stat-card {
    flex: none !important;
    min-width: 0 !important;
    width: auto !important;
    padding: 12px !important;
  }
  #page-money .flow-books-stats .flow-stat-card strong {
    font-size: 1.15rem;
    word-break: break-word;
  }
  #page-money .app-card {
    padding: 0.9rem;
  }
  #page-money .flow-books-form,
  #page-money .flow-books-entry {
    display: grid;
    gap: 10px;
  }

  /* —— Inbox / Chats —— */
  #page-inbox .app-page-header,
  #page-inbox .flow-inbox-header {
    margin-bottom: 0.65rem;
  }
  .flow-inbox-item {
    padding: 12px 10px;
  }

  /* —— Connect / QR —— */
  .flow-connect-layout {
    gap: 12px;
  }
  .flow-qr-body {
    padding: 1rem;
  }
}

@media (max-width: 960px) {
  /* —— POS immersive: don't reserve tab-bar space —— */
  body.pos-phone-immersive .app-main {
    padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: max(10px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(10px, env(safe-area-inset-right, 0px)) !important;
  }

  /* —— POS: never let inactive panels bleed through —— */
  .flow-pos-panel:not(.active),
  .flow-pos-panel[hidden] {
    display: none !important;
  }
  .flow-pos-panel.active {
    display: block;
  }
  #pos-panel-billing.pos-phone-floor.active {
    display: flex !important;
  }

  /* —— POS tabs: readable scroll chips —— */
  .flow-pos-tabs {
    gap: 6px !important;
    margin: 0 0 0.65rem !important;
    padding: 2px 0 8px !important;
  }
  .flow-pos-tab {
    padding: 0.42rem 0.75rem !important;
    font-size: 0.78rem !important;
    border-radius: 999px !important;
  }

  /* —— POS Tables panel (compact) —— */
  #pos-panel-tables.active {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
  }
  .flow-pos-tables-toolbar {
    display: grid !important;
    grid-template-columns: minmax(72px, 88px) 1fr 1fr !important;
    gap: 6px !important;
    align-items: end;
    margin-bottom: 4px !important;
  }
  .flow-pos-tables-toolbar label {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    margin: 0;
  }
  .flow-pos-tables-toolbar .flow-pos-input,
  .flow-pos-tables-toolbar input {
    width: 100%;
    min-height: 38px;
    padding: 6px 8px;
  }
  .flow-pos-tables-toolbar #btn-pos-tables-save {
    grid-column: 2;
  }
  .flow-pos-tables-toolbar #btn-pos-tables-refresh {
    grid-column: 3;
  }
  .flow-pos-tables-toolbar #btn-pos-tables-print-all {
    grid-column: 1 / -1;
  }
  .flow-pos-tables-toolbar .flow-btn {
    width: 100%;
    min-height: 38px !important;
    padding: 6px 8px !important;
    font-size: 0.72rem !important;
  }
  #pos-tables-hint {
    font-size: 0.68rem;
    line-height: 1.3;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .flow-pos-tables-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .flow-pos-table-card.occupied {
    grid-column: 1 / -1;
  }
  .flow-pos-table-card {
    padding: 10px !important;
    gap: 6px !important;
    border-radius: 10px !important;
  }
  .flow-pos-table-card-head strong {
    font-size: 0.88rem !important;
  }
  .flow-pos-table-badge {
    font-size: 0.62rem !important;
    padding: 2px 6px !important;
  }
  .flow-pos-table-orders {
    padding: 6px 8px !important;
  }
  .flow-pos-table-orders li {
    font-size: 0.72rem !important;
  }
  .flow-pos-table-meta {
    font-size: 0.65rem !important;
  }
  .flow-pos-table-actions {
    gap: 4px !important;
  }
  .flow-pos-table-actions .flow-btn {
    min-height: 34px !important;
    padding: 4px 8px !important;
    font-size: 0.68rem !important;
  }
  .flow-pos-table-card.free .flow-pos-table-extra {
    display: none !important;
  }
  .flow-pos-table-card.free .flow-pos-table-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  /* —— POS Inventory / Stock panel —— */
  #pos-panel-inventory.active {
    display: block !important;
  }
  .flow-pos-inv-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    max-width: 100%;
  }
  .flow-pos-inv-table-wrap .flow-inv-table,
  #pos-inv-table {
    min-width: 540px;
  }
  #pos-panel-inventory .flow-pos-kpi-row,
  #pos-panel-inventory .flow-inventory-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  #pos-panel-inventory .flow-stat-card {
    flex: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  /* —— POS Online / Reports —— */
  .flow-pos-kpi-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .flow-pos-kpi-row .flow-stat-card {
    flex: none !important;
    min-width: 0 !important;
  }

  /* —— Floor channels: 2×2 on narrow phones —— */
  .flow-pos-floor-channels {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .flow-pos-floor-tables {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 420px) {
  .app-staff-chip { display: none !important; }
  .hd-kpi-ribbon { gap: 6px; }
  .flow-pos-tables-toolbar {
    grid-template-columns: 1fr 1fr !important;
  }
  .flow-pos-tables-toolbar label {
    grid-column: 1 / -1 !important;
  }
  .flow-pos-tables-toolbar #btn-pos-tables-save { grid-column: 1 !important; }
  .flow-pos-tables-toolbar #btn-pos-tables-refresh { grid-column: 2 !important; }
  .flow-pos-tables-toolbar #btn-pos-tables-print-all { grid-column: 1 / -1 !important; }
}

/* ===== Staff gate (Netflix-style picker) + Team page ===== */
.flow-staff-gate {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--flow-accent) 18%, transparent), transparent 60%),
    linear-gradient(165deg, #0c1118 0%, #151b24 45%, #0f141c 100%);
  color: #f2f5fb;
  overflow: auto;
}
.flow-staff-gate[hidden] { display: none !important; }
.flow-staff-gate-inner {
  width: min(1100px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}
.flow-staff-gate-head { text-align: center; }
.flow-staff-gate-mark {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}
.flow-staff-gate-head h1 {
  margin: 0 0 6px;
  font-family: "Cabinet Grotesk", "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.flow-staff-gate-head p {
  margin: 0;
  color: rgba(242, 245, 251, 0.55);
  font-size: 0.95rem;
}
/* Netflix-style: one horizontal row of fixed-width profile cards */
.flow-staff-gate-step#staff-gate-cards-step {
  width: 100%;
  align-self: stretch;
}
.flow-staff-gate-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 20px 28px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
.flow-staff-gate-card {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 28px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  flex: 0 0 168px;
  width: 168px;
  max-width: 168px;
  box-sizing: border-box;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.flow-staff-gate-card:hover,
.flow-staff-gate-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--flow-accent) 55%, var(--flow-border));
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.flow-staff-gate-card.is-owner {
  border-color: color-mix(in srgb, var(--flow-accent) 40%, transparent);
}
.flow-staff-gate-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.75rem;
  background: color-mix(in srgb, var(--flow-accent) 28%, var(--flow-inset-bg));
  color: #fff;
}
.flow-staff-gate-card strong {
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}
.flow-staff-gate-card span {
  font-size: 0.72rem;
  color: rgba(242, 245, 251, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.flow-staff-gate-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(242, 245, 251, 0.5);
}
.flow-staff-gate-pin-card {
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.flow-staff-gate-back {
  align-self: flex-start;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(242, 245, 251, 0.65);
  font: inherit;
  cursor: pointer;
  margin-bottom: 8px;
}
.flow-staff-gate-pin-label {
  margin-top: 8px;
  font-size: 0.75rem;
  color: rgba(242, 245, 251, 0.5);
}
.flow-staff-gate-pin-input {
  width: 100%;
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 1.25rem !important;
  min-height: 48px !important;
}
.flow-staff-gate-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin: 8px 0;
}
.flow-staff-gate-pad button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 12px;
  min-height: 48px;
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
}
.flow-staff-gate-pad button:active { background: rgba(255, 255, 255, 0.14); }
.flow-staff-gate-go { width: 100%; min-height: 48px; margin-top: 4px; }
.flow-staff-gate-err {
  margin: 0;
  color: #fca5a5;
  font-size: 0.82rem;
  text-align: center;
}
.flow-staff-gate-logout {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(242, 245, 251, 0.4);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
html[data-theme="light"] .flow-staff-gate {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--flow-accent) 14%, transparent), transparent 60%),
    linear-gradient(165deg, #f4f7fa 0%, #e8eef4 100%);
  color: #0f172a;
}
html[data-theme="light"] .flow-staff-gate-head p,
html[data-theme="light"] .flow-staff-gate-card span,
html[data-theme="light"] .flow-staff-gate-hint,
html[data-theme="light"] .flow-staff-gate-back,
html[data-theme="light"] .flow-staff-gate-logout,
html[data-theme="light"] .flow-staff-gate-pin-label { color: rgba(15, 23, 42, 0.55); }
html[data-theme="light"] .flow-staff-gate-card,
html[data-theme="light"] .flow-staff-gate-pin-card {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}
html[data-theme="light"] .flow-staff-gate-pad button {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}
body.flow-staff-gate-open .app-shell { visibility: hidden; pointer-events: none; }
body.flow-staff-gate-open .flow-auth-screen { display: none !important; }

.flow-team-form {
  display: grid;
  gap: 10px;
}
.flow-team-form .flow-pos-staff-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--flow-inset-bg, var(--flow-w06));
  border: 1px solid var(--flow-border);
}
.flow-team-mods-label {
  width: 100%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--flow-w50);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.flow-pos-staff-mod {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}
.flow-team-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-team-list { display: flex; flex-direction: column; gap: 10px; }
.flow-team-person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--flow-border);
  background: var(--flow-card);
}
.flow-team-person.is-inactive { opacity: 0.55; }
.flow-team-person-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: color-mix(in srgb, var(--flow-accent) 18%, var(--flow-inset-bg, #fff));
  color: var(--flow-accent);
  flex: 0 0 auto;
}
.flow-team-person-copy { flex: 1 1 160px; min-width: 0; }
.flow-team-person-copy strong { display: block; font-size: 0.95rem; }
.flow-team-person-copy span { font-size: 0.78rem; color: var(--flow-w50); }
.flow-team-mod-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.flow-team-mod-chips em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--flow-w08);
  color: var(--flow-w70);
}
.flow-team-person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.flow-pos-settings-card .flow-pos-settings-mini {
  display: grid;
  gap: 8px;
}

/* ===== SALON PHONE SHELL — retired as a header.
   `sph-chrome` is no longer a second top bar. On the phone it is restyled by
   platform/flow-phone.css into an in-content segmented row (Desk | Bills |
   More); its exit and bell buttons are dropped because the shell owns those. */
.sph-chrome { display: none; }

@media (max-width: 960px) {
  /* Phone chrome is structural and always opaque. A translucent bar plus a
     blur filter is what produced the "frosted strip over the content" report —
     it is banned outright, on every shell. */
  .app-topbar,
  .fp-header,
  .fp-deck,
  .sph-chrome,
  .flow-pos-phone-sessionbar,
  .app-mobile-nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ===== Salon Membership page ===== */
body.flow-acct-salon_spa #pos-staff-modules .flow-pos-staff-mod[data-resto-only],
body.flow-acct-salon_spa #pos-staff-modules input[value="kitchen"] {
  display: none !important;
}
#page-membership .mem-search-bar { margin: 0 0 14px; }
#page-membership .mem-tabs { margin-bottom: 14px; }
.mem-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
}
.mem-accordion.is-filtered-out {
  display: none !important;
}
.mem-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name balance"
    "phone balance";
  align-items: center;
  gap: 3px 12px;
  text-align: left;
  min-height: 72px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--flow-border);
  background: var(--flow-card);
  color: inherit;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.mem-card:hover {
  border-color: color-mix(in srgb, var(--flow-accent, #c9a227) 28%, transparent);
  background: color-mix(in srgb, var(--flow-accent, #c9a227) 5%, var(--flow-card));
}
.mem-card-head {
  grid-area: name;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.mem-card-head strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .96rem;
}
.mem-card-pending,
.mem-card-pay {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .64rem;
  font-style: normal;
  font-weight: 750;
  letter-spacing: .02em;
  line-height: 1.2;
}
.mem-card-pending {
  background: #fff7ed;
  color: #c2410c;
}
.mem-card-pay {
  background: color-mix(in srgb, var(--flow-accent, #c9a227) 16%, transparent);
  color: var(--flow-w80, rgba(255,255,255,.82));
}
.mem-accordion.has-pending-pay > .mem-card {
  box-shadow: inset 0 0 0 1.5px rgba(180, 83, 9, 0.4);
}
.mem-session-pay-pending {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 750;
  background: #fff7ed;
  color: #c2410c;
}
.mem-card-phone {
  grid-area: phone;
  font-size: .72rem;
  color: var(--flow-w45);
}
.mem-card-balance {
  grid-area: balance;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.mem-card-balance > b {
  font-size: 1.3rem;
  line-height: 1;
  color: var(--flow-w95, rgba(255,255,255,.96));
}
.mem-card-balance > small {
  font-size: .64rem;
  color: var(--flow-w45);
}
.mem-detail { margin-top: 16px; }
.mem-accordion {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 76px;
}
.mem-accordion.is-open { grid-column: 1 / -1; }
.mem-accordion .mem-card {
  width: 100%;
  text-align: left;
}
.mem-accordion.is-open > .mem-card { display: none; }
.mem-accordion-panel {
  border: 1px solid var(--flow-border);
  border-radius: 14px;
  background: var(--flow-card);
  padding: 0;
  overflow: hidden;
}
.mem-accordion-body { margin: 0; }
.mem-btn-danger {
  color: color-mix(in srgb, var(--flow-red, #f87171) 88%, white) !important;
  border-color: color-mix(in srgb, var(--flow-red, #f87171) 40%, transparent) !important;
}
.mem-imp-preview {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--flow-border);
  border-radius: 10px;
  background: var(--flow-surface);
  color: var(--flow-w90, rgba(255,255,255,.9));
  font-size: .82rem;
  font-weight: 650;
}
.mem-session-view { color: var(--flow-w90); }
.mem-session-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--flow-border);
}
.mem-session-nav > strong { font-size: .86rem; }
.mem-session-back,
.mem-session-close,
.mem-session-id button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.mem-session-back {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
}
.mem-session-back:hover { background: var(--flow-surface); }
.mem-session-close {
  margin-left: auto;
  color: var(--flow-w45);
  font-size: .7rem;
}
.mem-session-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 16px 18px;
  padding: 18px;
  border: 1px solid var(--flow-border);
  border-radius: 12px;
  background: var(--flow-surface);
}
.mem-session-person {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.mem-session-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--flow-accent) 28%, var(--flow-bg3));
  border: 2px solid color-mix(in srgb, var(--flow-accent) 60%, transparent);
  color: var(--flow-w95);
  font-size: 1.35rem;
  font-weight: 750;
}
.mem-session-person h3 {
  margin: 0 0 5px;
  font-size: 1.15rem;
}
.mem-session-plan-chip {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--flow-accent) 11%, transparent);
  color: var(--flow-accent);
  font-size: .68rem;
  font-weight: 650;
}
.mem-session-person p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 9px 0 0;
  color: var(--flow-w45);
  font-size: .7rem;
}
.mem-session-id {
  min-width: 190px;
  padding-left: 22px;
  border-left: 1px solid var(--flow-border);
}
.mem-session-id > span {
  display: block;
  color: var(--flow-w45);
  font-size: .64rem;
}
.mem-session-id button {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.mem-session-id button strong { font-size: .82rem; }
.mem-session-id em {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--flow-border);
  border-radius: 8px;
  color: var(--flow-w75);
  font-size: .7rem;
  font-style: normal;
}
.mem-session-id em svg { color: var(--flow-green); }
.mem-session-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 18px 14px;
}
.mem-session-stats article {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid var(--flow-border);
  border-radius: 10px;
  background: var(--flow-surface);
}
.mem-session-stats article > svg {
  box-sizing: content-box;
  padding: 8px;
  border-radius: 50%;
}
.mem-session-stats article[data-kind="used"] > svg {
  color: var(--flow-green);
  background: color-mix(in srgb, var(--flow-green) 10%, transparent);
}
.mem-session-stats article[data-kind="remaining"] > svg {
  color: #e3a62f;
  background: color-mix(in srgb, #e3a62f 10%, transparent);
}
.mem-session-stats article[data-kind="total"] > svg {
  color: var(--flow-accent);
  background: color-mix(in srgb, var(--flow-accent) 10%, transparent);
}
.mem-session-stats span,
.mem-session-membership span {
  display: block;
  color: var(--flow-w45);
  font-size: .66rem;
}
.mem-session-stats strong {
  display: block;
  margin-top: 2px;
  font-size: 1.15rem;
}
.mem-session-membership {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 18px 14px;
  padding: 15px 18px;
  border: 1px solid var(--flow-border);
  border-radius: 10px;
  background: var(--flow-surface);
}
.mem-session-membership > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mem-session-membership > div > svg { color: #e3a62f; }
.mem-session-membership p { margin: 0; }
.mem-session-membership strong {
  display: block;
  margin-top: 3px;
  font-size: .8rem;
}
.mem-session-history {
  margin: 0 18px 16px;
  border: 1px solid var(--flow-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--flow-surface);
}
.mem-session-history > header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--flow-border);
}
.mem-session-history > header svg { color: var(--flow-accent); }
.mem-session-history > header strong { font-size: .8rem; }
.mem-table-wrap {
  overflow: auto;
  max-height: 420px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.mem-visit-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .8rem;
}
.mem-visit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: color-mix(in srgb, var(--flow-surface, #111) 94%, white);
  color: var(--flow-w45);
  font-size: .65rem;
  font-weight: 750;
  letter-spacing: .055em;
  text-align: left;
  text-transform: uppercase;
}
.mem-visit-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  color: var(--flow-w65, rgba(255,255,255,.68));
  vertical-align: middle;
}
.mem-visit-table tbody tr:last-child td { border-bottom: 0; }
.mem-visit-table tbody tr:hover { background: rgba(255,255,255,.025); }
.mem-visit-table .mem-table-empty {
  padding: 18px 10px;
  color: var(--flow-w45);
  text-align: center;
}
.mem-visit-table th:nth-child(1) { width: 138px; }
.mem-visit-table th:nth-child(2) { width: 95px; }
.mem-visit-table th:nth-child(4) { width: 130px; }
.mem-visit-table td strong {
  color: var(--flow-w90, rgba(255,255,255,.92));
  font-weight: 650;
}
.mem-visit-table td small {
  display: inline-block;
  margin-left: 7px;
  color: var(--flow-w45);
  font-size: .61rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.mem-session-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px 18px;
  border-top: 1px solid var(--flow-border);
  background: color-mix(in srgb, var(--flow-surface) 70%, transparent);
}
.mem-session-actions .flow-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mem-session-actions [data-mem-edit-open] {
  border-color: var(--flow-w90);
  background: var(--flow-w90);
  color: var(--flow-bg);
}
.mem-session-actions [data-mem-revoke] {
  color: color-mix(in srgb, var(--flow-red, #f87171) 88%, white);
  border-color: color-mix(in srgb, var(--flow-red, #f87171) 40%, transparent);
}
.mem-session-view > .mem-edit-form { margin: 14px 18px 18px; }
@media (max-width: 700px) {
  .mem-session-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .mem-session-id {
    padding: 12px 0 0;
    border-top: 1px solid var(--flow-border);
    border-left: 0;
  }
  .mem-session-id em { width: fit-content; }
  .mem-session-membership {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 520px) {
  .mem-session-hero,
  .mem-session-stats,
  .mem-session-membership,
  .mem-session-history { margin-left: 10px; margin-right: 10px; }
  .mem-session-nav { padding: 0 10px; }
  .mem-session-hero { padding: 14px; }
  .mem-session-avatar { width: 44px; height: 44px; }
  .mem-session-stats { gap: 6px; }
  .mem-session-stats article {
    min-height: 58px;
    padding: 9px;
    gap: 6px;
  }
  .mem-session-stats article > svg { display: none; }
  .mem-session-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 10px;
  }
  .mem-session-actions .flow-btn { justify-content: center; }
}
.mem-edit-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.mem-edit-form[hidden] { display: none; }
.mem-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mem-edit-form label {
  display: grid;
  gap: 6px;
  color: var(--flow-w65, rgba(255,255,255,.7));
  font-size: .72rem;
  font-weight: 650;
}
.mem-edit-form textarea {
  min-height: 64px;
  resize: vertical;
}
.mem-edit-entitlements {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  background: rgba(0,0,0,.12);
}
.mem-edit-entitlements > div:first-child strong,
.mem-edit-entitlements > div:first-child span {
  display: block;
}
.mem-edit-entitlements > div:first-child strong {
  color: var(--flow-w90, rgba(255,255,255,.92));
  font-size: .82rem;
}
.mem-edit-entitlements > div:first-child span {
  margin-top: 3px;
  color: var(--flow-w45);
  font-size: .68rem;
  line-height: 1.35;
}
.mem-edit-entitlements [data-mem-edit-entitlements] {
  display: grid;
  gap: 8px;
}
.mem-edit-entitlement {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(110px, .45fr) minmax(110px, .45fr);
  align-items: end;
  gap: 8px;
}
.mem-edit-entitlement > strong {
  align-self: center;
  color: var(--flow-w90, rgba(255,255,255,.92));
  font-size: .78rem;
}
.mem-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .mem-edit-grid { grid-template-columns: 1fr; }
  .mem-edit-entitlement { grid-template-columns: 1fr 1fr; }
  .mem-edit-entitlement > strong { grid-column: 1 / -1; }
}
.mem-form { display: grid; gap: 10px; max-width: 420px; }
.mem-form-wide { max-width: 560px; }
.mem-enroll-price {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--flow-text, #e8e4dc);
}
.mem-enroll-amount-label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--flow-w70, rgba(255,255,255,.72));
}
.mem-enroll-pay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mem-enroll-pay .flow-btn { width: 100%; }
.mem-edit-pay {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  display: grid;
  gap: 8px;
}
.mem-edit-pay legend {
  padding: 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
}
.mem-edit-pay-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}
.mem-edit-record {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 0.84rem;
  line-height: 1.35;
  color: rgba(255,255,255,0.78);
}
.mem-edit-record input { margin-top: 3px; }
.mem-package-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.mem-package-basics {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 12px;
}
.mem-package-basics label {
  display: grid;
  gap: 6px;
}
.mem-package-services-pane {
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid rgba(255,255,255,.08);
}
.mem-package-services-pane .salon-mode-label { margin: 0 0 5px; }
.mem-enroll-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.mem-import-layout {
  display: grid;
  grid-template-columns: minmax(290px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 14px;
}
.mem-import-basics {
  display: grid;
  gap: 10px;
}
.mem-import-entitlements {
  padding: 10px;
  background: var(--flow-surface);
  border-color: var(--flow-border);
}
.mem-import-entitlements #mem-imp-entitlements {
  display: grid;
  gap: 9px;
}
.mem-import-entitlements .mem-edit-entitlement {
  grid-template-columns: 1fr 1fr;
}
.mem-import-entitlements .mem-edit-entitlement > strong {
  grid-column: 1 / -1;
}
.mem-import-entitlements .mem-edit-entitlement + .mem-edit-entitlement {
  padding-top: 9px;
  border-top: 1px solid var(--flow-border);
}
.mem-import-basics #btn-mem-import {
  justify-self: start;
  min-width: 170px;
}
.mem-enroll-allowance {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.mem-enroll-custom {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.025);
}
.mem-enroll-custom > label {
  display: grid;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--flow-w70, rgba(255,255,255,.72));
}
.mem-enroll-custom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mem-enroll-custom-row > label {
  display: grid;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--flow-w70, rgba(255,255,255,.72));
}
.mem-enroll-custom .salon-mode-label { margin: 2px 0 0; }
.mem-enroll-custom .app-field-hint { margin: 0; }
.mem-enroll-save-pkg {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem !important;
  font-weight: 550 !important;
  color: var(--flow-w80, rgba(255,255,255,.82)) !important;
  cursor: pointer;
}
.mem-enroll-save-pkg input {
  width: 16px;
  height: 16px;
  accent-color: var(--flow-accent, #c4a574);
}
@media (max-width: 700px) {
  .mem-enroll-custom-row { grid-template-columns: 1fr; }
}
.mem-enroll-allowance > div:first-child strong,
.mem-enroll-allowance > div:first-child span {
  display: block;
}
.mem-enroll-allowance > div:first-child strong {
  color: var(--flow-w90, rgba(255,255,255,.92));
  font-size: .86rem;
}
.mem-enroll-allowance > div:first-child span {
  margin-top: 3px;
  color: var(--flow-w45);
  font-size: .7rem;
}
#mem-enroll-entitlements {
  display: grid;
  gap: 8px;
}
.mem-enroll-entitlement {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 90px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px;
  background: rgba(0,0,0,.12);
}
.mem-enroll-entitlement span {
  color: var(--flow-w90, rgba(255,255,255,.9));
  font-size: .78rem;
}
.mem-enroll-entitlement input { text-align: center; }
.mem-imp-history {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.mem-imp-history-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mem-imp-history-head strong { font-size: 0.92rem; }
.mem-imp-visits { display: grid; gap: 10px; }
.mem-imp-visit {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
}
.mem-imp-visit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mem-imp-visit-top span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--flow-w45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mem-imp-visit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 640px) {
  .mem-imp-visit-grid { grid-template-columns: 1fr; }
}
.mem-imp-visit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--flow-w45);
}
.mem-visit-staff { display: block; color: var(--flow-w45); font-size: 0.8rem; margin-top: 2px; }
.mem-pkg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mem-pkg > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mem-pkg span { font-size: 0.82rem; color: var(--flow-w45); }
.mem-pkg em { font-style: normal; font-weight: 600; }
.mem-pkg-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 460px;
  overflow: auto;
  padding: 4px 4px 4px 0;
}
.mem-pkg-svc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.mem-pkg-svc span { flex: 1; min-width: 0; font-size: 0.9rem; }
.mem-pkg-svc input { width: 72px; text-align: center; flex-shrink: 0; }
@media (max-width: 820px) {
  .mem-package-layout,
  .mem-enroll-layout,
  .mem-import-layout { grid-template-columns: 1fr; }
  .mem-package-basics { position: static; }
  .mem-package-services-pane {
    padding-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.08);
  }
}
@media (max-width: 560px) {
  .mem-pkg-services { grid-template-columns: 1fr; }
}
.mem-head-actions { display: flex; gap: 8px; }

/* Team kind chips (salon) */
.flow-team-kind { display: grid; gap: 8px; margin: 4px 0 8px; }
.flow-team-kind-opt { align-items: flex-start !important; }
.flow-team-kind-opt span { line-height: 1.35; }
.flow-team-kind-chips em.is-floor { color: #7dcea0; }
.flow-team-kind-chips em.is-login { color: #f0c674; }
.flow-team-kind-chips em.is-floor-only { opacity: 0.65; }
.flow-team-kind-chips em.is-services { color: #8bd5ca; }
.flow-team-kind-chips em.is-unassigned { color: #f28fad; }
.flow-team-kind-chips em.is-absent { color: #e8a87c; }
.flow-team-person.is-absent { opacity: 0.78; }
.flow-team-services { display: grid; gap: 8px; margin: 4px 0 10px; }
.flow-team-services-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.flow-team-services-head .flow-team-mods-label { margin: 0; }
.flow-team-service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 7px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}
.flow-team-service-opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--flow-border, rgba(255,255,255,.1));
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
}
.flow-team-service-opt:has(input:checked) {
  border-color: color-mix(in srgb, var(--flow-accent) 55%, transparent);
  background: color-mix(in srgb, var(--flow-accent) 8%, transparent);
}
.flow-team-service-opt input { margin-top: 2px; accent-color: var(--flow-accent); }
.flow-team-service-opt span { min-width: 0; }
.flow-team-service-opt strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .83rem;
}
.flow-team-service-opt small {
  display: block;
  margin-top: 2px;
  color: var(--flow-muted, #8b949e);
  font-size: .7rem;
}

/* Front-desk Pass board (order notifications) */
.flow-pass {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
}
.flow-pass-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.flow-pass-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flow-pass-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--flow-w55);
}
.flow-pass-count em {
  font-style: normal;
  color: var(--flow-w95);
  margin-right: 4px;
}
.flow-pass-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--flow-w15);
  border-radius: 16px;
  color: var(--flow-w50);
}
.flow-pass-empty[hidden] { display: none !important; }
.flow-pass-empty strong {
  color: var(--flow-w90);
  font-size: 1.05rem;
}
.flow-pass-empty p {
  margin: 0;
  max-width: 32ch;
  font-size: 0.85rem;
  line-height: 1.4;
}
.flow-pass-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flow-pass-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--flow-border, var(--flow-w12));
  background: var(--flow-subtle-bg, var(--flow-w06));
}
.flow-pass-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.flow-pass-card-head strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--flow-w95);
  letter-spacing: -0.02em;
}
.flow-pass-card-head span {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--flow-w50);
  font-weight: 600;
}
.flow-pass-total {
  font-style: normal;
  font-weight: 800;
  color: var(--flow-accent, #2dd4bf);
  white-space: nowrap;
}
.flow-pass-guest {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--flow-w70);
  font-weight: 600;
}
.flow-pass-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-pass-items li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--flow-w90);
}
.flow-pass-items em {
  font-style: normal;
  font-weight: 700;
  color: var(--flow-w55);
}
.flow-pass-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--flow-w55);
}
.flow-pass-card-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.flow-pass-card-actions .flow-btn {
  min-height: 42px;
  padding: 0 18px;
  font-weight: 800;
}
@media (max-width: 720px) {
  .flow-pass { max-width: none; }
  .flow-pass-card-actions .flow-btn { width: 100%; }
}

/* Phone Pass — table + order + button only */
@media (max-width: 960px) {
  body.pass-phone .app-main:has(#page-pass.active) {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .flow-pass.is-phone {
    max-width: none;
    gap: 10px;
  }
  .flow-pass.is-phone .flow-pass-top {
    align-items: center;
    gap: 8px;
  }
  .flow-pass.is-phone .hd-title {
    font-size: 1.15rem;
    margin: 0;
  }
  .flow-pass.is-phone .hd-sub,
  .flow-pass.is-phone .flow-pass-count {
    display: none !important;
  }
  .flow-pass.is-phone .flow-pass-actions {
    margin-left: auto;
  }
  .flow-pass.is-phone .flow-pass-actions .flow-btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.8rem;
  }
  .flow-pass.is-phone .flow-pass-empty {
    padding: 36px 12px;
    border-style: solid;
    border-width: 1px;
  }
  .flow-pass.is-phone .flow-pass-empty i,
  .flow-pass.is-phone .flow-pass-empty p {
    display: none;
  }
  .flow-pass-card-phone {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--flow-w15, rgba(0,0,0,.12));
    background: var(--flow-elevated, #fff);
  }
  .flow-pass-table {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--flow-w95, #111);
    line-height: 1.1;
  }
  .flow-pass-card-phone .flow-pass-items {
    gap: 6px;
  }
  .flow-pass-card-phone .flow-pass-items li {
    font-size: 1rem;
    font-weight: 600;
  }
  .flow-pass-card-phone .flow-pass-items em {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--flow-w70, #444);
  }
  .flow-pass-sent-btn {
    appearance: none;
    width: 100%;
    min-height: 48px;
    margin-top: 2px;
    border: 0;
    border-radius: 10px;
    background: var(--flow-accent, #111);
    color: #111;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
  }
  html[data-theme="light"] .flow-pass-sent-btn,
  :root:not([data-theme="dark"]) .flow-pass-sent-btn {
    background: #111;
    color: #fff;
  }
  .flow-pass-sent-btn:disabled {
    opacity: 0.55;
    cursor: wait;
  }
}
