:root {
  --bg: var(--tg-theme-bg-color, #f3f5f8);
  --text: var(--tg-theme-text-color, #14181f);
  --hint: var(--tg-theme-hint-color, #6b7280);
  --brand-blue: #1a3a6e;
  --brand-orange: #f97316;
  --accent: var(--tg-theme-button-color, var(--brand-blue));
  --accent-text: var(--tg-theme-button-text-color, #fff);
  --accent-secondary: var(--brand-orange);
  --card: var(--tg-theme-secondary-bg-color, #fff);
  --border: rgba(15, 23, 42, 0.08);
  --danger: #dc2626;
  --ok: #15803d;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
  --nav-h: 64px;
  --header-h: 56px;
  --header-search-gap: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
}
html, body {
  background: var(--bg);
}
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  overflow-x: hidden;
}
.header-stack {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
}
.header-stack.hidden { display: none; }
.header-stack.has-search {
  padding-bottom: 0;
}
.header-stack .header {
  position: static;
  top: auto;
  z-index: auto;
}
.header-stack.has-search .header {
  border-bottom: none;
  box-shadow: none;
}
.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.header .title-wrap { flex: 1; min-width: 0; }
.header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header .sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app.mgr-mode {
  --header-h: 68px;
}
.app.mgr-mode .header {
  height: auto;
  min-height: var(--header-h);
  align-items: flex-start;
  padding-top: 10px;
  padding-bottom: 10px;
}
.app.mgr-mode .header .sub {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.header .logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  border: none;
  flex-shrink: 0;
}
.header .brand-logo {
  width: auto;
  height: 34px;
  max-width: 132px;
  object-fit: contain;
  flex-shrink: 0;
}
.header .logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}
.header .back-btn {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  padding: 4px 8px 4px 0;
  cursor: pointer;
  color: var(--accent);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-return {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: var(--brand-orange);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}
.header-return--labeled {
  width: auto;
  min-width: 38px;
  max-width: 120px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.header-return.hidden { display: none; }
.home-top-bar {
  padding: var(--header-search-gap) 12px 0;
  background: transparent;
}
.home-top-bar.hidden { display: none; }
.search-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 17px;
  border: none;
  border-radius: 14px;
  background: #fff;
  color: #9ca3af;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  text-align: left;
}
.search-line-icon {
  flex-shrink: 0;
  color: #9ca3af;
}
.search-line-text {
  color: #9ca3af;
  font-size: 1rem;
}
main { flex: 1; padding: 12px 14px 16px; }
#screen-loading,
#screen-setup,
#screen-main { display: none; }
#screen-loading:not(.hidden),
#screen-setup:not(.hidden),
#screen-main:not(.hidden) { display: block; }
#screen-setup:not(.hidden) {
  position: fixed;
  inset: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: none;
  width: 100%;
  max-width: 560px;
  z-index: 500;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px 24px;
  box-sizing: border-box;
}
#screen-setup.hidden,
#screen-loading.hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}
#subview-host { display: block; min-height: 40px; }
#subview-host.hidden { display: none !important; }
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.panel + .panel { margin-top: 10px; }
.section-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--hint);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.promo-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scroll-snap-type: x mandatory;
}
.promo-card-mini {
  flex: 0 0 78%;
  max-width: 300px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #eff6ff, #fff);
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.promo-card-mini h3 { margin: 0 0 6px; font-size: 0.95rem; }
.promo-card-mini p { margin: 0; font-size: 0.85rem; color: var(--hint); }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-align: left;
  padding: 0;
  color: inherit;
}
.cat-tile img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  background: var(--bg);
  pointer-events: none;
}
.cat-tile .cat-emoji-fallback,
.cat-row img,
.prod-card img,
.prod-photo-fallback {
  pointer-events: none;
}
.cat-emoji-fallback {
  height: 88px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.cat-tile .cat-body { padding: 10px 12px; }
.cat-tile .name { font-weight: 600; font-size: 0.92rem; }
.cat-tile .count { font-size: 0.78rem; color: var(--hint); margin-top: 2px; }
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  box-shadow: var(--shadow);
  text-align: left;
  color: inherit;
}
.cat-row img,
.prod-card img,
.prod-photo-fallback,
.cat-row .cat-emoji-fallback {
  pointer-events: none;
}
.cat-row img {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg);
}
.cat-row .cat-emoji-fallback {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 14px;
  font-size: 2.4rem;
}
.cat-row .info { flex: 1; min-width: 0; pointer-events: none; }
.cat-row .name { font-weight: 800; font-size: 1.12rem; line-height: 1.3; }
.cat-row .count { font-size: 0.95rem; color: var(--hint); margin-top: 4px; }
.category-banner {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  max-height: 220px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.prod-list-sentinel { height: 1px; width: 100%; }
.prod-card {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.prod-card--list {
  align-items: center;
}
.prod-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg);
  flex-shrink: 0;
}
.prod-photo-fallback {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.prod-card .info { flex: 1; min-width: 0; }
.prod-card .name { font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.prod-card .meta { font-size: 0.95rem; color: var(--text); font-weight: 700; }
.prod-card .meta .meta-extra { color: var(--hint); font-weight: 500; font-size: 0.82rem; }
.prod-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: center;
}
.prod-actions button {
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}
.prod-actions .add { background: var(--accent); color: var(--accent-text); min-width: 40px; }
.prod-actions .add.has-qty { font-variant-numeric: tabular-nums; }
.prod-actions .fav {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.prod-actions .fav.active { color: #e11d48; border-color: #fecdd3; background: #fff1f2; }
#tab-cart:not(.hidden) {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--header-h) - var(--nav-h) - env(safe-area-inset-bottom, 0px) - 28px);
  min-height: 0;
}
.cart-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
.cart-hero, .fav-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.cart-hero-badge, .fav-hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(26, 58, 110, 0.1);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 8px;
}
.cart-hero-title, .fav-hero-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.cart-hero-sub, .fav-hero-sub {
  margin: 6px 0 0;
  font-size: 0.86rem;
  color: var(--hint);
  line-height: 1.4;
}
.fav-page { display: flex; flex-direction: column; gap: 12px; }
.fav-list { margin-top: 0; }
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.cart-item.invalid { border-color: #fecaca; background: #fffbfb; }
.cart-line-sum {
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}
.cart-item .cart-photo {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}
.cart-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--hint);
}
.cart-item .cart-body { flex: 1; min-width: 0; }
.cart-name { font-weight: 600; font-size: 0.94rem; line-height: 1.3; }
.cart-promo { font-size: 0.82rem; color: var(--hint); margin-top: 2px; }
.cart-price { font-size: 0.95rem; margin-top: 4px; color: var(--text); font-weight: 700; }
.cart-unit { color: inherit; font-size: inherit; font-weight: inherit; }
.cart-item .warn { color: var(--danger); font-size: 0.82rem; margin-top: 4px; }
.cart-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}
.cart-actions input {
  width: 64px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-align: center;
  font-weight: 600;
}
.qty-btn, .cart-del {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.cart-del { margin-left: auto; color: var(--danger); border-color: #fecaca; }
.cart-summary {
  margin-top: 0;
  position: static;
  flex-shrink: 0;
  z-index: 8;
  background: var(--card);
}
.cart-total-row--sum strong { color: var(--accent); }
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.cart-total-row strong { font-size: 1.2rem; }
.cart-min { font-size: 0.85rem; color: var(--hint); margin-bottom: 10px; }
.cart-summary .btn { margin-top: 8px; }
.cart-summary .btn:first-of-type { margin-top: 0; }
.cart-empty {
  text-align: center;
  padding: 48px 20px;
}
.cart-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.7; }
.cart-empty-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 6px; }
.cart-empty-hint { color: var(--hint); font-size: 0.9rem; margin: 0 0 20px; }
.cart-empty .btn { max-width: 280px; margin: 0 auto; }
.fav-empty {
  text-align: center;
  padding: 48px 22px;
  max-width: 340px;
  margin: 0 auto;
}
.fav-empty-icon { margin-bottom: 14px; display: flex; justify-content: center; }
.fav-empty-title { font-size: 1.12rem; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.fav-empty-hint {
  color: var(--hint);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 22px;
}
.fav-empty .btn { max-width: 280px; margin: 0 auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
}
.btn.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn.danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn.block { width: 100%; }
.btn.block + .btn.block { margin-top: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.menu-list { display: flex; flex-direction: column; gap: 12px; }
.menu-section { margin-bottom: 18px; }
.menu-section + .menu-section { margin-top: 6px; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  color: inherit;
  box-shadow: var(--shadow);
}
.profile-grid { display: grid; gap: 8px; font-size: 0.95rem; }
.profile-grid dt { color: var(--hint); font-size: 0.82rem; }
.profile-grid dd { margin: 0 0 8px; }
.account-card {
  padding: 18px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.account-card-title {
  margin: 0 0 16px;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.account-grid {
  display: grid;
  gap: 0;
  margin: 0;
}
.account-grid dt {
  margin: 14px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.01em;
}
.account-grid dt:first-of-type { margin-top: 0; }
.account-grid dd {
  margin: 4px 0 0;
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}
.account-grid dd code {
  font-family: inherit;
  font-size: 1.08rem;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--brand-blue);
  padding: 3px 8px;
  border-radius: 8px;
}
.account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
.account-actions .btn {
  font-size: 1rem;
  min-height: 48px;
}
.account-legal {
  margin: 4px 0 0;
  font-size: 0.98rem;
}
.account-legal a {
  color: var(--brand-blue);
  font-weight: 600;
}
.order-card, .return-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.order-card .status, .return-card .status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  margin-bottom: 6px;
}
.return-text-input {
  width: 100%;
  min-height: 140px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  background: var(--card);
  color: var(--text);
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: none;
  bottom: 0;
  z-index: 600;
  width: 100%;
  max-width: 560px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-top: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  outline: none;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.bottom-nav::before,
.bottom-nav::after {
  content: none !important;
  display: none !important;
}
.bottom-nav button {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hint);
  cursor: pointer;
  padding: 4px 2px 6px;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 100%;
  transition: color 0.15s ease, background-color 0.12s ease;
}
.bottom-nav button .ico {
  width: 40px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.28rem;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.14s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.app.sa-mode .bottom-nav button,
.app.mgr-mode .bottom-nav button {
  transition: color 0.15s ease, background-color 0.12s ease;
}
.app.sa-mode .bottom-nav button .ico,
.app.mgr-mode .bottom-nav button .ico {
  transition: transform 0.14s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.bottom-nav button:active,
.app.sa-mode .bottom-nav button:active,
.app.mgr-mode .bottom-nav button:active {
  background-color: rgba(15, 23, 42, 0.08);
}
.bottom-nav button:active .ico,
.app.sa-mode .bottom-nav button:active .ico,
.app.mgr-mode .bottom-nav button:active .ico {
  transform: scale(0.86);
}
.bottom-nav button .nav-label {
  display: block;
  width: 100%;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1px;
}
.bottom-nav button.active { color: var(--brand-blue); }
.bottom-nav button .nav-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.bottom-nav .nav-ico-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.bottom-nav .nav-ico-img--boost {
  width: 30px;
  height: 30px;
}
.fav-empty-icon .nav-ico-img {
  width: 48px;
  height: 48px;
  opacity: 0.35;
}
.bottom-nav .badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav .badge.hidden { display: none; }
.bottom-nav .badge.pulse,
.bottom-nav button.cart-pop .ico {
  animation: cart-pop 0.35s ease;
}
@keyframes cart-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.cart-fly {
  position: fixed;
  z-index: 2000;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  pointer-events: none;
  left: 0;
  top: 0;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.55s ease;
}
.screen-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 45vh;
  gap: 12px;
  padding: 24px 8px;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 1200;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(140%);
  transition: transform 0.25s ease, opacity 0.2s ease;
  max-width: 528px;
  margin: 0 auto;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}
.toast.show {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}
.toast.err { background: #fef2f2; color: var(--danger); }
.toast.ok { background: #f0fdf4; color: var(--ok); }
.hidden { display: none !important; }
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: none;
  width: 100%;
  max-width: 560px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  z-index: 150;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.overlay.hidden {
  display: none !important;
  pointer-events: none !important;
}
.overlay .overlay-head {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.overlay .overlay-head input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}
.overlay .overlay-body { flex: 1; overflow: auto; padding: 12px 14px; }
#promo-overlay {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 100%;
  max-width: 560px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  z-index: 180;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
#promo-overlay.hidden { display: none; }
#promo-card {
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 16px;
}
#promo-card img.banner, #promo-card video.banner { width: 100%; border-radius: 10px; margin-bottom: 10px; }
#promo-card .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
#promo-card .actions button { padding: 12px; border: none; border-radius: 10px; font-size: 1rem; }
#promo-card .actions button.primary { background: var(--accent); color: var(--accent-text); }
#promo-card .actions button.ghost { background: var(--bg); color: inherit; }
.empty { text-align: center; color: var(--hint); padding: 28px 12px; font-size: 0.92rem; }
.prod-card { cursor: pointer; }
.prod-card .info { cursor: pointer; }
#subview-host:not(.hidden) {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.product-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 0 0 8px;
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100dvh - var(--header-h) - var(--nav-h) - env(safe-area-inset-bottom, 0px) - 12px);
}
.product-detail.panel { padding: 0 0 8px; }
.product-detail-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 8px 12px 0;
  background: #fff;
  border: none;
  border-radius: 0;
  overflow: hidden;
  flex: 0 0 auto;
  height: min(46vh, 320px);
  max-height: min(46vh, 320px);
  min-height: 140px;
}
.product-detail .hero {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: min(46vh, 320px);
  min-height: 0;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: #fff;
  border: none;
  pointer-events: none;
}
.product-detail h2,
.product-detail .price,
.product-detail .meta-line,
.product-detail .stock,
.product-detail .actions-row {
  flex-shrink: 0;
  padding-left: 14px;
  padding-right: 14px;
}
.product-detail h2 {
  font-size: 1.05rem;
  line-height: 1.3;
}
.product-detail .price { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.product-detail .price .price-unit { color: inherit; font-size: inherit; font-weight: inherit; }
.product-detail .meta-line { color: var(--hint); font-size: 0.9rem; }
.product-detail .stock { font-size: 0.9rem; margin-top: 4px; }
.product-detail .actions-row {
  display: flex;
  gap: 10px;
  margin-top: auto;
  position: static;
  z-index: 4;
  background: var(--card);
  padding-top: 10px;
  padding-bottom: 12px;
}
.product-detail .actions-row .btn { flex: 1; }
.search-section { margin-bottom: 16px; }
.search-promo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.search-promo-tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
}
.search-promo-tile img { width: 100%; height: 80px; object-fit: cover; }
.search-promo-tile .t { padding: 8px; font-size: 0.82rem; font-weight: 600; }
.menu-section { margin-bottom: 14px; }
.menu-item.danger { color: var(--danger); }
.menu-section h3 { margin: 0 0 8px; font-size: 0.88rem; color: var(--hint); text-transform: uppercase; letter-spacing: 0.04em; }
.pager { display: flex; gap: 8px; margin-top: 12px; }
.pager button { flex: 1; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.auth-shell {
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 0 16px;
}
.auth-hero {
  text-align: center;
  padding: 0 8px 2px;
}
.auth-hero-logo {
  width: min(88vw, 220px);
  height: auto;
  max-height: 168px;
  max-width: min(88vw, 220px);
  object-fit: contain;
  margin: 0 auto 4px;
  display: block;
}
#setup-logo:not([src]),
#setup-logo.hidden,
#screen-setup.hidden .auth-hero-logo {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
img.brand-logo {
  width: auto;
  height: 34px;
  max-width: 132px;
  object-fit: contain;
}
.auth-hero--branded .auth-hero-title { display: none; }
.auth-hero-icon {
  font-size: 2.25rem;
  line-height: 1;
  margin-bottom: 6px;
}
.auth-hero-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.auth-hero-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--hint);
  line-height: 1.4;
}
.auth-card {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
}
.auth-panel-body { display: flex; flex-direction: column; gap: 2px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 14px;
  background: #f1f5f9;
}
.auth-tabs button {
  padding: 11px 10px;
  border-radius: 11px;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.92rem;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.auth-tabs button.active {
  background: #fff;
  color: var(--brand-blue);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.auth-field { margin-bottom: 12px; text-align: left; }
.auth-field label span {
  display: block;
  color: #475569;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}
.auth-field input,
.auth-field select {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.auth-field-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--hint);
  line-height: 1.4;
}
.auth-field-warn {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #b45309;
  line-height: 1.4;
  background: #fffbeb;
  border-radius: 8px;
  padding: 6px 8px;
}
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
  text-align: left;
  cursor: pointer;
}
.auth-terms input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--brand-blue);
}
.auth-terms a {
  color: var(--brand-blue);
  font-weight: 600;
  text-decoration: none;
}
.auth-terms a:active { opacity: 0.75; }
.legal-overlay-head h3 { margin: 0; font-size: 1rem; flex: 1; }
.legal-overlay-head { align-items: center; }
.legal-overlay-body { font-size: 0.9rem; line-height: 1.55; }
.legal-overlay-body section { margin-bottom: 16px; }
.legal-overlay-body h2 { font-size: 1.05rem; margin: 0 0 8px; }
.legal-overlay-body h3 { font-size: 0.95rem; margin: 12px 0 6px; }
.legal-overlay-body ul { margin: 0; padding-left: 18px; }
.auth-role-block { margin-bottom: 12px; text-align: left; }
.auth-role-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}
.auth-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.auth-role-card.selected {
  border-color: var(--brand-blue);
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.auth-role-card-icon { font-size: 1.35rem; line-height: 1.2; }
.auth-role-card-title { font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.auth-role-card-desc { font-size: 0.72rem; color: var(--hint); line-height: 1.3; }
.auth-submit { margin-top: 6px; padding: 13px; font-size: 1rem; border-radius: 12px; }
.auth-submit:disabled {
  opacity: 1;
  background: #94a3b8 !important;
  border-color: #94a3b8 !important;
  color: #f8fafc !important;
  cursor: not-allowed;
  box-shadow: none;
}
.auth-dev-label {
  font-size: 0.85rem;
  color: var(--hint);
  margin: 14px 0 8px;
  text-align: left;
}
.auth-success-wrap { width: 100%; text-align: left; }
.auth-cred-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.auth-cred-box {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
}
.auth-cred-box.staff-id { border-color: #fde68a; background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%); }
.auth-cred-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 6px;
}
.auth-cred-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #0f172a;
  word-break: break-all;
  cursor: pointer;
}
.auth-cred-value:active { opacity: 0.7; }
.auth-cred-copy { font-size: 0.72rem; color: var(--hint); margin-top: 4px; }
.auth-steps {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.55;
}
.auth-steps li { margin-bottom: 6px; }
.auth-steps li:last-child { margin-bottom: 0; }
.auth-success-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  margin: 0 auto 12px;
}
.auth-success-badge.staff {
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
}
.auth-success-lead {
  text-align: center;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 4px;
}
.auth-steps-card {
  margin: 14px 0;
  padding: 12px 14px;
  background: #fff;
}
.auth-steps-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.auth-birthday-card {
  margin: 14px 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
  border-color: #fde68a;
}
.auth-success-wrap > .btn.block { margin-top: 12px; }
.auth-success-wrap > .btn.block + .btn.block { margin-top: 10px; }
#setup-join-host { margin: 12px 16px 20px; }
.auth-birthday-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.auth-birthday-icon { font-size: 1.5rem; line-height: 1; }
.auth-birthday-field { display: block; margin-bottom: 6px; }
.auth-birthday-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.auth-birthday-actions .btn { flex: 1; }
.auth-birthday-ok {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0fdf4;
  color: var(--ok);
  font-weight: 600;
}
.btn.ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--hint);
}
.dev-preview-btns { display: flex; flex-direction: column; gap: 8px; }
.auth-login-type { display: flex; gap: 8px; margin-bottom: 12px; }
.auth-login-type button {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
}
.auth-login-type button.active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.day-chips label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 0;
  cursor: pointer;
  font-size: 0.85rem;
}
.day-chips input { width: auto; margin: 0; }
.catalog-blocked {
  padding: 16px;
  border-radius: var(--radius);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.action-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.action-row .btn { flex: 1; min-width: 140px; }
.btn.accent-orange { background: var(--brand-orange); color: #fff; }
.return-qty { width: 80px; padding: 8px; border-radius: 8px; border: 1px solid var(--border); }
.return-line { padding: 10px 0; border-bottom: 1px solid var(--border); }
.return-line:last-child { border-bottom: none; }

.mgr-panel { padding: 4px 0 24px; }
.mgr-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.mgr-stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.mgr-stat--accent { border-color: var(--brand); background: #eef2ff; }
.mgr-stat-val { font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.mgr-stat-label { font-size: 0.78rem; color: var(--hint); margin-top: 4px; }
.mgr-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.mgr-action-btn {
  display: block;
  width: 100%;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.25;
  cursor: pointer;
}
.mgr-action-btn:active { opacity: 0.85; }
.mgr-periods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.mgr-period-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.mgr-order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mgr-order-actions .btn { flex: 1; min-width: 120px; padding: 10px 8px; font-size: 0.88rem; }
.mgr-store-card { width: 100%; text-align: left; cursor: pointer; border: 1px solid var(--border); background: var(--card); }
.mgr-select { width: 100%; margin-top: 6px; padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
.mgr-report-body, .order-body { white-space: pre-wrap; font-family: inherit; font-size: 0.88rem; line-height: 1.45; margin-top: 12px; background: var(--bg); padding: 10px; border-radius: 8px; overflow-x: auto; }
.order-detail .status { display: inline-block; margin-bottom: 8px; }
.order-items { margin: 10px 0 0 18px; font-size: 0.9rem; }
.menu-item.active { border-color: var(--brand); background: #eef2ff; }
.mgr-prod-card { margin-bottom: 10px; }
.mgr-photo-preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; background: var(--bg); }
.mgr-photo-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mgr-photo-actions .btn { text-align: left; font-size: 0.95rem; font-weight: 600; color: var(--text); }
.app.mgr-mode .menu-item.mgr-photo-cat-item {
  font-size: 1rem;
  font-weight: 600;
  color: #0f2744;
  line-height: 1.35;
  padding: 14px 16px;
}
.mgr-photo-cat-label { flex: 1; min-width: 0; word-break: break-word; }
.mgr-photo-cat-count { color: #475569; font-weight: 700; }
.mgr-photo-cat-arrow { color: var(--mgr-blue); font-size: 1.2rem; font-weight: 700; flex-shrink: 0; margin-left: 8px; }
.mgr-photo-panel { margin-bottom: 12px; }
.mgr-photo-toolbar { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.mgr-photo-search {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
}
.mgr-photo-product-list { display: flex; flex-direction: column; gap: 8px; }
.mgr-photo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mgr-photo-filter {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.mgr-photo-filter.active {
  background: var(--mgr-blue);
  border-color: var(--mgr-blue);
  color: #fff;
}
.mgr-photo-title { margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; color: #0f2744; line-height: 1.3; }
.mgr-photo-stats { margin: 0; font-size: 0.92rem; font-weight: 600; color: #334155; line-height: 1.45; }
.mgr-photo-product-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.mgr-photo-product-icons { flex-shrink: 0; font-size: 0.95rem; line-height: 1.4; }
.mgr-photo-product-body { flex: 1; min-width: 0; }
.mgr-photo-product-name { font-size: 0.98rem; font-weight: 700; color: #0f172a; line-height: 1.35; margin-bottom: 4px; word-break: break-word; }
.mgr-photo-product-meta { font-size: 0.88rem; font-weight: 600; color: #475569; }
.mgr-photo-product-title { margin: 0 0 8px; font-size: 1.08rem; font-weight: 800; color: #0f2744; line-height: 1.35; }
.mgr-form-hint { font-size: 0.92rem; color: #334155; line-height: 1.45; margin: 0 0 12px; }
.mgr-day-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mgr-day-chip {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f2744;
  cursor: pointer;
}
.mgr-day-chip.active { background: #e8eef8; border-color: var(--mgr-blue); color: var(--mgr-blue); }
.mgr-staff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.mgr-staff-id { font-size: 0.92rem; font-weight: 700; color: #0f2744; }
.mgr-staff-meta { font-size: 0.84rem; color: #475569; }
.mgr-staff-remove { flex-shrink: 0; padding: 8px 12px; font-size: 0.82rem; }
.guide-body { white-space: pre-wrap; line-height: 1.5; font-size: 0.92rem; }

/* Super Admin — Mini App */
.app.sa-mode {
  --sa-gold: #f59e0b;
  --sa-navy: #1e3a5f;
  --sa-navy-deep: #0f2744;
  background: linear-gradient(180deg, #eef2f8 0%, var(--bg) 220px);
}
.sa-panel { padding: 4px 12px 28px; }
.sa-hero {
  background: linear-gradient(135deg, var(--sa-navy-deep) 0%, var(--sa-navy) 55%, #2d4a7a 100%);
  color: #fff;
  border-radius: 18px;
  padding: 16px 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(15, 39, 68, 0.18);
}
.sa-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sa-hero-logo {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sa-hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.sa-hero-top .sa-hero-badge { margin-bottom: 0; }
.sa-hero-sub { margin: 6px 0 0; font-size: 0.82rem; color: rgba(255, 255, 255, 0.78); line-height: 1.4; }
.sa-hero-title { margin: 0; font-size: 1.18rem; font-weight: 800; line-height: 1.25; color: #fff; }
.sa-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.sa-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.sa-stat--accent { border-color: #fbbf24; background: linear-gradient(180deg, #fffbeb 0%, #fff 100%); }
.sa-stat-icon { font-size: 1.25rem; line-height: 1; margin-bottom: 6px; }
.sa-stat-val { font-size: 1.2rem; font-weight: 800; line-height: 1.15; color: var(--text); }
.sa-stat-label { font-size: 0.76rem; color: var(--hint); margin-top: 4px; }
.sa-revenue-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.sa-revenue-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sa-revenue-label { font-size: 0.78rem; color: var(--hint); }
.sa-revenue-val { font-size: 1rem; font-weight: 800; color: var(--brand-orange); white-space: nowrap; }
.sa-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}
.sa-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.sa-toggle-title { font-size: 0.92rem; font-weight: 700; }
.sa-toggle-sub { font-size: 0.78rem; color: var(--hint); }
.sa-toggle-switch {
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.15s ease;
}
.sa-toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease;
}
.sa-toggle.on .sa-toggle-switch { background: #16a34a; }
.sa-toggle.on .sa-toggle-switch::after { transform: translateX(20px); }
.sa-section { margin-bottom: 16px; }
.sa-section-title {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sa-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sa-action-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.sa-action-card:active { transform: scale(0.98); box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08); }
.sa-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e8eef8;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.sa-action-label { font-size: 0.9rem; font-weight: 600; line-height: 1.25; flex: 1; min-width: 0; }
.sa-action-card--companies {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}
.sa-action-card--companies .sa-action-icon,
.sa-action-card--new .sa-action-icon,
.sa-action-card--analytics .sa-action-icon,
.sa-action-card--load .sa-action-icon {
  background: rgba(255, 255, 255, 0.22);
}
.sa-action-card--new {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.28);
}
.sa-action-card--analytics {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.28);
}
.sa-action-card--load {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.28);
}
.sa-company-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  color: var(--text);
}
.sa-company-card:active { opacity: 0.9; }
.sa-company-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sa-company-head b { font-size: 0.95rem; line-height: 1.3; flex: 1; }
.sa-company-meta { margin-top: 6px; font-size: 0.78rem; color: var(--hint); }
.sa-status {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.sa-status--active { background: #dcfce7; color: #166534; }
.sa-status--paused { background: #fef3c7; color: #92400e; }
.sa-status--archived { background: #f3f4f6; color: #6b7280; }
.sa-profile-hero {
  background: linear-gradient(135deg, var(--sa-navy-deep) 0%, var(--sa-navy) 100%);
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.sa-profile-panel { border-top: 3px solid var(--sa-gold); }
.sa-subpanel { border-radius: 14px; }
.sa-form-panel .sa-field span { display: block; font-size: 0.82rem; color: var(--hint); margin-bottom: 6px; }
.sa-form-panel input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}
.app.sa-mode .home-top-bar,
.app.mgr-mode .home-top-bar {
  display: none !important;
}
.app.sa-mode .header h1 { color: var(--sa-navy); }

/* Manager — Mini App */
.app.mgr-mode {
  --mgr-blue: var(--brand-blue);
  --mgr-blue-deep: #142d52;
  background: linear-gradient(180deg, #eef3fa 0%, var(--bg) 220px);
}
.mgr-home { padding: 4px 0 24px; }
.mgr-hero {
  background: linear-gradient(135deg, var(--mgr-blue-deep) 0%, var(--mgr-blue) 55%, #2a5088 100%);
  color: #fff;
  border-radius: 18px;
  padding: 18px 16px 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(26, 58, 110, 0.2);
}
.mgr-hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(249, 115, 22, 0.22);
  color: #fed7aa;
  border: 1px solid rgba(249, 115, 22, 0.45);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.mgr-hero-title { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.25; }
.mgr-hero-sub { margin: 6px 0 0; font-size: 0.82rem; color: rgba(255, 255, 255, 0.78); line-height: 1.4; }
.mgr-hero-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.mgr-period-chip {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mgr-period-chip:hover { background: rgba(255, 255, 255, 0.18); }
.mgr-period-chip.active {
  background: #fff;
  color: var(--mgr-blue);
  border-color: #fff;
  box-shadow: 0 2px 10px rgba(15, 39, 68, 0.18);
}
.mgr-period-chip:active { transform: scale(0.97); }
.mgr-profile-hero {
  background: linear-gradient(135deg, var(--mgr-blue-deep) 0%, var(--mgr-blue) 100%);
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.mgr-profile-hero--compact { padding: 14px; margin-bottom: 12px; border-radius: 14px; }
.mgr-alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: linear-gradient(90deg, #fff1f2 0%, #fff 100%);
  color: #9f1239;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
}
.mgr-alert-icon { font-size: 1.25rem; flex-shrink: 0; }
.mgr-alert-text { flex: 1; font-size: 0.88rem; line-height: 1.35; }
.mgr-alert-go { font-size: 1.2rem; color: #be123c; font-weight: 700; }
.mgr-alert-banner--return {
  border-color: #fde68a;
  background: linear-gradient(90deg, #fffbeb 0%, #fff 100%);
  color: #92400e;
}
.mgr-alert-banner--return .mgr-alert-go { color: #d97706; }
.mgr-alert-banner--cats {
  border-color: #bfdbfe;
  background: linear-gradient(90deg, #eff6ff 0%, #fff 100%);
  color: #1e3a8a;
}
.mgr-alert-banner--cats .mgr-alert-go { color: #1d4ed8; }
.mgr-action-card--cats {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}
.mgr-action-card--cats .mgr-action-icon {
  background: rgba(255, 255, 255, 0.22);
}
.mgr-action-card--cats .mgr-action-label { font-weight: 700; }
:root.tg-dark .mgr-action-card--cats .mgr-action-icon,
html.tg-dark .mgr-action-card--cats .mgr-action-icon {
  background: rgba(255, 255, 255, 0.24);
}
.mgr-dash-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.mgr-dash-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.mgr-dash-stat--accent { border-color: #f97316; background: linear-gradient(180deg, #fff7ed 0%, #fff 100%); }
.mgr-dash-stat--sales {
  border-color: #22c55e;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.15);
}
.mgr-dash-stat--sales .mgr-dash-stat-val { font-size: 1.15rem; }
.mgr-dash-stat--sales .mgr-dash-stat-label { color: #166534; font-weight: 600; }
.mgr-dash-stat-icon { font-size: 1.2rem; margin-bottom: 6px; }
.mgr-dash-stat-val {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--tg-theme-text-color, var(--mgr-blue));
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.85),
    0 0 3px rgba(255, 255, 255, 0.45);
}
:root.tg-dark .mgr-dash-stat-val,
html.tg-dark .mgr-dash-stat-val {
  color: var(--tg-theme-text-color, #fff);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.mgr-dash-stat--sales .mgr-dash-stat-val {
  color: var(--tg-theme-link-color, #15803d);
}
:root.tg-dark .mgr-dash-stat--sales .mgr-dash-stat-val,
html.tg-dark .mgr-dash-stat--sales .mgr-dash-stat-val {
  color: #86efac;
}
.mgr-dash-stat-label { font-size: 0.76rem; color: var(--hint); margin-top: 4px; }
.mgr-dash-stats--extra { margin-bottom: 16px; }
.mgr-dash-stats--extra .mgr-dash-stat-val { font-size: 0.95rem; }
.mgr-dash-stats--extra .mgr-dash-stat-label { font-size: 0.7rem; line-height: 1.25; }
.mgr-section { margin-bottom: 16px; }
.mgr-section-title {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mgr-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mgr-action-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: transform 0.12s ease;
}
.mgr-action-card:active { transform: scale(0.98); }
.mgr-action-card--promo {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.32);
}
.mgr-action-card--promo .mgr-action-icon {
  background: rgba(255, 255, 255, 0.22);
}
.mgr-action-card--promo .mgr-action-label { font-weight: 700; }
.mgr-action-card--newprod {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.30);
}
.mgr-action-card--newprod .mgr-action-icon {
  background: rgba(255, 255, 255, 0.22);
}
.mgr-action-card--newprod .mgr-action-label { font-weight: 700; }
:root.tg-dark .mgr-action-card--promo .mgr-action-icon,
html.tg-dark .mgr-action-card--promo .mgr-action-icon,
:root.tg-dark .mgr-action-card--newprod .mgr-action-icon,
html.tg-dark .mgr-action-card--newprod .mgr-action-icon {
  background: rgba(255, 255, 255, 0.24);
}
.mgr-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e8eef8;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  overflow: hidden;
}
.mgr-action-icon img,
.mgr-action-icon svg {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}
:root.tg-dark .mgr-action-icon,
html.tg-dark .mgr-action-icon {
  background: rgba(255, 255, 255, 0.12);
}
.mgr-action-label { font-size: 0.9rem; font-weight: 600; line-height: 1.25; flex: 1; min-width: 0; }
.mgr-entity-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  color: var(--text);
}
.mgr-entity-card--static { cursor: default; }
.mgr-entity-card:active:not(.mgr-entity-card--static) { opacity: 0.92; }
.mgr-entity-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  margin-bottom: 4px;
}
.mgr-entity-head b,
.mgr-entity-title {
  font-size: 0.95rem;
  min-width: 0;
  word-break: break-word;
}
.mgr-entity-code {
  font-size: 0.78rem;
  background: #eef2ff;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  justify-self: end;
}
.mgr-entity-sum { font-size: 1rem; font-weight: 800; color: var(--mgr-blue); margin: 4px 0; }
.mgr-entity-meta { font-size: 0.82rem; color: var(--hint); margin-top: 4px; }
.mgr-entity-return-flag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}
.mgr-order-returns { margin-top: 14px; }
.mgr-entity-card--return {
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}
.mgr-entity-preview { font-size: 0.84rem; margin-top: 8px; line-height: 1.4; color: var(--text); }
.mgr-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
  padding: 0 2px;
  font-size: 0.82rem;
  color: var(--hint);
}
.mgr-list-head b { font-size: 1rem; color: var(--mgr-blue); }
.mgr-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8eef8;
  color: var(--mgr-blue);
}
.mgr-status--pending { background: #ffedd5; color: #c2410c; }
.mgr-status--accepted { background: #dcfce7; color: #15803d; }
.mgr-status--cancelled { background: #fee2e2; color: #b91c1c; }
.mgr-mkt-editor { display: flex; flex-direction: column; gap: 10px; }
.mgr-mkt-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.mgr-mkt-prod-results { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.mgr-campaign-card { cursor: pointer; }
.mgr-detail-btn { margin-top: 10px; }
.mgr-empty-state { line-height: 1.6; padding: 28px 16px; }
.mgr-profile-panel { border-top: 3px solid var(--brand-orange); }
.mgr-profile-grid dt { font-size: 0.9rem; font-weight: 650; }
.mgr-profile-grid dd { font-size: 1.08rem; font-weight: 700; margin-bottom: 10px; }
.mgr-profile-grid code { font-size: 1.05rem; font-weight: 700; }
.mgr-profile-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.mgr-profile-actions .btn.block + .btn.block { margin-top: 0; }
.mgr-form-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.mgr-form-actions .btn.block + .btn.block { margin-top: 0; }
.mgr-more-profile { margin: 10px 0 0; text-align: left; }
.mgr-more-profile dt { margin-top: 6px; }
.mgr-subpanel { border-radius: 14px; }
.mgr-form-panel .mgr-field { display: block; margin-bottom: 4px; }
.mgr-form-panel .mgr-field + .btn.block { margin-top: 12px; }
.mgr-form-panel .mgr-field span { display: block; font-size: 0.82rem; color: var(--hint); margin-bottom: 6px; }
.mgr-form-panel input,
.mgr-form-panel textarea,
.mgr-search-input,
.mgr-dict-search {
  -webkit-user-select: text;
  user-select: text;
}
.mgr-form-panel input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}
.mgr-form-result { margin-top: 12px; }
.mgr-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.mgr-setting-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.mgr-setting-val { display: block; font-size: 1rem; font-weight: 800; color: var(--mgr-blue); }
.mgr-setting-lbl { display: block; font-size: 0.72rem; color: var(--hint); margin-top: 4px; }
.mgr-team-note, .mgr-bot-hint { margin-top: 12px; }
.mgr-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.mgr-search-icon { font-size: 1rem; flex-shrink: 0; opacity: 0.7; }
.mgr-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
}
.mgr-store-detail { padding-bottom: 8px; }
.mgr-store-hero-panel { margin-bottom: 12px; }
.mgr-store-recent {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--hint);
}
.mgr-store-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.mgr-connect-hint {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #fffbeb;
  font-size: 0.88rem;
  line-height: 1.45;
}
.mgr-connect-hint b { color: var(--brand-orange); }
.mgr-store-action-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.mgr-store-action-btn:active { opacity: 0.92; }
.mgr-cat-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px 8px 6px 6px;
}
.mgr-cat-sort {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.mgr-cat-arrow {
  width: 32px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}
.mgr-cat-open {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 6px 4px;
  color: inherit;
}
.mgr-cat-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
}
.mgr-cat-actions .btn { flex: 1; }
.mgr-cat-move-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 12px;
}
.mgr-cat-move-row .mgr-select { flex: 1; }
.mgr-cat-prod {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 8px;
}
.mgr-cat-prod input { margin-top: 3px; }
.mgr-cat-prod .mgr-dict-sub { display: block; }
.mgr-cat-hits { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.mgr-cat-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
}
.mgr-field-label {
  display: block;
  margin: 8px 0 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}
.mgr-store-action-btn--danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}
.mgr-store-panel {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.app.mgr-mode .bottom-nav button.active .nav-label { color: var(--mgr-blue); font-weight: 700; }
.app.mgr-mode .header h1 { color: var(--mgr-blue); }
.mgr-period-btn.active { background: var(--mgr-blue); color: #fff; border-color: var(--mgr-blue); }

/* Працівники — картки */
.mgr-emp-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
}
.mgr-emp-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.mgr-emp-hero-title { font-size: 1.1rem; font-weight: 700; }
.mgr-emp-hero-sub { font-size: 0.88rem; opacity: 0.9; margin-top: 4px; }
.mgr-emp-tools { margin-bottom: 12px; }
.mgr-emp-grid { display: flex; flex-direction: column; gap: 10px; }
.mgr-emp-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
}
.mgr-emp-card--blocked { opacity: 0.75; border-color: #fecaca; background: #fff8f8; }
.mgr-emp-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mgr-emp-card-body { flex: 1; min-width: 0; }
.mgr-emp-name { font-weight: 600; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-emp-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.mgr-emp-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
}
.mgr-emp-badge--bad { background: #fee2e2; color: #b91c1c; }
.mgr-emp-stores { font-size: 0.78rem; color: var(--hint); }
.mgr-emp-id { font-size: 0.75rem; color: var(--hint); margin-top: 2px; }
.mgr-emp-chevron { color: var(--hint); font-size: 1.2rem; }

/* Словники: типи / регіони */
.mgr-dict-panel { padding-top: 14px; }
.mgr-dict-panel > .btn.block { margin: 4px 0 14px; }
.mgr-dict-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mgr-dict-heading { margin: 0 0 4px; font-size: 1.05rem; }
.mgr-dict-desc { margin: 0; font-size: 0.85rem; color: var(--hint); line-height: 1.4; }
.mgr-dict-count {
  flex-shrink: 0;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--mgr-blue, var(--brand-blue));
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mgr-dict-toolbar { margin: 10px 0 4px; }
.mgr-dict-search {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
}
.mgr-dict-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.mgr-join-company {
  margin: 12px 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hint);
}
.onboard-join-host { margin: 12px 0 4px; }
.onboard-join-host .mgr-form-panel { margin: 0; }
.mgr-dict-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mgr-dict-card:active { transform: scale(0.99); }
.mgr-dict-card--type { border-left: 4px solid var(--brand-orange); }
.mgr-dict-card--region { border-left: 4px solid var(--mgr-blue, var(--brand-blue)); }
.mgr-dict-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mgr-dict-icon { font-size: 1.35rem; flex-shrink: 0; }
.mgr-dict-body { flex: 1; min-width: 0; }
.mgr-dict-title { display: block; font-weight: 600; font-size: 0.98rem; }
.mgr-dict-sub { display: block; font-size: 0.78rem; color: var(--hint); margin-top: 2px; }
.mgr-dict-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hint);
}
.mgr-dict-badge--all {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.mgr-dict-chevron { color: var(--hint); font-size: 1.1rem; }
.mgr-cat-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.mgr-cat-actions { display: flex; gap: 8px; }
.mgr-cat-selected-count { margin: 0 0 8px; font-size: 0.85rem; color: var(--hint); }
.mgr-cat-all-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  font-size: 0.92rem;
}
.mgr-sheets-card {
  margin-top: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(37, 99, 235, 0.01));
}
.mgr-sheets-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.mgr-sheets-title { margin: 0 0 2px; font-size: 0.98rem; }
.mgr-sheets-sub { margin: 0; font-size: 0.8rem; color: var(--hint); }
.mgr-check-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 8px;
  -webkit-overflow-scrolling: touch;
}
.mgr-check-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.9rem;
  cursor: pointer;
}
.mgr-check-chip--on {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}
.mgr-check-chip-text { flex: 1; line-height: 1.35; }
.mgr-check-chip input { width: 18px; height: 18px; flex-shrink: 0; }
.mgr-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.95rem;
}
.sa-stats--metrics { margin: 10px 0 8px; }
.sa-load-today {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg, #f6f8fa);
  font-size: 0.92rem;
  line-height: 1.45;
}
.sa-chart-card { margin-top: 8px; }
.sa-chart-legend { display: flex; gap: 12px; margin-bottom: 6px; font-size: 0.85rem; }
.sa-chart-key::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
.sa-chart-key--cpu::before { background: #2563eb; }
.sa-chart-key--ram::before { background: #d97706; }
.sa-load-chart { width: 100%; height: auto; display: block; }
.sa-chart-axis { font-size: 8px; fill: #6b7280; }

html.tg-dark {
  color-scheme: dark;
  --bg: var(--tg-theme-bg-color, #1c1c1e);
  --text: var(--tg-theme-text-color, #f4f4f5);
  --hint: var(--tg-theme-hint-color, #a1a1aa);
  --card: var(--tg-theme-secondary-bg-color, #2c2c2e);
  --border: rgba(255, 255, 255, 0.14);
  --danger: #f87171;
  --ok: #4ade80;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}
html.tg-dark,
html.tg-dark body,
html.tg-dark .app,
html.tg-dark .app.mgr-mode,
html.tg-dark .app.sa-mode {
  background: var(--bg);
  color: var(--text);
}
html.tg-dark .header .logo,
html.tg-dark .search-line,
html.tg-dark .auth-tabs button.active,
html.tg-dark .auth-steps-card,
html.tg-dark .auth-cred-box,
html.tg-dark .product-detail-photo,
html.tg-dark .product-detail .hero,
html.tg-dark .cart-item.invalid,
html.tg-dark .sa-stat--accent,
html.tg-dark .mgr-dash-stat--accent,
html.tg-dark .mgr-dash-stat--sales,
html.tg-dark .sa-status--archived,
html.tg-dark .mgr-emp-card--blocked,
html.tg-dark .panel,
html.tg-dark .prod-card,
html.tg-dark .mgr-setting-tile,
html.tg-dark .mgr-store-hero-panel,
html.tg-dark .mgr-entity-head,
html.tg-dark .cat-tile,
html.tg-dark .cat-row {
  background: var(--card);
  color: var(--text);
}
html.tg-dark .auth-cred-box.staff-id,
html.tg-dark .sa-stat--accent,
html.tg-dark .mgr-dash-stat--accent,
html.tg-dark .mgr-alert-banner {
  background: var(--card);
  background-image: none;
}
html.tg-dark .prod-photo-fallback {
  background: rgba(255, 255, 255, 0.08);
}
html.tg-dark .search-line { color: var(--hint); }
html.tg-dark .prod-actions .fav.active {
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.18);
}
html.tg-dark .btn.danger {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}
html.tg-dark .account-grid dd code {
  background: rgba(255, 255, 255, 0.1);
  color: #93c5fd;
}
html.tg-dark .account-grid dt {
  color: #94a3b8;
}
html.tg-dark .mgr-alert-banner,
html.tg-dark .mgr-alert-banner--return,
html.tg-dark .mgr-alert-banner--cats {
  background: var(--card);
  color: var(--text);
}
html.tg-dark .mgr-period-chip.active {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
html.tg-dark input,
html.tg-dark select,
html.tg-dark textarea {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
html.tg-dark .sa-action-icon {
  background: rgba(255, 255, 255, 0.12);
}
html.tg-dark .sa-stat-val {
  color: var(--text);
  text-shadow: none;
}
