:root {
  color-scheme: light dark;
  --bg: #edf4fb;
  --bg-deep: #d9e7f4;
  --text: #17202d;
  --muted: #788394;
  --muted-2: #9aa6b6;
  --blue: #1f7aff;
  --blue-soft: rgba(31, 122, 255, .14);
  --green: #2fb56f;
  --glass: rgba(255, 255, 255, .66);
  --glass-strong: rgba(255, 255, 255, .78);
  --stroke: rgba(136, 157, 188, .22);
  --shadow: 0 18px 48px rgba(72, 107, 143, .18), inset 0 1px 0 rgba(255,255,255,.68);
  --blur: blur(28px) saturate(1.28);
  --radius-lg: 18px;
  --radius-md: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121824;
    --bg-deep: #252d39;
    --text: #edf3fb;
    --muted: #a6b1c2;
    --muted-2: #7f8a9d;
    --blue: #68a6ff;
    --blue-soft: rgba(104, 166, 255, .18);
    --green: #57d98f;
    --glass: rgba(28, 36, 50, .62);
    --glass-strong: rgba(44, 54, 70, .78);
    --stroke: rgba(209, 224, 255, .16);
    --shadow: 0 22px 58px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255,255,255,.15);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf4fb;
  --bg-deep: #d9e7f4;
  --text: #17202d;
  --muted: #788394;
  --muted-2: #9aa6b6;
  --blue: #1f7aff;
  --blue-soft: rgba(31, 122, 255, .14);
  --green: #2fb56f;
  --glass: rgba(255, 255, 255, .66);
  --glass-strong: rgba(255, 255, 255, .78);
  --stroke: rgba(136, 157, 188, .22);
  --shadow: 0 18px 48px rgba(72, 107, 143, .18), inset 0 1px 0 rgba(255,255,255,.68);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121824;
  --bg-deep: #252d39;
  --text: #edf3fb;
  --muted: #a6b1c2;
  --muted-2: #7f8a9d;
  --blue: #68a6ff;
  --blue-soft: rgba(104, 166, 255, .18);
  --green: #57d98f;
  --glass: rgba(28, 36, 50, .62);
  --glass-strong: rgba(44, 54, 70, .78);
  --stroke: rgba(209, 224, 255, .16);
  --shadow: 0 22px 58px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255,255,255,.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(113, 171, 255, .26), transparent 28%),
    radial-gradient(circle at 85% 4%, rgba(255,255,255,.46), transparent 22%),
    linear-gradient(145deg, var(--bg), var(--bg-deep));
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.phone-shell {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 16px calc(84px + var(--safe-bottom));
  position: relative;
  overflow: hidden;
}

.phone-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 26%, rgba(255,255,255,.35) 34%, transparent 42% 100%);
  opacity: .35;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.login-view {
  min-height: calc(100vh - 36px);
  display: grid;
  align-content: center;
  gap: 16px;
}

.brand-mark,
.app-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  background: linear-gradient(145deg, #1778ff, #9fbaff);
  box-shadow: 0 16px 34px rgba(31,122,255,.3);
}

.login-view h1 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.login-view p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.login-card {
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  padding: 0 13px;
  outline: none;
  color: var(--text);
  background: rgba(255,255,255,.38);
}

@media (prefers-color-scheme: dark) {
  input {
    background: rgba(255,255,255,.08);
  }
}

input:focus,
select:focus {
  border-color: rgba(31,122,255,.55);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 14px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: linear-gradient(145deg, #1f7aff, #63a4ff);
  box-shadow: 0 12px 28px rgba(31,122,255,.28);
}

.secondary-button {
  background: rgba(126, 145, 169, .15);
}

.login-card small,
.dialog-card small {
  color: var(--muted-2);
}

.topbar {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  padding-top: 2px;
}

.company-block {
  min-width: 0;
}

.company-block strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.company-block span {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}

.user-pill {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.avatar {
  display: none;
}

.user-pill span:not(.avatar) {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill #userName {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 22px;
}

.user-pill em {
  display: none;
}

.user-pill i {
  color: var(--blue);
}

.user-pill > i {
  display: none;
}

.module-tabs {
  margin-top: 18px;
  padding: 4px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.module-tab {
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
}

.module-tab.active {
  color: var(--blue);
  background: rgba(255,255,255,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 8px 22px rgba(64, 104, 142, .13);
}

@media (prefers-color-scheme: dark) {
  .module-tab.active {
    background: rgba(255,255,255,.11);
  }
}

.search-panel,
.inventory-card,
.stock-preview,
.movement-preview,
.list-page {
  border-radius: var(--radius-lg);
  margin-top: 14px;
}

.search-panel {
  padding: 14px;
  position: relative;
  z-index: 30;
}

.app-view > .search-panel {
  margin-top: 0;
}

.module-panel {
  position: relative;
  z-index: 1;
}

.task-hero,
.task-panel,
.task-detail {
  border-radius: var(--radius-lg);
  margin-top: 12px;
  padding: 16px;
}

.task-hero {
  margin-top: 0;
  display: grid;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 40;
}

.task-search-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: center;
}

.task-search-row i {
  color: var(--blue);
  font-size: 23px;
}

.task-search-row input {
  min-height: 42px;
}

.task-suggest-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 66px;
  z-index: 160;
  display: grid;
  gap: 6px;
  max-height: min(420px, 58vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(136,157,188,.26);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(72, 107, 143, .24);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(31,122,255,.55) rgba(126,145,169,.16);
}

.task-suggest-panel::-webkit-scrollbar {
  width: 6px;
}

.task-suggest-panel::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(126,145,169,.16);
}

.task-suggest-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(31,122,255,.55);
}

:root[data-theme="dark"] .task-suggest-panel {
  background: #fff;
}

.task-suggest-item {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  text-align: left;
  touch-action: pan-y;
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.task-suggest-item strong {
  color: var(--blue);
}

.task-suggest-item span,
.task-suggest-item em,
.task-suggest-empty {
  color: var(--muted);
  font-size: 12px;
}

.task-suggest-item span,
.task-suggest-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-suggest-item em {
  grid-column: 2;
  font-style: normal;
}

.task-suggest-empty {
  padding: 12px;
}

.task-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.task-total span,
.task-metrics span,
.task-empty,
.task-result-list aside span,
.task-detail header span,
.task-detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.task-total strong {
  display: block;
  margin-top: 2px;
  font-size: 46px;
  line-height: 1;
  color: var(--text);
}

.task-total em {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--green);
  background: rgba(47,181,111,.15);
  font-style: normal;
  font-weight: 800;
}

.task-total em.pop {
  animation: task-pop .7s ease both;
}

.number-pop {
  animation: number-pop .45s ease both;
}

.task-ring {
  --task-percent: 0%;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--blue) var(--task-percent), rgba(126,145,169,.18) 0);
  position: relative;
}

.task-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--glass-strong);
}

.task-ring span {
  position: relative;
  z-index: 1;
  font-weight: 850;
}

.task-metrics {
  display: flex;
  gap: 10px;
}

.task-metrics span {
  flex: 1;
  border-radius: 13px;
  padding: 10px;
  background: rgba(255,255,255,.24);
}

.task-metrics strong {
  color: var(--text);
}

.task-progress,
.task-group-card i,
.task-class-chip i {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(126,145,169,.18);
}

.task-progress span,
.task-group-card b,
.task-class-chip b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width .45s ease;
}

.task-group-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 14px;
}

.task-group-unit {
  display: grid;
  gap: 0;
}

.task-group-card {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  background: rgba(255,255,255,.24);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  align-items: center;
  width: 100%;
}

.task-group-card.active,
.task-class-chip.active {
  border-color: rgba(31,122,255,.5);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.task-group-card span,
.task-class-chip span {
  font-weight: 760;
}

.task-group-card strong {
  font-size: 27px;
  line-height: 1;
  grid-row: 1 / span 2;
  grid-column: 2;
}

.task-group-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.task-group-card i {
  grid-column: 1 / -1;
}

.task-group-card small {
  position: absolute;
  right: 13px;
  bottom: 11px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.task-group-card {
  position: relative;
}

.task-group-card small span {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .24s ease;
}

.task-group-card.active small span {
  transform: rotate(225deg) translate(-2px, -2px);
  border-color: var(--blue);
}

.task-class-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  max-height: 0;
  overflow: hidden;
  padding: 0 8px;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height .32s ease, opacity .24s ease, transform .24s ease, padding .24s ease;
}

.task-class-list.expanded {
  max-height: 720px;
  opacity: 1;
  transform: translateY(0);
  padding: 8px 8px 2px;
}

.task-class-chip {
  border: 1px solid var(--stroke);
  border-radius: 13px;
  padding: 9px 10px;
  background: rgba(255,255,255,.3);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 10px;
  text-align: left;
}

.task-class-chip strong {
  color: var(--blue);
  font-size: 18px;
  grid-row: 1 / span 2;
  grid-column: 2;
}

.task-class-chip span {
  font-size: 14px;
}

.task-class-chip em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.task-class-chip i {
  grid-column: 1 / -1;
  height: 7px;
}

.task-result-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  touch-action: pan-y;
}

.task-item {
  border: 1px solid var(--stroke);
  border-radius: 15px;
  padding: 12px;
  background: rgba(255,255,255,.24);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  text-align: left;
  touch-action: pan-y;
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.task-item.tap-select,
.task-suggest-item.tap-select {
  transform: scale(.985);
  border-color: rgba(31,122,255,.48);
  box-shadow: 0 0 0 4px var(--blue-soft), 0 12px 28px rgba(31,122,255,.12);
  background: rgba(255,255,255,.66);
}

.task-item.tap-select::after,
.task-suggest-item.tap-select::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(31,122,255,.18), transparent);
  animation: task-card-sweep .48s ease both;
}

.task-item div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.task-item strong {
  color: var(--text);
}

.task-item span,
.task-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.task-item aside {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 4px;
  max-width: 116px;
}

.task-item aside strong {
  color: var(--blue);
  font-size: 12px;
}

.task-empty {
  padding: 14px;
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  background: rgba(255,255,255,.18);
}

.task-empty.compact {
  min-width: 100%;
}

.task-detail {
  display: grid;
  gap: 10px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.task-detail.task-just-completed {
  animation: task-detail-complete .88s ease both;
  border-color: rgba(47,181,111,.42);
}

.task-detail.task-just-completed::after {
  content: "";
  position: absolute;
  inset: -30%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(47,181,111,.22), transparent 48%);
  animation: task-complete-glow .9s ease both;
}

.task-detail header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.task-detail header div {
  display: grid;
  gap: 4px;
}

.task-detail h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.task-detail p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.task-detail-main {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.task-detail-grid span {
  display: grid;
  gap: 2px;
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(255,255,255,.23);
}

.task-detail-grid strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.task-image-tile {
  width: 78px;
  min-height: 78px;
  height: 78px;
  border-radius: 14px;
}

.task-image-tile img {
  min-height: 78px;
}

.task-actions {
  margin-top: 0;
}

.task-actions .action-button {
  min-height: 58px;
  padding: 9px 10px;
}

.task-actions .action-button i {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  font-size: 19px;
}

#taskImageEmpty[hidden],
#taskImage[hidden] {
  display: none !important;
}

.task-complete-burst {
  position: fixed;
  left: 50%;
  top: 42%;
  z-index: 220;
  width: min(250px, calc(100vw - 72px));
  transform: translate(-50%, -50%);
  border-radius: 18px;
  padding: 16px 18px;
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  pointer-events: none;
  animation: task-burst .95s ease both;
}

.task-complete-burst strong {
  color: var(--green);
  font-size: 25px;
}

.task-complete-burst span {
  color: var(--muted);
  font-size: 12px;
}

@keyframes task-pop {
  0% { transform: translateY(8px) scale(.9); opacity: 0; }
  35% { transform: translateY(0) scale(1.05); opacity: 1; }
  100% { transform: translateY(-6px) scale(1); opacity: 0; }
}

@keyframes number-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); color: var(--green); }
  100% { transform: scale(1); }
}

@keyframes task-card-sweep {
  from { transform: translateX(-80%); opacity: 0; }
  35% { opacity: 1; }
  to { transform: translateX(80%); opacity: 0; }
}

@keyframes task-detail-complete {
  0% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-3px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes task-complete-glow {
  from { opacity: 0; transform: scale(.82); }
  45% { opacity: 1; }
  to { opacity: 0; transform: scale(1.18); }
}

@keyframes task-burst {
  0% { opacity: 0; transform: translate(-50%, -44%) scale(.88); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
  72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(.96); }
}

@media (prefers-reduced-motion: reduce) {
  .task-total em.pop,
  .number-pop {
    animation: none;
  }

  .task-progress span,
  .task-group-card b {
    transition: none;
  }

  .task-item.tap-select,
  .task-suggest-item.tap-select,
  .task-detail.task-just-completed,
  .task-complete-burst {
    animation: none;
  }
}

.search-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  min-height: 46px;
  gap: 8px;
  border-bottom: 1px solid var(--stroke);
  padding-bottom: 8px;
}

.search-row i {
  color: var(--muted);
  font-size: 22px;
}

.search-row input {
  border: 0;
  background: transparent;
  padding: 0 0 0 6px;
  min-height: 38px;
}

.icon-button,
.filter-button,
.copy-button,
.mini-edit {
  border: 0;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  width: 36px;
  height: 36px;
}

.filter-button {
  width: auto;
  min-width: 74px;
  padding: 0 10px;
  display: inline-flex;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-button i {
  font-size: 14px;
}

.recent-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding-top: 10px;
  padding-bottom: 2px;
  min-height: 36px;
}

.recent-row span {
  color: var(--muted);
  font-size: 11px;
  flex: 0 0 auto;
}

.recent-row button,
.ghost-button {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  min-height: 24px;
  padding: 0 9px;
  background: rgba(255,255,255,.34);
  color: var(--blue);
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
}

.suggest-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  top: calc(100% - 4px);
  z-index: 40;
  display: grid;
  gap: 6px;
  padding: 8px;
  max-height: min(280px, 42vh);
  overflow-y: auto;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(72, 107, 143, .22);
}

.suggest-item {
  border: 0;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  text-align: left;
}

.suggest-item + .suggest-item {
  border-top: 1px solid rgba(136, 157, 188, .18);
  border-radius: 0;
}

.suggest-item strong {
  color: var(--blue);
}

.suggest-item span,
.suggest-item em,
.suggest-empty {
  color: var(--muted);
  font-size: 12px;
}

.suggest-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-item em {
  grid-column: 2;
  font-style: normal;
}

.suggest-empty {
  padding: 10px;
}

.ghost-button {
  margin-left: auto;
  color: var(--muted);
  background: transparent;
}

.inventory-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.loading-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0;
}

.is-loading .loading-bar {
  width: 100%;
  opacity: 1;
  animation: shimmer 1s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.code-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.accent-line {
  width: 3px;
  height: 24px;
  border-radius: 99px;
  background: var(--blue);
}

.code-line h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}

.copy-button {
  width: 28px;
  height: 28px;
  background: transparent;
  color: var(--muted);
}

.card-head p {
  margin: 11px 0 0;
  font-size: 17px;
  font-weight: 650;
}

.status-chip {
  align-self: start;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(47,181,111,.14);
  font-weight: 750;
  font-size: 13px;
}

.inventory-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38%;
  gap: 14px;
  margin-top: 20px;
}

.field-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.field-list div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  align-items: center;
}

.field-list dt {
  color: var(--muted);
  font-size: 13px;
}

.field-list dd {
  margin: 0;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.field-list dd span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-list dd i {
  color: var(--muted-2);
}

.mini-edit {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.image-tile {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  min-height: 130px;
  padding: 0;
  overflow: hidden;
  position: relative;
  background: linear-gradient(145deg, rgba(255,255,255,.42), rgba(120,145,173,.16));
  color: var(--muted);
  cursor: pointer;
}

.image-tile.has-image {
  background: rgba(255,255,255,.2);
}

.image-tile img {
  width: 100%;
  height: 100%;
  min-height: 130px;
  object-fit: cover;
}

#imageEmpty,
#taskImageEmpty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 6px;
  font-size: 12px;
}

#invImage[hidden],
#imageEmpty[hidden] {
  display: none !important;
}

#imageEmpty i,
#taskImageEmpty i {
  font-size: 28px;
}

.image-tile em {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  background: rgba(30, 37, 48, .45);
  font-style: normal;
  font-size: 11px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 12px;
}

.meta-row strong {
  color: var(--muted);
  font-weight: 600;
}

.meta-right {
  display: grid;
  gap: 4px;
  text-align: right;
  justify-items: end;
  min-width: 0;
}

#imageAuditRow {
  max-width: 190px;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.action-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--stroke);
}

.action-button {
  border: 0;
  min-height: 70px;
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
  text-align: left;
  padding: 12px;
  background: rgba(255,255,255,.28);
}

.action-button i {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 22px;
}

.action-button span {
  font-weight: 760;
}

.action-button small {
  color: var(--muted);
  font-size: 11px;
}

.stock-preview,
.movement-preview,
.list-page {
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-title div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  color: var(--blue);
  font-size: 20px;
}

.section-title button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  gap: 2px;
  align-items: center;
  font-size: 12px;
}

.module-context {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
}

.metric-grid div {
  padding: 12px;
  background: rgba(255,255,255,.22);
}

.metric-grid div + div {
  border-left: 1px solid var(--stroke);
}

.metric-grid span,
.warehouse-card span {
  color: var(--muted);
  font-size: 12px;
}

.metric-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--blue);
  font-size: 23px;
}

.green {
  color: var(--green) !important;
}

.warehouse-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-top: 12px;
  padding: 0 14px 3px 0;
}

.warehouse-card {
  min-width: 128px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.22);
}

.warehouse-card strong {
  display: block;
  margin-top: 8px;
}

.movement-list,
.stock-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.movement-row,
.stock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255,255,255,.22);
}

.movement-row strong,
.stock-row strong {
  font-size: 14px;
}

.movement-row span,
.stock-row span {
  color: var(--muted);
  font-size: 12px;
}

.movement-row em {
  color: var(--blue);
  font-style: normal;
  font-weight: 760;
}

.stock-row {
  grid-template-columns: 1fr;
}

.stock-row-head,
.movement-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.movement-row-head {
  grid-column: 1 / -1;
}

.stock-row-head > div,
.movement-row-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.stock-row-head strong,
.movement-row-head strong {
  overflow-wrap: anywhere;
}

.stock-row-total {
  text-align: right;
  flex: 0 0 auto;
}

.stock-row-total strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.stock-row-total span,
.movement-balance {
  color: var(--muted);
  font-size: 12px;
}

.stock-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.stock-detail-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.22);
}

.stock-detail-grid small {
  color: var(--muted);
  font-size: 11px;
}

.stock-detail-grid strong {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.movement-meta,
.movement-balance {
  display: block;
}

.movement-amount {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.pending-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, var(--safe-bottom));
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 414px);
  border-radius: 28px;
  min-height: 66px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 10;
}

.bottom-nav.has-admin {
  grid-template-columns: repeat(6, 1fr);
}

.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  position: relative;
  font-size: 12px;
  border-radius: 20px;
  min-height: 52px;
}

.bottom-nav i {
  font-size: 23px;
}

.bottom-nav .active {
  color: var(--blue);
  background: rgba(255,255,255,.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.bottom-nav em {
  position: absolute;
  top: 4px;
  right: 25%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ff4d4f;
}

.admin-page {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.password-panel {
  border-radius: var(--radius-lg);
  margin-top: 14px;
  padding: 18px;
}

.password-form,
.account-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.account-form {
  grid-template-columns: 1fr 1fr;
}

.account-form label,
.account-form button {
  min-width: 0;
}

.account-form label:nth-child(5),
.account-form button {
  grid-column: 1 / -1;
}

.account-list {
  display: grid;
  gap: 10px;
}

.account-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255,255,255,.22);
}

.account-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.account-row header div {
  min-width: 0;
}

.account-row header strong {
  display: block;
  overflow-wrap: anywhere;
}

.account-row header span,
.account-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-actions button {
  min-height: 40px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255,255,255,.26);
}

.enabled-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.enabled-toggle input {
  width: auto;
  min-height: auto;
}

.status-chip.muted {
  color: var(--muted);
  background: rgba(126, 145, 169, .15);
}

.profile-summary {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(255,255,255,.24);
}

.profile-summary strong {
  font-size: 20px;
}

.profile-summary span,
.upload-log-row span {
  color: var(--muted);
  font-size: 12px;
}

.logout-button {
  width: 100%;
}

.upload-log-list {
  display: grid;
  gap: 10px;
}

.upload-log-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255,255,255,.22);
}

.upload-log-row img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,.3);
}

.upload-log-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.sync-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.32);
}

.sync-summary div {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.sync-summary div + div {
  border-left: 1px solid var(--stroke);
}

.sync-summary span,
.sync-progress small,
.sync-note,
.sync-danger {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sync-summary strong {
  color: var(--text);
  font-size: 16px;
}

.sync-progress {
  display: grid;
  gap: 8px;
}

.sync-progress-bar {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(120, 134, 154, .22);
}

.sync-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #5edb9a);
  transition: width .28s ease;
}

.sync-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(31, 122, 255, .1);
  border: 1px solid rgba(31, 122, 255, .16);
}

.sync-button {
  min-height: 48px;
}

.sync-button:disabled {
  opacity: .72;
}

.edit-dialog {
  width: min(calc(100vw - 26px), 390px);
  border: 0;
  background: transparent;
  padding: 0;
}

.image-dialog {
  width: min(calc(100vw - 24px), 430px);
  max-height: 86vh;
  border: 0;
  padding: 0;
  background: transparent;
}

.image-dialog::backdrop {
  background: rgba(6, 10, 18, .72);
  backdrop-filter: blur(14px);
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}

.image-dialog-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top, 0px));
  right: 18px;
  z-index: 2;
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(20, 28, 40, .72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.category-dialog {
  width: min(calc(100vw - 24px), 390px);
  border: 0;
  background: transparent;
  padding: 0;
}

.category-dialog::backdrop {
  background: rgba(10, 16, 24, .28);
  backdrop-filter: blur(10px);
}

.category-card {
  border-radius: 22px;
  padding: 14px;
}

.category-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.category-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.category-options button {
  min-height: 42px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255,255,255,.24);
  color: var(--text);
  font-weight: 650;
}

.category-options button.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(31,122,255,.34);
}

.edit-dialog::backdrop {
  background: rgba(10, 16, 24, .42);
  backdrop-filter: blur(12px);
}

.dialog-card {
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 13px;
}

.dialog-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 360px) {
  .phone-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .inventory-body {
    grid-template-columns: 1fr;
  }
}
