body {
  background: #f5f7fb;
}
.stock-import-form { max-width: 1100px; }
.stock-import-form fieldset { min-width: 0; }
#importText { height: 260px; min-height: 180px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.import-drop { border: 1px dashed #8696ab; padding: 20px; background: #fff; border-radius: 6px; }
.import-drop.drag-over { border-color: #0d6efd; background: #edf5ff; }
.import-encoding { width: 180px; }
.import-history { min-width: 800px; }
#importMessage { overflow-wrap: anywhere; }
.admin-inline-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.admin-inline-form > div { min-width: 0; }
.admin-user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1000px; }
.admin-user-grid > div { min-width: 0; }
.admin-user-grid button { justify-self: start; }
.users-table { min-width: 760px; }
.points-table { min-width: 720px; }
.nav-identity { overflow-wrap: anywhere; }
.navbar .navbar-nav { flex-wrap: wrap; }
@media (max-width: 600px) {
  .admin-user-grid { grid-template-columns: minmax(0, 1fr); }
  .navbar form { flex-wrap: wrap; max-width: 100%; }
  .admin-inline-form > div { flex: 1 1 180px; }
}
.page-title {
  font-size: 1.5rem;
  margin: 0 0 .25rem;
}
.login-wrap {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}
.login-panel,
.panel {
  background: #fff;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 24px;
}
.login-panel {
  width: min(420px, 92vw);
}
.login-panel h1,
.panel h2 {
  font-size: 1.25rem;
  margin-bottom: 18px;
}

#inventoryTable th,
#inventoryTable td {
  white-space: nowrap;
}
.history-remark {
  min-width: 160px;
  max-width: 320px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#templateFields,
.delivery-batch {
  overflow-wrap: anywhere;
}
#deliveryText {
  height: 280px;
  min-height: 160px;
  max-height: 45vh;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.delivery-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 600px) {
  .navbar .container-fluid {
    gap: 8px;
  }
  .navbar .navbar-nav {
    order: 3;
    width: 100%;
    flex-direction: row;
    gap: 16px;
  }
}
.history-heading { font-size: 1.1rem; margin-bottom: 16px; }
.history-table th { white-space: nowrap; }
.history-table { min-width: 980px; }
.history-table td { padding: 10px 8px; }
.history-table td:not(.history-remark):not(.history-batch):not(.history-identity) { white-space: nowrap; }
.history-batch { max-width: 340px; overflow-wrap: anywhere; font-size: .875rem; }
.history-identity { min-width: 150px; max-width: 280px; overflow-wrap: anywhere; }
.history-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.history-filters > div { flex: 1 1 145px; min-width: 0; }
.history-filters .history-search { flex: 2 1 240px; }
.history-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; }
.history-facts dt { font-size: .875rem; color: #626a73; font-weight: normal; margin-bottom: 4px; }
.history-facts dd { margin: 0; overflow-wrap: anywhere; }
.history-note { grid-column: 1 / -1; white-space: pre-wrap; }
.history-timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 16px 40px; }
.history-timeline li { border-left: 3px solid #198754; padding-left: 12px; display: grid; gap: 4px; }
.history-timeline time { font-size: .875rem; color: #626a73; }
@media (max-width: 600px) {
  .history-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
