:root {
  --sidebar-w: 256px;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e3e8ef;
  --border-soft: #eef1f6;
  --text: #0a1628;
  --text-soft: #52637a;
  --text-faint: #8fa3b8;
  --navy: #0f2744;
  --navy-mid: #1b3a6b;
  --navy-light: #2a5096;
  --red: #c41230;
  --accent: #2563eb;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info-soft: #eff6ff;
  --shadow: 0 1px 4px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
  color: #fff;
}

.brand {
  padding: 26px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: center;
}

.brand-logo,
.login-logo {
  width: 88%;
  max-width: 250px;
  max-height: 150px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.brand-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #fff;
  margin-top: 12px;
}

.sidebar-section {
  padding: 16px 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.nav-section-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #fff;
  padding: 6px 12px 4px;
  margin-top: 8px;
}

.sidebar-label {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 6px 12px 8px;
}

.supplier-filter select {
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.88);
  padding: 0 34px 0 12px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a9b8cc'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.supplier-filter option {
  color: var(--text);
}

.nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,.55);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
}

.nav-link[href$="/inventory/manufacturer/"] {
  background: #b22234;
  color: #fff;
  font-weight: 700;
}

.nav-link[href$="/inventory/manufacturer/"]:hover {
  background: #981b2b;
  color: #fff;
}

.nav-link.active {
  background: rgba(255,255,255,.14);
  color: #fff;
  font-weight: 600;
}

.nav-link[href$="/inventory/manufacturer/"].active {
  background: #b22234;
  color: #fff;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #60a5fa;
  border-radius: 0 3px 3px 0;
}

.status,
.logout-form {
  margin: 0 12px;
}

.status {
  padding: 9px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.55);
}

.status-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  margin-top: 6px;
}

.status-value {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.status-small,
.utility-link {
  font-size: 11.5px;
}

.utility-link {
  display: inline-flex;
  margin-top: 10px;
  color: rgba(255,255,255,.7);
}

.utility-link:hover {
  color: #fff;
}

.logout-form {
  padding: 0 0 20px;
}

.logout-form button {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.55);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background .15s, color .15s, border-color .15s;
}

.logout-form button:hover {
  background: rgba(196,18,48,.18);
  border-color: rgba(196,18,48,.45);
  color: #ff6b7a;
}

.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0,0,0,.04);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.topbar-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.security-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--info-soft);
  border: 1px solid #dbeafe;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.page-content {
  padding: 28px 32px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-tile {
  border-radius: 16px;
  padding: 22px 24px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 132px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

.stat-tile::after {
  content: "";
  position: absolute;
  top: -28px;
  right: -22px;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.tile-blue {
  background: linear-gradient(140deg, #1560cc 0%, #1f80ff 100%);
  box-shadow: 0 4px 20px rgba(31,128,255,.3);
}

.tile-green {
  background: linear-gradient(140deg, #15803d 0%, #22c55e 100%);
  box-shadow: 0 4px 20px rgba(22,163,74,.3);
}

.tile-amber {
  background: linear-gradient(140deg, #c2710c 0%, #f97316 100%);
  box-shadow: 0 4px 20px rgba(234,88,12,.3);
}

.stat-tile-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}

.stat-tile-value {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  letter-spacing: -.02em;
  margin-top: 4px;
}

.stat-tile-note {
  font-size: 12.5px;
  color: rgba(255,255,255,.68);
  margin-top: 4px;
}

.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 0;
}

.filter-card .filter-bar {
  padding: 16px 20px 18px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.filter-head {
  padding-bottom: 12px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.panel-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 2px;
}

.panel-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-bar .search-box,
.filter-bar select,
.login-panel input {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.filter-bar .search-box {
  flex: 1;
  min-width: 240px;
  max-width: 430px;
  padding: 10px 14px;
}

.filter-bar .search-box:focus,
.filter-bar select:focus,
.login-panel input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.filter-bar select {
  min-width: 180px;
  padding: 10px 34px 10px 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2352637a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background .15s, box-shadow .15s, opacity .15s;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  box-shadow: 0 2px 10px rgba(37,99,235,.35);
}

.btn-primary:hover {
  opacity: .9;
  box-shadow: 0 4px 16px rgba(37,99,235,.45);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
  border-color: #c5d0df;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12.5px;
}

.results-panel {
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  background: var(--surface);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.inventory-table {
  min-width: 1340px;
}

.col-supplier { width: 142px; }
.col-mfg { width: 160px; }
.col-upc { width: 150px; }
.col-cost { width: 96px; }
.col-qty { width: 72px; }
.col-manufacturer { width: 170px; }
.col-dist { width: 150px; }
.col-product { width: 400px; }

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: 13px 16px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8fafd;
}

tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mono-cell {
  font-family: "DM Mono", Consolas, monospace;
  font-size: 13px;
}

.supplier-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--info-soft);
  color: var(--accent);
  border: 1px solid #dbeafe;
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-cell {
  max-width: 0;
}

.empty {
  height: 340px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 280px;
}

.empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-soft);
}

.empty-copy {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 3px;
}

.yes-row {
  background: #f0fdf4;
}

.no-row {
  background: #fff8f8;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-soft);
  font-size: 13px;
}

.main.inventory-main {
  background: #0f2744;
}

.inventory-workspace {
  flex: 1;
  min-height: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 14px 14px 20px;
  overflow: hidden;
  background: #0f2744;
}

.inventory-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.inventory-searchbar {
  display: grid;
  grid-template-columns: minmax(300px, 340px) 188px 144px;
  align-items: stretch;
  gap: 8px;
  height: 40px;
  min-width: 0;
}

.inventory-search-input,
.inventory-select select,
.inventory-search-button {
  height: 40px;
  border-radius: 4px;
  font-size: 12px;
}

.inventory-search-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(0,0,0,.2);
  background: #fff;
  color: #081426;
  padding: 0 10px;
  outline: none;
}

.inventory-search-input::placeholder {
  color: #5b6574;
}

.inventory-select {
  position: relative;
  display: block;
  min-width: 0;
}

.inventory-select select {
  width: 100%;
  border: 0;
  background: #fff;
  color: #050b14;
  padding: 0 48px 0 10px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.inventory-select::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 40px;
  border-radius: 0 4px 4px 0;
  background: var(--red);
  pointer-events: none;
}

.inventory-select::before {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-right: 2px solid #020817;
  border-bottom: 2px solid #020817;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.inventory-search-button {
  background: var(--red);
  color: #fff;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: none;
}

.inventory-search-button:hover {
  background: #a90f28;
}

.classification {
  margin-left: auto;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.inventory-table-frame {
  min-height: 0;
  background: #fff;
  border: 1px solid #bfc9d8;
  border-right: 8px solid var(--red);
  border-bottom: 8px solid var(--red);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.inventory-table-frame .table-wrap {
  height: 100%;
  background: #fff;
  overflow: auto;
}

.inventory-table-frame .inventory-table {
  min-width: 1060px;
  width: 100%;
}

.inventory-table-frame .col-supplier { width: 11%; }
.inventory-table-frame .col-mfg { width: 12%; }
.inventory-table-frame .col-upc { width: 12%; }
.inventory-table-frame .col-cost { width: 8%; }
.inventory-table-frame .col-qty { width: 6%; }
.inventory-table-frame .col-manufacturer { width: 14%; }
.inventory-table-frame .col-dist { width: 12%; }
.inventory-table-frame .col-product { width: 25%; }

.inventory-table-frame thead th {
  height: 37px;
  background: #d9e2f0;
  color: #020817;
  padding: 0;
  border-bottom: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
}

.sort-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 37px;
  padding: 8px 12px;
  color: #020817;
}

.sort-link::after {
  content: "";
  width: 0;
  margin-left: 5px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.sort-link.active.asc::after {
  border-bottom: 6px solid #dc2626;
}

.sort-link.active.desc::after {
  border-top: 6px solid #dc2626;
}

.sort-link:hover {
  background: #cfd9e9;
}

.inventory-table-frame tbody tr {
  height: 38px;
  border-bottom: 1px solid #edf1f7;
}

.inventory-table-frame tbody tr:hover {
  background: #f6f8fc;
}

.inventory-table-frame tbody td {
  padding: 8px 12px;
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
}

.inventory-table-frame .numeric {
  text-align: right;
}

.inventory-table-frame .product-cell {
  max-width: none;
}

.inventory-pagination {
  min-height: 32px;
  color: #dce7f7;
}

.inventory-pagination .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,.35);
}

.lookup-workspace {
  grid-template-rows: 40px minmax(0, 1fr);
}

.lookup-searchbar {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 112px;
  align-items: stretch;
  gap: 8px;
  height: 40px;
  min-width: 0;
}

.lookup-table-frame .table-wrap {
  height: 100%;
  background: #fff;
  overflow: auto;
}

.lookup-table {
  min-width: 680px;
}

.plain-th {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 37px;
  padding: 8px 12px;
}

.lookup-table td:nth-child(2) {
  text-align: center;
}

.lookup-table td:nth-child(3) {
  text-align: right;
}

.supplier-workspace {
  flex: 1;
  min-height: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px 14px 20px;
  overflow: hidden;
  background: #0f2744;
}

.supplier-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  color: #fff;
  min-width: 0;
}

.supplier-header h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
}

.supplier-header p {
  color: rgba(255,255,255,.68);
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.supplier-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.supplier-summary span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.74);
  font-size: 12px;
  font-weight: 700;
}

.supplier-summary strong {
  color: #fff;
  font-size: 14px;
}

.supplier-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}

.supplier-status-frame {
  min-width: 0;
  min-height: 0;
  background: #fff;
  border: 1px solid #bfc9d8;
  border-right: 8px solid var(--red);
  border-bottom: 8px solid var(--red);
  overflow: hidden;
}

.supplier-table-wrap {
  height: 100%;
  overflow: auto;
  background: #fff;
}

.supplier-status-table {
  min-width: 1160px;
  table-layout: fixed;
}

.supplier-status-table th {
  height: 38px;
  background: #d9e2f0;
  color: #020817;
  padding: 0 10px;
  border-bottom: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: left;
  text-transform: none;
}

.supplier-status-table th:nth-child(1) { width: 150px; }
.supplier-status-table th:nth-child(2) { width: 120px; }
.supplier-status-table th:nth-child(3) { width: 120px; }
.supplier-status-table th:nth-child(4) { width: 150px; }
.supplier-status-table th:nth-child(5) { width: 150px; }
.supplier-status-table th:nth-child(6) { width: 105px; }
.supplier-status-table th:nth-child(7) { width: 105px; }
.supplier-status-table th:nth-child(8) { width: 260px; }

.supplier-status-table td {
  height: 42px;
  padding: 8px 10px;
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-badge,
.connection-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.health-badge.success {
  background: #dcfce7;
  color: #166534;
}

.health-badge.manual {
  background: #fef3c7;
  color: #92400e;
}

.health-badge.failed {
  background: #fee2e2;
  color: #991b1b;
}

.health-badge.running {
  background: #dbeafe;
  color: #1d4ed8;
}

.health-badge.stale,
.health-badge.setup,
.health-badge.unknown {
  background: #e5e7eb;
  color: #374151;
}

.health-badge.paused {
  background: #dbeafe;
  color: #1e3a8a;
}

.connection-badge {
  background: #eef2ff;
  color: #1f3a8a;
}

.muted {
  color: #94a3b8;
}

.supplier-form-panel {
  min-height: 0;
  overflow: auto;
  background: #fff;
  border: 1px solid #bfc9d8;
  border-bottom: 8px solid var(--red);
  padding: 18px;
  color: #0a1628;
}

.supplier-action-block {
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #dbe3ef;
}

.supplier-action-block:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.supplier-progress-panel {
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.supplier-progress-panel h2 {
  color: #0f2744;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #dbeafe;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: #1d4ed8;
}

.progress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  margin-top: 12px;
}

.progress-stats div {
  min-width: 0;
}

.progress-stats dt {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.progress-stats dd {
  overflow: hidden;
  color: #0f2744;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-form-panel h2 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.form-note {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.supplier-profile-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.supplier-profile-form label {
  display: grid;
  gap: 5px;
  color: #0f2744;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.supplier-profile-form input[type="text"],
.supplier-profile-form input[type="file"],
.supplier-profile-form select,
.supplier-profile-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #0a1628;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  outline: none;
  padding: 9px 10px;
}

.supplier-profile-form input[type="file"] {
  min-height: 40px;
}

.supplier-profile-form textarea {
  min-height: 78px;
  resize: vertical;
}

.supplier-profile-form input:focus,
.supplier-profile-form select:focus,
.supplier-profile-form textarea:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 9px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: #0a1628 !important;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.supplier-profile-form button {
  min-height: 40px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.supplier-profile-form button:hover {
  background: #a90f28;
}

.errorlist {
  color: #991b1b;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.message-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.message {
  border-radius: 4px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 700;
}

.message.success {
  background: #dcfce7;
  color: #166534;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #0f2744;
  padding: 20px;
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
  background: #122f52;
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.login-panel h1 {
  margin: 12px 0 20px;
  font-size: 22px;
  color: #fff;
}

.login-panel form {
  display: grid;
  gap: 9px;
}

.login-panel label {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.login-panel input {
  width: 100%;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

.login-panel button {
  margin-top: 8px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  background: #b22234;
  color: #fff;
  font-weight: 800;
}

.login-panel button:hover {
  background: #981b2b;
}

.form-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px;
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    height: auto;
    overflow: visible;
  }

  .main {
    overflow: visible;
  }

  .topbar,
  .page-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .page-content {
    overflow: visible;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    max-height: none;
  }

  .inventory-workspace {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto minmax(520px, 1fr) auto;
    overflow: visible;
  }

  .inventory-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .inventory-searchbar,
  .lookup-searchbar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 188px 144px;
  }

  .lookup-searchbar {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .classification {
    margin-left: 0;
    text-align: right;
  }

  .supplier-workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .supplier-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .supplier-summary {
    justify-content: flex-start;
  }

  .supplier-grid {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .supplier-status-frame {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .inventory-searchbar,
  .lookup-searchbar {
    height: auto;
    grid-template-columns: 1fr;
  }

  .inventory-search-input,
  .inventory-select select,
  .inventory-search-button {
    height: 42px;
  }

  .classification {
    white-space: normal;
    text-align: left;
    line-height: 1.3;
  }
}
