:root {
  --bg: #1a1f24;
  --panel: #2a313a;
  --panel-2: #333b47;
  --ink: #ece9e2;
  --muted: #a8b1be;
  --yellow: #c7ae64;
  --blue: #778394;
  --red: #ac6562;
  --green: #5b896e;
  --border: #4a5564;
  --shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  --radius: 14px;
  --radius-lg: 26px;
  --menu-speed: 0.5s;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Futura", "Avenir Next", "Century Gothic", sans-serif;
  line-height: 1.35;
}

.bauhaus-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 18% 15%, rgba(119, 131, 148, 0.12), transparent 42%),
    radial-gradient(circle at 84% 20%, rgba(199, 174, 100, 0.08), transparent 38%),
    linear-gradient(148deg, #1b2026 0%, #232a33 54%, #27303b 100%);
}

.bauhaus-bg::before {
  content: "";
  position: absolute;
  inset: -8%;
  pointer-events: none;
  opacity: 0.16;
  background: repeating-linear-gradient(
      0deg,
      transparent 0 122px,
      rgba(220, 228, 241, 0.05) 122px 123px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 168px,
      rgba(220, 228, 241, 0.05) 168px 169px
    );
}

.bauhaus-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: radial-gradient(circle, rgba(230, 236, 246, 0.3) 1px, transparent 1.3px);
  background-size: 24px 24px;
}

.route {
  position: absolute;
  display: block;
  pointer-events: none;
  opacity: 0.22;
  transform-origin: left center;
}

.route::before,
.route::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(218, 227, 237, 0.5);
}

.route::before {
  left: -3px;
}

.route::after {
  right: -3px;
}

.route-solid {
  top: 30%;
  left: 8%;
  width: 44vw;
  height: 3px;
  background: linear-gradient(90deg, rgba(213, 223, 234, 0.32), rgba(213, 223, 234, 0.1));
  transform: rotate(-11deg);
}

.route-dotted {
  top: 63%;
  left: 36%;
  width: 38vw;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(199, 174, 100, 0.6) 0 6px, transparent 6px 11px);
  transform: rotate(8deg);
}

.route-dotted-two {
  top: 46%;
  left: 58%;
  width: 24vw;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(210, 218, 229, 0.5) 0 3px, transparent 3px 8px);
  transform: rotate(102deg);
}

.shape {
  position: absolute;
  opacity: 0.12;
  animation: drift 20s ease-in-out infinite alternate;
}

.shape-circle {
  width: 320px;
  height: 320px;
  background: var(--blue);
  border-radius: 50%;
  bottom: -120px;
  left: -90px;
}

.shape-rect {
  width: 260px;
  height: 260px;
  background: var(--red);
  top: 12%;
  right: -110px;
  transform: rotate(22deg);
  animation-duration: 26s;
}

.shape-tri {
  width: 0;
  height: 0;
  border-left: 140px solid transparent;
  border-right: 140px solid transparent;
  border-bottom: 240px solid var(--yellow);
  left: 40%;
  bottom: -120px;
  animation-duration: 24s;
}

@keyframes drift {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-10px) scale(1.01);
  }
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.reveal-menu {
  transform-origin: top center;
  will-change: transform, opacity;
}

.is-opening {
  animation: menuDropOpen var(--menu-speed) cubic-bezier(0.23, 1.18, 0.32, 1) both;
}

.is-closing {
  pointer-events: none;
  animation: menuDropClose var(--menu-speed) ease-in-out both;
}

@keyframes menuDropOpen {
  0% {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.94);
    filter: saturate(0.84);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    filter: saturate(1);
  }
}

@keyframes menuDropClose {
  0% {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-6px) scaleY(0.94);
  }
}

.gate-card {
  width: min(520px, calc(100vw - 2rem));
  margin: 10vh auto 0;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(34, 40, 48, 0.9);
  text-align: center;
  box-shadow: var(--shadow);
}

.warehouse-icon {
  fill: currentColor;
}

.gate-icon {
  width: 72px;
  color: var(--ink);
}

.gate-card h1 {
  margin: 0.4rem 0 1.2rem;
  letter-spacing: 0.02em;
}

#passcode-input {
  width: min(220px, 100%);
  background: #101319;
  border: 1px solid #3f4858;
  color: var(--ink);
  border-radius: 12px;
  font-size: 2rem;
  letter-spacing: 0.55rem;
  text-align: center;
  padding: 0.55rem 0.8rem;
}

#passcode-input:focus {
  outline: 2px solid var(--yellow);
  border-color: var(--yellow);
}

#gate-hint {
  margin-top: 0.8rem;
  color: var(--muted);
}

.shake {
  animation: shake 0.22s linear 2;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-6px);
  }
  60% {
    transform: translateX(6px);
  }
  100% {
    transform: translateX(0);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(32, 38, 46, 0.94);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  opacity: 0.6;
  background: rgba(205, 215, 226, 0.36);
}

.brand-wrap {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.brand-icon {
  width: 34px;
  color: var(--yellow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  line-height: 1.16;
  flex-wrap: wrap;
}

.brand-text .ui-version {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.02rem 0.36rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  padding: 1rem;
}

.riders {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.rider-btn,
.subrider-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  padding: 0.72rem 0.84rem;
  text-align: left;
  cursor: pointer;
}

.rider-btn.active,
.subrider-btn.active {
  background: rgba(56, 65, 78, 0.92);
  border-color: #6f7d91;
}

.content {
  border-radius: var(--radius);
}

.rider-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(40, 47, 58, 0.92);
  box-shadow: var(--shadow);
}

.rider-panel h2 {
  margin-top: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.subpanel,
.list-block,
.inline-form,
.modal-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(46, 54, 66, 0.78);
  padding: 0.8rem;
}

.subpanel {
  margin-bottom: 1rem;
}

.list-block {
  margin-top: 0.85rem;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.inline-form input {
  margin-top: 0;
}

.fields {
  display: grid;
  gap: 0.8rem;
}

.two-up {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.one-up {
  margin-top: 0.7rem;
}

.block {
  display: block;
}

label,
.label {
  display: block;
  color: #c6cad2;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.3rem;
  font: inherit;
  color: var(--ink);
  background: #222933;
  border: 1px solid #4a5463;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(119, 131, 148, 0.52);
  border-color: var(--blue);
}

.autocomplete-wrap {
  display: flex;
  flex-direction: column;
}

.suggestions {
  margin-top: 0.1rem;
  margin-bottom: 0.2rem;
  min-height: 1.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.suggestions strong {
  color: var(--yellow);
}

.actions {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.65rem;
}

.actions.end {
  justify-content: flex-end;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #14161c;
  background: var(--ink);
  cursor: pointer;
  display: inline-block;
  padding: 0.55rem 0.82rem;
  text-decoration: none;
  text-align: center;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-yellow {
  background: var(--yellow);
}

.btn-blue {
  background: var(--blue);
  color: #f5f8ff;
}

.btn-green {
  background: var(--green);
}

.btn-red {
  background: var(--red);
  color: #fff;
}

.state-grey {
  background: #6f7786;
  color: #e6ebf5;
}

.state-yellow {
  background: var(--yellow);
  color: #171718;
}

.state-green {
  background: var(--green);
  color: #0c1f13;
}

.search {
  margin-bottom: 0.5rem;
}

.list-head,
.list-row {
  display: grid;
  align-items: center;
  gap: 0.6rem;
}

.list-head {
  color: #cbd1dc;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.item-grid,
.item-row {
  grid-template-columns: minmax(140px, 2fr) minmax(120px, 1.2fr) minmax(120px, 1fr) 90px;
}

.packing-grid,
.packing-row {
  grid-template-columns: minmax(140px, 2fr) 110px 130px 120px;
}

.location-grid,
.location-row {
  grid-template-columns: minmax(140px, 1fr) 80px;
}

.archive-grid,
.archive-row {
  grid-template-columns: minmax(120px, 2fr) 90px 90px 80px 120px;
}

.trash-grid,
.trash-row {
  grid-template-columns: 90px minmax(120px, 1.8fr) minmax(120px, 1fr) minmax(120px, 1fr) 100px;
}

.modal-grid,
.modal-row {
  grid-template-columns: minmax(120px, 1.8fr) minmax(120px, 1.1fr) minmax(120px, 1.1fr) 70px 80px;
}

.list-row {
  border: 1px solid #465061;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.45rem;
  background: rgba(38, 45, 56, 0.88);
}

.list-row.clickable {
  cursor: pointer;
}

.list-row:hover {
  border-color: #637083;
}

.item-expanded,
.location-expanded {
  border: 1px solid #4d586b;
  border-top: none;
  border-radius: 0 0 12px 12px;
  margin: -0.1rem 0 0.7rem;
  padding: 0.8rem;
  background: rgba(43, 51, 63, 0.92);
  transform-origin: top center;
  animation: menuDropOpen var(--menu-speed) cubic-bezier(0.23, 1.18, 0.32, 1) both;
}

.expanded-media {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.preview-box {
  width: 50mm;
  height: 50mm;
  border: 1px solid #5a677d;
  border-radius: 8px;
  background: #1e252f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-small {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #55627b;
  background: #f8f8f8;
}

.item-description {
  margin: 1rem 0 0.95rem;
  padding: 0.6rem;
  background: #212833;
  border: 1px solid #4b5668;
  border-radius: 10px;
  white-space: pre-wrap;
  color: #d3dae7;
}

.status-pill {
  border-radius: 999px;
  border: 1px solid #66738b;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #d4dbe8;
}

.stats {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.stats.two {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.stats.three {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(43, 50, 61, 0.9);
}

.stat-card h3,
.stat-card h4 {
  margin: 0;
  color: #bdc5d5;
  font-weight: 600;
}

.stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.7rem;
  color: var(--yellow);
  font-weight: 800;
}

.segmented {
  margin-top: 0.28rem;
  display: inline-flex;
  border: 1px solid #44516a;
  border-radius: 10px;
  overflow: hidden;
  transform-origin: center;
}

.segmented.warp {
  animation: priorityWarp 180ms cubic-bezier(0.2, 1, 0.34, 1);
}

@keyframes priorityWarp {
  0% {
    transform: skewX(0deg) scale(1);
  }
  38% {
    transform: skewX(-9deg) scale(1.03, 0.96);
  }
  72% {
    transform: skewX(7deg) scale(0.99, 1.02);
  }
  100% {
    transform: skewX(0deg) scale(1);
  }
}

.segmented button {
  border: none;
  border-right: 1px solid #44516a;
  background: #232b36;
  color: #d7deeb;
  font: inherit;
  padding: 0.42rem 0.72rem;
  cursor: pointer;
  transform-origin: center;
  transition: background-color 120ms ease, color 120ms ease;
}

.segmented button:last-child {
  border-right: none;
}

.segmented button.active {
  background: var(--yellow);
  color: #131617;
}

.segmented button.priority-pulse {
  animation: priorityPulse 160ms cubic-bezier(0.2, 1.1, 0.24, 1);
}

@keyframes priorityPulse {
  0% {
    transform: scale(1) rotate(0deg);
  }
  45% {
    transform: scale(1.08) rotate(-1deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.picker-table {
  border: 1px solid #475164;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.55rem;
}

.picker-head,
.picker-row {
  display: grid;
  grid-template-columns: minmax(120px, 2fr) minmax(100px, 1fr) minmax(100px, 1fr) 60px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
}

.picker-head {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #c7ccda;
  background: #232b36;
}

.picker-row {
  border-top: 1px solid #3d4554;
  background: rgba(40, 48, 60, 0.92);
}

.picker-check {
  width: 20px;
  height: 20px;
  border: 1px solid #607087;
  border-radius: 5px;
  background: #10151f;
  display: inline-grid;
  place-items: center;
  color: transparent;
  cursor: pointer;
}

.picker-check.active {
  background: var(--green);
  color: #102014;
}

.chips {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  background: #262f3a;
  border: 1px solid #4d5a72;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  color: #d8deea;
  font-size: 0.8rem;
}

.subriders {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.muted {
  color: var(--muted);
  margin-top: 0.2rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 17, 22, 0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 10;
}

.modal-card {
  width: min(980px, calc(100vw - 1rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 30px;
  background: rgba(43, 51, 63, 0.96);
}

.modal-head,
.modal-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.modal-tools {
  flex-wrap: wrap;
}

.modal-tools input {
  max-width: 320px;
}

.modal-list {
  margin-top: 0.5rem;
}

.modal-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

hr {
  border: none;
  border-top: 1px solid #3c4454;
  margin: 1.2rem 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1080px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .riders {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }

  .rider-btn {
    text-align: center;
    padding: 0.52rem 0.4rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 760px) {
  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .riders {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .two-up,
  .stats.two,
  .stats.three,
  .modal-edit {
    grid-template-columns: 1fr;
  }

  .item-grid,
  .item-row,
  .packing-grid,
  .packing-row,
  .archive-grid,
  .archive-row,
  .trash-grid,
  .trash-row,
  .modal-grid,
  .modal-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .list-head {
    display: none;
  }

  .list-row {
    padding: 0.7rem;
  }
}

/* Bauhaus light-grey refresh (appearance only) */
:root {
  --bg: #d9dde2;
  --panel: #f3f5f8;
  --panel-2: #e8ecf1;
  --ink: #1d2430;
  --muted: #5f6b7a;
  --yellow: #f3c849;
  --blue: #1f67ca;
  --red: #d7433f;
  --green: #17a84d;
  --border: #a2adbb;
  --shadow: 0 14px 30px rgba(24, 31, 42, 0.16);
  --radius: 8px;
  --radius-lg: 18px;
}

body {
  background: #d9dde2;
  color: var(--ink);
  font-family: "Futura", "Avenir Next", "Century Gothic", sans-serif;
}

.bauhaus-bg {
  background: linear-gradient(130deg, #d4d9df 0%, #e8ebf0 54%, #f2f5f9 100%);
}

.bauhaus-bg::before {
  opacity: 0.3;
  background: repeating-linear-gradient(
      0deg,
      transparent 0 102px,
      rgba(80, 93, 111, 0.11) 102px 104px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 152px,
      rgba(80, 93, 111, 0.11) 152px 154px
    );
}

.bauhaus-bg::after {
  opacity: 0.18;
  background-image: radial-gradient(circle, rgba(77, 89, 108, 0.33) 1px, transparent 1.3px);
  background-size: 24px 24px;
}

.route {
  opacity: 0.4;
}

.route::before,
.route::after {
  background: rgba(57, 70, 89, 0.5);
}

.route-solid {
  background: linear-gradient(90deg, rgba(31, 103, 202, 0.42), rgba(31, 103, 202, 0.1));
}

.route-dotted {
  background: repeating-linear-gradient(90deg, rgba(243, 200, 73, 0.8) 0 8px, transparent 8px 13px);
}

.route-dotted-two {
  background: repeating-linear-gradient(90deg, rgba(215, 67, 63, 0.6) 0 4px, transparent 4px 9px);
}

.shape {
  opacity: 0.2;
}

.shape-circle {
  background: var(--blue);
}

.shape-rect {
  background: var(--red);
}

.shape-tri {
  border-bottom-color: var(--yellow);
}

.gate-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(246, 248, 251, 0.95);
  color: var(--ink);
  box-shadow: var(--shadow);
}

#passcode-input {
  background: #ffffff;
  border: 2px solid #a7b2c0;
  color: var(--ink);
}

#passcode-input:focus {
  outline: 2px solid rgba(31, 103, 202, 0.35);
  border-color: var(--blue);
}

#gate-hint {
  color: var(--muted);
}

.topbar {
  background: rgba(247, 249, 251, 0.94);
  border-bottom: 2px solid var(--border);
}

.topbar::after {
  opacity: 0.85;
  background: rgba(70, 83, 101, 0.24);
}

.brand-icon {
  color: var(--blue);
}

.brand-text small {
  color: var(--muted);
}

.app-layout {
  gap: 1.05rem;
}

.rider-btn,
.subrider-btn {
  border: 2px solid var(--border);
  border-radius: 7px;
  background: #f5f7fa;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rider-btn.active,
.subrider-btn.active {
  background: #dce8fb;
  border-color: var(--blue);
  color: #113f83;
}

.rider-panel {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: rgba(244, 246, 249, 0.92);
  box-shadow: var(--shadow);
}

.subpanel,
.list-block,
.inline-form,
.modal-card {
  border: 2px solid #adb6c3;
  border-radius: 7px;
  background: rgba(237, 241, 246, 0.82);
}

label,
.label {
  color: #39475a;
  font-weight: 600;
}

input,
select,
textarea {
  color: var(--ink);
  background: #ffffff;
  border: 2px solid #a8b2bf;
  border-radius: 6px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(31, 103, 202, 0.3);
  border-color: var(--blue);
}

.suggestions {
  color: var(--muted);
}

.suggestions strong {
  color: #0f4c9a;
}

.btn {
  border: 2px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-yellow {
  background: var(--yellow);
  border-color: #c89f2e;
  color: #332100;
}

.btn-blue {
  background: var(--blue);
  border-color: #184d98;
  color: #f4f8ff;
}

.btn-green {
  background: var(--green);
  border-color: #107f3a;
  color: #f1fff5;
}

.btn-red {
  background: var(--red);
  border-color: #b72b29;
  color: #fff6f6;
}

.state-grey {
  background: #b8c0cc;
  border-color: #8f9aaa;
  color: #2d3847;
}

.state-yellow {
  background: var(--yellow);
  border-color: #c89f2e;
  color: #2f2100;
}

.state-green {
  background: var(--green);
  border-color: #107f3a;
  color: #f3fff8;
}

.list-head {
  color: #46566e;
}

.list-row {
  border: 2px solid #aab3bf;
  border-radius: 7px;
  background: rgba(249, 251, 253, 0.95);
}

.list-row:hover {
  border-color: #71809a;
}

.copy-inline,
.suk-copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
  min-width: 0;
}

.copy-suk-btn {
  border: none;
  background: transparent;
  color: #627189;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
}

.copy-suk-btn:hover {
  color: #1a4f95;
}

.copy-suk-btn:focus-visible {
  outline: 2px solid rgba(31, 103, 202, 0.36);
  outline-offset: 1px;
}

.copy-pulse {
  animation: copyPulseGreen 500ms ease-out 1;
}

@keyframes copyPulseGreen {
  0% {
    background: rgba(24, 168, 77, 0.06);
  }
  45% {
    background: rgba(24, 168, 77, 0.32);
  }
  100% {
    background: rgba(24, 168, 77, 0.06);
  }
}

.item-expanded,
.location-expanded {
  border: 2px solid #a3adba;
  border-top: none;
  border-radius: 0 0 7px 7px;
  background: rgba(241, 245, 250, 0.95);
}

.preview-box {
  border: 2px solid #a2adbc;
  border-radius: 6px;
  background: #f8fafd;
}

.qr-small {
  border: 1px solid #8d99ad;
  background: #ffffff;
}

.location-row .location-qr-wrap {
  justify-self: end;
  display: flex;
  justify-content: flex-end;
  overflow: visible;
  position: relative;
  z-index: 8;
}

.location-row.is-expanded,
.location-row.is-collapsing {
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

.location-row.is-expanded + .location-expanded,
.location-row.is-collapsing + .location-expanded {
  margin: 0 0 0.45rem;
  border-top: none;
  border-radius: 0 0 7px 7px;
  padding: 0.45rem 0.6rem 0.55rem;
  background: rgba(249, 251, 253, 0.95);
  border-color: #aab3bf;
  box-shadow: none;
  position: relative;
  z-index: 2;
}

.location-row.is-expanded + .location-expanded .actions,
.location-row.is-collapsing + .location-expanded .actions {
  margin-top: 0;
  width: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-right: 8.2rem;
}

.location-row.is-expanded + .location-expanded .btn,
.location-row.is-collapsing + .location-expanded .btn {
  width: auto;
  min-width: 128px;
}

.location-row.is-expanded + .location-expanded {
  animation: locationMenuSeamlessOpen var(--menu-speed) cubic-bezier(0.23, 1.08, 0.32, 1) both;
}

.location-row.is-collapsing + .location-expanded.is-closing {
  animation: locationMenuSeamlessClose var(--menu-speed) ease-in-out both;
}

.location-row .qr-small {
  transform-origin: top right;
  transform: scale(1);
  transition: transform 260ms cubic-bezier(0.2, 0.86, 0.26, 1), filter 180ms ease;
  will-change: transform;
  position: relative;
  z-index: 9;
}

.location-row.is-expanded .qr-small {
  transform: scale(4.2);
  animation: locationQrGrow 260ms cubic-bezier(0.2, 0.86, 0.26, 1) both;
}

.location-row.is-collapsing .qr-small {
  transform: scale(1);
  animation: locationQrShrink 260ms cubic-bezier(0.42, 0, 0.2, 1) both;
}

@keyframes locationQrGrow {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(4.2);
  }
}

@keyframes locationQrShrink {
  0% {
    transform: scale(4.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes locationMenuSeamlessOpen {
  0% {
    opacity: 0;
    transform: scaleY(0.9);
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes locationMenuSeamlessClose {
  0% {
    opacity: 1;
    transform: scaleY(1);
  }
  100% {
    opacity: 0;
    transform: scaleY(0.9);
  }
}

.item-description {
  background: #ffffff;
  border: 2px solid #a8b2c0;
  border-radius: 6px;
  color: #2f3b4e;
}

.status-pill {
  border: 2px solid #8f9db3;
  color: #304157;
  background: #eef2f8;
}

.status-pill.status-stored {
  background: #d8f3e3;
  border-color: #67b889;
  color: #125d35;
}

.status-pill.status-in-warehouse {
  background: #ffe7cc;
  border-color: #de9636;
  color: #7f4b00;
}

.status-pill.status-borrowed {
  background: #fff4bf;
  border-color: #d5b832;
  color: #6b5900;
}

.status-pill.status-trashed {
  background: #ffdedd;
  border-color: #d44a47;
  color: #8b2422;
}

.stat-card {
  border: 2px solid var(--border);
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.9);
}

.stat-card h3,
.stat-card h4 {
  color: #44556c;
}

.stat-value {
  color: #113f83;
}

.segmented {
  border: 2px solid #97a5bb;
  border-radius: 7px;
}

.segmented button {
  border-right: 2px solid #97a5bb;
  background: #f2f5fa;
  color: #34465f;
}

.segmented button.active {
  background: var(--yellow);
  color: #2f2200;
}

.picker-table {
  border: 2px solid #a4aebc;
  border-radius: 7px;
}

.picker-head {
  color: #3f4f66;
  background: #ebf0f7;
}

.picker-row {
  border-top: 1px solid #a8b2bf;
  background: rgba(247, 250, 253, 0.95);
}

.picker-check {
  border: 2px solid #7e8ea6;
  border-radius: 5px;
  background: #ffffff;
}

.picker-check.active {
  background: var(--green);
  color: #f5fff8;
  border-color: #107f3a;
}

.chip {
  background: #edf2f8;
  border: 2px solid #a7b0bf;
  color: #2f3f56;
}

.muted {
  color: var(--muted);
}

.modal {
  background: rgba(31, 38, 49, 0.34);
}

.modal-card {
  border-radius: 14px;
  background: rgba(245, 248, 252, 0.97);
}

hr {
  border-top: 2px solid #b4bcc7;
}

/* Item search/filter interaction overhaul */
.item-search-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.item-search-shell {
  position: relative;
  min-width: 0;
}

.item-search-input.search {
  width: 100%;
  margin: 0;
  padding-right: 2.1rem;
  position: relative;
  z-index: 1;
}

.item-search-hologram {
  position: absolute;
  top: 50%;
  left: 0.68rem;
  right: 2.15rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: #9ca8b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

.item-search-hologram .typed-fragment {
  color: transparent;
}

.item-search-hologram.is-placeholder {
  color: #a8b2c0;
}

.item-search-clear-btn {
  position: absolute;
  top: 50%;
  right: 0.32rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #7f8ea3;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.1rem;
  cursor: pointer;
  z-index: 3;
}

.item-search-clear-btn:hover {
  color: #1a4f95;
}

.item-search-clear-btn:focus-visible {
  outline: 2px solid rgba(31, 103, 202, 0.36);
  outline-offset: 1px;
}

.item-status-cycle {
  border: 2px solid #96a4b8;
  border-radius: 6px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.16rem;
  padding: 0.26rem 0.2rem 0.22rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 110ms ease, filter 110ms ease;
}

.item-status-cycle:hover {
  transform: translateY(-1px);
  filter: saturate(1.03);
}

.item-status-cycle:focus-visible {
  outline: 2px solid rgba(31, 103, 202, 0.36);
  outline-offset: 1px;
}

.item-status-cycle-label {
  font-size: 0.63rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
}

.item-status-cycle-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.17rem;
}

.item-status-cycle-dots .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.46;
  transition: width 120ms ease, height 120ms ease, opacity 120ms ease;
}

.item-status-cycle-dots .dot.is-active {
  width: 7px;
  height: 7px;
  opacity: 1;
}

.item-status-cycle.status-filter-all {
  background: #dfe5ee;
  border-color: #9aa6b7;
  color: #4f5f75;
}

.item-status-cycle.status-filter-stored {
  background: #d8f3e3;
  border-color: #67b889;
  color: #125d35;
}

.item-status-cycle.status-filter-borrowed {
  background: #fff4bf;
  border-color: #d5b832;
  color: #6b5900;
}

.item-status-cycle.status-filter-warehouse {
  background: #ffe7cc;
  border-color: #de9636;
  color: #7f4b00;
}

.item-status-cycle.status-filter-trash {
  background: #ffdedd;
  border-color: #d44a47;
  color: #8b2422;
}

.item-list-refresh-btn {
  width: auto;
  height: 100%;
  aspect-ratio: 1 / 1;
  align-self: stretch;
  border: 2px solid #97a4b7;
  border-radius: 6px;
  background: #e3e8ef;
  color: #34506f;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 110ms ease, filter 110ms ease;
}

.item-list-refresh-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
}

.item-list-refresh-btn:focus-visible {
  outline: 2px solid rgba(31, 103, 202, 0.36);
  outline-offset: 1px;
}

.item-list-body {
  border: 2px solid #aab3bf;
  border-radius: 7px;
  background: rgba(249, 251, 253, 0.95);
  overflow: hidden;
}

.location-list-body {
  min-height: 56px;
  transition: min-height var(--menu-speed) cubic-bezier(0.23, 1.02, 0.32, 1);
}

#item-list .item-row,
#item-list > .list-row:not(.item-row) {
  border: none;
  border-radius: 0;
  margin: 0;
  background: transparent;
}

#item-list .item-row + .item-row,
#item-list .item-expanded + .item-row {
  border-top: 1px dotted #9eabba;
}

#item-list .item-row:hover {
  border-color: transparent;
  background: rgba(215, 226, 239, 0.52);
}

#item-list .item-expanded {
  margin: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
}

/* Add-item layout */
#item-add-panel .item-add-description-row {
  margin-top: 0.7rem;
}

#item-add-panel .item-photo-native-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

#item-add-panel .item-add-actions {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: stretch;
}

#item-add-panel .item-add-actions > .btn {
  width: 100%;
}

#item-add-panel .item-photo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.36rem;
}

#item-add-panel .item-name-autocomplete-wrap {
  position: relative;
  margin-top: 0.3rem;
}

#item-add-panel .item-name-autocomplete-wrap #item-name-input {
  margin-top: 0;
  position: relative;
  z-index: 1;
}

#item-add-panel .item-name-hologram {
  position: absolute;
  top: 50%;
  left: 0.65rem;
  right: 0.65rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: #9ca8b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

#item-add-panel .item-name-hologram .typed-fragment {
  color: transparent;
}

/* Add-item dropdown: remove inner control boundaries (keep bottom action button) */
#item-add-panel :is(input, select, textarea) {
  border: none !important;
  box-shadow: none;
}

#item-add-panel :is(input, select, textarea):focus {
  border-color: transparent !important;
  outline: none;
}

#item-add-panel input[type="file"]::file-selector-button {
  border: none;
}

#item-add-panel input[type="file"]::-webkit-file-upload-button {
  border: none;
}

.admin-feedback {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 90;
  pointer-events: none;
}

.admin-feedback-badge {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 12px 28px rgba(18, 26, 34, 0.32);
}

.admin-feedback-badge.success {
  background: #18b64b;
}

.admin-feedback-badge.error {
  background: #de3431;
}

.admin-feedback-badge.shake {
  animation: adminFeedbackShake 170ms linear 3;
}

@keyframes adminFeedbackShake {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-6px);
  }
  60% {
    transform: translateX(6px);
  }
  100% {
    transform: translateX(0);
  }
}

#pack-item-dropdown {
  position: relative;
}

#pack-item-dropdown .picker-head {
  padding-right: 2.35rem;
}

.picker-dropdown-toggle {
  position: absolute;
  top: 0.28rem;
  right: 0.36rem;
  width: 1.9rem;
  height: 1.9rem;
  border: 2px solid #8f9db3;
  border-radius: 6px;
  background: #f4f7fb;
  color: #354761;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.picker-dropdown-toggle:hover {
  background: #ffffff;
}

.account-tools {
  margin: 0 0 0.8rem;
}
