/* 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: #f2efe8;
  color: #0a0a0c;
  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: 11px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0a0e16;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.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: oklch(0.92 0.04 195);
  background: linear-gradient(90deg, oklch(0.28 0.06 195 / 0.95), oklch(0.22 0.04 255 / 0.95));
  border-bottom: 1px solid oklch(0.7 0.12 195 / 0.35);
}
.flow-demo-banner strong { color: #fff; 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: oklch(0.28 0.05 230);
  background: linear-gradient(90deg, oklch(0.94 0.03 195), oklch(0.96 0.02 255));
  border-bottom-color: oklch(0.75 0.08 195 / 0.4);
}
html[data-theme="light"] .flow-demo-banner strong { color: oklch(0.22 0.06 230); }
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-bar-bg);
  backdrop-filter: blur(20px) saturate(1.15);
  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: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0a0e16;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.app-topbar-wordmark span { color: var(--flow-cyan); }
.app-topbar-logo span { color: var(--flow-cyan); }
.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;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--flow-border);
  background: transparent;
  color: var(--flow-w70);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.flow-alerts-mute:hover { color: var(--flow-w95); border-color: var(--flow-w20); }
.flow-alerts-mute.is-muted {
  color: var(--flow-w45);
  opacity: 0.85;
}
.flow-alerts-mute.is-open {
  color: var(--flow-w95);
  border-color: var(--flow-w20);
  background: var(--flow-muted-surface);
}
.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 {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  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: 320;
  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-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;
}
.flow-alerts-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--flow-overlay, rgba(0, 0, 0, 0.55));
  backdrop-filter: blur(6px) saturate(1.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--flow-ease, ease);
}
.flow-alerts-overlay.is-in {
  opacity: 1;
  pointer-events: auto;
}
.flow-alerts-overlay[hidden] { display: none !important; }
.flow-alerts-popup {
  --fa-glow: oklch(0.82 0.14 195);
  position: fixed;
  left: 50%;
  top: min(22vh, 160px);
  transform: translate(-50%, 16px);
  z-index: 910;
  width: min(400px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--flow-r-xl, 24px);
  border: 1px solid oklch(0.82 0.14 195 / 0.28);
  background: var(--flow-elevated, oklch(0.18 0.02 255 / 0.96));
  color: var(--flow-white, #ececf1);
  box-shadow:
    0 24px 64px oklch(0.05 0.02 255 / 0.45),
    0 0 0 1px oklch(0.82 0.14 195 / 0.08),
    0 0 28px oklch(0.82 0.14 195 / 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--flow-ease, ease), transform 0.28s var(--flow-ease, ease);
}
.flow-alerts-popup.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
  animation: flow-alerts-breath 2.4s ease-in-out infinite;
}
.flow-alerts-popup[hidden] { display: none !important; }
.flow-alerts-popup--warn {
  --fa-glow: oklch(0.68 0.18 25);
  border-color: oklch(0.68 0.18 25 / 0.32);
}
.flow-alerts-popup--payment {
  --fa-glow: oklch(0.72 0.17 145);
  border-color: oklch(0.72 0.17 145 / 0.32);
}
@keyframes flow-alerts-breath {
  0%, 100% {
    box-shadow:
      0 24px 64px oklch(0.05 0.02 255 / 0.45),
      0 0 0 1px color-mix(in oklch, var(--fa-glow) 12%, transparent),
      0 0 22px color-mix(in oklch, var(--fa-glow) 18%, transparent),
      0 0 48px color-mix(in oklch, var(--fa-glow) 10%, transparent);
  }
  50% {
    box-shadow:
      0 28px 72px oklch(0.05 0.02 255 / 0.5),
      0 0 0 1px color-mix(in oklch, var(--fa-glow) 28%, transparent),
      0 0 40px color-mix(in oklch, var(--fa-glow) 42%, transparent),
      0 0 80px color-mix(in oklch, var(--fa-glow) 22%, transparent);
  }
}
/* Fallback if color-mix unsupported */
@supports not (background: color-mix(in oklch, white 50%, black)) {
  @keyframes flow-alerts-breath {
    0%, 100% {
      box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.4),
        0 0 24px oklch(0.82 0.14 195 / 0.2),
        0 0 48px oklch(0.82 0.14 195 / 0.1);
    }
    50% {
      box-shadow:
        0 28px 72px rgba(0, 0, 0, 0.45),
        0 0 42px oklch(0.82 0.14 195 / 0.45),
        0 0 84px oklch(0.82 0.14 195 / 0.22);
    }
  }
}
.flow-alerts-popup-accent {
  display: none;
}
.flow-alerts-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 0 18px;
}
.flow-alerts-popup-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--flow-cyan);
  box-shadow: 0 0 0 0 oklch(0.82 0.14 195 / 0.55);
  animation: flow-alerts-live 1.6s ease-out infinite;
  flex-shrink: 0;
}
.flow-alerts-popup--warn .flow-alerts-popup-live { background: var(--flow-red); }
.flow-alerts-popup--payment .flow-alerts-popup-live { background: var(--flow-green); }
@keyframes flow-alerts-live {
  0% { box-shadow: 0 0 0 0 oklch(0.82 0.14 195 / 0.45); }
  70% { box-shadow: 0 0 0 10px oklch(0.82 0.14 195 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.82 0.14 195 / 0); }
}
.flow-alerts-popup-kicker {
  flex: 1;
  font-family: var(--flow-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--flow-w55);
}
.flow-alerts-popup-x {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--flow-w45);
  cursor: pointer;
}
.flow-alerts-popup-x:hover {
  background: var(--flow-w08);
  color: var(--flow-w95);
}
.flow-alerts-popup-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 20px 6px;
}
.flow-alerts-popup-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--flow-cyan-dim);
  color: var(--flow-cyan);
  border: 1px solid oklch(0.82 0.14 195 / 0.18);
}
.flow-alerts-popup--warn .flow-alerts-popup-ico {
  background: oklch(0.62 0.2 25 / 0.12);
  color: oklch(0.72 0.16 25);
  border-color: oklch(0.62 0.2 25 / 0.22);
}
.flow-alerts-popup--payment .flow-alerts-popup-ico {
  background: oklch(0.72 0.17 145 / 0.12);
  color: var(--flow-green);
  border-color: oklch(0.72 0.17 145 / 0.22);
}
.flow-alerts-popup-body { flex: 1; min-width: 0; padding-top: 1px; }
.flow-alerts-popup-body strong {
  display: block;
  font-family: var(--flow-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--flow-white);
}
.flow-alerts-popup-body span {
  display: block;
  font-size: 0.88rem;
  color: var(--flow-w70);
  line-height: 1.45;
  word-break: break-word;
}
.flow-alerts-popup-actions {
  padding: 16px 18px 18px;
}
.flow-alerts-popup-ack {
  width: 100%;
  border: 1px solid oklch(0.82 0.14 195 / 0.35);
  border-radius: 12px;
  padding: 11px 14px;
  font-family: var(--flow-font);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  background: oklch(0.82 0.14 195 / 0.14);
  color: var(--flow-cyan);
  transition: background 0.15s, border-color 0.15s;
}
.flow-alerts-popup-ack:hover {
  background: oklch(0.82 0.14 195 / 0.22);
  border-color: oklch(0.82 0.14 195 / 0.5);
}
.flow-alerts-popup--warn .flow-alerts-popup-ack {
  background: oklch(0.62 0.2 25 / 0.12);
  border-color: oklch(0.62 0.2 25 / 0.3);
  color: oklch(0.78 0.14 25);
}
.flow-alerts-popup--payment .flow-alerts-popup-ack {
  background: oklch(0.72 0.17 145 / 0.12);
  border-color: oklch(0.72 0.17 145 / 0.3);
  color: var(--flow-green);
}
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-overlay {
  background: rgba(12, 14, 22, 0.38);
}
html[data-theme="light"] .flow-alerts-popup {
  background: #ffffff;
  border-color: oklch(0.55 0.12 195 / 0.28);
  color: #0c0c18;
}
html[data-theme="light"] .flow-alerts-popup.is-in {
  animation-name: flow-alerts-breath-light;
}
@keyframes flow-alerts-breath-light {
  0%, 100% {
    box-shadow:
      0 24px 56px rgba(12, 18, 40, 0.14),
      0 0 0 1px oklch(0.55 0.12 195 / 0.1),
      0 0 26px oklch(0.55 0.12 195 / 0.16);
  }
  50% {
    box-shadow:
      0 28px 64px rgba(12, 18, 40, 0.18),
      0 0 0 1px oklch(0.55 0.12 195 / 0.22),
      0 0 44px oklch(0.55 0.12 195 / 0.32),
      0 0 72px oklch(0.55 0.12 195 / 0.16);
  }
}
html[data-theme="light"] .flow-alerts-popup-body strong { color: #0c0c18; }
html[data-theme="light"] .flow-alerts-popup-body span { color: rgba(12, 12, 24, 0.62); }
html[data-theme="light"] .flow-alerts-popup-kicker { color: rgba(12, 12, 24, 0.45); }
html[data-theme="light"] .flow-alerts-popup-x { color: rgba(12, 12, 24, 0.4); }
html[data-theme="light"] .flow-alerts-popup-x:hover {
  background: rgba(12, 12, 24, 0.05);
  color: #0c0c18;
}
html[data-theme="light"] .flow-alerts-popup-ack {
  background: oklch(0.55 0.12 195 / 0.1);
  border-color: oklch(0.5 0.12 195 / 0.28);
  color: oklch(0.42 0.12 195);
}

/* 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;
}
.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 {
  margin-top: auto; 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-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-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: oklch(0.82 0.14 195 / 0.12);
  color: var(--flow-cyan);
  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: oklch(0.72 0.17 145 / 0.12);
  color: var(--flow-green);
}
.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: #059669; }
.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: linear-gradient(90deg, var(--flow-accent), #22d3ee);
  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(5, 1fr); gap: 12px; margin-bottom: 1.25rem; }
.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: #059669; }
.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: #05966944;
  background: #05966912;
}
.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, #10b981);
  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: #059669; }
#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-cyan, #2dd4bf); }
.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: #059669; }
.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-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-name {
  width: 100%; border: none; background: transparent; color: var(--flow-w90);
  font-weight: 600; font-size: 0.9rem; padding: 0;
}
.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;
}
.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-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: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.28);
}
.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 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: #059669; }
.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-cyan, #22d3ee);
  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;
  }

  /* ── Native-style phone app shell ── */
  .app-shell { height: 100dvh; height: 100svh; overflow-x: hidden; }
  .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;
  }
  .app-topbar-logo {
    font-size: 0.85rem;
    min-width: 0;
    flex: 0 1 auto;
    gap: 8px;
  }
  .app-topbar-wordmark { display: none; }
  .app-topbar-mark { width: 26px; height: 26px; }
  .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 (like WhatsApp / banking apps) */
  .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-bar-bg);
    backdrop-filter: blur(24px) saturate(1.3);
    border-top: 1px solid var(--flow-border);
    box-shadow: 0 -4px 24px color-mix(in srgb, var(--flow-bg) 50%, transparent);
  }
  .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 {
    height: 100%;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
  }
  .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;
  }

  .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 — bottom sheet */
  .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;
    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;
  }
  .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;
  }
  .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; }

  .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-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--done { color: var(--flow-green); }
.fx-queue-status--running { color: var(--flow-cyan); }
.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: rgba(255,255,255,0.9);
  border-bottom-color: var(--flow-border);
}
html[data-theme="light"] .app-topbar-logo span { color: oklch(0.5 0.14 195); }
html[data-theme="light"] .app-sidebar {
  background: rgba(255,255,255,0.8);
  border-right-color: var(--flow-border);
}
html[data-theme="light"] .app-nav-item.active {
  background: oklch(0.55 0.14 195 / 0.12);
  border-color: oklch(0.55 0.14 195 / 0.22);
  color: oklch(0.4 0.14 195);
}
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: oklch(0.55 0.14 195);
  color: #fff;
}
html[data-theme="light"] .flow-btn-primary:hover {
  background: oklch(0.5 0.14 195);
  box-shadow: 0 4px 16px oklch(0.55 0.14 195 / 0.22);
}
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-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-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"] .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"] .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 (phone-scanner results, etc.) */
.flow-toast-host {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.flow-toast {
  pointer-events: auto;
  cursor: pointer;
  max-width: min(92vw, 460px);
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  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: translateY(14px) scale(0.98);
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.flow-toast.is-in {
  opacity: 1;
  transform: translateY(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);
}
.flow-pos-chrome-btn {
  display: none;
  margin-left: auto;
  padding: 0.45rem !important;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px !important;
}
#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 .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-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;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--flow-w75);
  line-height: 1.25;
}
.flow-pos-open-items li em {
  font-style: normal;
  font-weight: 700;
  color: var(--flow-w55);
  flex: 0 0 auto;
}
.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 {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--flow-subtle-bg);
  color: var(--flow-w70);
  white-space: nowrap;
}
.flow-pos-cart-meta-slim {
  grid-template-columns: 1fr 1fr !important;
}
.flow-pos-cart-meta-slim #pos-staff { grid-column: 1 / -1; }
  .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-pay-grid.is-open {
  display: grid;
  grid-template-columns: 1fr 1fr 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-grid.is-open #btn-pos-pay-cancel { grid-column: 1 / -1; }
.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-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-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: min(68vh, 780px);
  overflow: auto;
}
.flow-pos-menu-item {
  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;
}
.flow-pos-menu-item:hover:not(:disabled) { border-color: var(--flow-accent); transform: translateY(-1px); }
.flow-pos-menu-item:disabled,
.flow-pos-menu-item.out { opacity: 0.5; cursor: not-allowed; }
.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;
}

/* POS inputs — theme-aware (never hardcode dark boxes) */
.flow-pos-input,
#pos-panel-billing input,
#pos-panel-billing select,
#pos-panel-reports input,
#pos-panel-reports select,
#pos-panel-menu input[type="number"],
#pos-panel-crm input,
#pos-panel-brand input,
#pos-panel-brand select,
#pos-panel-tables input,
#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:focus,
#pos-panel-billing select:focus,
#pos-panel-reports input:focus,
#pos-panel-reports select:focus,
#pos-panel-menu input:focus,
#pos-panel-crm input:focus,
#pos-panel-brand input:focus,
#pos-panel-tables input: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: space-between; gap: 8px; }
.flow-pos-cart-head h3 { margin: 0; font-size: 1rem; }
.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-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-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-brand-form .app-form-group { margin-bottom: 12px; }
.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-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-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="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-wrap: wrap; gap: 14px; margin-bottom: 14px;
}
.flow-pos-brand-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--flow-w80); cursor: pointer;
}
.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-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-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-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: #047857;
  background: color-mix(in oklab, #059669 14%, #fff);
  border: 1px solid color-mix(in oklab, #059669 30%, 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;
}
.flow-pos-staff-form,
.flow-pos-settings-mini {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: end;
}
.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;
}
@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 16px;
}
#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.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);
}
.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-menu-manage-card.is-out .flow-pos-manage-meta span { color: #f87171; }
.flow-pos-soldout-btn {
  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; justify-self: end; align-self: center;
}
.flow-pos-soldout-btn.is-on { background: #05966922; color: #34d399; border-color: #05966955; }
.flow-pos-soldout-btn.is-off { background: #f59e0b22; color: #fbbf24; border-color: #f59e0b55; }
.flow-pos-soldout-btn:disabled { opacity: 0.55; cursor: wait; }
.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-restaurant .app-topbar-logo span { color: #f59e0b; }
body.flow-acct-agency .app-topbar-logo span { color: #38bdf8; }
body.flow-acct-warehouse .app-topbar-logo span { color: #a78bfa; }
body.flow-acct-smb .app-topbar-logo span { color: var(--flow-accent); }

/* 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-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-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.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; gap: 8px; margin-bottom: 8px;
}
.kitchen-card-head strong { font-size: 1rem; }
.kitchen-card-head span { font-size: 0.72rem; color: var(--flow-w45); }
.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-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-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-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 {
    margin-top: 24px;
    padding: 20px 16px;
    border-radius: 16px;
    border: 1px solid var(--flow-border);
    background: var(--flow-card);
    text-align: center;
  }
  .kitchen-off-panel[hidden] { display: none !important; }
  .kitchen-off-panel strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 8px;
  }
  .kitchen-off-panel p {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: var(--flow-w55);
    line-height: 1.4;
  }
}

.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 — kill app chrome so floor fills the screen */
  body.pos-phone-immersive .app-topbar,
  body.pos-phone-immersive .app-mobile-nav,
  body.pos-phone-immersive .flow-demo-banner {
    display: none !important;
  }
  body.pos-phone-immersive .app-main {
    padding-top: calc(4px + 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));
  }
  body.pos-phone-immersive #pos-panel-billing.pos-phone-session .flow-pos-menu-grid {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  /* ── 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-btn {
    display: none;
    margin-left: auto;
    padding: 0.35rem !important;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
  }
  .flow-pos-chrome-btn + .flow-pos-chrome-btn {
    margin-left: 4px;
  }
  .flow-pos-more-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  body.pos-phone-immersive .flow-pos-chrome-btn {
    display: inline-flex !important;
  }
  .flow-pos-tabs:not(.pos-more-open) .flow-pos-tab-more { display: none; }
  .flow-pos-tabs.pos-more-open .flow-pos-tab-more { display: inline-flex; }

  /* 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-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: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    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;
  }
  .flow-pos-open-panel {
    display: flex;
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(42vh, 320px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    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 {
    font-size: 0.84rem;
  }

  .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, transparent rows */
  .flow-pos-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 0 0 calc(88px + 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;
  }
  .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 fields compact — hide staff picker on phone */
  .flow-pos-cart-meta-slim {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .flow-pos-cart-meta-slim #pos-staff { display: none; }
  .flow-pos-cart-totals .flow-pos-total-row:not(.flow-pos-grand) {
    font-size: 0.78rem;
  }

  /* Mobile bill sheet — cart slides up over the menu */
  .flow-pos-cart-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 220;
    background: var(--flow-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.pos-cart-open .flow-pos-cart-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .flow-pos-cart-pane {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 230;
    max-height: min(88dvh, 720px);
    margin: 0;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(110%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.45);
  }
  body.pos-cart-open .flow-pos-cart-pane {
    transform: translateY(0);
  }
  .flow-pos-cart-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 28px;
    margin: 0 0 6px;
  }
  .flow-pos-cart-sheet-handle > span {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--flow-w20);
  }
  .flow-pos-cart-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    appearance: none;
    border: 0;
    background: var(--flow-w10);
    color: var(--flow-w80);
    border-radius: 999px;
    padding: 6px 12px;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
  }
  .flow-pos-cart-head {
    flex-wrap: wrap;
  }
  .flow-pos-cart-head h3 { font-size: 1.05rem; }
  .flow-pos-cart-head select {
    min-height: 40px;
    max-width: 100%;
  }
  .flow-pos-cart-meta {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .flow-pos-cart-lines {
    max-height: 28vh;
    min-height: 72px;
  }
  .flow-pos-pay-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    position: sticky;
    bottom: 0;
    padding-top: 8px;
    background: linear-gradient(180deg, transparent, var(--flow-card) 28%);
  }
  .flow-pos-pay-grid .flow-btn {
    min-height: 46px;
    font-size: 0.84rem;
    padding: 10px 8px;
  }
  .flow-pos-pay-hint { display: none; }

  .flow-pos-mobile-billbar {
    display: grid;
    grid-template-columns: 1fr auto;
    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: var(--flow-elevated, var(--flow-card));
    border: 0;
    border-top: 1px solid var(--flow-border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
  }
  .flow-pos-mobile-billbar:has(#btn-pos-mbar-settle:not([hidden])) {
    grid-template-columns: 1fr auto auto;
  }
  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 {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    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 14px;
    min-height: 48px;
    height: 48px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
  }
  .flow-pos-mbar-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(12, 12, 24, 0.55);
  }
  .flow-pos-mbar-total {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--flow-accent);
    letter-spacing: -0.02em;
  }
  .flow-pos-mbar-pay,
  .flow-pos-mbar-settle {
    flex: 0 0 auto;
    align-self: stretch;
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 16px !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  .flow-pos-mbar-pay {
    min-width: 7.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; }
  .flow-pos-menu-manage-card .flow-pos-soldout-btn,
  .flow-pos-menu-manage-card .flow-pos-toggle,
  .flow-pos-menu-manage-card .flow-pos-cost { grid-column: 1 / -1; }
  .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;
}
.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 {
  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 .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;
}
.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--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-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-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-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; }
}
