:root {
  color-scheme: light;
  --fm-blue-dark: #073f66;
  --fm-blue-header: #0b5d94;
  --fm-blue-mid: #1372b2;
  --fm-cyan: #18a4bf;
  --fm-cyan-dark: #117f96;
  --fm-green: #58a828;
  --fm-green-dark: #43861b;
  --fm-orange: #ee8900;
  --fm-orange-dark: #cf7100;
  --fm-royal: #2d6df6;
  --fm-purple: #7c3aed;
  --fm-purple-dark: #6d28d9;
  --fm-yellow-btn: #fff492;
  --fm-red: #dc2626;
  --fm-badge-green: #148a3b;
  --fm-ink: #122132;
  --fm-muted: #50657a;
  --fm-border: rgba(182, 206, 226, 0.85);
  --fm-surface: rgba(255, 255, 255, 0.91);
  --fm-surface-strong: rgba(255, 255, 255, 0.96);
  --fm-radius: 16px;
  --fm-champagne: rgba(232, 206, 148, 0.42);
  --shadow-sm: 0 2px 8px rgba(10, 38, 66, 0.06), 0 1px 2px rgba(10, 38, 66, 0.04);
  --shadow-md: 0 12px 32px rgba(10, 40, 70, 0.09), 0 2px 8px rgba(10, 40, 70, 0.04);
  --shadow-lg: 0 28px 64px rgba(6, 26, 48, 0.28), 0 6px 18px rgba(6, 26, 48, 0.12);
  --ring: 0 0 0 3px rgba(19, 114, 178, 0.24);

  /* Typography & Proportional Layout Tokens — Default: Medium (中) */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 16px;
  --fs-lg: 19px;
  --fs-xl: 23px;
  --fs-kpi: 28px;
  --fs-hero: clamp(22px, 2.1vw, 30px);
  --mm-max: 1180px;
  --mm-c1: 238px;
  --mm-c2: 158px;
  --mm-c3: minmax(430px, 1fr);
  --mm-c4: 236px;
  --mm-badge: 64px;
  --mm-circle: 80px;
  --mm-input-h: 46px;
  --mm-label-w: 84px;
  --dropoff-h: 600px;
  --chip-min: 148px;
  --csbtn-min: 178px;
  --hub-min: 196px;
  --kpi-min: 178px;
  --btn-pad-y: 7px;
  --btn-pad-x: 14px;
  --cell-pad-y: 8px;
  --cell-pad-x: 11px;
}

:root[data-font-size="sm"] {
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14.5px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-kpi: 24px;
  --fs-hero: clamp(20px, 1.85vw, 26px);
  --mm-max: 1080px;
  --mm-c1: 214px;
  --mm-c2: 144px;
  --mm-c3: minmax(390px, 1fr);
  --mm-c4: 216px;
  --mm-badge: 56px;
  --mm-circle: 72px;
  --mm-input-h: 42px;
  --mm-label-w: 74px;
  --dropoff-h: 555px;
  --chip-min: 136px;
  --csbtn-min: 156px;
  --hub-min: 174px;
  --kpi-min: 156px;
  --btn-pad-y: 6px;
  --btn-pad-x: 12px;
  --cell-pad-y: 6px;
  --cell-pad-x: 9px;
}

:root[data-font-size="lg"] {
  --fs-xs: 13.5px;
  --fs-sm: 15px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 21.5px;
  --fs-xl: 26px;
  --fs-kpi: 32px;
  --fs-hero: clamp(24px, 2.35vw, 34px);
  --mm-max: 1320px;
  --mm-c1: 268px;
  --mm-c2: 178px;
  --mm-c3: minmax(470px, 1fr);
  --mm-c4: 268px;
  --mm-badge: 72px;
  --mm-circle: 88px;
  --mm-input-h: 52px;
  --mm-label-w: 96px;
  --dropoff-h: 665px;
  --chip-min: 146px;
  --csbtn-min: 212px;
  --hub-min: 224px;
  --kpi-min: 208px;
  --btn-pad-y: 9px;
  --btn-pad-x: 16px;
  --cell-pad-y: 10px;
  --cell-pad-x: 13px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scrollbar-gutter: stable; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  font-size: var(--fs-base);
  color: var(--fm-ink);
  line-height: 1.5;
  line-break: strict;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: #dfeef7;
  background-image:
    linear-gradient(180deg, rgba(246, 251, 255, 0.48) 0%, rgba(235, 246, 252, 0.28) 55%, rgba(212, 232, 246, 0.44) 100%),
    url("/assets/bg-silk-light.jpg"),
    radial-gradient(1200px 460px at 85% 96%, rgba(86, 162, 214, 0.3), transparent 62%),
    linear-gradient(162deg, #c9e1f1 0%, #edf6fc 48%, #c7dfef 100%);
  background-size: cover, cover, auto, auto;
  background-position: center, center bottom, center, center;
  background-attachment: fixed;
  overflow-x: hidden;
  scrollbar-color: #90b2cc transparent;
  scrollbar-width: thin;
}

h1, h2, h3 { text-wrap: balance; word-break: keep-all; }
p { text-wrap: pretty; }
strong, .count-badge, .topbar-date, table.pos-table td, input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.ui-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.17em;
  filter: drop-shadow(0 1px 1.5px rgba(8, 30, 52, 0.14));
}

:focus-visible { outline: none; box-shadow: var(--ring); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(15, 50, 80, 0.05); border-radius: 99px; }
::-webkit-scrollbar-thumb { background: rgba(74, 118, 154, 0.42); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(45, 92, 132, 0.65); }

/* ============ FONT SIZE SWITCHER PILL (小 / 中 / 大) ============ */
.font-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 3px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.22);
  white-space: nowrap;
}
.font-switcher-label {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  padding: 0 5px 0 6px;
}
.font-size-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 900;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 99px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s, color 0.14s;
  line-height: 1.15;
}
.font-size-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.font-size-btn.active {
  background: linear-gradient(180deg, #fffbe0, #ffea75);
  color: #122132;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
}

/* ============ TOP CLASSIC HEADER BAR ============ */
.pos-topbar {
  background: linear-gradient(180deg, #0d588d 0%, #094571 58%, #07365a 100%);
  color: #fff;
  padding: 10px 22px 11px;
  display: grid;
  grid-template-columns: minmax(290px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--fm-champagne);
  box-shadow: 0 10px 28px rgba(5, 28, 52, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 50;
}
.pos-topbar.theme-factory {
  background: linear-gradient(180deg, #165973 0%, #0f4358 58%, #0a3142 100%);
}
.pos-topbar.theme-admin {
  background: linear-gradient(180deg, #21376d 0%, #172954 58%, #101d3e 100%);
}

.topbar-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.staff-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.staff-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  padding: 4px 12px;
  border-radius: 99px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 800;
  transition: background 0.14s, transform 0.1s;
  backdrop-filter: blur(6px);
  font-family: inherit;
}
.staff-btn:hover { background: rgba(255, 255, 255, 0.24); transform: translateY(-1px); }

.param-strip { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.param-pill {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(0, 0, 0, 0.18);
  padding: 3px 6px 4px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.param-pill label {
  font-size: 10.5px; opacity: 0.92; letter-spacing: 0.2px; font-weight: 700; white-space: nowrap;
}
.param-pill input {
  width: 44px; height: 22px; text-align: center; font-weight: 800; font-size: var(--fs-sm);
  border: 1px solid #e0cf66; border-radius: 5px;
  background: linear-gradient(180deg, #fffef2, #fff5b5); color: #132234;
}
.param-pill input:focus { outline: none; box-shadow: 0 0 0 2px #ffe46b; }

.topbar-center-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.topbar-center {
  text-align: center;
  font-size: var(--fs-hero);
  font-weight: 900;
  letter-spacing: 4px;
  white-space: nowrap;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  line-height: 1.1;
  cursor: pointer;
  transition: opacity 0.14s;
}
.topbar-center:hover { opacity: 0.92; }

.mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 5px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  flex-wrap: nowrap;
  white-space: nowrap;
}
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border: none;
  border-radius: 99px;
  padding: 5px 12px;
  font-size: var(--fs-xs);
  font-weight: 800;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.mode-pill:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.mode-pill.active {
  background: linear-gradient(180deg, #fffbe0, #ffea75);
  color: #122132;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}
.mode-branch-select {
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.96);
  color: #0e2a45;
  font-size: var(--fs-xs);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.topbar-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.topbar-right-row {
  display: flex; align-items: center; gap: 9px; flex-wrap: nowrap;
}
.date-wash-stack {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.topbar-date {
  font-size: var(--fs-base); font-weight: 800; letter-spacing: 0.6px; opacity: 0.96; white-space: nowrap;
}
.btn-wash-mini {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  background: linear-gradient(180deg, #3ac9e2, #1795ad);
  color: #fff; border: 1px solid rgba(164, 240, 255, 0.72); border-radius: 99px;
  padding: 3px 12px; font-size: var(--fs-xs); font-weight: 800; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: filter 0.12s, transform 0.1s;
  font-family: inherit;
}
.btn-wash-mini:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-close-app {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: linear-gradient(180deg, #fff9b8 0%, #ffe65c 100%);
  color: #122132;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: var(--fs-md);
  font-weight: 900;
  letter-spacing: 0.8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.1s, filter 0.12s;
  font-family: inherit;
}
.btn-close-app:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-close-app:active { transform: translateY(1px); }

.manual-price-box {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.18); padding: 3px 9px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.manual-price-box input {
  width: 46px; height: 22px; text-align: center; font-weight: 800; font-size: var(--fs-sm);
  border: 1px solid #e0cf66; border-radius: 5px; background: #fffce0; color: #132234;
}

.safe-sync-pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(110, 231, 183, 0.65);
  color: #d1fae5;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}

/* ============ MAIN MENU CLASSIC 4-COLUMN GRID ============ */
.main-menu-stage {
  min-height: calc(100vh - 98px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 20px 38px;
}

.main-menu-grid {
  display: grid;
  grid-template-columns: var(--mm-c1) var(--mm-c2) var(--mm-c3) var(--mm-c4);
  gap: 18px;
  align-items: stretch;
  max-width: var(--mm-max);
  width: 100%;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.72) 0%, rgba(244, 250, 255, 0.58) 100%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(22px);
  box-shadow: 0 28px 68px rgba(8, 44, 76, 0.16), 0 4px 16px rgba(8, 44, 76, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

/* Column 1: Alpine Teal Alert Stack */
.col-cyan { display: flex; flex-direction: column; gap: 12px; }
.cyan-tile {
  background: linear-gradient(162deg, #22b2ca 0%, #1690a7 60%, #10768b 100%);
  color: #fff;
  border: 1px solid rgba(182, 242, 252, 0.52);
  border-radius: 17px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(12, 84, 104, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.44);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, filter 0.14s ease;
  min-height: 78px;
  font-family: inherit;
}
.cyan-tile:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
  box-shadow: 0 14px 28px rgba(12, 84, 104, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.cyan-tile:active { transform: translateY(0); }
.cyan-tile.board-tile {
  min-height: 64px;
  justify-content: center;
  gap: 10px;
  font-size: var(--fs-xl);
  font-weight: 900;
  letter-spacing: 3px;
  white-space: nowrap;
  background: linear-gradient(162deg, #1aa3be 0%, #0f7890 100%);
}
.cyan-label {
  font-size: var(--fs-lg);
  font-weight: 900;
  line-height: 1.28;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}
.count-badge {
  width: var(--mm-badge); height: var(--mm-badge);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #f1f7fc 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-kpi); font-weight: 900;
  box-shadow: 0 5px 14px rgba(5, 34, 52, 0.18), inset 0 2px 4px rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(255, 255, 255, 0.92);
  flex-shrink: 0;
}
.count-badge.red { color: #d62828; }
.count-badge.green { color: #15803d; }

/* Column 2: Botanical Emerald Feature Pillar */
.col-green {
  background: linear-gradient(175deg, #5eb334 0%, #489524 58%, #387b19 100%);
  border: 1px solid rgba(186, 238, 148, 0.56);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 14px 10px;
  box-shadow: 0 12px 26px rgba(34, 78, 14, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.green-action-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 12px 8px;
  border-radius: 15px;
  transition: background 0.16s, border-color 0.16s, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: inherit;
}
.green-action-btn:hover {
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-2px);
}
.green-action-btn:active { transform: translateY(0); }
.green-action-btn .icon-circle {
  width: var(--mm-circle); height: var(--mm-circle);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.08) 72%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(20, 56, 6, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease;
}
.green-action-btn:hover .icon-circle {
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(20, 56, 6, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}
.green-action-btn span {
  font-size: var(--fs-lg); font-weight: 900; letter-spacing: 1.5px; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

/* Column 3: Warm Amber Atelier Search Panel */
.col-orange {
  background: linear-gradient(166deg, #f39a1c 0%, #e17e08 56%, #c76904 100%);
  border: 1px solid rgba(255, 224, 166, 0.65);
  border-radius: 18px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 13px;
  box-shadow: 0 14px 30px rgba(142, 72, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}
.search-row {
  display: grid;
  grid-template-columns: var(--mm-label-w) 1fr 40px;
  align-items: center;
  gap: 10px;
}
.search-row label {
  color: #fff;
  font-size: var(--fs-xl);
  font-weight: 900;
  letter-spacing: 4px;
  white-space: nowrap;
  text-shadow: 0 2px 4px rgba(112, 50, 0, 0.3);
}
.search-row input {
  height: var(--mm-input-h);
  border-radius: 12px;
  border: 2px solid rgba(255, 240, 210, 0.85);
  background: rgba(255, 255, 255, 0.98);
  padding: 0 15px;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #122132;
  outline: none;
  box-shadow: 0 2px 6px rgba(110, 52, 0, 0.1), inset 0 1px 3px rgba(120, 60, 0, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.12s;
  min-width: 0;
}
.search-row input::placeholder { font-size: var(--fs-sm); font-weight: 600; color: #8c9bab; }
.search-row input:focus {
  background: #fff;
  border-color: #0b5a8e;
  box-shadow: 0 0 0 3px rgba(11, 90, 142, 0.26), 0 6px 16px rgba(0, 0, 0, 0.12);
}
.search-hotkey {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: 0 3px 0 rgba(112, 50, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #fff;
  font-size: var(--fs-xl);
  font-weight: 900;
  font-family: Consolas, monospace;
}

.orange-bottom-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}
.orange-white-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f1f6fc 100%);
  color: #0c2b56;
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 13px;
  padding: 11px 10px;
  font-size: var(--fs-xl);
  font-weight: 900;
  letter-spacing: 3px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(104, 48, 0, 0.22), inset 0 1px 0 #fff;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background 0.14s, box-shadow 0.16s;
  font-family: inherit;
}
.orange-white-btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e4f1ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(104, 48, 0, 0.26);
}
.orange-white-btn:active { transform: translateY(0); }

/* Column 4: Customer Log Porcelain Sidebar */
.col-oplog {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(154, 184, 212, 0.65);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 28px rgba(12, 46, 82, 0.13);
  max-height: 500px;
}
.oplog-header {
  background: linear-gradient(180deg, #2d6ae0 0%, #1d50b8 100%);
  color: #fff;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: 900;
  padding: 13px 10px;
  letter-spacing: 3px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}
.oplog-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.oplog-item {
  border: 1px solid #dce8f3;
  border-left: 3.5px solid #2d6ae0;
  border-radius: 11px;
  padding: 9px 11px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fafe 100%);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(12, 46, 82, 0.05);
  transition: background 0.14s, border-color 0.14s, transform 0.14s, box-shadow 0.14s;
}
.oplog-item:hover {
  background: #edf5ff;
  border-color: #2d6ae0;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(29, 80, 184, 0.12);
}
.oplog-item .oplog-top {
  display: flex; justify-content: space-between; gap: 6px;
  font-weight: 800; font-size: var(--fs-sm); color: #0a4e7c; white-space: nowrap;
}
.oplog-item .oplog-desc { font-size: var(--fs-xs); color: #475b70; margin-top: 3px; line-height: 1.45; word-break: keep-all; }

/* ============ SUB-SCREEN COMMON LAYOUT ============ */
.sub-page {
  max-width: 1420px;
  margin: 0 auto;
  padding: 16px 22px 36px;
}

.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(125deg, rgba(8, 56, 94, 0.92) 0%, rgba(11, 78, 126, 0.84) 55%, rgba(7, 46, 80, 0.94) 100%),
    url("/assets/hero-boutique-banner.jpg") center / cover no-repeat;
  color: #fff;
  padding: 17px 24px;
  border-radius: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--fm-champagne);
  box-shadow: 0 12px 30px rgba(7, 42, 74, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  flex-wrap: wrap;
  gap: 12px;
}
.factory-theme .sub-header {
  background:
    linear-gradient(125deg, rgba(14, 68, 90, 0.88) 0%, rgba(20, 88, 114, 0.78) 55%, rgba(11, 52, 72, 0.92) 100%),
    url("/assets/bg-login-atelier.jpg") center / cover no-repeat !important;
}
.legacy-theme .sub-header {
  background:
    linear-gradient(125deg, rgba(86, 60, 36, 0.92) 0%, rgba(108, 76, 44, 0.84) 55%, rgba(58, 39, 22, 0.94) 100%),
    url("/assets/hero-boutique-banner.jpg") center / cover no-repeat !important;
}
.sub-header h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 900;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  word-break: keep-all;
}
.sub-header-sub {
  font-size: var(--fs-sm);
  opacity: 0.9;
  margin-top: 3px;
  word-break: keep-all;
}
.sub-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(196, 216, 234, 0.82);
  border-radius: var(--fm-radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  margin-bottom: 16px;
}
.card-title {
  font-size: var(--fs-md);
  font-weight: 900;
  color: var(--fm-blue-dark);
  border-bottom: 1.5px solid #e4eff8;
  padding-bottom: 10px;
  margin: 0 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  word-break: keep-all;
}
.card-title > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* KPI Metric Card Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 960px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.94) 100%);
  border: 1px solid rgba(190, 214, 234, 0.84);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), inset 0 1px 0 #fff;
}
.kpi-card .kpi-label { font-size: var(--fs-sm); font-weight: 700; color: var(--fm-muted); white-space: nowrap; }
.kpi-card .kpi-val { font-size: var(--fs-kpi); font-weight: 900; line-height: 1.15; white-space: nowrap; }
.kpi-card .kpi-sub { font-size: var(--fs-xs); color: var(--fm-muted); white-space: nowrap; }

/* Buttons */
.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-size: var(--fs-base);
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: filter 0.12s, transform 0.1s, box-shadow 0.14s, background 0.12s;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(15, 42, 68, 0.12);
}
.btn:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 5px 12px rgba(15, 42, 68, 0.16); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.48; cursor: not-allowed; box-shadow: none; }

.btn-primary { background: linear-gradient(180deg, #1b81c4, #10639b); color: #fff; }
.btn-cyan { background: linear-gradient(180deg, #22b5d0, #158ca3); color: #fff; }
.btn-green { background: linear-gradient(180deg, #62b92d, #48931b); color: #fff; }
.btn-orange { background: linear-gradient(180deg, #f69610, #d67600); color: #fff; }
.btn-purple { background: linear-gradient(180deg, #8b5cf6, #6c28d9); color: #fff; }
.btn-red { background: linear-gradient(180deg, #e53935, #c42525); color: #fff; }
.btn-yellow { background: linear-gradient(180deg, #fff8b2, #ffe96e); color: #152435; border-color: #d7c74f; }
.btn-gray { background: linear-gradient(180deg, #f0f5f9, #dfe8f0); color: #1b2f43; border-color: #c5d4e2; box-shadow: 0 1px 3px rgba(15, 42, 68, 0.08); }
.btn-dark { background: linear-gradient(180deg, #334a62, #1e2f41); color: #fff; }
.btn-lg { padding: calc(var(--btn-pad-y) + 4px) calc(var(--btn-pad-x) + 8px); font-size: var(--fs-md); border-radius: 11px; }
.btn-sm { padding: calc(var(--btn-pad-y) - 2px) calc(var(--btn-pad-x) - 4px); font-size: var(--fs-sm); border-radius: 7px; }

/* Tables (Anti-Crush & Horizontal Scroll Safe) */
.table-wrap {
  overflow-x: auto;
  max-height: 540px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border: 1px solid #d5e4f0;
  border-radius: 13px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
table.pos-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-base);
}
table.pos-table th {
  background: linear-gradient(180deg, #f1f7fc 0%, #e4eff8 100%);
  color: #0b4168;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: calc(var(--cell-pad-y) + 2px) var(--cell-pad-x);
  border-bottom: 1.5px solid #c3d7e8;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
table.pos-table td {
  padding: calc(var(--cell-pad-y) + 1px) var(--cell-pad-x);
  border-bottom: 1px solid #ecf3f9;
  vertical-align: middle;
  word-break: keep-all;
  transition: background 0.12s ease;
}
table.pos-table td:first-child,
table.pos-table td:last-child { white-space: nowrap; }
table.pos-table tbody tr:nth-child(even) td { background: #fafcfe; }
table.pos-table tbody tr:hover td { background: #eef6fe; }
table.pos-table tbody tr.selected td { background: #d8edfd; }
table.pos-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: var(--fs-xs);
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-blue { background: #e0f0ff; color: #09538a; border-color: #b8dcfa; }
.badge-cyan { background: #dcf6fa; color: #0e6b7c; border-color: #a5e5ef; }
.badge-green { background: #dcfce7; color: #166534; border-color: #a7f3d0; }
.badge-orange { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.badge-red { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge-purple { background: #f3e8ff; color: #6b21a8; border-color: #ddd6fe; }
.badge-gray { background: #eef1f5; color: #374151; border-color: #d5dce4; }

/* Form controls */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 11px 14px;
}
.form-grid-2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px;
}
@media (max-width: 820px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label {
  font-size: var(--fs-sm); font-weight: 800; color: #2d4963;
  white-space: normal; line-height: 1.4;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  border: 1.5px solid #c3d5e5;
  border-radius: 10px;
  font-size: var(--fs-base);
  font-family: inherit;
  background: #fff;
  color: var(--fm-ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--fm-blue-mid); box-shadow: var(--ring);
}
.field input:disabled, .field select:disabled, .field textarea:disabled {
  background: #edf2f7;
  color: #5b6d80;
  border-color: #cfdbe6;
  cursor: not-allowed;
}

/* Tabs (Strict No-Mid-Word Wrapping) */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 13px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.68);
  padding: 6px;
  border-radius: 13px;
  border: 1px solid rgba(186, 210, 228, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 1px solid transparent;
  background: transparent;
  color: #213d59;
  font-weight: 800;
  font-size: var(--fs-base);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
  font-family: inherit;
}
.tab-btn:hover { background: rgba(19, 114, 178, 0.1); color: #0a4b78; }
.tab-btn.active {
  background: linear-gradient(180deg, #1372b0 0%, #095488 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(10, 82, 134, 0.28);
}
.factory-theme .tabs {
  gap: 4px;
  padding: 5px;
}
.factory-theme .tab-btn {
  padding: 6px 8px;
  gap: 4px;
  font-size: var(--fs-sm);
}
.factory-theme .tab-btn.active {
  background: linear-gradient(180deg, #1a6988 0%, #114a63 100%);
  box-shadow: 0 4px 10px rgba(16, 72, 98, 0.3);
}
.legacy-theme .tab-btn.active {
  background: linear-gradient(180deg, #735334 0%, #4d361f 100%);
  box-shadow: 0 4px 10px rgba(72, 48, 24, 0.3);
}

/* Other Functions & Hub Tile Grid */
.other-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--hub-min), 1fr));
  gap: 12px;
}
.hub-tile {
  border-radius: 15px;
  padding: 18px 14px;
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 8px 20px rgba(10, 38, 66, 0.17), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.14s, filter 0.14s, box-shadow 0.16s;
  font-family: inherit;
  word-break: keep-all;
}
.hub-tile:hover { transform: translateY(-3px); filter: brightness(1.06); box-shadow: 0 13px 26px rgba(10, 38, 66, 0.24); }
.hub-tile:active { transform: translateY(0); }
.hub-tile .hub-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12) 72%);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 6px 14px rgba(8, 30, 56, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.14s ease;
}
.hub-tile:hover .hub-icon { transform: scale(1.06); }
.hub-tile .hub-title { white-space: nowrap; letter-spacing: 0.4px; }
.hub-tile small {
  font-size: var(--fs-xs);
  font-weight: 600;
  opacity: 0.92;
  line-height: 1.4;
  word-break: keep-all;
  text-wrap: balance;
}
.hub-cyan { background: linear-gradient(155deg, #22b2ca, #117d93); }
.hub-green { background: linear-gradient(155deg, #5ab132, #3c821b); }
.hub-orange { background: linear-gradient(155deg, #ee921b, #c56a04); }
.hub-blue { background: linear-gradient(155deg, #2d6de0, #194aa6); }
.hub-purple { background: linear-gradient(155deg, #8255ec, #5e22c2); }
.hub-red { background: linear-gradient(155deg, #dc3a3a, #a61b1b); }
.hub-brown { background: linear-gradient(155deg, #725335, #48321c); }

/* Customer Service Main Screen */
.cs-hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
}
.cs-big-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cs-action-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 215px;
  max-width: 315px;
  min-width: 175px;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 14px;
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: 0.4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 7px 16px rgba(10, 38, 66, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.36);
  transition: transform 0.13s ease, filter 0.14s ease, box-shadow 0.14s ease;
  font-family: inherit;
}
.cs-action-card .cs-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cs-action-card:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 11px 22px rgba(10, 38, 66, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}
.cs-action-card:active { transform: translateY(0); }

/* Drop-off Zero-Jump 9-Tab Workspace */
.dropoff-workspace {
  display: grid;
  grid-template-columns: 1.06fr 1.08fr;
  gap: 14px;
  align-items: stretch;
}
.dropoff-panel {
  display: flex;
  flex-direction: column;
  height: var(--dropoff-h);
  margin-bottom: 0;
  overflow: hidden;
}
.dropoff-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-gutter: stable;
  border: 1px solid #d7e5f1;
  border-radius: 11px;
  background: #fff;
}
.dropoff-promo-slot {
  min-height: 32px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  background: #f4f8fc;
  color: #52667a;
  border: 1px solid #dce8f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropoff-promo-slot.active {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}
.nine-field-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #f3f8fc, #ebf3fa);
  border: 1px solid #cfe0ee;
  border-radius: 10px;
  min-height: 64px;
  align-content: center;
}
.nf-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  background: #fff;
  border: 1px solid #c5d8e8;
  font-size: var(--fs-xs);
  font-weight: 800;
  color: #1a3752;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, background 0.12s;
  font-family: inherit;
}
.nf-pill span { color: #678099; font-weight: 700; }
.nf-pill.current {
  background: #0d639b;
  color: #fff;
  border-color: #094a75;
}
.nf-pill.current span { color: rgba(255, 255, 255, 0.78); }
.choice-stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 4px 2px 6px;
  align-content: start;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--chip-min), 1fr));
  gap: 8px;
  align-content: start;
}
.choice-chip {
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fd 100%);
  border: 1.5px solid #c7d9e8;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: var(--fs-base);
  font-weight: 800;
  color: #163047;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 5px rgba(10, 42, 72, 0.05);
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.12s;
  user-select: none;
}
.choice-chip:hover {
  background: linear-gradient(180deg, #f4faff 0%, #e4f2fe 100%);
  border-color: #1474b4;
  box-shadow: 0 4px 10px rgba(19, 114, 178, 0.12);
}
.choice-chip.active {
  background: linear-gradient(180deg, #167bc0, #0c588d);
  color: #fff;
  border-color: #08446d;
  box-shadow: 0 4px 12px rgba(12, 88, 141, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.choice-chip small { display: block; font-size: var(--fs-xs); font-weight: 600; opacity: 0.88; margin-top: 2px; }

/* Login Screen */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background-color: #0b2d47;
  background-image:
    linear-gradient(155deg, rgba(6, 28, 48, 0.56) 0%, rgba(12, 54, 84, 0.42) 50%, rgba(6, 26, 44, 0.62) 100%),
    url("/assets/bg-login-atelier.jpg"),
    linear-gradient(155deg, #0b3554 0%, #14537c 48%, #0e3d60 100%);
  background-size: cover;
  background-position: center;
}
.login-font-corner {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 20;
}
.login-card {
  width: min(520px, 95vw);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(22px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(3, 16, 34, 0.56), 0 0 0 1px rgba(255, 255, 255, 0.42);
}
.login-banner {
  background:
    linear-gradient(155deg, rgba(10, 52, 86, 0.88) 0%, rgba(7, 38, 66, 0.8) 55%, rgba(5, 26, 46, 0.92) 100%),
    url("/assets/hero-boutique-banner.jpg") center / cover no-repeat;
  color: #fff;
  padding: 36px 28px 30px;
  text-align: center;
  border-bottom: 1px solid var(--fm-champagne);
}
.login-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 2px;
  white-space: nowrap;
}
.login-banner h1 {
  margin: 10px 0 0; font-size: var(--fs-hero); letter-spacing: 4px; font-weight: 900; white-space: nowrap;
}
.login-banner p { margin: 8px 0 0; opacity: 0.9; font-size: var(--fs-sm); word-break: keep-all; }
.login-body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 14px; }

/* Modal (Native <dialog> + Light Dismiss) & Toast */
dialog.pos-dialog {
  border: none;
  padding: 0;
  margin: auto;
  background: transparent;
  width: min(780px, 94vw);
  max-width: 94vw;
  max-height: 92vh;
  overflow: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.16s ease-out, transform 0.16s ease-out;
}
dialog.pos-dialog.wide { width: min(1100px, 96vw); }
dialog.pos-dialog::backdrop {
  background: rgba(8, 22, 38, 0.56);
  backdrop-filter: blur(5px);
}
@starting-style {
  dialog.pos-dialog[open] {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}
.modal-box {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.65);
}
.modal-box.wide { max-width: 1100px; }
.modal-head {
  background: linear-gradient(135deg, #0d5b91 0%, #083d65 100%);
  color: #fff;
  padding: 15px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--fm-champagne);
}
.modal-head h3 { margin: 0; font-size: var(--fs-md); font-weight: 900; letter-spacing: 0.5px; word-break: keep-all; }
.modal-close {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 9px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 900;
  flex-shrink: 0;
  transition: background 0.14s, transform 0.12s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.04); }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; font-size: var(--fs-base); }
.modal-foot {
  padding: 13px 22px;
  background: #f5f9fd;
  border-top: 1px solid #dde8f3;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

#toast-root {
  position: fixed; bottom: 22px; right: 22px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: rgba(16, 34, 54, 0.96);
  color: #fff;
  padding: 12px 18px;
  border-radius: 11px;
  font-size: var(--fs-base);
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  border-left: 5px solid #28b1c9;
  backdrop-filter: blur(8px);
  animation: toast-in 0.2s ease-out;
  max-width: 460px;
  word-break: keep-all;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast.ok { border-left-color: #22c55e; }
.toast.err { border-left-color: #ef4444; background: rgba(92, 20, 24, 0.96); }

/* Print Area (Fixed Physical Print Sizes — Never Affected by Screen Scale!) */
#print-area { display: none; }
.print-preview-sheet {
  background: #fff;
  border: 1px dashed #93a7ba;
  border-radius: 8px;
  padding: 18px;
  font-family: "Microsoft JhengHei", monospace;
  color: #000;
  margin: 0 auto;
}
.thermal-sheet { max-width: 330px; font-size: 13px; }
.label-sheet { max-width: 360px; border: 2px solid #000; padding: 10px; margin-bottom: 10px; border-radius: 4px; }
.report-sheet { width: 100%; font-size: 13px; }

@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area {
    display: block !important;
    position: absolute; left: 0; top: 0; width: 100%;
  }
}

/* Responsive Breakpoints Protecting Layout at All 3 Font Sizes */
@media (max-width: 1260px) {
  :root[data-font-size="lg"] .main-menu-grid { grid-template-columns: 1fr 1fr; }
  :root[data-font-size="lg"] .pos-topbar { grid-template-columns: 1fr; text-align: center; gap: 10px; }
  :root[data-font-size="lg"] .topbar-left, :root[data-font-size="lg"] .topbar-right { align-items: center; }
}
@media (max-width: 1180px) {
  .main-menu-grid { grid-template-columns: 1fr 1fr; padding: 16px; }
  .cs-hero, .dropoff-workspace { grid-template-columns: 1fr; }
  .dropoff-panel { height: auto; min-height: 460px; }
  .choice-stage { height: 260px; flex: none; }
  .pos-topbar { grid-template-columns: 1fr; text-align: center; gap: 10px; }
  .topbar-left, .topbar-right { align-items: center; }
  .mode-switcher { flex-wrap: wrap; }
}

/* Branch Unfinished Items Alert Bell & Banner */
.btn-alert-bell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s, background 0.16s, box-shadow 0.16s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-alert-bell:hover { background: rgba(255, 255, 255, 0.24); transform: translateY(-1px); }
.btn-alert-bell.has-warn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: rgba(255, 243, 199, 0.7);
  color: #fff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.42);
}
.btn-alert-bell.has-high {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border-color: rgba(254, 202, 202, 0.8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.48);
  animation: alert-pulse 2.2s infinite;
}
.alert-bell-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
@keyframes alert-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.26), 0 4px 18px rgba(220, 38, 38, 0.65); }
}

.branch-alert-banner {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto 12px;
  padding: 11px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.96) 0%, rgba(254, 243, 199, 0.94) 100%);
  border: 1.5px solid rgba(217, 119, 6, 0.42);
  box-shadow: 0 8px 20px rgba(146, 64, 14, 0.12);
}
.branch-alert-banner.high {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.97) 0%, rgba(254, 226, 226, 0.95) 100%);
  border-color: rgba(220, 38, 38, 0.48);
  box-shadow: 0 8px 22px rgba(185, 28, 28, 0.15);
}
.branch-alert-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 240px;
}
.ba-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.ba-item-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid #dbe7f2;
  border-left-width: 5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ba-item-card.sev-high { border-left-color: #dc2626; background: #fffafa; }
.ba-item-card.sev-warn { border-left-color: #d97706; background: #fffdf7; }
.ba-item-card.sev-closing { border-left-color: #6d28d9; background: #fbfaff; }
