  :root {
    --bg: #1B1F23;
    --panel: #24292E;
    --panel-2: #2C3238;
    --line: #383F46;
    --text: #E8EAED;
    --text-dim: #9AA3AC;
    --amber: #F5A623;
    --amber-dim: #7a5518;
    --steel: #4F9DB5;
    --green: #4CAF6D;
    --red: #E5484D;
    --radius: 4px;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    display: flex;
    overflow: hidden;
  }
  h1, h2, h3, .label-font {
    font-family: 'Oswald', 'Inter', sans-serif;
    letter-spacing: 0.02em;
  }

  /* ---- Nav rail ---- */
  .nav-rail {
    width: 76px;
    flex-shrink: 0;
    background: #16191C;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 6px;
    overflow-y: auto;
  }
  .nav-brand {
    width: 40px; height: 40px;
    background: var(--amber);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Oswald'; font-weight: 700; font-size: 18px;
    color: #16191C;
    margin-bottom: 18px;
  }
  .nav-item {
    width: 60px;
    padding: 8px 4px 10px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-dim);
    border: none; background: none;
    font-family: 'Inter'; font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
  }
  .nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
  .nav-item.active { color: var(--amber); background: rgba(245,166,35,0.1); }
  .nav-item:hover:not(.active) { color: var(--text); }

  /* ---- Main ---- */
  .main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
  .topbar {
    height: 56px; flex-shrink: 0;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
  }
  .topbar h1 { font-size: 19px; margin: 0; font-weight: 600; color: var(--text); }
  .topbar .sub { color: var(--text-dim); font-size: 12px; margin-top: 1px; }
  .content { flex: 1; overflow-y: auto; padding: 24px; }

  /* ---- Cards / dashboard ---- */
  .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
  .stat-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px;
  }
  .stat-card .n { font-family: 'Oswald'; font-size: 30px; font-weight: 600; }
  .stat-card .l { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
  .stat-card.warn .n { color: var(--amber); }
  .stat-card.ok .n { color: var(--green); }

  .quick-row { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
  .quick-btn {
    flex: 1; min-width: 150px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--text); padding: 16px; text-align: left; cursor: pointer;
    font-family: 'Inter'; font-size: 13.5px; font-weight: 600;
  }
  .quick-btn:hover { border-color: var(--amber); }
  .quick-btn .d { color: var(--text-dim); font-weight: 400; font-size: 11.5px; margin-top: 3px; }

  .panel-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin: 0 0 10px; font-weight: 600; }

  table { width: 100%; border-collapse: collapse; }
  th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
  td { padding: 10px 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
  tr:hover td { background: rgba(255,255,255,0.02); }
  tr.clickable { cursor: pointer; }

  .badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
  .badge.low { background: rgba(229,72,77,0.15); color: var(--red); }
  .badge.ok { background: rgba(76,175,109,0.15); color: var(--green); }

  /* ---- Search / filter bar ---- */
  .toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
  input[type=text], input[type=number], input[type=date], select {
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    border-radius: var(--radius); padding: 9px 11px; font-size: 13.5px; font-family: 'Inter';
  }
  input:focus, select:focus { outline: none; border-color: var(--amber); }
  .search-wrap { flex: 1; position: relative; }
  .search-wrap input { width: 100%; padding-left: 34px; }
  .search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text-dim); fill: none; pointer-events: none; }

  .btn {
    background: var(--amber); color: #16191C; border: none; border-radius: var(--radius);
    padding: 10px 18px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: 'Inter';
  }
  .btn:hover { filter: brightness(1.08); }
  .btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
  .btn.danger { background: var(--red); color: white; }
  .btn:disabled { opacity: 0.4; cursor: not-allowed; }

  /* ---- Forms ---- */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 640px; }
  .field { display: flex; flex-direction: column; gap: 5px; }
  .field label { font-size: 11.5px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
  .field.full { grid-column: 1 / -1; }

  .btn.sm { padding: 5px 12px; font-size: 12px; }
  .field-note { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }
  input[readonly] { opacity: 0.6; cursor: not-allowed; }
  .form-actions { display: flex; gap: 10px; margin: 4px 0 24px; }

  .card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }

  .line-row { display: grid; grid-template-columns: 1.7fr 0.6fr 0.6fr 1.3fr 1.3fr 32px; gap: 10px; margin-bottom: 8px; align-items: center; min-width: 980px; }
  .line-row.head { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; min-width: 980px; }
  .line-rows-scroll { overflow-x: auto; }
  .remove-btn { background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; }

  .totals { text-align: right; margin: 10px 0; font-family: 'Oswald'; font-size: 16px; color: var(--amber); }

  .steps { display: flex; gap: 6px; margin-bottom: 20px; }
  .step { padding: 6px 14px; border-radius: 3px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--text-dim); }
  .step.active { background: var(--amber); color: #16191C; }
  .step.done { background: rgba(76,175,109,0.15); color: var(--green); }

  .toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--green); color: #0e2015; padding: 12px 22px; border-radius: var(--radius);
    font-weight: 600; font-size: 13.5px; display: none; z-index: 50;
  }
  .back-link { color: var(--text-dim); font-size: 12.5px; cursor: pointer; margin-bottom: 14px; display: inline-block; }
  .back-link:hover { color: var(--amber); }

  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

  /* ---- CI import ---- */
  .ci-line { display: grid; grid-template-columns: 28px 3fr 90px 70px 3fr; gap: 10px; margin-bottom: 10px; align-items: center; font-size: 13px; }
  .ci-line.head { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
  .ci-line.off { opacity: 0.4; }
  .ci-warn { border-color: var(--amber); background: rgba(245,166,35,0.07); font-size: 13px; }
  .ci-drop input[type=file] { color: var(--text); }

  /* ---- GRN PDF list ---- */
  .grn-row { display: grid; grid-template-columns: 1fr 110px 1fr 140px 130px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .grn-row.head { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; border-bottom: 2px solid var(--line); }

  /* ---- Item combo (type-to-search), used in Issue and Receive line pickers ---- */
  .item-combo { position: relative; }
  .item-combo input.combo-input { width: 100%; box-sizing: border-box; }
  .combo-list {
    display: none; position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 40;
    max-height: 260px; overflow-y: auto;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  }
  .combo-option { padding: 8px 11px; font-size: 13px; cursor: pointer; white-space: normal; line-height: 1.3; }
  .combo-option:hover { background: var(--amber-dim); }
  .combo-empty { padding: 8px 11px; font-size: 12.5px; color: var(--text-dim); }


  /* ---- Home: chosen-items dashboard ---- */
  .wl-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
  .wl-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .wl-tools select { padding: 5px 8px; font-size: 12px; }
  .wl-empty { color: var(--text-dim); font-size: 13px; padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
  .wl-summary { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text); margin-bottom: 14px; }
  .wl-summary b { font-family: 'Oswald'; font-size: 16px; }
  .good { color: var(--green); } .bad { color: var(--red); } .dim { color: var(--text-dim); }
  .wl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
  .wl-item { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
  .wl-item.low { border-color: rgba(229,72,77,0.55); }
  .wl-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
  .wl-code { font-family: 'Oswald'; font-size: 16px; font-weight: 600; }
  .wl-desc { color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wl-stock span { font-family: 'Oswald'; font-size: 28px; font-weight: 600; }
  .wl-stock small { color: var(--text-dim); font-size: 11.5px; }
  .wl-bar { position: relative; height: 7px; background: var(--line); border-radius: 4px; }
  .wl-bar .fill { height: 100%; background: var(--green); border-radius: 4px; }
  .wl-bar .fill.low { background: var(--red); }
  .wl-bar .min { position: absolute; top: -3px; width: 2px; height: 13px; background: var(--amber); }
  .wl-io { display: flex; gap: 14px; font-size: 12px; flex-wrap: wrap; }
  .wl-moves { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
  .wl-move { display: grid; grid-template-columns: 82px 1fr auto; gap: 8px; font-size: 12px; color: var(--text-dim); }
  .wl-actions { display: flex; gap: 8px; margin-top: auto; }

  .wl-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
  .wl-modal { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; width: 100%; max-width: 720px; max-height: 88vh; display: flex; flex-direction: column; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
  .wl-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
  .wl-results { flex: 1; overflow-y: auto; min-height: 220px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
  .wl-row { display: grid; grid-template-columns: 22px 130px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
  .wl-row:hover { background: var(--amber-dim); }
  .wl-row .c { font-weight: 600; } .wl-row .d { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wl-row .s { font-size: 12px; }
  .wl-modal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
  @media (max-width: 700px) { .wl-row { grid-template-columns: 22px 1fr auto; } .wl-row .d { display: none; } }

  /* ---- Edit Issues ---- */
  .ie-line-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
  .ie-line.removed { opacity: 0.55; border-color: var(--amber); }
  .ie-line.removed input { text-decoration: line-through; pointer-events: none; }
  .ie-add { border: 1px dashed var(--amber); border-radius: var(--radius); padding: 14px; background: rgba(245,166,35,0.04); }


  /* ---- Latest movement: polished + marquee ---- */
.wl-move:first-child {
  position: relative;
  align-items: center;
  padding: 4px 8px 4px 10px;
  margin: 0 -4px;
  border-radius: var(--radius);
  color: var(--text);
  background: linear-gradient(90deg, rgba(76,175,109,0.14), transparent 75%);
  box-shadow: inset 2px 0 0 var(--green);
}

/* small NEW tag */
.wl-move:first-child::before {
  content: "NEW";
  position: absolute; top: -7px; right: 6px;
  font: 700 9px/1 'Inter', sans-serif;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--amber);
  color: #0e2015;
  animation: wl-pulse 2s ease-in-out infinite;
}

/* marquee on the middle column (ISS number / location) */
.wl-move:first-child > :nth-child(2) {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  animation: wl-marquee 9s linear infinite;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.wl-move:first-child:hover > :nth-child(2) { animation-play-state: paused; }

/* quantity pops a bit */
.wl-move:first-child > :last-child { font-weight: 700; }

@keyframes wl-marquee {
  from { text-indent: 100%; }
  to   { text-indent: -100%; }
}
@keyframes wl-pulse { 50% { opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  .wl-move:first-child > :nth-child(2),
  .wl-move:first-child::before { animation: none; text-indent: 0; }
}
  /* ---- Editable GRN number ---- */
  .grn-edit { display: flex; gap: 8px; align-items: center; }
  .grn-edit input { flex: 1; min-width: 0; }

  /* ---- Nav rail polish: hover animation ---- */
  .nav-item {
    position: relative;
    overflow: hidden;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
  }
  /* accent bar that slides in on the left edge */
  .nav-item::before {
    content: "";
    position: absolute; left: 0; top: 18%; bottom: 18%;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--amber);
    transform: scaleY(0); transform-origin: center;
    transition: transform .22s cubic-bezier(.3,1.4,.5,1);
  }
  .nav-item.active::before,
  .nav-item:hover::before { transform: scaleY(1); }

  .nav-item svg {
    transition: transform .25s cubic-bezier(.3,1.5,.5,1), filter .2s ease;
  }
  .nav-item:hover:not(.active) {
    color: var(--text);
    background: rgba(255,255,255,0.05);
  }
  .nav-item:hover svg {
    transform: translateY(-2px) scale(1.14);
  }
  .nav-item:hover:not(.active) svg { filter: drop-shadow(0 3px 5px rgba(0,0,0,.45)); }
  .nav-item.active svg { filter: drop-shadow(0 0 6px rgba(245,166,35,.45)); }
  .nav-item.active:hover { background: rgba(245,166,35,0.16); }

  /* label eases out slightly on hover */
  .nav-item { letter-spacing: 0.04em; }
  .nav-item:hover { letter-spacing: 0.07em; }

  /* press feedback + keyboard focus */
  .nav-item:active { transform: scale(0.95); }
  .nav-item:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }

  /* brand square gets a small wiggle */
  .nav-brand { transition: transform .3s cubic-bezier(.3,1.5,.5,1), box-shadow .3s ease; }
  .nav-brand:hover { transform: rotate(-6deg) scale(1.08); box-shadow: 0 4px 14px rgba(245,166,35,.35); }

  @media (prefers-reduced-motion: reduce) {
    .nav-item, .nav-item svg, .nav-item::before, .nav-brand { transition: none; }
    .nav-item:hover svg, .nav-item:hover, .nav-brand:hover { transform: none; }
  }

  /* ---- Nav rail: neon purple & pink hover ---- */
  .nav-rail { --neon-purple: #b44cff; --neon-pink: #ff3ec9; }

  /* gradient accent bar with glow */
  .nav-item::before {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-pink));
    box-shadow: 0 0 8px var(--neon-pink), 0 0 14px var(--neon-purple);
  }
  .nav-item.active::before { background: var(--amber); box-shadow: 0 0 8px rgba(245,166,35,.7); }
  .nav-item.active:hover::before,
  .nav-item:hover::before {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-pink));
    box-shadow: 0 0 8px var(--neon-pink), 0 0 14px var(--neon-purple);
  }

  /* light sweep that runs across the item once on hover */
  .nav-item::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255,160,235,.28) 50%, transparent 70%);
    transform: translateX(-130%);
    pointer-events: none;
  }
  .nav-item:hover::after { animation: neon-sweep .9s ease-out forwards; }

  .nav-item:hover,
  .nav-item.active:hover {
    color: #ffe3f8;
    background: linear-gradient(135deg, rgba(180,76,255,.22), rgba(255,62,201,.22));
    text-shadow: 0 0 6px rgba(255,62,201,.9), 0 0 12px rgba(180,76,255,.8);
    animation: neon-pulse 1.8s ease-in-out infinite;
  }
  .nav-item:hover svg,
  .nav-item.active:hover svg {
    stroke: #ffd2f4;
    filter: drop-shadow(0 0 3px var(--neon-pink)) drop-shadow(0 0 9px var(--neon-purple));
    animation: neon-flicker 2.4s ease-in-out infinite;
  }
  .nav-item:active { filter: brightness(1.25); }

  @keyframes neon-pulse {
    0%, 100% {
      box-shadow: inset 0 0 0 1px rgba(180,76,255,.75), inset 0 0 14px rgba(180,76,255,.30), 0 0 8px rgba(180,76,255,.55);
    }
    50% {
      box-shadow: inset 0 0 0 1px rgba(255,62,201,.85), inset 0 0 16px rgba(255,62,201,.32), 0 0 12px rgba(255,62,201,.65);
    }
  }
  @keyframes neon-sweep { to { transform: translateX(130%); } }
  @keyframes neon-flicker {
    0%, 100% { opacity: 1; }
    46%      { opacity: 1; }
    48%      { opacity: .75; }
    50%      { opacity: 1; }
    52%      { opacity: .85; }
  }

  @media (prefers-reduced-motion: reduce) {
    .nav-item:hover, .nav-item.active:hover, .nav-item:hover svg, .nav-item:hover::after { animation: none; }
    .nav-item:hover { box-shadow: inset 0 0 0 1px rgba(255,62,201,.7); }
  }

  /* ---- Home dashboard cards: neon purple & pink hover ---- */
  .wl-item {
    --neon-purple: #b44cff; --neon-pink: #ff3ec9;
    position: relative;
    transition: transform .22s cubic-bezier(.3,1.4,.5,1), border-color .2s ease, background-color .2s ease;
  }
  /* light sweep across the card (background moves, so nothing needs clipping) */
  .wl-item::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 35%, rgba(255,160,235,.16) 50%, transparent 65%) no-repeat;
    background-size: 250% 100%;
    background-position: 150% 0;
  }
  .wl-item:hover,
  .wl-item.low:hover {
    transform: translateY(-3px);
    border-color: var(--neon-pink);
    background: linear-gradient(135deg, rgba(180,76,255,.10), rgba(255,62,201,.08)), var(--panel-2);
    animation: wl-neon-pulse 1.8s ease-in-out infinite;
  }
  .wl-item:hover::after { animation: wl-neon-sweep 1s ease-out forwards; }

  .wl-item:hover .wl-code {
    color: #ffe3f8;
    text-shadow: 0 0 6px rgba(255,62,201,.85), 0 0 14px rgba(180,76,255,.7);
  }
  .wl-item:hover .wl-stock span { text-shadow: 0 0 10px rgba(255,62,201,.55); }
  .wl-item:hover .wl-bar .fill:not(.low) {
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
    box-shadow: 0 0 8px rgba(255,62,201,.7);
  }
  .wl-item:hover .wl-bar .min { box-shadow: 0 0 6px var(--amber); }
  .wl-item:hover .wl-actions .btn { border-color: rgba(255,62,201,.5); }
  .wl-item:hover .wl-actions .btn:hover {
    box-shadow: 0 0 10px rgba(255,62,201,.6), inset 0 0 8px rgba(180,76,255,.35);
    color: #ffe3f8;
  }

  @keyframes wl-neon-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(180,76,255,.65), 0 0 14px rgba(180,76,255,.45), 0 10px 24px rgba(0,0,0,.35); }
    50%      { box-shadow: 0 0 0 1px rgba(255,62,201,.8),  0 0 20px rgba(255,62,201,.5),  0 10px 24px rgba(0,0,0,.35); }
  }
  @keyframes wl-neon-sweep { to { background-position: -50% 0; } }

  @media (prefers-reduced-motion: reduce) {
    .wl-item, .wl-item:hover, .wl-item:hover::after { animation: none; transition: none; transform: none; }
    .wl-item:hover { box-shadow: 0 0 0 1px rgba(255,62,201,.7); }
  }

  /* ---- Item pictures ---- */
  /* Issue / Receive line picker: thumbnail beside the chosen item */
  .item-combo { display: flex; align-items: center; gap: 8px; }
  .item-combo input.combo-input { flex: 1; min-width: 0; width: auto; }
  .item-thumb-wrap { position: relative; flex: 0 0 auto; width: 38px; height: 38px; cursor: zoom-in; }
  .item-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); display: block; transition: border-color .15s ease, box-shadow .15s ease; }
  .item-thumb-wrap:hover .item-thumb { border-color: #ff3ec9; box-shadow: 0 0 10px rgba(255,62,201,.55); }
  .item-thumb-pop {
    display: none; position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 60;
    width: 220px; height: 220px; object-fit: contain; background: #fff;
    border: 2px solid #b44cff; border-radius: 6px; box-shadow: 0 12px 34px rgba(0,0,0,.6), 0 0 18px rgba(180,76,255,.5);
    pointer-events: none;
  }
  .item-thumb-wrap:hover .item-thumb-pop { display: block; }
  /* thumbnails inside the dropdown list and the Master table */
  .combo-option { display: flex; align-items: center; gap: 9px; }
  .opt-thumb, .m-thumb { width: 30px; height: 30px; flex: 0 0 30px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); display: inline-block; }
  .opt-thumb.empty, .m-thumb.empty { border-style: dashed; opacity: .5; }
  /* full-size viewer */
  .pic-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
  .pic-overlay figure { margin: 0; text-align: center; }
  .pic-overlay img { max-width: min(92vw, 900px); max-height: 82vh; background: #fff; border-radius: 6px; box-shadow: 0 0 30px rgba(180,76,255,.5); }
  .pic-overlay figcaption { color: var(--text); font-size: 13px; margin-top: 10px; }
  /* Master edit / add: picture card */
  .pic-edit { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
  .pic-box { width: 180px; height: 180px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 12.5px; overflow: hidden; }
  .pic-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; cursor: zoom-in; }
  .pic-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: 380px; }
  .pic-actions .btn { display: inline-block; text-align: center; }
  .pic-actions [hidden] { display: none; }

  /* ---- Sign-in screen, user chip ---- */
  .topbar-right { display: flex; align-items: center; gap: 18px; }
  .user-chip { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
  .user-chip:empty { display: none; }
  .uc-name { font-weight: 600; color: var(--text); }
  .uc-role { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; }
  .uc-btn { background: none; border: 1px solid var(--line); color: var(--text-dim); border-radius: var(--radius); padding: 4px 10px; font: 600 11.5px 'Inter', sans-serif; cursor: pointer; transition: color .15s, border-color .15s, box-shadow .15s; }
  .uc-btn:hover { color: #ffe3f8; border-color: #ff3ec9; box-shadow: 0 0 8px rgba(255,62,201,.45); }

  .auth-screen {
    position: fixed; inset: 0; z-index: 500; display: none; align-items: center; justify-content: center; padding: 16px;
    background: radial-gradient(900px 500px at 15% 10%, rgba(180,76,255,.18), transparent 60%),
                radial-gradient(800px 500px at 90% 95%, rgba(255,62,201,.14), transparent 60%), var(--bg);
  }
  .auth-card {
    width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px 26px 24px;
    display: flex; flex-direction: column; gap: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(180,76,255,.18);
  }
  .auth-brand { width: 44px; height: 44px; background: var(--amber); color: #16191C; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font: 700 19px 'Oswald', sans-serif; margin-bottom: 10px; }
  .auth-card h2 { margin: 0; font-size: 22px; }
  .auth-sub { color: var(--text-dim); font-size: 12.5px; margin-bottom: 10px; }
  .auth-card label { font-size: 11.5px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-top: 8px; }
  .auth-card input { width: 100%; padding: 11px 12px; }
  .auth-card input:focus { border-color: #b44cff; box-shadow: 0 0 0 3px rgba(180,76,255,.25); }
  .auth-btn { margin-top: 14px; padding: 12px; }
  .auth-msg { background: rgba(245,166,35,.1); border: 1px solid var(--amber); color: var(--text); border-radius: var(--radius); padding: 8px 10px; font-size: 12.5px; margin-bottom: 4px; }
  .auth-err { color: var(--red); font-size: 12.5px; min-height: 18px; margin-top: 6px; }
