:root {
  --red: #d71920;
  --red-dark: #a90f15;
  --ink: #1f2933;
  --muted: #667085;
  --line: #dfe3e8;
  --soft: #f5f7f9;
  --white: #ffffff;
  --green: #157347;
  --amber: #9a6700;
  --danger: #b42318;
  --shadow: 0 12px 34px rgba(31, 41, 51, 0.08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #eef1f4; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f8fa 0, #eef1f4 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--red); color: white; font-size: 24px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(215, 25, 32, .24);
}
.brand strong { display: block; font-size: 16px; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.top-nav { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 650; }
.top-nav a, .link-button { text-decoration: none; color: #475467; transition: color .15s ease; }
.top-nav a:hover, .link-button:hover { color: var(--red); }
.link-button { border: 0; background: none; padding: 0; }
.inline-form { display: inline; margin: 0; }

.page-shell { max-width: 1500px; margin: 0 auto; padding: 32px 28px 64px; }
.site-footer {
  max-width: 1500px; margin: 0 auto; padding: 20px 28px 36px;
  color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 20px;
}

.hero-card, .form-card, .table-card, .detail-card, .upload-card, .login-card, .success-card, .filter-card, .stat-card {
  background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-card {
  border-radius: 22px; padding: 30px 34px; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  margin-bottom: 22px; overflow: hidden; position: relative;
}
.hero-card::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: rgba(215,25,32,.06); right: -80px; top: -110px; }
.hero-card h1, .page-title-row h1, .success-card h1, .login-card h1 { margin: 2px 0 8px; line-height: 1.1; }
.hero-card p, .page-title-row p, .login-card p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 4px !important; color: var(--red) !important; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.hero-status { z-index: 1; display: inline-flex; align-items: center; gap: 9px; background: #f8fafc; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 13px; font-weight: 700; }
.status-dot { width: 9px; height: 9px; background: #19a56f; border-radius: 50%; box-shadow: 0 0 0 4px rgba(25,165,111,.12); }

.form-card { border-radius: 22px; padding: 30px; }
.narrow-card { max-width: 720px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 20px; }
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.item-heading { margin-top: 36px; }
.step-number { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; }
.form-grid { display: grid; gap: 20px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: #344054; }
.field b { color: var(--red); }
.field small { color: var(--muted); font-size: 12px; }
input, select, textarea {
  width: 100%; border: 1px solid #cfd6dd; border-radius: 10px; background: #fff; color: var(--ink);
  padding: 10px 12px; outline: none; transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,25,32,.10); }
input[readonly] { background: #f7f8fa; color: #475467; }
textarea { resize: vertical; min-height: 90px; }
.short { min-width: 88px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; font-weight: 750; font-size: 14px; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button-primary { background: var(--red); color: #fff; box-shadow: 0 7px 15px rgba(215,25,32,.18); }
.button-primary:hover { background: var(--red-dark); }
.button-secondary { background: #fff; color: #344054; border-color: #cfd6dd; }
.button-secondary:hover { background: #f8fafc; }
.button-danger { background: #fff; color: var(--danger); border-color: #f4b7b2; }
.button-large { min-height: 48px; padding: 12px 22px; }
.full-width { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 28px; }

.item-table-wrap, .table-scroll { width: 100%; overflow-x: auto; }
.item-table, .data-table { width: 100%; border-collapse: collapse; }
.item-table { min-width: 1220px; }
.item-table th, .item-table td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.item-table th { background: #f7f8fa; text-align: left; color: #475467; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.item-table td:first-child, .item-table th:first-child { text-align: center; }
.line-number { padding-top: 18px !important; color: var(--muted); font-weight: 700; }
.sku-cell { min-width: 230px; position: relative; }
.sku-input-wrap { display: flex; gap: 7px; }
.icon-button {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid #cfd6dd; background: #fff; color: #475467; font-size: 20px; line-height: 1;
}
.icon-button:hover { color: var(--red); border-color: #e8a3a6; background: #fff6f6; }
.remove-line { color: var(--danger); }
.suggestions {
  position: absolute; z-index: 30; top: 49px; left: 8px; right: 8px; max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid #cfd6dd; border-radius: 12px; box-shadow: 0 16px 35px rgba(31,41,51,.16);
}
.suggestions button { width: 100%; border: 0; border-bottom: 1px solid #edf0f2; background: #fff; text-align: left; padding: 10px 12px; display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; }
.suggestions button:hover { background: #fff6f6; }
.suggestions span, .suggestions small { color: var(--muted); }
.field-error { display: block; min-height: 16px; margin-top: 4px; color: var(--danger); font-size: 11px; }
.ppb-note { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.total-pieces { display: inline-block; min-width: 56px; padding: 10px 6px; font-weight: 800; text-align: center; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.flash, .notice { border-radius: 12px; padding: 13px 16px; border: 1px solid; }
.flash-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.flash-error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.notice { margin-bottom: 18px; }
.notice-warning { background: #fffaeb; border-color: #fedf89; color: #854a0e; }
.notice a { font-weight: 800; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.58); backdrop-filter: blur(3px); }
.modal-panel { position: relative; z-index: 1; width: min(1000px, 96vw); max-height: 88vh; overflow: auto; background: #fff; border-radius: 18px; padding: 26px; box-shadow: 0 24px 70px rgba(15,23,42,.30); }
.modal-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.modal-header h2 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.modal-open { overflow: hidden; }
.scanner-panel { width: min(640px, 96vw); }
#scanner-video { width: 100%; min-height: 260px; max-height: 420px; object-fit: cover; background: #111827; border-radius: 14px; }
#scanner-message { color: var(--muted); }

.page-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { border-radius: 14px; padding: 18px 20px; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat-card strong { display: block; margin-top: 6px; font-size: 28px; }
.filter-card { border-radius: 16px; padding: 18px; display: grid; grid-template-columns: repeat(5, minmax(140px,1fr)) auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.filter-actions { display: flex; gap: 8px; }
.table-card { border-radius: 16px; margin-top: 18px; overflow: hidden; }
.table-card.compact { box-shadow: none; }
.table-header { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.table-header h2 { margin: 0; font-size: 18px; }
.table-header span { color: var(--muted); font-size: 13px; }
.data-table { min-width: 760px; }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #edf0f2; vertical-align: top; }
.data-table th { background: #f8fafc; color: #475467; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.data-table tbody tr:hover { background: #fcfcfd; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.record-link, .text-action { color: #175cd3; text-decoration: none; font-weight: 750; }
.text-action { border: 0; background: none; padding: 0; }
.text-action.danger { color: var(--danger); }
.actions-cell { display: flex; gap: 14px; white-space: nowrap; }
.empty-state { text-align: center !important; color: var(--muted); padding: 34px !important; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 800; }
.badge-success { background: #ecfdf3; color: #067647; }
.badge-danger { background: #fef3f2; color: #b42318; }
.badge-muted { background: #f2f4f7; color: #475467; }

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.detail-card { border-radius: 16px; padding: 22px; }
.detail-card h2 { margin-top: 0; }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.detail-list div { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.detail-list dt, .summary-grid dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.detail-list dd, .summary-grid dd { margin: 4px 0 0; font-weight: 700; }
.upload-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.upload-card { border-radius: 16px; padding: 22px; }
.upload-card h2 { margin-top: 0; }
.upload-card p { color: var(--muted); }
.upload-card form { display: grid; gap: 12px; margin: 16px 0; }

.login-shell { min-height: 65vh; display: grid; place-items: center; }
.login-card { width: min(460px,100%); border-radius: 20px; padding: 32px; display: grid; gap: 18px; }
.success-card { max-width: 1000px; margin: 20px auto; border-radius: 22px; padding: 38px; text-align: center; }
.success-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: #ecfdf3; color: #067647; font-size: 34px; font-weight: 900; }
.record-number { font-size: 22px; font-weight: 850; color: var(--red); }
.summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 26px 0; text-align: left; }
.summary-grid > div { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.modal-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.error-card { max-width: 650px; }
.json-view { max-width: 560px; overflow: auto; white-space: pre-wrap; background: #101828; color: #d0d5dd; border-radius: 8px; padding: 12px; font-size: 11px; }

@media (max-width: 1100px) {
  .filter-card { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .header-inner { padding: 0 16px; min-height: 64px; }
  .brand small { display: none; }
  .brand strong { font-size: 14px; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .top-nav { gap: 11px; font-size: 12px; }
  .top-nav a:nth-of-type(3) { display: none; }
  .page-shell { padding: 18px 14px 44px; }
  .hero-card, .form-card, .success-card { border-radius: 16px; padding: 20px; }
  .hero-card, .page-title-row { align-items: flex-start; flex-direction: column; }
  .two-col, .upload-grid, .summary-grid, .modal-summary, .detail-list { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-card { grid-template-columns: 1fr; }
  .section-heading.item-heading { align-items: flex-start; gap: 14px; flex-direction: column; }
  .button-row { width: 100%; }
  .button-row .button { flex: 1; }
  .form-actions .button { width: 100%; }
  .site-footer { padding: 16px; flex-direction: column; }
  .modal { padding: 10px; }
  .modal-panel { padding: 18px; }
}

.form-help { margin: -4px 0 14px !important; font-size: 12px; color: var(--muted); }
.badge-warning { background: #fffaeb; color: #854a0e; }
.validation-report {
  margin-top: 18px;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.validation-pass { border-left: 5px solid var(--green); }
.validation-fail { border-left: 5px solid var(--danger); }
.validation-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.validation-heading h2 { margin: 0 0 6px; }
.validation-heading p { margin: 0; color: var(--muted); }
.validation-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  background: #f2f4f7;
}
.validation-pass .validation-status { background: #ecfdf3; color: #067647; }
.validation-fail .validation-status { background: #fef3f2; color: #b42318; }
.validation-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.validation-stats > div { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.validation-stats span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.validation-stats strong { display: block; margin-top: 5px; font-size: 22px; }
.recommendation-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; margin-bottom: 18px; }
.recommendation-box h3 { margin: 0 0 8px; font-size: 15px; }
.recommendation-box ul { margin: 0; padding-left: 20px; }
.validation-table { min-width: 980px; }

@media (max-width: 1100px) {
  .validation-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .validation-heading { flex-direction: column; }
  .validation-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Version 1.3 master-data management */
.button-ghost { background: transparent; color: #475467; border-color: transparent; }
.button-ghost:hover { background: #f2f4f7; }
.button-small { min-height: 34px; padding: 6px 10px; font-size: 12px; border-radius: 8px; }

.staged-upload {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.staged-ready { border-color: #abefc6; background: #f6fef9; }
.staged-blocked { border-color: #fedf89; background: #fffcf5; }
.staged-upload > div:first-child { min-width: 0; display: grid; gap: 2px; }
.staged-upload strong { overflow-wrap: anywhere; }
.staged-upload small { color: var(--muted); }
.staged-label { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.staged-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.upload-card .staged-actions form { display: inline; margin: 0; }

.item-add-card {
  margin-top: 18px;
  padding: 22px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.item-add-card .section-heading { margin: 0 0 18px; }
.item-add-card .section-heading > div { display: block; }
.item-add-card .section-heading h2 { margin: 2px 0 5px; }
.item-add-card .section-heading p:last-child { margin: 0; color: var(--muted); }
.item-add-form {
  display: grid;
  grid-template-columns: 150px minmax(260px, 2fr) 130px 160px 130px 130px auto;
  gap: 12px;
  align-items: end;
}
.item-add-form label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 750; }
.item-add-action { display: flex; align-items: end; }
.item-add-action .button { white-space: nowrap; }

.table-header > div { min-width: 0; }
.master-table-note { margin: 0; padding: 12px 20px; color: var(--muted); background: #fffcf5; border-bottom: 1px solid var(--line); font-size: 12px; }
.master-data-table { min-width: 1280px; }
.master-data-table th, .master-data-table td { padding: 10px 8px; vertical-align: middle; }
.table-input, .table-select { min-height: 36px; padding: 7px 9px; border-radius: 8px; font-size: 13px; }
.sku-table-input { min-width: 130px; font-weight: 750; }
.description-table-input { min-width: 280px; }
.uom-table-input { min-width: 110px; }
.location-table-input { min-width: 135px; }
.ppb-table-input { min-width: 105px; }
.table-select { min-width: 105px; }
.master-actions-cell { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.master-actions-cell .inline-form { display: inline-flex; }

@media (max-width: 1250px) {
  .item-add-form { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .item-description-field { grid-column: span 2; }
  .item-add-action { align-self: end; }
}
@media (max-width: 760px) {
  .staged-upload { align-items: stretch; flex-direction: column; }
  .staged-actions { justify-content: flex-start; }
  .staged-actions .button { width: 100%; }
  .item-add-form { grid-template-columns: 1fr; }
  .item-description-field { grid-column: auto; }
  .item-add-action .button { width: 100%; }
}

/* Version 1.4 administrator search and pagination */
.filter-card-wide { grid-template-columns: repeat(6, minmax(125px, 1fr)) auto; }
.audit-filter-card { grid-template-columns: minmax(260px, 2fr) minmax(190px, 1fr) 150px auto; }

.table-filter-bar {
  padding: 14px 20px;
  display: grid;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.item-filter-bar { grid-template-columns: repeat(5, minmax(130px, 1fr)) auto; }
.person-filter-bar { grid-template-columns: minmax(240px, 2fr) minmax(150px, 1fr) 150px auto; }
.table-filter-bar .field { min-width: 0; }
.table-filter-bar .field input,
.table-filter-bar .field select { background: #fff; }

.pagination-bar {
  min-height: 62px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
}
.pagination-summary { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pagination-links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px; }
.pagination-link {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #344054;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}
a.pagination-link:hover { border-color: #98a2b3; background: #f8fafc; }
.pagination-link.is-current { border-color: var(--red); background: var(--red); color: #fff; }
.pagination-link.is-disabled { color: #98a2b3; background: #f2f4f7; cursor: not-allowed; }
.pagination-direction { min-width: 74px; }
.pagination-ellipsis { padding: 0 3px; color: var(--muted); }

@media (max-width: 1250px) {
  .filter-card-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .audit-filter-card, .person-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pagination-bar { align-items: flex-start; flex-direction: column; }
  .pagination-links { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .filter-card-wide, .audit-filter-card, .item-filter-bar, .person-filter-bar { grid-template-columns: 1fr; }
  .table-filter-bar { padding: 14px; }
  .table-filter-bar .filter-actions { width: 100%; }
  .table-filter-bar .filter-actions .button { flex: 1; }
  .pagination-bar { padding: 12px 14px; }
  .pagination-summary { white-space: normal; }
  .pagination-direction { min-width: 68px; }
}

/* Version 1.6: individual storeperson maintenance */
.inline-maintenance-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(420px, 2fr);
  gap: 20px;
  align-items: end;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.inline-maintenance-card h3 { margin: 0 0 4px; }
.inline-maintenance-card p { margin: 0; color: var(--muted); }
.storeperson-add-form {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(130px, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.storeperson-add-form label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 750; }
.storeperson-name-input { min-width: 240px; }
.storeperson-data-table th:nth-child(1) { min-width: 280px; }
.storeperson-data-table th:nth-child(2) { min-width: 130px; }
.storeperson-data-table th:nth-child(3) { min-width: 160px; }

@media (max-width: 900px) {
  .inline-maintenance-card { grid-template-columns: 1fr; }
  .storeperson-add-form { grid-template-columns: 1fr 1fr; }
  .storeperson-add-form > div { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .storeperson-add-form { grid-template-columns: 1fr; }
  .storeperson-add-form > div { grid-column: auto; }
}

/* V1.7 entry-type selector and mobile entry workflow */
.entry-choice-hero { max-width: 860px; margin: 12px auto 26px; text-align: center; }
.entry-choice-hero h1 { margin: 4px 0 10px; font-size: clamp(30px, 5vw, 52px); line-height: 1.05; }
.entry-choice-hero p:last-child { margin: 0; color: var(--muted); font-size: 17px; }
.entry-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 1120px; margin: 0 auto 24px; }
.entry-choice-card {
  min-height: 300px; padding: 32px; border-radius: 24px; border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px;
  text-decoration: none; color: var(--ink); background: #fff; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.entry-choice-card:hover { transform: translateY(-3px); box-shadow: 0 18px 45px rgba(31,41,51,.14); }
.entry-choice-pick { border-color: rgba(215,25,32,.22); background: linear-gradient(145deg,#fff 55%,#fff1f1); }
.entry-choice-received { border-color: rgba(21,115,71,.23); background: linear-gradient(145deg,#fff 55%,#effcf5); }
.entry-choice-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; font-size: 36px; font-weight: 900; background: #f2f4f7; }
.entry-choice-pick .entry-choice-icon { color: var(--red); background: #fff1f1; }
.entry-choice-received .entry-choice-icon { color: var(--green); background: #ecfdf3; }
.entry-choice-label { font-size: clamp(28px,4vw,42px); line-height: 1.08; font-weight: 900; }
.entry-choice-description { color: var(--muted); font-size: 16px; }
.entry-choice-action { margin-top: 14px; border-radius: 12px; padding: 12px 16px; color: #fff; font-weight: 800; background: var(--red); }
.entry-choice-received .entry-choice-action { background: var(--green); }
.mobile-entry-note { max-width: 900px; margin: 20px auto 0; color: var(--muted); text-align: center; font-size: 13px; }

.entry-switcher { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.entry-switch-card { min-height: 92px; padding: 17px 20px; border: 2px solid var(--line); border-radius: 16px; background: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: center; }
.entry-switch-card strong { font-size: 22px; }
.entry-switch-card span { color: var(--muted); font-size: 13px; }
.entry-switch-card.active { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,25,32,.08); }
.entry-switch-card:nth-child(2).active { border-color: var(--green); box-shadow: 0 0 0 3px rgba(21,115,71,.09); }
.hero-received::after { background: rgba(21,115,71,.07); }
.hero-received .eyebrow { color: var(--green) !important; }
.hero-received .status-dot { background: var(--green); }

.admin-record-tabs { display: inline-flex; gap: 6px; margin-bottom: 22px; padding: 5px; border-radius: 14px; background: #e8ecf0; }
.admin-record-tab { padding: 11px 18px; border-radius: 10px; text-decoration: none; color: #475467; font-weight: 800; }
.admin-record-tab.active { background: #fff; color: var(--red); box-shadow: 0 3px 10px rgba(31,41,51,.10); }
.success-actions { justify-content: center; margin-top: 24px; }

@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; min-height: 46px; }
  .entry-choice-grid, .entry-switcher { grid-template-columns: 1fr; }
  .entry-choice-card { min-height: 230px; padding: 25px; }
  .entry-choice-label { font-size: 32px; }
  .entry-switch-card { min-height: 82px; }
  .entry-switch-card strong { font-size: 20px; }
  .admin-record-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .admin-record-tab { text-align: center; padding: 12px 8px; font-size: 13px; }

  .item-table-wrap { overflow: visible; }
  .item-table { min-width: 0; display: block; }
  .item-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .item-table tbody { display: grid; gap: 16px; }
  .item-table tr.item-row { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fff; box-shadow: 0 6px 18px rgba(31,41,51,.06); }
  .item-table td { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 10px; align-items: start; border-bottom: 1px solid #edf0f2; padding: 11px 4px; text-align: left !important; }
  .item-table td::before { content: attr(data-label); color: #475467; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding-top: 11px; }
  .item-table td:last-child { border-bottom: 0; }
  .line-number { padding-top: 11px !important; }
  .sku-cell { min-width: 0; }
  .suggestions { left: 108px; right: 4px; top: 54px; }
  .suggestions button { grid-template-columns: 85px 1fr; }
  .suggestions button small { grid-column: 2; }
  .total-pieces { text-align: left; }
  .mobile-remove-cell .icon-button { width: 100%; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .success-actions { flex-direction: column; }
  .success-actions .button { width: 100%; }
}

@media (max-width: 430px) {
  .top-nav { gap: 9px; }
  .top-nav a { font-size: 11px; }
  .entry-choice-card { min-height: 210px; }
  .item-table td { grid-template-columns: 86px minmax(0,1fr); }
  .suggestions { left: 90px; }
}
@media (max-width: 760px) {
  .icon-button { width: 46px; height: 46px; flex-basis: 46px; }
  .button { min-height: 46px; }
}
