* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 28px;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(104, 124, 57, 0.18), transparent 35%),
    linear-gradient(135deg, #080a07, #11130d 55%, #070807);
  color: #d8d1bd;
  max-width: 1150px;
}

h1 {
  font-size: 44px;
  letter-spacing: 6px;
  margin: 0 0 28px;
  color: #c8c0aa;
  text-shadow: 0 3px 0 #000;
}

h1::after {
  content: "WAREHOUSE INVENTORY SYSTEM";
  display: block;
  font-size: 13px;
  letter-spacing: 3px;
  color: #8b9560;
  margin-top: 4px;
}

input {
  width: 100%;
  padding: 16px 18px;
  font-size: 22px;
  background: #11130f;
  color: #e8e0c8;
  border: 1px solid #414735;
  border-radius: 10px;
  outline: none;
  margin-bottom: 14px;
}

input:focus {
  border-color: #7f923d;
  box-shadow: 0 0 0 3px rgba(127, 146, 61, 0.2);
}

button {
  width: 100%;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid #59653a;
  border-radius: 10px;
  background: linear-gradient(180deg, #4f6229, #2c3619);
  color: #e8e0c8;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  text-transform: uppercase;
}

button:hover {
  filter: brightness(1.15);
}

#returnsBtn {
  background: linear-gradient(180deg, #7b6a25, #40350f);
  border-color: #b79a35;
}

#correctionsBtn {
  background: linear-gradient(180deg, #3b4027, #1d2116);
  border-color: #7f923d;
}

#result {
  margin-top: 22px;
}

#result > h2 {
  font-size: 22px;
  margin: 18px 0;
}

.part-card {
  margin-top: 16px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    #11130f;
  border: 1px solid #3f4631;
  border-radius: 14px;
  box-shadow: 0 14px 35px rgba(0,0,0,0.45);
}

.part-card h2 {
  font-size: 34px;
  margin: 0 0 18px;
  color: #d8d1bd;
  letter-spacing: 2px;
}

.part-card p {
  font-size: 18px;
  margin: 8px 0;
}

.part-card strong {
  display: block;
  font-size: 12px;
  color: #8b9560;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.part-card p:first-of-type {
  padding: 14px 16px;
  border: 1px solid #6f8137;
  border-radius: 12px;
  background: rgba(91, 111, 43, 0.18);
  font-size: 26px;
  font-weight: 900;
  color: #8fa34a;
}

.part-card h3 {
  margin-top: 18px;
  font-size: 16px;
  color: #8b9560;
  text-transform: uppercase;
  letter-spacing: 2px;
}

textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  background: #151811;
  color: #e8e0c8;
  border: 1px solid #414735;
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 12px;
}

.sort-buttons {
  display: flex;
  gap: 12px;
  margin: 12px 0 20px;
}

.sort-buttons button {
  flex: 1;
}

.compact-card {
  padding: 0;
  overflow: hidden;
}

.part-summary {
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
}

.part-summary:hover {
  background: rgba(91, 111, 43, 0.12);
}

.arrow {
  color: #d8d1bd;
  font-size: 18px;
}

.summary-bin {
  background: rgba(91, 111, 43, 0.35);
  border: 1px solid #59653a;
  border-radius: 7px;
  padding: 6px 12px;
  color: #9fb653;
  font-weight: 900;
  font-size: 22px;
}

.summary-soh {
  font-size: 16px;
  color: #e8e0c8;
}

.part-details {
  padding: 22px;
  border-top: 1px solid #3f4631;
}

.part-summary strong {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #e8e0c8;
}

.return-add-btn {
  background: linear-gradient(180deg, #8b7428, #4c3d10);
  border-color: #c3a340;
}

.return-header {
  margin-bottom: 20px;
}

.return-header h2 {
  font-size: 30px;
  margin-bottom: 14px;
}

.return-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.danger-btn {
  background: linear-gradient(180deg, #693636, #351919);
  border-color: #8c4a4a;
}

.return-section {
  margin: 28px 0;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #404832;
  background: rgba(12, 14, 10, 0.72);
}

.return-section > h2 {
  margin: 0 0 16px;
  letter-spacing: 2px;
  font-size: 21px;
}

.return-section.ground {
  border-color: #6f8137;
}

.return-section.lift {
  border-color: #9a762c;
}

.return-section.unknown {
  border-color: #824242;
}

.return-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #3f4631;
  border-radius: 12px;
  background: #11130f;
}

.route-number {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #59653a;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.return-main {
  min-width: 0;
}

.return-part {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
}

.return-bin {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(91, 111, 43, 0.35);
  border: 1px solid #59653a;
  color: #a6bd5b;
  font-size: 22px;
  font-weight: 900;
}

.return-description {
  margin-top: 8px;
  color: #bcb59f;
}

.return-quantity {
  padding: 8px 10px;
  border-radius: 8px;
  background: #24281d;
  border: 1px solid #4c543c;
  font-weight: 900;
  white-space: nowrap;
}

.return-card-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 70px 70px 1fr;
  gap: 10px;
}

.return-card-actions button {
  margin: 0;
}

.complete-btn {
  background: linear-gradient(180deg, #4e7130, #263b16);
  border-color: #729848;
}

@media (min-width: 800px) {
  .part-card {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 14px 28px;
    align-items: start;
  }

  .part-card h2,
  .part-card h3,
  .part-card button,
  .part-card div {
    grid-column: 1 / -1;
  }

  .part-card p {
    margin: 0;
  }

  .part-card p:first-of-type {
    grid-column: 1 / 2;
  }
}

@media (max-width: 650px) {
  body {
    padding: 18px;
  }

  h1 {
    font-size: 34px;
  }

  .part-summary {
    grid-template-columns: 24px 1fr;
    gap: 10px;
  }

  .summary-bin,
  .summary-soh {
    grid-column: 2;
    justify-self: start;
  }

  .return-actions {
    grid-template-columns: 1fr;
  }

  .return-card {
    grid-template-columns: 42px 1fr;
  }

  .return-quantity {
    grid-column: 2;
    justify-self: start;
  }
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-thumb {
  background: #59653a;
  border-radius: 10px;
}

/* ----------------------------
   AUTHENTICATION + USER MANAGER
----------------------------- */
.hidden { display: none !important; }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(104, 124, 57, 0.22), transparent 38%),
    linear-gradient(135deg, #080a07, #11130d 55%, #070807);
}

.auth-card {
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid #4a5238;
  border-radius: 18px;
  background: rgba(17, 19, 15, 0.97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.auth-brand {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #d8d1bd;
}

.auth-subtitle {
  margin: 4px 0 28px;
  color: #8b9560;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.auth-form h2 { margin: 0 0 8px; }
.auth-form p { color: #aaa38f; }
label {
  display: block;
  margin: 10px 0 7px;
  color: #9ba56d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.auth-error { min-height: 22px; color: #df7777 !important; font-weight: 700; }

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.user-panel { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.user-identity { text-align: right; margin-right: 4px; }
.user-identity strong { display: block; color: #e8e0c8; }
.role-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 8px;
  border: 1px solid #68753f;
  border-radius: 999px;
  color: #9fb653;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.header-btn { width: auto; min-width: 90px; padding: 10px 12px; margin: 0; font-size: 12px; }
.logout-btn { background: linear-gradient(180deg, #453e2d, #252117); border-color: #675f49; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  overflow-y: auto;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}
.modal-card {
  width: min(1000px, 100%);
  margin: 20px auto;
  padding: 24px;
  border: 1px solid #4a5238;
  border-radius: 16px;
  background: #11130f;
  box-shadow: 0 24px 70px rgba(0,0,0,.7);
}
.modal-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.modal-header h2 { margin: 0; }
.modal-header p { color: #aaa38f; }
.modal-close { width: 48px; min-width: 48px; margin: 0; padding: 7px; font-size: 28px; }

.account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 20px 0 26px;
  padding: 18px;
  border: 1px solid #3f4631;
  border-radius: 12px;
  background: #0c0e0a;
}
.account-form button, .account-form .auth-error { grid-column: 1 / -1; }
select {
  width: 100%;
  min-height: 57px;
  padding: 14px;
  border: 1px solid #414735;
  border-radius: 10px;
  background: #151811;
  color: #e8e0c8;
  font-size: 16px;
}

.user-list { display: grid; gap: 10px; }
.user-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(160px, 220px) 110px 110px;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid #3f4631;
  border-radius: 12px;
  background: #151811;
}
.user-row.inactive { opacity: .55; }
.user-row strong, .user-row span { display: block; }
.user-row span { margin-top: 3px; color: #8f8977; }
.small-btn { margin: 0; padding: 10px; font-size: 11px; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .45; }

@media (max-width: 760px) {
  .app-header { display: block; }
  .user-panel { justify-content: flex-start; margin-bottom: 16px; }
  .user-identity { text-align: left; width: 100%; margin-bottom: 5px; }
  .account-form { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 1fr 1fr; }
  .user-row > div { grid-column: 1 / -1; }
}


/* v0.4.1 header polish */
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #3f5630;
  border-radius: 999px;
  color: #a9bf70;
  background: rgba(74, 101, 43, .18);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #87a94c;
  box-shadow: 0 0 10px rgba(135, 169, 76, .8);
}
@media (max-width: 760px) {
  .connection-status { order: 2; }
}


/* ----------------------------
   ADMIN INVENTORY IMPORT — v0.5.1
----------------------------- */
.settings-card { width: min(820px, 100%); }
.inventory-upload-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #3f4631;
  border-radius: 14px;
  background: #0c0e0a;
}
.settings-section-header { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; }
.settings-section-header h3 { margin:0 0 6px; font-size:22px; }
.settings-section-header p { margin:0 0 18px; color:#aaa38f; }
.inventory-count {
  flex:0 0 auto; padding:9px 12px; border:1px solid #68753f; border-radius:999px;
  color:#a9bf70; background:rgba(74,101,43,.18); font-weight:900; white-space:nowrap;
}
.file-drop {
  display:grid; place-items:center; gap:8px; min-height:170px; padding:24px; margin:0 0 14px;
  border:2px dashed #59653a; border-radius:14px; background:rgba(91,111,43,.08);
  text-align:center; cursor:pointer; text-transform:none; letter-spacing:normal;
}
.file-drop:hover { border-color:#8fa34a; background:rgba(91,111,43,.14); }
.file-drop input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.file-drop strong { color:#d8d1bd; font-size:20px; }
.file-drop span { max-width:580px; color:#918b78; font-size:14px; font-weight:400; }
.upload-progress { height:7px; margin:10px 0; overflow:hidden; border-radius:999px; background:#24281d; }
.upload-progress span { display:block; width:38%; height:100%; border-radius:inherit; background:#8fa34a; animation:import-slide 1s infinite ease-in-out; }
@keyframes import-slide { from{transform:translateX(-110%)} to{transform:translateX(300%)} }
.import-message { min-height:24px; color:#c9c0aa; font-weight:700; }
.import-message.success { color:#9fc36b; }
.import-message.error { color:#df7777; }
.last-import-card { display:grid; gap:5px; margin-top:18px; padding:15px; border:1px solid #3f4631; border-radius:11px; background:#151811; color:#aaa38f; }
.last-import-card strong { color:#d8d1bd; }
.last-import-card span { display:block; }
@media(max-width:650px){ .settings-section-header{display:block}.inventory-count{display:inline-block;margin-bottom:16px}.inventory-upload-panel{padding:15px} }

/* ----------------------------
   AUDIT MODE + CHANGE REVIEW
----------------------------- */
.audit-card.part-card { display:block; }
.part-summary { width:100%; margin:0; border:0; border-radius:0; background:transparent; text-align:left; text-transform:none; }
.pending-pill { padding:5px 9px; border-radius:999px; background:#6d5520; border:1px solid #a9822f; color:#f0d27b; font-size:12px; white-space:nowrap; }
.audit-details { padding:22px; }
.audit-card-header { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; }
.audit-card-header > div { min-width:0; }
.audit-bin-block { text-align:right; }
.audit-part-number { font-size:34px !important; color:#eee5ca !important; letter-spacing:2px !important; }
.audit-bin-block strong { font-size:30px !important; color:#a9c25b !important; }
.audit-label { display:block; margin-bottom:5px; color:#8b9560; font-size:11px; font-weight:900; letter-spacing:2px; text-transform:uppercase; }
.audit-data-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:20px 0; }
.audit-data-grid > div { padding:13px; border:1px solid #3f4631; border-radius:10px; background:#0d0f0b; }
.audit-data-grid strong { color:#e8e0c8; font-size:17px; letter-spacing:0; text-transform:none; }
.audit-description { margin:0 0 18px !important; color:#bcb59f; }
.audit-action-row { display:flex !important; flex-wrap:nowrap; gap:10px; align-items:stretch; }
.audit-action { width:auto !important; min-width:0; flex:1 1 0; min-height:82px; margin:0 !important; padding:9px 5px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; border-radius:10px; font-size:10px; line-height:1.15; letter-spacing:.35px; }
.audit-action-icon { width:34px; height:34px; display:grid; place-items:center; border:2px solid currentColor; border-radius:7px; font-size:20px; line-height:1; }
.audit-action.return-action { background:linear-gradient(180deg,#7b6a25,#40350f); border-color:#b79a35; }
.audit-action.correct-action { background:linear-gradient(180deg,#4e7130,#263b16); border-color:#729848; }
.part-pending-list { margin-top:16px; padding:14px; border-left:4px solid #9a762c; background:rgba(154,118,44,.1); border-radius:8px; }
.part-pending-list strong,.part-pending-list span { display:block; }
.part-pending-list span { margin-top:7px; color:#d2c6a5; }
.action-modal-card { max-width:560px; }
.change-filter-row,.change-actions,.reconciliation-actions { display:flex; gap:10px; flex-wrap:wrap; margin:14px 0; }
.change-filter-row button,.change-actions button,.reconciliation-actions button { width:auto; flex:1; min-width:120px; }
.change-card { margin:12px 0; padding:16px; border:1px solid #3f4631; border-left-width:5px; border-radius:12px; background:#11130f; }
.change-card.severity-low { border-left-color:#66734b; }
.change-card.severity-medium { border-left-color:#a9822f; }
.change-card.severity-high { border-left-color:#9b4f45; }
.change-card-top,.change-values { display:flex; justify-content:space-between; gap:18px; align-items:center; }
.change-card-top > strong { font-size:26px; }
.change-values { margin:12px 0; }
.status-badge { display:inline-block; padding:5px 9px; border:1px solid #59653a; border-radius:999px; font-size:11px; font-weight:900; text-transform:uppercase; }
.status-approved { border-color:#729848; color:#a9cb77; }
.status-rejected { border-color:#8c4a4a; color:#d78d82; }
.status-pending { border-color:#a9822f; color:#e1bd59; }
.reconciliation-card { max-width:1050px; }
.reconciliation-summary { margin:16px 0; padding:14px; border:1px solid #59653a; border-radius:10px; background:#11130f; font-weight:800; }
.reconcile-row { display:grid; grid-template-columns:1.2fr 1fr 1fr 1fr 1fr 1.3fr auto; gap:10px; align-items:center; margin:10px 0; padding:12px; border:1px solid #3f4631; border-radius:10px; }
.reconcile-row.safe { border-left:5px solid #729848; }
.reconcile-row.conflict,.reconcile-row.missing { border-left:5px solid #9b4f45; }
.reconcile-row input { margin:4px 0 0; padding:8px; font-size:15px; }

@media (max-width: 800px) {
  .audit-data-grid { grid-template-columns:1fr 1fr; }
  .audit-action-row { flex-wrap:wrap; }
  .audit-action { flex:1 1 calc(33.333% - 10px); }
  .reconcile-row { grid-template-columns:1fr 1fr; }
}

@media (max-width: 520px) {
  .audit-card-header { flex-direction:column; }
  .audit-bin-block { text-align:left; }
  .audit-data-grid { grid-template-columns:1fr; }
  .audit-action { flex-basis:calc(50% - 10px); }
}


/* ----------------------------
   PICK MODE — v0.7.0
----------------------------- */
.audit-action.pick-action {
  background: linear-gradient(180deg, #345d70, #18313c);
  border-color: #4f8197;
}
.pick-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 18px 0;
}
.pick-header h2 { margin: 0 0 5px; }
.pick-header p { margin: 0; color: #aaa38f; }
.pick-section.lift { border-color: #9a762c; }
.pick-section.ground { border-color: #6f8137; }
.pick-section.moulding { border-color: #6e5c86; }
.pick-section.completed { border-color: #4b5542; opacity: .92; }
.pick-card { position: relative; }
.pick-meta {
  grid-column: 2 / -1;
  color: #847e6d;
  font-size: 12px;
}
.pick-card-actions {
  grid-template-columns: 58px 58px minmax(100px, 1fr) minmax(80px, .7fr) minmax(90px, .7fr);
}
.pick-card.status-picked { border-left: 5px solid #729848; background: rgba(72, 104, 48, .12); }
.pick-card.status-missing { border-left: 5px solid #9b4f45; background: rgba(117, 52, 48, .12); }
.pick-card.status-skipped { border-left: 5px solid #a9822f; background: rgba(125, 93, 35, .12); }
@media (max-width: 700px) {
  .pick-header { display: block; }
  .pick-header .return-actions { margin-top: 14px; }
  .pick-card-actions { grid-template-columns: 1fr 1fr; }
  .pick-card-actions .complete-btn { grid-column: 1 / -1; }
}


/* ============================================================
   JW INV ADMIN DASHBOARD — photo-matched home screen v0.7.1
   ============================================================ */
:root {
  --jw-bg: #080a07;
  --jw-panel: #12140f;
  --jw-line: #758a2f;
  --jw-green: #91ad3c;
  --jw-green-bright: #a8ca48;
  --jw-gold: #e0aa16;
  --jw-text: #f1efe9;
  --jw-muted: #c7c4ba;
}
body {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 22%, rgba(99,118,47,.10), transparent 28%),
    radial-gradient(circle at 86% 47%, rgba(99,118,47,.07), transparent 30%),
    linear-gradient(115deg,#090b08 0%,#070906 48%,#0b0d09 100%);
  color: var(--jw-text);
}
#appShell { min-height: 100vh; display:flex; flex-direction:column; }
.app-header {
  min-height: 150px;
  margin: 0;
  padding: 34px 36px 18px;
  align-items: flex-start;
}
h1 { margin:0; font-size:64px; line-height:.95; letter-spacing:8px; color:#f0eee7; text-shadow:0 4px 12px #000; }
h1::after { margin-top:15px; font-size:16px; letter-spacing:2.6px; color:#9ab52f; }
.user-panel { gap:10px; align-items:flex-start; }
.connection-status { margin-top:8px; padding:8px 14px; border-color:#6d8430; background:#0b0d09; color:#9fbd3f; font-size:14px; }
.status-dot { width:8px; height:8px; }
.user-identity { min-width:210px; text-align:center; margin:0 4px; }
.user-identity strong { font-size:20px; line-height:1.15; }
.role-badge { margin-top:8px; padding:6px 16px; font-size:14px; border-color:#73872f; }
.header-btn { min-width:145px; height:68px; padding:0 18px; border-radius:9px; font-size:16px; border-color:#6e8132; background:linear-gradient(145deg,rgba(74,87,38,.30),rgba(26,30,19,.7)); }
.header-btn::first-letter { font-size:20px; }
.logout-btn { border-color:#88743a; background:linear-gradient(145deg,rgba(90,71,31,.25),rgba(28,25,17,.75)); }
.dashboard-shell { flex:1; padding:22px 18px 44px; border-bottom:1px solid rgba(117,138,47,.35); }
.dashboard-grid {
  display:grid;
  grid-template-columns: 395px minmax(480px, 642px) 395px;
  justify-content:space-between;
  align-items:start;
  gap:40px;
  max-width:1500px;
  margin:0 auto;
}
.dashboard-column { display:grid; gap:22px; }
.dashboard-card {
  width:100%; height:202px; margin:0; padding:30px;
  display:grid; grid-template-columns:112px 1fr; gap:26px; align-items:center;
  text-align:left; text-transform:none; letter-spacing:0;
  border:1px solid #70852f; border-radius:13px;
  background:linear-gradient(105deg,rgba(33,37,27,.90),rgba(15,17,13,.96));
  box-shadow:inset 0 0 38px rgba(121,145,48,.035),0 10px 24px rgba(0,0,0,.18);
}
.dashboard-card:hover { transform:translateY(-2px); filter:brightness(1.08); box-shadow:0 12px 30px rgba(0,0,0,.34),0 0 18px rgba(144,173,60,.08); }
.dashboard-icon {
  width:112px; height:112px; display:grid; place-items:center;
  border:1px solid #62772c; border-radius:50%;
  background:radial-gradient(circle at 35% 30%,rgba(128,153,53,.25),rgba(37,43,23,.35) 52%,rgba(12,14,10,.5));
  color:#94b640; font-size:55px; font-weight:500; line-height:1;
  text-shadow:0 0 15px rgba(144,173,60,.3);
}
.dashboard-icon-gold { color:#e6ad17; border-color:#a77e0e; background:radial-gradient(circle at 35% 30%,rgba(150,105,15,.25),rgba(45,36,16,.45) 55%,rgba(12,14,10,.5)); }
.dashboard-card-copy { display:block; }
.dashboard-title { display:block; margin-bottom:13px; color:#f4f2ec; font-size:26px; font-weight:900; line-height:1.08; text-transform:uppercase; text-shadow:0 2px 3px #000; }
.dashboard-title em { margin-left:8px; color:#93ae36; font-size:17px; font-style:normal; }
.returns-card .dashboard-title em { color:#e5ad16; }
.dashboard-description { display:block; color:#e0ded7; font-size:18px; font-weight:400; line-height:1.55; }
.dashboard-center { padding-top:88px; display:flex; flex-direction:column; gap:112px; }
.search-panel { padding:46px 38px 42px; border:1px solid #4d513d; border-radius:13px; background:linear-gradient(145deg,rgba(26,29,22,.76),rgba(15,17,13,.86)); }
.search-panel label { margin:0 0 22px; color:#8fae39; font-size:20px; text-align:center; text-transform:none; letter-spacing:0; }
.search-panel input { height:86px; margin:0 0 30px; padding:0 25px; border:2px solid #87a42d; border-radius:11px; background:#11130f; font-size:20px; box-shadow:0 0 0 2px rgba(130,158,42,.11),inset 0 0 30px rgba(0,0,0,.22); }
.search-panel .primary-search { height:89px; margin:0; border-color:#718631; border-radius:10px; background:linear-gradient(100deg,#4d6129,#34431f); font-size:25px; }
.pick-mode-preview { min-height:185px; padding:28px 27px; border:1px solid #4b4f3c; border-radius:13px; background:linear-gradient(145deg,rgba(24,27,20,.85),rgba(14,16,12,.92)); cursor:pointer; }
.pick-preview-top { display:grid; grid-template-columns:86px 1fr auto; gap:20px; align-items:center; }
.dashboard-icon.small-truck { width:86px; height:86px; font-size:42px; }
.pick-preview-copy strong { display:block; margin-bottom:14px; font-size:25px; text-transform:uppercase; }
.pick-preview-copy span { color:#dedbd0; font-size:15px; }
.pick-preview-copy b { color:#8fac39; font-weight:500; }
.pick-preview-top button { width:auto; min-width:213px; height:47px; margin:0; padding:0 16px; border-radius:8px; font-size:14px; }
.pick-mode-preview p { margin:16px 0 0 104px; color:#efede7; font-size:15px; }
.legacy-action-buttons { display:none!important; }
.dashboard-result { max-width:1000px; margin:35px auto 0; padding:0; }
.dashboard-result:has(.part-card), .dashboard-result:has(h2), .dashboard-result:has(textarea), .dashboard-result:has(.change-card), .dashboard-result:has(.return-batch), .dashboard-result:has(.pick-batch) { padding:20px; border:1px solid #424834; border-radius:13px; background:rgba(15,17,13,.88); }
body::after { content:"JW INV © 2026"; display:block; padding:26px 0; color:#788b32; text-align:center; letter-spacing:2px; }
@media (max-width: 1250px) {
  .dashboard-grid { grid-template-columns:320px minmax(420px,1fr) 320px; gap:24px; }
  .dashboard-card { grid-template-columns:88px 1fr; height:180px; padding:22px; gap:18px; }
  .dashboard-icon { width:88px;height:88px;font-size:44px; }
  .dashboard-title { font-size:21px; }
  .dashboard-description { font-size:16px; }
  .dashboard-center { gap:70px; }
}
@media (max-width: 900px) {
  .app-header { padding:24px 20px; }
  h1 { font-size:48px; }
  .user-panel { width:100%; margin-top:20px; justify-content:flex-start; }
  .user-identity { min-width:0; text-align:left; }
  .header-btn { min-width:120px; height:52px; }
  .dashboard-grid { grid-template-columns:1fr 1fr; }
  .dashboard-center { grid-column:1/-1; grid-row:1; padding-top:0; gap:28px; }
  .dashboard-column { grid-row:2; }
}
@media (max-width: 620px) {
  .dashboard-shell { padding:12px; }
  .dashboard-grid { grid-template-columns:1fr; gap:16px; }
  .dashboard-center,.dashboard-column { grid-column:1; grid-row:auto; gap:16px; }
  .search-panel { padding:24px 18px; }
  .search-panel input,.search-panel .primary-search { height:64px; }
  .dashboard-card { height:145px; grid-template-columns:72px 1fr; padding:18px; }
  .dashboard-icon { width:72px;height:72px;font-size:36px; }
  .dashboard-title { font-size:19px; }
  .dashboard-description { font-size:14px; }
  .pick-preview-top { grid-template-columns:64px 1fr; }
  .dashboard-icon.small-truck { width:64px;height:64px; }
  .pick-preview-top button { grid-column:1/-1; width:100%; }
  .pick-mode-preview p { margin-left:0; }
}

/* =========================================================
   JW INV BRANDED LOGIN — v0.7.2
   ========================================================= */
.auth-screen {
  overflow: auto;
  padding: 34px;
  background:
    linear-gradient(rgba(4, 6, 5, .92), rgba(4, 6, 5, .95)),
    radial-gradient(circle at 76% 48%, rgba(193, 154, 107, .10), transparent 34%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(125, 143, 76, .025) 80px),
    #070908;
}
.auth-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(116, 135, 73, .10), transparent 28%),
    linear-gradient(115deg, transparent 0 68%, rgba(71, 55, 34, .05) 68% 100%);
}
.auth-card {
  position: relative;
  width: min(1040px, 96vw);
  min-height: 510px;
  padding: 0;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  overflow: hidden;
  border: 1px solid rgba(112, 129, 67, .52);
  border-radius: 10px;
  background: rgba(10, 12, 10, .97);
  box-shadow: 0 30px 90px rgba(0,0,0,.78), inset 0 0 70px rgba(105,121,64,.025);
}
.auth-card::after {
  content: "";
  position: absolute;
  left: 56%; top: 44px; bottom: 44px;
  width: 1px;
  background: linear-gradient(transparent, rgba(129,144,83,.42) 13%, rgba(129,144,83,.42) 87%, transparent);
}
.auth-brand-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 510px;
  padding: 38px 52px 34px 42px;
  background: radial-gradient(circle at 42% 42%, rgba(109,126,68,.07), transparent 44%);
}
.auth-brand-panel img {
  display: block;
  width: min(100%, 520px);
  max-height: 420px;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: saturate(.93) contrast(1.05);
}
.auth-form-panel {
  display: grid;
  place-items: center;
  padding: 52px 48px;
}
.auth-form { width: min(100%, 370px); }
.auth-form-heading { margin-bottom: 25px; }
.auth-form-heading > span {
  display: block;
  margin-bottom: 8px;
  color: #879546;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}
.auth-form-heading h2 {
  margin: 0 0 8px;
  color: #eee9df;
  font-size: 29px;
  line-height: 1;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.auth-form-heading p {
  margin: 0;
  color: #8e9187;
  font-size: 13px;
  line-height: 1.5;
}
.auth-field {
  position: relative;
  height: 52px;
  margin: 0 0 13px;
  display: flex;
  align-items: center;
  border: 1px solid #30352d;
  border-radius: 5px;
  background: linear-gradient(180deg, #101310, #0b0d0b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 7px 16px rgba(0,0,0,.18);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-field:focus-within {
  border-color: #778b43;
  box-shadow: 0 0 0 2px rgba(120,141,67,.10), inset 0 1px 0 rgba(255,255,255,.03);
}
.auth-field-icon {
  width: 48px;
  display: grid;
  place-items: center;
  color: #e8e5dd;
  font-size: 13px;
  opacity: .92;
}
.auth-field input {
  height: 100%;
  width: calc(100% - 48px);
  margin: 0;
  padding: 0 16px 0 0;
  border: 0 !important;
  outline: 0;
  border-radius: 0;
  background: transparent !important;
  color: #e7e5df;
  font-size: 15px;
  box-shadow: none !important;
}
.auth-field input::placeholder { color: #9b9d97; opacity: 1; }
.auth-submit {
  height: 54px;
  margin: 7px 0 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid #7d914a;
  border-radius: 5px;
  background: linear-gradient(105deg, #667a38, #52652f 58%, #405029);
  color: #f2efe8;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px rgba(0,0,0,.28);
}
.auth-submit:hover { filter: brightness(1.12); transform: translateY(-1px); }
.auth-submit span { font-size: 23px; font-weight: 400; line-height: 1; }
.auth-error { margin: 10px 0 0 !important; min-height: 22px; font-size: 12px; }
.auth-footer {
  position: fixed;
  left: 0; right: 0; bottom: 17px;
  color: #667139;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
}
.auth-footer span { margin: 0 10px; color: #a27c4e; }
@media (max-width: 820px) {
  .auth-screen { padding: 18px; align-items: start; }
  .auth-card { grid-template-columns: 1fr; width: min(560px, 100%); margin: 18px 0 55px; }
  .auth-card::after { left: 34px; right: 34px; top: 288px; bottom: auto; width: auto; height: 1px; }
  .auth-brand-panel { min-height: 290px; padding: 26px 35px 22px; }
  .auth-brand-panel img { max-height: 235px; }
  .auth-form-panel { padding: 35px 30px 40px; }
}
@media (max-width: 480px) {
  .auth-screen { padding: 10px; }
  .auth-card { margin-top: 8px; border-radius: 8px; }
  .auth-brand-panel { min-height: 238px; padding: 18px 24px 12px; }
  .auth-brand-panel img { max-height: 205px; }
  .auth-card::after { top: 238px; left: 22px; right: 22px; }
  .auth-form-panel { padding: 28px 22px 34px; }
  .auth-form-heading h2 { font-size: 25px; }
  .auth-footer { position: absolute; bottom: 8px; font-size: 8px; letter-spacing: 1.2px; }
}

/* ============================================================
   v0.8.0 PROPOSAL — DISCORD-STYLE APPLICATION SHELL
   Navigation/layout only. Existing inventory workflows remain intact.
   ============================================================ */

:root {
  --shell-rail: #0b0d0a;
  --shell-sidebar: #131610;
  --shell-main: #191c16;
  --shell-panel: #20241b;
  --shell-panel-2: #171a14;
  --shell-border: #31382a;
  --shell-muted: #8f9782;
  --shell-accent: #9bb83d;
  --shell-accent-strong: #b1cf4b;
  --shell-gold: #d4a52f;
  --shell-danger: #ba5c52;
}

body {
  padding: 0;
  overflow: hidden;
  background: #0b0d0a;
}

#appShell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #0b0d0a;
}

/* The old header remains in markup because auth/user logic uses its IDs.
   On the proposed shell it becomes a hidden compatibility layer. */
#appShell > .app-header {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.discord-shell {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-columns: 76px 274px minmax(0, 1fr);
  background: var(--shell-main);
  color: #edf0e8;
}

.workspace-rail {
  position: relative;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 12px 8px 10px;
  background: var(--shell-rail);
  border-right: 1px solid #20251c;
}

.rail-brand,
.rail-btn {
  position: relative;
  width: 52px;
  min-width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #30372a;
  border-radius: 18px;
  background: #1a1e17;
  color: #b6bea8;
  box-shadow: none;
  transition: border-radius .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.rail-brand {
  border-color: #73872f;
  background: linear-gradient(145deg, #61742e, #35431b);
  color: #fff;
  font-weight: 1000;
  letter-spacing: -1px;
}

.rail-btn:hover,
.rail-btn.active,
.rail-brand:hover {
  border-radius: 14px;
  border-color: #718632;
  background: #465522;
  color: #f7f9f3;
  transform: none;
  filter: none;
}

.rail-btn.active::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 4px;
  height: 32px;
  border-radius: 0 4px 4px 0;
  background: #e8eee1;
}

.rail-icon {
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
}

.rail-label { display: none; }
.rail-divider { width: 34px; height: 1px; background: #30362b; margin: 1px 0 4px; }
.rail-spacer { flex: 1; }

.rail-badge {
  position: absolute;
  right: -5px;
  bottom: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid var(--shell-rail);
  border-radius: 999px;
  background: #a94d45;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.workspace-sidebar {
  position: relative;
  z-index: 30;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--shell-sidebar);
  border-right: 1px solid #292f24;
  overflow: hidden;
}

.sidebar-head {
  min-height: 70px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2b3126;
  box-shadow: 0 1px 0 rgba(255,255,255,.02), 0 7px 16px rgba(0,0,0,.13);
}

.sidebar-head .eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--shell-accent);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 2px;
}

.sidebar-head strong { color: #f4f5f1; font-size: 15px; }
.sidebar-close { display: none; }

.sidebar-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 15px 10px 92px;
}
.sidebar-panel.active { display: block; }
.sidebar-section-title {
  padding: 4px 9px 8px;
  color: #747c6d;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 1.35px;
}

.sidebar-item {
  width: 100%;
  min-height: 48px;
  margin: 2px 0;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #a8afa0;
  text-transform: none;
  letter-spacing: 0;
}
.sidebar-item:hover,
.sidebar-item.active {
  transform: none;
  filter: none;
  background: #252a21;
  color: #f3f5ef;
}
.sidebar-item > span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #2a3025;
  color: #9fb33e;
  font-size: 14px;
  font-weight: 900;
}
.sidebar-item div { min-width: 0; }
.sidebar-item strong,
.sidebar-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-item strong { font-size: 13px; color: inherit; }
.sidebar-item small { margin-top: 2px; color: #777f71; font-size: 10px; font-weight: 600; }
.sidebar-item em {
  min-width: 23px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #303629;
  color: #cbd5ba;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}
.sidebar-item.future-item { opacity: .48; }
.sidebar-item.future-item > span { font-size: 9px; letter-spacing: .3px; }
.sidebar-item.danger-item > span { color: #e08378; }
.sidebar-note {
  margin: 14px 8px;
  padding: 12px;
  border: 1px solid #30372b;
  border-radius: 8px;
  background: #0f120d;
  color: #737b6d;
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-user-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 10px minmax(0,1fr);
  gap: 9px;
  align-items: center;
  padding: 10px 14px;
  background: #0f120d;
  border-top: 1px solid #2a3025;
}
.sidebar-user-card strong,.sidebar-user-card small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-user-card strong { color:#e9ece5; font-size:12px; }
.sidebar-user-card small { margin-top:2px; color:#7e8976; font-size:9px; font-weight:900; letter-spacing:1px; }
.sidebar-status-dot { width:9px;height:9px;border-radius:50%;background:#86a936;box-shadow:0 0 8px rgba(134,169,54,.5); }

.workspace-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 10%, rgba(108,126,53,.055), transparent 27%),
    var(--shell-main);
  overflow: hidden;
}

.workspace-topbar {
  min-height: 70px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #2e3429;
  background: rgba(25,28,22,.96);
  box-shadow: 0 1px 0 rgba(255,255,255,.015), 0 8px 18px rgba(0,0,0,.12);
}
.mobile-nav-trigger { display: none; }
.workspace-heading { min-width:0; flex:1; }
.workspace-heading > span {
  display:block;
  margin-bottom:2px;
  color:#7f8976;
  font-size:9px;
  font-weight:1000;
  letter-spacing:1.7px;
}
.workspace-heading h2 { margin:0; color:#f0f2ed; font-size:17px; line-height:1.1; }
.workspace-top-actions { display:flex;align-items:center;gap:11px; }
.top-online { display:inline-flex;align-items:center;gap:6px;color:#788370;font-size:9px;font-weight:900;letter-spacing:1px; }
.top-online i { width:7px;height:7px;border-radius:50%;background:#8caf3d;box-shadow:0 0 7px rgba(140,175,61,.5); }
.top-avatar {
  width:34px;min-width:34px;height:34px;margin:0;padding:0;border-radius:50%;border:1px solid #65752f;background:#455522;color:#fff;font-size:12px;font-weight:1000;
}

.workspace-search {
  padding: 22px 24px 18px;
  border-bottom: 1px solid #2c3227;
  background: #171a14;
}
.workspace-search.hidden-workspace { display:none; }
.workspace-search label { margin:0 0 8px;color:#7e8875;font-size:9px;letter-spacing:1.35px; }
.search-row { display:grid;grid-template-columns:minmax(0,1fr) 132px;gap:9px;max-width:980px; }
.search-row input {
  min-height: 48px;
  margin:0;
  border:1px solid #353c2f;
  border-radius:7px;
  background:#0d100c;
  color:#f2f4ef;
  font-size:17px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}
.search-row input:focus { border-color:#718532; box-shadow:0 0 0 2px rgba(113,133,50,.14); }
.search-row .primary-search { min-height:48px;margin:0;border-radius:7px;font-size:12px;letter-spacing:.8px; }
.search-row .primary-search span { margin-right:5px;font-size:17px; }
.search-hint { margin-top:8px;color:#687162;font-size:10px; }
.search-hint span { display:inline-grid;place-items:center;margin-right:5px;width:17px;height:17px;border:1px solid #3a4134;border-radius:4px;color:#89947f; }

.workspace-content {
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding: 22px 24px 54px;
}
.dashboard-result.discord-result {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.dashboard-result.discord-result:has(.part-card),
.dashboard-result.discord-result:has(h2),
.dashboard-result.discord-result:has(textarea),
.dashboard-result.discord-result:has(.change-card),
.dashboard-result.discord-result:has(.return-batch),
.dashboard-result.discord-result:has(.pick-batch),
.dashboard-result.discord-result:has(.pick-header),
.dashboard-result.discord-result:has(.return-header) {
  padding: 0;
  border: 0;
  background: transparent;
}
.empty-workspace {
  min-height: 360px;
  display:grid;
  place-items:center;
  align-content:center;
  text-align:center;
  color:#7e8776;
}
.empty-workspace .empty-icon { width:72px;height:72px;display:grid;place-items:center;margin-bottom:15px;border:1px solid #38402f;border-radius:24px;background:#11140f;color:#93ad3b;font-size:34px; }
.empty-workspace h3 { margin:0 0 7px;color:#dfe3da;font-size:20px; }
.empty-workspace p { max-width:520px;margin:0;line-height:1.55;font-size:12px; }

/* Search results: flatter, feed-like cards rather than dashboard blocks. */
.discord-result .part-card.compact-card {
  margin: 0 0 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #1e221a;
  box-shadow: none;
}
.discord-result .part-card.compact-card:hover { border-color:#3a4332;background:#22271e; }
.discord-result .part-summary { min-height:55px; }
.discord-result .part-summary strong { font-size:15px; }
.discord-result .summary-bin { color:#adbf68; }

/* Pick mode: compact queue cards. */
.discord-result .pick-header,
.discord-result .return-header {
  margin-bottom: 18px;
  padding: 0 0 15px;
  border-bottom: 1px solid #30372b;
}
.discord-result .pick-section,
.discord-result .return-section {
  margin: 14px 0 20px;
  padding: 12px;
  border-width: 1px;
  border-radius: 8px;
  background: #171a14;
}
.discord-result .pick-section > h2,
.discord-result .return-section > h2 {
  margin:0 0 8px;
  color:#848d7b;
  font-size:10px;
  letter-spacing:1.6px;
}
.discord-result .return-card.pick-card {
  grid-template-columns: 34px minmax(0,1fr) auto;
  gap: 10px;
  margin-top: 5px;
  padding: 10px 11px;
  border-radius: 7px;
  background:#20241b;
}
.discord-result .pick-card .route-number { width:30px;height:30px;font-size:12px; }
.discord-result .pick-card .return-part { font-size:17px;letter-spacing:.3px; }
.discord-result .pick-card .return-bin {
  margin-top:3px;padding:0;border:0;background:transparent;color:#a9bd61;font-size:13px;
}
.discord-result .pick-card .return-description { margin-top:3px;color:#777f71;font-size:10px; }
.discord-result .pick-card .return-quantity { padding:5px 8px;border-radius:5px;font-size:10px; }
.discord-result .pick-card .pick-meta { grid-column:2 / 4;color:#70796a;font-size:9px; }
.discord-result .pick-card .return-card-actions { grid-column:2 / 4;display:flex;justify-content:flex-end;gap:6px;margin-top:2px; }
.discord-result .pick-card .return-card-actions button { width:auto;min-width:58px;padding:7px 10px;border-radius:5px;font-size:9px;letter-spacing:.4px; }
.discord-result .pick-card.status-picked,
.discord-result .pick-card.status-missing,
.discord-result .pick-card.status-skipped { border-left-width:3px; }

.mobile-sidebar-scrim { display:none; }
.legacy-action-buttons { position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important; }

@media (max-width: 980px) and (min-width: 701px) {
  .discord-shell { grid-template-columns: 68px 220px minmax(0,1fr); }
  .workspace-rail { padding-left:7px;padding-right:7px; }
  .rail-btn,.rail-brand { width:48px;min-width:48px;height:48px; }
  .workspace-sidebar { font-size: 95%; }
  .sidebar-item { padding-left:7px;padding-right:7px; }
  .workspace-content { padding:18px; }
  .workspace-search { padding:18px; }
}

@media (max-width: 700px) {
  body { padding:0!important; overflow:hidden; }
  #appShell { height:100dvh; }
  .discord-shell {
    height:100dvh;
    min-height:100dvh;
    display:grid;
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) 66px;
  }
  .workspace-main { grid-column:1;grid-row:1; }
  .workspace-rail {
    position:relative;
    grid-column:1;
    grid-row:2;
    z-index:60;
    width:100%;
    height:66px;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom));
    flex-direction:row;
    justify-content:space-around;
    gap:0;
    border-right:0;
    border-top:1px solid #2c3228;
    background:#0c0f0b;
  }
  .rail-brand,.rail-divider,.rail-spacer { display:none; }
  .rail-btn {
    width:62px;min-width:58px;height:52px;
    display:flex;flex-direction:column;gap:2px;
    border:0;border-radius:7px;background:transparent;
  }
  .rail-btn:hover,.rail-btn.active { border-radius:7px;background:#1d221a;color:#eef2e9; }
  .rail-btn.active::before { left:50%;bottom:-6px;top:auto;width:28px;height:3px;transform:translateX(-50%);border-radius:3px 3px 0 0;background:#9eb83d; }
  .rail-icon { font-size:20px; }
  .rail-label { display:block;color:#858e7d;font-size:8px;font-weight:900;letter-spacing:.5px;text-transform:uppercase; }
  .rail-btn.active .rail-label { color:#bec9b2; }
  .rail-badge { right:8px;bottom:auto;top:0;border-color:#0c0f0b; }

  .workspace-sidebar {
    position:fixed;
    inset:0 auto 66px 0;
    z-index:90;
    width:min(84vw,320px);
    transform:translateX(-102%);
    transition:transform .18s ease;
    box-shadow:18px 0 40px rgba(0,0,0,.42);
  }
  body.mobile-sidebar-open .workspace-sidebar { transform:translateX(0); }
  .mobile-sidebar-scrim {
    position:fixed;
    inset:0 0 66px 0;
    z-index:80;
    background:rgba(0,0,0,.55);
  }
  body.mobile-sidebar-open .mobile-sidebar-scrim { display:block; }
  .sidebar-close {
    display:grid;place-items:center;width:34px;min-width:34px;height:34px;margin:0;padding:0;border:0;border-radius:7px;background:#252a21;color:#b5bcae;font-size:21px;
  }
  .workspace-topbar { min-height:58px;padding:0 12px;gap:10px; }
  .mobile-nav-trigger {
    display:grid;place-items:center;width:36px;min-width:36px;height:36px;margin:0;padding:0;border:0;border-radius:7px;background:#252a21;color:#d5dbcf;font-size:18px;
  }
  .workspace-heading > span { font-size:8px; }
  .workspace-heading h2 { font-size:15px; }
  .top-online { display:none; }
  .top-avatar { width:32px;min-width:32px;height:32px; }
  .workspace-search { padding:12px; }
  .search-row { grid-template-columns:minmax(0,1fr) 96px;gap:6px; }
  .search-row input { min-height:44px;padding:10px 11px;font-size:16px; }
  .search-row .primary-search { min-height:44px;padding:8px;font-size:9px; }
  .search-row .primary-search span { font-size:14px;margin-right:2px; }
  .search-hint { display:none; }
  .workspace-content { padding:12px 10px 28px; }
  .empty-workspace { min-height:250px; }
  .empty-workspace .empty-icon { width:58px;height:58px;border-radius:18px;font-size:27px; }

  .discord-result .part-card.compact-card { margin-bottom:5px; }
  .discord-result .part-summary { min-height:50px;padding:9px;grid-template-columns:20px minmax(0,1fr);gap:5px 8px; }
  .discord-result .summary-bin,.discord-result .summary-soh,.discord-result .pending-pill { grid-column:2;justify-self:start; }

  .discord-result .pick-header { display:block; }
  .discord-result .pick-header .return-actions { display:flex;flex-wrap:wrap;gap:5px;margin-top:9px; }
  .discord-result .pick-header .return-actions button { width:auto;margin:0;padding:7px 9px;font-size:9px; }
  .discord-result .pick-section { padding:7px; }
  .discord-result .return-card.pick-card {
    grid-template-columns:28px minmax(0,1fr) auto;
    padding:9px 8px;
    gap:7px;
  }
  .discord-result .pick-card .route-number { width:26px;height:26px;font-size:10px; }
  .discord-result .pick-card .return-part { font-size:15px; }
  .discord-result .pick-card .return-bin { font-size:12px; }
  .discord-result .pick-card .return-description { font-size:9px; }
  .discord-result .pick-card .pick-meta { font-size:8px; }
  .discord-result .pick-card .return-card-actions { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px; }
  .discord-result .pick-card .return-card-actions button { min-width:0;width:100%;padding:7px 4px;font-size:8px; }
  .discord-result .pick-card .return-card-actions .complete-btn { grid-column:auto; }

  .modal { padding:10px; }
  .modal-card { margin:8px auto;padding:16px; }
}

/* ============================================================
   v0.8.0 LIVE — Discord shell polish + AGD/AGS EOD
   ============================================================ */
:root {
  --shell-rail:#0b0d10;
  --shell-sidebar:#181a20;
  --shell-main:#1c1f25;
  --shell-panel:#23262d;
  --shell-panel-2:#202329;
  --shell-border:#343942;
  --shell-muted:#9da4ae;
  --shell-accent:#748c43;
  --shell-accent-strong:#879f53;
  --shell-gold:#d6a850;
  --shell-danger:#d66b6b;
}
.discord-shell{background:var(--shell-main)}
.workspace-rail{background:var(--shell-rail);border-color:#202329}
.workspace-sidebar{background:var(--shell-sidebar);border-color:#2a2d34}
.sidebar-head{min-height:56px;border-color:#2d3037}
.sidebar-item:hover,.sidebar-item.active{background:#252830}
.sidebar-item>span{background:#2a2e35;color:#9eaf72}
.sidebar-user-card{background:#121419;border-color:#2a2d34}
.workspace-main{background:radial-gradient(circle at 80% -10%,rgba(116,140,67,.08),transparent 30rem),var(--shell-main)}
.workspace-topbar{min-height:56px;background:#1d2026;border-color:#2c3037}
.workspace-search{background:#202329;border-color:#30343b}
.search-row input{background:#131519;border-color:#424852}
.dashboard-result.discord-result .part-card.compact-card{background:#23262d}
.dashboard-result.discord-result .part-card.compact-card:hover{background:#272b32;border-color:#3f4650}
.discord-result .pick-section,.discord-result .return-section{background:#202329;border-color:#343942}
.discord-result .return-card.pick-card{background:#23262d;border-color:#343942}

.shop-chip,.shop-dot{font-size:10px!important;font-weight:1000!important;color:#fff!important}
.shop-chip.agd,.shop-dot.agd{background:#f2c94c!important;color:#181a1f!important}
.shop-chip.ags,.shop-dot.ags{background:#d94b4b!important;color:#fff!important}
.zero-count{opacity:.35}
.eod-kicker{display:block;margin-bottom:4px;color:#8d96a0;font-size:9px;font-weight:1000;letter-spacing:1.4px}
.eod-agd .eod-kicker{color:#f2c94c}
.eod-ags .eod-kicker{color:#ef6868}
.eod-readonly{grid-column:2 / 4;color:#777f89;font-size:9px;text-align:right}
.audit-action.eod-action .audit-action-icon{font-size:11px;font-weight:1000}
.audit-action.agd-action .audit-action-icon{background:#f2c94c;color:#181a1f}
.audit-action.ags-action .audit-action-icon{background:#d94b4b;color:#fff}

.mobile-bottom-nav{display:none}

.audit-timeline{position:relative;margin:8px 0 0 9px;padding-left:24px;border-left:1px solid #394049}
.audit-timeline-item{position:relative;padding:0 0 24px 4px}
.audit-timeline-item::before{content:"";position:absolute;left:-33px;top:4px;width:9px;height:9px;border-radius:50%;background:var(--shell-accent);box-shadow:0 0 0 4px var(--shell-main)}
.audit-timeline-item.change::before{background:#d6a850}
.audit-timeline-item strong{display:block;color:#e9ece6;font-size:12px}
.audit-timeline-item span{display:block;margin-top:4px;color:#7f8791;font-size:10px}
.audit-timeline-item p{margin:5px 0 0;color:#9da4ae;font-size:10px}
.audit-log-header{display:flex;justify-content:space-between;gap:12px;align-items:end;margin-bottom:22px}
.audit-log-header h2{margin:0;font-size:24px}
.audit-log-header p{margin:5px 0 0;color:#8d95a0;font-size:11px}

@media(max-width:700px){
  .discord-shell{grid-template-rows:minmax(0,1fr) 67px}
  .workspace-rail{display:none!important}
  .workspace-sidebar{bottom:67px;inset:auto auto 67px 0;height:calc(100dvh - 67px)}
  .mobile-sidebar-scrim{inset:0 0 67px 0}
  .mobile-bottom-nav{
    grid-column:1;grid-row:2;display:grid;grid-template-columns:repeat(5,1fr);
    height:67px;background:rgba(17,19,24,.98);border-top:1px solid #2f333a;
    z-index:70;padding-bottom:max(0px,env(safe-area-inset-bottom));
  }
  .mobile-bottom-nav button{
    position:relative;border:0;background:transparent;color:#7f8792;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
    padding:4px 2px;box-shadow:none;text-transform:none;letter-spacing:0
  }
  .mobile-bottom-nav button:hover{transform:none;filter:none;background:#1b1e24}
  .mobile-bottom-nav button.active{color:#cbd9b4}
  .mobile-bottom-nav button.active::before{content:"";position:absolute;top:0;left:26%;right:26%;height:2px;background:var(--shell-accent);border-radius:0 0 3px 3px}
  .mobile-bottom-nav button>span{display:grid;place-items:center;min-height:23px;font-size:18px;font-weight:900}
  .mobile-bottom-nav button small{font-size:8px;font-weight:800}
  .mobile-bottom-nav button em{position:absolute;top:5px;right:21%;min-width:17px;height:17px;padding:0 4px;border-radius:10px;display:grid;place-items:center;background:#a94d45;color:#fff;border:2px solid #111318;font-size:8px;font-style:normal;font-weight:1000}
  .mobile-bottom-nav button em.zero-count{display:none}
  .workspace-content{padding-bottom:28px}
  .eod-readonly{grid-column:2 / 4;text-align:left}
  .audit-log-header{display:block}
  .audit-log-header h2{font-size:21px}
  .audit-timeline{margin-left:7px;padding-left:18px}
  .audit-timeline-item::before{left:-27px}
}


/* ============================================================
   v0.8.1 — TRUE VIEWPORT RESPONSIVE PASS
   Uses JS-measured visual viewport CSS pixels + fluid CSS.
   ============================================================ */
:root{
  --jw-vw:100vw;
  --jw-vh:100vh;
  --jw-mobile-scale:1;
  --jw-safe-bottom:env(safe-area-inset-bottom, 0px);
  --jw-safe-left:env(safe-area-inset-left, 0px);
  --jw-safe-right:env(safe-area-inset-right, 0px);
}

/* Critical overflow guards at every size. */
html,body,#appShell,.discord-shell,.workspace-main,.workspace-content,
.dashboard-result,.discord-result,.workspace-search,.search-row,
.pick-section,.return-section,.return-card,.pick-card,.part-card{
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}
body{max-width:100%;overflow-x:hidden}
img,svg,canvas,video{max-width:100%;height:auto}
input,select,textarea,button{max-width:100%;box-sizing:border-box}
.discord-result *{overflow-wrap:anywhere}

@media (max-width:700px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  #appShell{
    width:100%;
    height:var(--jw-vh);
    min-height:var(--jw-vh);
    overflow:hidden;
  }
  .discord-shell{
    width:100%;
    height:var(--jw-vh);
    min-height:var(--jw-vh);
    grid-template-rows:minmax(0,1fr) calc(62px + var(--jw-safe-bottom));
    overflow:hidden;
  }
  .workspace-main{
    width:100%;
    min-width:0;
    overflow:hidden;
  }
  .workspace-topbar{
    min-height:clamp(50px, calc(56px * var(--jw-mobile-scale)), 62px);
    padding-left:max(9px,var(--jw-safe-left));
    padding-right:max(9px,var(--jw-safe-right));
    gap:clamp(6px,2.4vw,10px);
  }
  .workspace-heading h2{
    font-size:clamp(13px,4vw,16px);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .workspace-heading>span{font-size:clamp(7px,2.2vw,9px)}
  .top-avatar{
    width:clamp(30px,9vw,34px);
    min-width:clamp(30px,9vw,34px);
    height:clamp(30px,9vw,34px);
  }

  .workspace-search{
    width:100%;
    padding:clamp(8px,3vw,13px);
  }
  .search-row{
    width:100%;
    max-width:none;
    grid-template-columns:minmax(0,1fr) clamp(76px,25vw,105px);
    gap:clamp(4px,1.7vw,7px);
  }
  .search-row input{
    width:100%;
    min-width:0;
    min-height:44px;
    padding:9px clamp(8px,2.8vw,12px);
    font-size:16px;
  }
  .search-row .primary-search{
    width:100%;
    min-width:0;
    min-height:44px;
    padding:7px 5px;
    font-size:clamp(8px,2.5vw,10px);
    white-space:nowrap;
  }

  .workspace-content{
    width:100%;
    min-width:0;
    padding:
      clamp(8px,2.6vw,12px)
      max(clamp(7px,2.4vw,11px),var(--jw-safe-right))
      clamp(18px,5vw,28px)
      max(clamp(7px,2.4vw,11px),var(--jw-safe-left));
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
  }
  .dashboard-result.discord-result{width:100%;max-width:none}

  /* Search cards become a single safe column on narrow phones. */
  .discord-result .part-summary{
    width:100%;
    grid-template-columns:20px minmax(0,1fr)!important;
    gap:5px 7px!important;
  }
  .discord-result .part-summary>*{min-width:0;max-width:100%}
  .discord-result .summary-bin,
  .discord-result .summary-soh,
  .discord-result .pending-pill{
    grid-column:2!important;
    justify-self:start!important;
    max-width:100%;
  }

  /* Pick/EOD rows: info first, controls below. This is much harder to break
     than squeezing desktop's three-column action layout onto a phone. */
  .discord-result .return-card.pick-card{
    width:100%;
    display:grid;
    grid-template-columns:clamp(25px,7.5vw,30px) minmax(0,1fr) auto!important;
    gap:clamp(5px,2vw,8px)!important;
    padding:clamp(7px,2.4vw,10px)!important;
  }
  .discord-result .pick-card .return-part{
    font-size:clamp(13px,4vw,16px)!important;
    line-height:1.12;
    overflow-wrap:anywhere;
  }
  .discord-result .pick-card .return-bin{font-size:clamp(10px,3.2vw,12px)!important}
  .discord-result .pick-card .return-description{font-size:clamp(8px,2.5vw,10px)!important}
  .discord-result .pick-card .return-card-actions{
    grid-column:1 / -1;
    width:100%;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:clamp(3px,1.3vw,5px)!important;
  }
  .discord-result .pick-card .return-card-actions button{
    width:100%!important;
    min-width:0!important;
    min-height:38px;
    padding:6px 3px!important;
    font-size:clamp(7px,2.4vw,9px)!important;
    white-space:normal;
    line-height:1.1;
  }
  .eod-readonly{
    grid-column:1 / -1!important;
    text-align:left!important;
    overflow-wrap:anywhere;
  }

  /* Tables/log-ish content should scroll locally instead of breaking page width. */
  .discord-result table,
  .audit-table,
  .change-table{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .audit-log-header{width:100%;min-width:0}
  .audit-log-header button{width:auto;max-width:100%;margin-top:10px}
  .audit-timeline{max-width:100%;margin-right:0}
  .audit-timeline-item{min-width:0;max-width:100%}
  .audit-timeline-item strong,
  .audit-timeline-item span,
  .audit-timeline-item p{overflow-wrap:anywhere}

  .workspace-sidebar{
    position:fixed;
    top:0!important;
    left:0!important;
    right:auto!important;
    bottom:calc(62px + var(--jw-safe-bottom))!important;
    width:min(88%,320px)!important;
    height:auto!important;
    max-height:none!important;
    padding-left:var(--jw-safe-left);
  }
  .mobile-sidebar-scrim{
    inset:0 0 calc(62px + var(--jw-safe-bottom)) 0!important;
  }

  .mobile-bottom-nav{
    width:100%;
    height:calc(62px + var(--jw-safe-bottom))!important;
    padding:
      0 max(2px,var(--jw-safe-right))
      var(--jw-safe-bottom)
      max(2px,var(--jw-safe-left))!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    overflow:hidden;
  }
  .mobile-bottom-nav button{
    min-width:0;
    width:100%;
    padding:3px 1px!important;
    gap:1px!important;
  }
  .mobile-bottom-nav button>span{
    min-height:21px!important;
    font-size:clamp(15px,5vw,19px)!important;
  }
  .mobile-bottom-nav button small{
    max-width:100%;
    font-size:clamp(7px,2.2vw,9px)!important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .mobile-bottom-nav button em{
    right:clamp(8%,16%,20%)!important;
    top:3px!important;
  }
}

/* Tiny phones: don't pretend 320px and 430px are the same canvas. */
@media (max-width:360px){
  .workspace-topbar{padding-left:7px;padding-right:7px}
  .mobile-nav-trigger{width:32px;min-width:32px;height:32px}
  .top-avatar{display:none}
  .workspace-search{padding:8px 7px}
  .search-row{grid-template-columns:minmax(0,1fr) 72px;gap:4px}
  .search-row .primary-search span{display:none}
  .workspace-content{padding-left:6px;padding-right:6px}
  .discord-result .pick-section,.discord-result .return-section{padding:5px}
  .mobile-bottom-nav button small{font-size:7px!important}
}

/* Landscape phones: viewport height becomes the limiting dimension. */
@media (max-width:700px) and (max-height:500px){
  .workspace-topbar{min-height:46px}
  .workspace-heading>span{display:none}
  .workspace-search{padding-top:6px;padding-bottom:6px}
  .search-row input,.search-row .primary-search{min-height:40px}
  .mobile-bottom-nav{height:calc(54px + var(--jw-safe-bottom))!important}
  .discord-shell{grid-template-rows:minmax(0,1fr) calc(54px + var(--jw-safe-bottom))}
  .workspace-sidebar{bottom:calc(54px + var(--jw-safe-bottom))!important}
  .mobile-sidebar-scrim{inset:0 0 calc(54px + var(--jw-safe-bottom)) 0!important}
}


/* ============================================================
   v0.8.2 — MOBILE TOUCH / HIT-TEST FIX
   Keep hidden navigation layers from sitting above tappable UI.
   ============================================================ */
@media (max-width:700px){
  .workspace-main{
    position:relative;
    z-index:10;
    pointer-events:auto;
  }
  .workspace-topbar,
  .workspace-search,
  .workspace-content,
  .discord-result,
  .mobile-bottom-nav{
    pointer-events:auto;
  }

  /* The off-canvas drawer must NOT participate in hit testing while closed.
     Some mobile WebKit builds can still hit-test transformed fixed layers. */
  .workspace-sidebar{
    pointer-events:none;
    visibility:hidden;
  }
  body.mobile-sidebar-open .workspace-sidebar{
    pointer-events:auto;
    visibility:visible;
  }

  .mobile-sidebar-scrim{
    display:block!important;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .18s ease, visibility 0s linear .18s;
  }
  body.mobile-sidebar-open .mobile-sidebar-scrim{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transition:opacity .18s ease;
  }

  .mobile-bottom-nav{
    position:relative;
    z-index:120!important;
    pointer-events:auto!important;
  }

  button,
  [role="button"],
  .sidebar-item,
  .rail-btn{
    touch-action:manipulation;
    -webkit-tap-highlight-color:rgba(158,184,61,.18);
  }

  /* Any hidden auth/modal layer is completely removed from mobile hit testing. */
  .hidden,
  .modal.hidden,
  .auth-screen.hidden{
    pointer-events:none!important;
  }
}


/* v0.8.3 — shop priority/colors: AGS primary (red), AGD sister shop (yellow) */
.sidebar-item:has(.shop-chip.ags).active{
  border-left-color:#d94b4b!important;
}
.sidebar-item:has(.shop-chip.agd).active{
  border-left-color:#f2c94c!important;
}
.mobile-bottom-nav button[data-mobile-view="ags"].active .shop-dot.ags{
  box-shadow:0 0 0 2px rgba(217,75,75,.28);
}
.mobile-bottom-nav button[data-mobile-view="agd"].active .shop-dot.agd{
  box-shadow:0 0 0 2px rgba(242,201,76,.28);
}
