@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/noto-sans-thai-thai.woff2") format("woff2");
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/noto-sans-thai-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-page: #E5EBE4;
  --bg-sunken: #DCE4DB;
  --surface: #FFFFFF;
  --surface-head: #F5F8F4;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --line-soft: #CFD9CE;
  --line: #BDC9BC;
  --ink-900: #14261A;
  --ink-700: #36483C;
  --ink-500: #66776C;
  --ink-400: #8B9A90;

  --green-50: #F1FBEC;
  --green-100: #DDF5CF;
  --green-200: #BCEBA2;
  --green-400: #7ED957;
  --green-500: #5BBF36;
  --green-700: #296818;
  --green-900: #123A1E;

  --tt-main: #161823;
  --tt-cyan: #25F4EE;
  --tt-red: #FE2C55;
  --tt-soft: #F2F4F7;
  --tt-border: #D5DBE4;
  --tt-ink: #161823;

  --ln-main: #06C755;
  --ln-soft: #E9FBF0;
  --ln-border: #B8EECD;
  --ln-ink: #0B6E33;

  --tr-main: #2563EB;
  --tr-soft: #EEF4FF;
  --tr-border: #C7DCFF;
  --tr-ink: #1D4ED8;

  --warn-main: #D97706;
  --warn-soft: #FFF4D4;
  --warn-border: #FCD984;
  --warn-ink: #92400E;

  --danger-main: #E53935;
  --danger-soft: #FFECEC;
  --danger-border: #FFC8C8;
  --danger-ink: #B71C1C;

  --shadow-float: 0 10px 28px -8px rgba(20, 38, 26, 0.16), 0 2px 6px rgba(20, 38, 26, 0.06);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;
}

html[data-theme="dark"] {
  --bg-page: #0A110D;
  --bg-sunken: #131E17;
  --surface: #16231B;
  --surface-head: #1C2C22;
  --surface-glass: rgba(20, 31, 24, 0.94);
  --line-soft: #2A3D31;
  --line: #364E3F;
  --ink-900: #EDF5EF;
  --ink-700: #C2D2C7;
  --ink-500: #8DA194;
  --ink-400: #66796D;

  --green-50: rgba(126, 217, 87, 0.10);
  --green-100: rgba(126, 217, 87, 0.22);
  --green-200: rgba(126, 217, 87, 0.30);
  --green-700: #9CE67D;
  --green-900: #0E2A14;

  --tt-main: #2B3040;
  --tt-soft: #1A1F28;
  --tt-border: #313949;
  --tt-ink: #F5F7FA;

  --ln-main: #06C755;
  --ln-soft: rgba(6, 199, 85, 0.14);
  --ln-border: rgba(6, 199, 85, 0.34);
  --ln-ink: #6BE89E;

  --tr-soft: rgba(59, 130, 246, 0.15);
  --tr-border: rgba(59, 130, 246, 0.32);
  --tr-ink: #93C5FD;

  --warn-soft: rgba(245, 158, 11, 0.16);
  --warn-border: rgba(245, 158, 11, 0.35);
  --warn-ink: #FCD34D;

  --danger-soft: rgba(229, 57, 53, 0.16);
  --danger-border: rgba(229, 57, 53, 0.36);
  --danger-ink: #FCA5A5;
  --shadow-float: 0 14px 36px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-page);
  color: var(--ink-900);
  font-family: "Noto Sans Thai", Thonburi, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overscroll-behavior-y: none;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ===== Boot ===== */
.boot-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-500);
}

.boot-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3.5px solid var(--line);
  border-top-color: var(--green-500);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Login Screen ===== */
.login-screen {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 18% 12%, rgba(126, 217, 87, 0.22), transparent 44%),
    radial-gradient(circle at 86% 88%, rgba(6, 184, 79, 0.12), transparent 46%),
    var(--bg-page);
}

.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-float);
}

.login-card.is-shake {
  animation: shake 0.38s;
}

@keyframes shake {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.login-hero {
  padding: 28px 24px 20px;
  text-align: center;
  background-color: var(--green-50);
  background-image: radial-gradient(var(--green-200) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-badge {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
}

.brand-badge svg {
  width: 100%;
  height: 100%;
  display: block;
}

.login-hero h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink-900);
}

.login-hero p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-500);
}

.login-form {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.field span,
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--bg-page);
  color: var(--ink-900);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(126, 217, 87, 0.28);
  background: var(--surface);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--ink-700);
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green-500);
}

.form-err {
  color: var(--danger-main);
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
}

.local-hint {
  font-size: 12px;
  color: var(--ink-500);
  background: var(--bg-sunken);
  border-radius: 12px;
  padding: 9px 12px;
  text-align: center;
}

/* ===== Shared Buttons ===== */
.btn-primary {
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--green-400);
  color: var(--green-900);
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s, filter 0.15s;
}

.btn-primary.btn-lg {
  width: 100%;
  height: 50px;
  font-size: 16px;
}

.btn-primary:active,
.btn-secondary:active,
.btn-confirm:active,
.btn-soft:active,
.btn-soft-danger:active,
.btn-add-pill:active,
.card-act:active {
  transform: scale(0.97);
}

.btn-primary:disabled,
.btn-confirm:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  color: var(--ink-900);
  font-weight: 600;
  font-size: 14.5px;
}

.btn-soft {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-900);
  font-size: 13.5px;
  font-weight: 600;
}

.btn-soft-danger {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--danger-border);
  border-radius: var(--r-pill);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: none;
}

.btn-soft-danger svg {
  width: 16px;
  height: 16px;
}

.btn-outline-danger {
  width: 100%;
  height: 42px;
  border: 1.5px dashed var(--danger-border);
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-weight: 600;
  font-size: 13.5px;
}

.btn-text-muted {
  border: 0;
  background: transparent;
  color: var(--ink-500);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
}

/* ===== App Shell (Mobile-First Fixed Frame) ===== */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg-page);
}

@media (max-width: 767px) {
  .app-shell {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
  }
}

.app-header {
  flex: none;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  padding-top: env(safe-area-inset-top);
  z-index: 20;
}

.header-inner {
  max-width: 1020px;
  margin: 0 auto;
  height: 58px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  padding: 4px 6px 4px 0;
  text-align: left;
  border-radius: 12px;
  outline: none;
}

.header-brand:active {
  opacity: 0.78;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.header-edit-ico {
  width: 14px;
  height: 14px;
  color: var(--ink-400);
  flex: none;
  display: inline-grid;
  place-items: center;
  opacity: 0.72;
}

.header-edit-ico svg {
  width: 13px;
  height: 13px;
}

.header-emblem {
  width: 34px;
  height: 34px;
  flex: none;
}

.header-emblem svg {
  width: 100%;
  height: 100%;
  display: block;
}

.header-titles {
  min-width: 0;
}

.header-titles h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-sub {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
  background: var(--bg-sunken);
  padding: 4px;
  border-radius: var(--r-pill);
}

.dnav-btn {
  border: 0;
  background: transparent;
  color: var(--ink-700);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  transition: background 0.15s, color 0.15s;
}

.dnav-btn.is-active {
  background: var(--surface);
  color: var(--green-700);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-pill {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink-700);
  display: grid;
  place-items: center;
}

.icon-pill svg {
  width: 18px;
  height: 18px;
}

.icon-pill.is-spinning svg {
  animation: spin 0.7s linear infinite;
}

.user-pill {
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 120px;
}

.user-pill span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-500);
  flex: none;
}

/* ===== Main Scroll Area ===== */
.main-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (max-width: 767px) {
  .main-scroll {
    scrollbar-width: none;
  }
  .main-scroll::-webkit-scrollbar {
    display: none;
  }
}

.page-wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 14px 16px 28px;
}

/* ===== Hero Bento Summary Card (Distinct Deep Ocean-Blue Executive Banner) ===== */
.hero-card {
  background: linear-gradient(145deg, #0D2B4E 0%, #144B82 56%, #1D72B2 100%);
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: var(--r-xl);
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  color: #F2F8FF;
  box-shadow: 0 10px 26px -8px rgba(13, 43, 78, 0.36);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(147, 219, 255, 0.18) 1.25px, transparent 1.25px);
  background-size: 20px 20px;
  pointer-events: none;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: #BAE0FF;
}

.hero-total-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.hero-total {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.hero-unit {
  font-size: 15px;
  font-weight: 600;
  color: #C7E6FF;
}

.hero-sku {
  font-size: 12px;
  font-weight: 700;
  color: #E0F2FE;
  background: rgba(255, 255, 255, 0.14);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  margin-left: 2px;
}

.status-pill {
  border: 0;
  border-radius: var(--r-pill);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
}

.status-pill.is-ok {
  background: #7ED957;
  color: #103219;
}

.status-pill.is-warn {
  background: #FDE68A;
  color: #78350F;
}

.split-bar-wrap {
  margin: 13px 0;
}

.split-bar {
  height: 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: flex;
  gap: 3px;
}

.hero-card .split-seg.is-tt {
  background: linear-gradient(90deg, #0D0F16 0%, #24293B 76%, #25F4EE 90%, #FE2C55 100%);
}

.hero-card .split-seg.is-ln {
  background: #1AD96A;
}

.split-seg {
  height: 100%;
  transition: width 0.35s ease;
}

.split-seg.is-tt {
  background: linear-gradient(90deg, #161823 0%, #1F2333 88%, #25F4EE 94%, #FE2C55 100%);
}

html[data-theme="dark"] .split-seg.is-tt {
  background: linear-gradient(90deg, #3A4256 0%, #4C5670 84%, #25F4EE 92%, #FE2C55 100%);
}

.split-seg.is-ln {
  background: var(--ln-main);
}

.hero-pools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hero-pool {
  border-radius: var(--r-md);
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
}

.hero-pool.is-tt {
  background: rgba(9, 17, 34, 0.44);
  border-color: rgba(37, 244, 238, 0.24);
}

.hero-pool.is-ln {
  background: rgba(6, 199, 85, 0.22);
  border-color: rgba(52, 235, 134, 0.34);
}

.hp-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #EEF7FF;
}

.brand-ico {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  flex: none;
}

.brand-ico svg {
  width: 14px;
  height: 14px;
  display: block;
}

.brand-ico.is-tt {
  background: #161823;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-ico.is-ln {
  background: #06C755;
}

.pool-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

.pool-dot.is-tt { background: #161823; }
.pool-dot.is-ln { background: var(--ln-main); }

.hp-val {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 3px;
}

.hp-val span {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: #FFFFFF;
}

.hero-pool.is-tt .hp-val span { color: #FFFFFF; }
.hero-pool.is-ln .hp-val span { color: #8EF5B4; }

.hp-val small {
  font-size: 12px;
  color: #BAE0FF;
}

.hp-sub {
  font-size: 11.5px;
  color: #BAE0FF;
}

/* ===== Search & Filters ===== */
.toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.toolbar-row.is-compact {
  margin-bottom: 0;
}

.search-results {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-page);
  border: 1px solid var(--line-soft);
}

.search-hit b {
  display: block;
  font-size: 14.5px;
  color: var(--ink-900);
}

.search-hit span {
  font-size: 12px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

.search-hit-btns {
  display: flex;
  gap: 6px;
  flex: none;
}

.search-box {
  flex: 1;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line-soft);
}

.search-box:focus-within {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(126, 217, 87, 0.25);
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--ink-400);
  flex: none;
}

.search-box input {
  border: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  font-size: 16px;
  outline: none;
}

.btn-add-pill {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--green-400);
  color: var(--green-900);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex: none;
}

.btn-add-pill svg {
  width: 17px;
  height: 17px;
}

.chip-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.chip-strip::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.filter-chip span {
  font-variant-numeric: tabular-nums;
  opacity: 0.78;
}

.filter-chip.is-active {
  background: var(--green-100);
  border-color: var(--green-400);
  color: var(--green-700);
  font-weight: 700;
}

/* ===== Product Cards (Crisp Visual Separation on Sage-Stone Canvas) ===== */
.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.prod-card {
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 0 15px 15px;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px -4px rgba(20, 38, 26, 0.09);
}

.prod-card.is-low {
  border-color: var(--warn-main);
  box-shadow: 0 4px 14px -4px rgba(217, 119, 6, 0.16);
}

.prod-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -15px;
  padding: 13px 15px;
  background: var(--surface-head);
  border-bottom: 1px solid var(--line-soft);
}

.prod-thumb {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--ink-400);
  position: relative;
  padding: 0;
}

.prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prod-thumb svg {
  width: 24px;
  height: 24px;
}

.prod-info {
  flex: 1;
  min-width: 0;
}

.prod-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prod-name {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-900);
  overflow-wrap: anywhere;
}

.prod-total-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.prod-total-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}

.prod-total-num strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-900);
}

.prod-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.prod-badge.is-ok {
  background: var(--green-100);
  color: var(--green-700);
}

.prod-badge.is-warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.prod-badge.is-danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.prod-edit-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: var(--bg-page);
  color: var(--ink-500);
  display: grid;
  place-items: center;
  flex: none;
  align-self: flex-start;
}

.prod-edit-btn svg {
  width: 17px;
  height: 17px;
}

.prod-mini-bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  overflow: hidden;
  display: flex;
  gap: 2px;
  margin: 12px 0 10px;
}

.pool-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pool-box {
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: var(--bg-page);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.1s;
}

.pool-box:active {
  transform: scale(0.98);
}

.pool-box.is-tt {
  background: var(--tt-soft);
  border-color: var(--tt-border);
}

.pool-box.is-ln {
  background: var(--ln-soft);
  border-color: var(--ln-border);
}

.pool-box.is-low {
  background: var(--warn-soft);
  border-color: var(--warn-border);
}

.pool-box-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-900);
}

.pool-box-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pool-box-qty {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--ink-900);
}

.pool-box.is-tt:not(.is-low) .pool-box-qty { color: var(--tt-ink); }
.pool-box.is-ln:not(.is-low) .pool-box-qty { color: var(--ln-ink); }
.pool-box.is-low .pool-box-qty { color: var(--danger-ink); }

.pool-box-qty small {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  margin-left: 3px;
}

.pool-box-low {
  font-size: 11px;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pool-low-tag {
  color: var(--danger-ink);
  font-weight: 700;
}

.card-actions {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1fr;
  gap: 7px;
}

.card-act {
  height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.card-act.is-out {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-ink);
}

.card-act.is-in {
  background: var(--green-100);
  border-color: var(--green-200);
  color: var(--green-700);
}

.card-act.is-tr {
  background: var(--tr-soft);
  border-color: var(--tr-border);
  color: var(--tr-ink);
}

/* ===== Section Headings, History & Bento Cards ===== */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.section-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-500);
}

.feed-card,
.bento-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.bento-card {
  padding: 16px;
  margin-bottom: 12px;
}

.bento-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 12px;
}

.bento-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bento-title-row .bento-title {
  margin-bottom: 0;
}

.mini-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  color: var(--ink-700);
}

.log-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.log-row:last-child {
  border-bottom: 0;
}

.log-ic {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex: none;
}

.log-ic.is-out { background: var(--danger-soft); color: var(--danger-ink); }
.log-ic.is-in { background: var(--green-100); color: var(--green-700); }
.log-ic.is-tr { background: var(--tr-soft); color: var(--tr-ink); }

.log-main {
  flex: 1;
  min-width: 0;
}

.log-top-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.log-prod {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-900);
}

.log-pool-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

.log-pool-tag.is-tt { background: #161823; color: #FFFFFF; }
.log-pool-tag.is-ln { background: var(--ln-soft); color: var(--ln-ink); border: 1px solid var(--ln-border); }
.log-pool-tag.is-tr { background: var(--tr-soft); color: var(--tr-ink); }

.log-meta {
  font-size: 12.5px;
  color: var(--ink-500);
  margin-top: 2px;
}

.log-bal {
  font-size: 11.5px;
  color: var(--ink-500);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.log-right {
  text-align: right;
  flex: none;
}

.log-amt {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.log-amt.is-out { color: var(--danger-ink); }
.log-amt.is-in { color: var(--green-700); }
.log-amt.is-tr { color: var(--tr-ink); }

.log-time {
  font-size: 11px;
  color: var(--ink-400);
  margin-top: 2px;
  white-space: nowrap;
}

/* ===== Summary Tab ===== */
.today-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.today-tile {
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  background: var(--bg-page);
}

.today-tile.is-tt { background: var(--tt-soft); border-color: var(--tt-border); }
.today-tile.is-ln { background: var(--ln-soft); border-color: var(--ln-border); }
.today-tile.is-in { background: var(--green-50); border-color: var(--green-200); }
.today-tile.is-tr { background: var(--tr-soft); border-color: var(--tr-border); }

.today-tile span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
}

.today-tile b {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}

.today-tile small {
  font-size: 12px;
  color: var(--ink-500);
}

.watchlist-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
}

.watch-info b {
  display: block;
  font-size: 14px;
  color: var(--ink-900);
}

.watch-info span {
  font-size: 12px;
  color: var(--warn-ink);
  font-weight: 600;
}

.watch-btn {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--green-400);
  color: var(--green-900);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.export-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--green-50);
  border-color: var(--green-200);
}

.export-icon {
  width: 44px;
  height: 44px;
}

.export-icon svg {
  width: 100%;
  height: 100%;
}

.export-copy h3 {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 800;
}

.export-copy p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-700);
}

/* ===== Settings & Admin ===== */
.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 19px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: none;
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-info b {
  display: block;
  font-size: 16px;
}

.account-info span {
  font-size: 13px;
  color: var(--ink-500);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-row b {
  display: block;
  font-size: 14.5px;
}

.setting-row p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-500);
}

.setting-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 14px 0;
}

.seg-toggle {
  display: inline-flex;
  background: var(--bg-sunken);
  padding: 3px;
  border-radius: var(--r-pill);
  flex: none;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-700);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
}

.seg-btn.is-active {
  background: var(--surface);
  color: var(--green-700);
  font-weight: 700;
}

.admin-locked p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-500);
}

.admin-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.admin-sub-head h4 {
  margin: 0;
  font-size: 14.5px;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-page);
  border: 1px solid var(--line-soft);
}

.admin-user-row b {
  display: block;
  font-size: 14px;
}

.admin-user-row span {
  font-size: 12px;
  color: var(--ink-500);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-form-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-700);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.danger-zone b {
  display: block;
  font-size: 14px;
  color: var(--danger-ink);
}

.danger-zone p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-500);
}

/* ===== Mobile Bottom Nav (theekhee-toilet.com style) ===== */
.bottom-nav {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  z-index: 25;
}

.bnav-item {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 0;
  color: var(--ink-500);
  outline: none;
}

.bnav-item:focus-visible .bnav-pill {
  box-shadow: 0 0 0 3px rgba(126, 217, 87, 0.55);
}

.bnav-pill {
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  transition: background 0.16s, transform 0.12s;
}

.bnav-item:active .bnav-pill {
  transform: scale(0.92);
}

.bnav-pill svg {
  width: 21px;
  height: 21px;
}

.bnav-label {
  font-size: 11.5px;
  font-weight: 600;
}

.bnav-item.is-active {
  color: var(--green-700);
}

.bnav-item.is-active .bnav-pill {
  background: var(--green-100);
}

.bnav-item.is-active .bnav-label {
  font-weight: 700;
}

.bnav-badge {
  position: absolute;
  top: -2px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--danger-main);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ===== Overlays, Bottom Sheets & Dialogs ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 28, 20, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
  padding: 0;
}

.overlay.is-center {
  align-items: center;
  padding: 18px;
}

.sheet {
  width: min(500px, 100%);
  max-height: 92vh;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.22s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(36px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 10px auto 2px;
  flex: none;
}

.sheet-head {
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
}

.sheet-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.sheet-prod {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sheet-prod p {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

.sheet-thumb {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-sunken);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--ink-400);
  flex: none;
}

.sheet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-sunken);
  color: var(--ink-700);
  font-size: 15px;
  font-weight: 700;
  flex: none;
}

.sheet-body {
  padding: 14px 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.sheet-foot {
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 10px;
  background: var(--surface);
  flex: none;
}

/* Action Sheet Controls */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: var(--bg-sunken);
  padding: 4px;
  border-radius: var(--r-pill);
}

.mode-tab {
  height: 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-700);
  font-size: 13.5px;
  font-weight: 700;
}

.mode-tab.is-active.is-out { background: var(--danger-main); color: #FFFFFF; }
.mode-tab.is-active.is-in { background: var(--green-400); color: var(--green-900); }
.mode-tab.is-active.is-tr { background: var(--tr-main); color: #FFFFFF; }

.pool-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.pick-hint {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}

.pool-picker.is-attention {
  animation: shake 0.38s;
}

.pool-picker.is-attention .pick-card {
  border-color: var(--warn-main);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.22);
}

.pick-card {
  border-radius: 16px;
  padding: 11px 12px;
  border: 2px solid var(--line);
  background: var(--bg-page);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s, transform 0.1s;
}

.pick-card:active {
  transform: scale(0.97);
}

.pick-name {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pick-card b {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pick-card small {
  font-size: 12px;
  color: var(--ink-500);
}

.pick-card.is-tt.is-selected {
  background: #161823;
  border-color: #161823;
  color: #FFFFFF;
}

.pick-card.is-tt.is-selected .brand-ico.is-tt {
  background: #272B3C;
}

.pick-card.is-ln.is-selected {
  background: var(--ln-soft);
  border-color: var(--ln-main);
  color: var(--ln-ink);
}

.pick-card.is-tr.is-selected {
  background: var(--tr-soft);
  border-color: var(--tr-main);
  color: var(--tr-ink);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.step-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  color: var(--ink-900);
  font-size: 22px;
  font-weight: 700;
  flex: none;
}

.qty-stepper input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--bg-page);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.qty-stepper input:focus {
  outline: none;
  border-color: var(--green-500);
  background: var(--surface);
}

.quick-chips {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.qchip {
  flex: 1;
  height: 34px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-soft);
  background: var(--bg-page);
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 700;
}

.qchip:active {
  background: var(--green-100);
  color: var(--green-700);
}

.channel-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.ch-chip {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 13.5px;
  font-weight: 600;
}

.ch-chip.is-selected {
  background: var(--green-100);
  border-color: var(--green-500);
  color: var(--green-700);
  font-weight: 700;
}

.preview-box {
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-soft);
}

.preview-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-500);
  margin-bottom: 6px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pv-item {
  background: var(--surface);
  border-radius: 10px;
  padding: 7px 8px;
  text-align: center;
}

.pv-item span {
  display: block;
  font-size: 11px;
  color: var(--ink-500);
}

.pv-item b {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pv-item.is-total b {
  color: var(--green-700);
}

.preview-warn {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.btn-confirm {
  height: 46px;
  border: 0;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
}

.btn-confirm.is-out { background: var(--danger-main); }
.btn-confirm.is-in { background: var(--green-400); color: var(--green-900); }
.btn-confirm.is-tr { background: var(--tr-main); }

/* Edit Product Photo */
.edit-photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.edit-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--ink-400);
  flex: none;
}

.edit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-start;
}

/* Center Dialog, Animated Loader & Lightbox */
.dialog {
  width: min(392px, 100%);
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: var(--shadow-float);
  animation: popIn 0.24s cubic-bezier(0.22, 1.28, 0.36, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.88) translateY(14px); }
  to { opacity: 1; transform: none; }
}

.dialog-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: var(--green-100);
  color: var(--green-700);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
}

.dialog-icon.is-out { background: var(--danger-soft); color: var(--danger-main); }
.dialog-icon.is-in { background: var(--green-100); color: var(--green-700); }
.dialog-icon.is-tr { background: var(--tr-soft); color: var(--tr-main); }
.dialog-icon.is-warn { background: var(--warn-soft); color: var(--warn-main); }

.dialog-actions.is-single {
  grid-template-columns: 1fr;
}

/* Sleek Dual-Ring Loading Spinner */
.fancy-loader-wrap {
  padding: 10px 0 6px;
}

.fancy-loader {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
}

.fancy-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4.5px solid var(--bg-sunken);
  border-top-color: var(--green-500);
  border-right-color: var(--green-400);
  animation: spin 0.78s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.fancy-loader.is-out .fancy-loader-ring {
  border-top-color: var(--danger-main);
  border-right-color: #FF8A80;
}

.fancy-loader.is-tr .fancy-loader-ring {
  border-top-color: var(--tr-main);
  border-right-color: #93C5FD;
}

.fancy-loader-inner {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: var(--tt-cyan);
  border-left-color: var(--tt-red);
  animation: spinRev 1.15s linear infinite;
  opacity: 0.75;
}

@keyframes spinRev {
  to { transform: rotate(-360deg); }
}

.anim-svg {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 10px;
}

.anim-svg.is-ok circle {
  fill: var(--green-50);
  stroke: var(--green-500);
  stroke-width: 3.2;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: drawStroke 0.45s ease forwards;
}

.anim-svg.is-ok path {
  fill: none;
  stroke: var(--green-700);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: drawStroke 0.32s 0.32s ease forwards;
}

.anim-svg.is-err {
  animation: shake 0.38s 0.25s;
}

.anim-svg.is-err circle {
  fill: var(--danger-soft);
  stroke: var(--danger-main);
  stroke-width: 3.2;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: drawStroke 0.42s ease forwards;
}

.anim-svg.is-err path {
  fill: none;
  stroke: var(--danger-main);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: drawStroke 0.28s 0.28s ease forwards;
}

@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}

.owner-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.owner-kpi {
  background: var(--bg-page);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.owner-kpi b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.owner-kpi span {
  font-size: 11.5px;
  color: var(--ink-500);
}

.dialog h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}

.dialog-sub {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-500);
}

.dialog-rows {
  background: var(--bg-page);
  border-radius: 14px;
  padding: 6px 14px;
  margin-bottom: 12px;
  text-align: left;
}

.d-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}

.d-row:last-child { border-bottom: 0; }
.d-row span { color: var(--ink-500); }
.d-row b { text-align: right; }

.dialog-input {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--bg-page);
  padding: 0 14px;
  text-align: center;
  font-size: 16px;
  margin-bottom: 8px;
}

.dialog-input:focus {
  outline: none;
  border-color: var(--green-500);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  margin-top: 10px;
}

.lightbox {
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-float);
}

.lightbox img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 16px;
  display: block;
  margin: 0 auto;
  background: var(--bg-sunken);
}

.lb-cap {
  font-size: 16px;
  font-weight: 700;
  margin: 12px 0 10px;
}

/* Empty & Toast */
.empty-box {
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-500);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}

.empty-box b {
  display: block;
  color: var(--ink-900);
  font-size: 15.5px;
  margin-bottom: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 82px;
  transform: translate(-50%, 20px);
  background: #14261A;
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 90;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-float);
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== Responsive Desktop Layout (>= 768px) ===== */
@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }

  .bottom-nav {
    display: none;
  }

  .page-wrap {
    padding: 20px 24px 40px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .today-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .overlay {
    align-items: center;
    padding: 20px;
  }

  .sheet {
    border-radius: var(--r-xl);
    max-height: 86vh;
  }

  .toast {
    bottom: 26px;
  }
}
