/* Panorama – Shipment Tracking
   Rothy's-inspired: clean, minimal, light backgrounds, sage green accent
   https://rothys.com
   Font loaded via link tag in root layout (avoids @import blocking). */

:root {
  --font-sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-text: #1e3a5f;
  --color-text-muted: #4a6b8a;
  --color-text-subtle: #6b8a9e;
  --color-accent: #4a6b4a;
  --color-accent-hover: #3d5a3d;
  --color-accent-muted: #e8f0e8;
  --color-border: #d6d6d6;
  --color-border-light: #f2f2f2;
  /* McMaster-style flatness: prefer hairline borders over pillowy shadows */
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.02);
  --shadow-md: 0 1px 0 rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 6px 18px rgba(0, 0, 0, 0.06);
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-full: 9999px;
  --transition: 0.2s ease;
  --color-primary: #1e3a5f;
  --color-primary-hover: #162e4d;
  /* Base for rem; keep in sync with body font-size */
  --font-size-base: 16px;
}

* {
  box-sizing: border-box;
}

/* Screen-reader-only text (several HEEx templates use class="sr-only") */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

.non-production-banner {
  background: #f59e0b;
  color: #1e3a5f;
  text-align: center;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.non-production-banner strong {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.5rem 1rem 1.25rem;
}

/* App header – logo row + tabbed main nav */
.app-header {
  background: var(--color-bg);
  border-bottom: none;
  padding: 0;
  margin-bottom: 0;
}

.app-header-bar {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg);
}

.app-header-inner {
  width: 100%;
  margin: 0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.app-logo:hover {
  color: var(--color-accent);
}

.app-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.2rem;
  padding: 0.35rem 1.5rem 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}

.app-nav-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  margin-bottom: -1px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
  white-space: nowrap;
  background: transparent;
}

.app-nav-tab:hover {
  color: var(--color-text);
  background: var(--color-surface-muted, #f1f5f9);
  border-color: var(--color-border-light);
}

.app-nav-tab--active {
  color: #fff;
  font-weight: 600;
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 1px 0 var(--color-primary);
}

.app-nav-tab--active:hover {
  color: #fff;
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.app-nav-tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.locale-toggle,
.locale-toggle-global {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.locale-toggle-global {
  position: fixed;
  top: 0.5rem;
  right: 1rem;
  z-index: 1100;
}

.locale-option {
  color: var(--color-text-muted, #64748b);
  text-decoration: none;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.locale-option:hover {
  color: var(--color-accent, #2563eb);
}

.locale-option.locale-active {
  color: var(--color-accent, #2563eb);
  font-weight: 600;
}

.locale-sep {
  color: var(--color-text-muted, #94a3b8);
  user-select: none;
}

.app-header-user {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.header-feedback-link {
  font-size: 0.875rem;
  color: var(--color-accent, #2563eb);
  text-decoration: none;
  margin-right: 0.5rem;
}

.header-feedback-link:hover {
  text-decoration: underline;
}

.feedback-page {
  max-width: min(56rem, 100%);
  margin: 0 auto;
}

.feedback-page__header h1 {
  margin-bottom: 0.25rem;
}

.feedback-page__subtitle {
  color: var(--color-text-muted, #64748b);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.feedback-context-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #64748b);
  margin: 0 0 1rem;
}

.feedback-form .feedback-message-input {
  min-height: 9rem;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

/* SAML roles popover */
.roles-popover {
  position: relative;
}

.roles-summary {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  cursor: pointer;
  list-style: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.roles-summary::-webkit-details-marker {
  display: none;
}

.roles-summary:hover {
  color: var(--color-accent);
  background: var(--color-accent-muted);
}

.roles-popover-content {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 12rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.roles-popover-content strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
  margin-bottom: 0.5rem;
}

.roles-popover-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.roles-popover-content li {
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

/* Login */
.login {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  background: var(--color-surface);
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  max-width: 420px;
  width: 100%;
  border: 1px solid var(--color-border-light);
}

.login-title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.login-subtitle {
  margin: 0 0 2.25rem;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.login-or {
  margin: 1.75rem 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.login-password-form {
  text-align: left;
  margin-bottom: 0.5rem;
}

.login-password-form .form-group {
  margin-bottom: 1rem;
}

.login-password-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.login-password-form .form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 1rem;
  background: var(--color-surface);
  color: var(--color-text);
}

.login-password-form .login-submit {
  width: 100%;
  margin-top: 0.25rem;
  border: none;
  cursor: pointer;
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background: var(--color-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: background var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.login-button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.login-button:active {
  transform: translateY(0);
}

.login-dev-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.login-dev-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: var(--color-text-subtle);
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.login-dev-link:hover {
  color: var(--color-text-muted);
  background: var(--color-border-light);
}

/* Dashboard */
.dashboard {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.dashboard-header h1 {
  margin: 0;
  flex: 1;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.user-email {
  color: var(--color-accent-hover);
  font-size: 0.9rem;
  padding: 0.375rem 0.75rem;
  background: var(--color-accent-muted);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background var(--transition), color var(--transition);
}

.logout-link:hover {
  background: var(--color-accent-muted);
  color: var(--color-accent-hover);
}

/* Shipment Tracker */
.tracker-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.tracker-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.tracker-desc {
  margin: 0 0 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.tracker-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tracker-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.tracker-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(74, 107, 74, 0.12);
}

.tracker-button {
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.tracker-button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* Shipment Result */
.track-result {
  margin-top: 2rem;
}

.shipment-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-md);
}

.shipment-card h3 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.shipment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.shipment-number {
  font-weight: 600;
  font-family: ui-monospace, monospace;
  color: var(--color-text);
}

.shipment-carrier {
  padding: 0.25rem 0.5rem;
  background: var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
}

.shipment-status {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
}

.status-in_transit { background: #dbeafe; color: #1d4ed8; }
.status-delivered { background: #d1fae5; color: #047857; }
.status-empty_returned { background: #ccfbf1; color: #0d9488; }
.status-out_for_delivery { background: #fef3c7; color: #b45309; }
.status-pending { background: #f3f4f6; color: #4b5563; }
.status-exception { background: #fee2e2; color: #b91c1c; }
.status-unknown { background: #f3f4f6; color: #6b7280; }

.shipment-eta {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.shipment-route {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.route-point {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.route-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
}

.route-address {
  font-size: 0.9375rem;
  color: var(--color-text);
}

.shipment-events h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.events-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.875rem;
}

.event-item:last-child {
  border-bottom: none;
}

.event-date {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.event-desc {
  color: var(--color-text);
  font-weight: 500;
}

.event-location {
  color: var(--color-text-subtle);
  font-size: 0.8125rem;
}

.shipment-error {
  border-left: 4px solid #dc2626;
}

.shipment-error p {
  margin: 0;
  color: #991b1b;
}

/* Inbound Shipments – RoRo-style card */
.inbound-page {
  animation: fadeIn 0.3s ease;
}

/* Shipment detail: map next to fields, compact layout */
.inbound-shipment-detail .details-with-map {
  grid-column: 1 / -1;
}

.inbound-shipment-detail .details-and-map {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(320px, 420px);
  gap: 1rem;
  align-items: start;
}

.inbound-shipment-detail .details-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem 1.5rem;
}

.inbound-shipment-detail .detail-map-inline {
  position: sticky;
  top: 0.5rem;
}

.inbound-shipment-detail .detail-map-inline .shipment-map-container {
  min-height: 280px;
  height: 320px;
}

.inbound-shipment-detail .admin-carrier-api-raw {
  margin-top: 1rem;
  width: 100%;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-muted, #f1f5f9);
}

.inbound-shipment-detail .admin-carrier-api-raw__summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text, #0f172a);
  list-style-position: outside;
}

.inbound-shipment-detail .admin-carrier-api-raw__hint {
  display: block;
  margin-top: 0.25rem;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.inbound-shipment-detail .admin-carrier-api-raw__pre {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  overflow: auto;
  max-height: 28rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 4px;
  white-space: pre;
  word-break: break-word;
}

/* Remove top spacing on shipment detail page */
main.container:has(.inbound-shipment-detail) {
  padding-top: 0;
}

.inbound-shipment-detail .page-header {
  margin-bottom: 0.5rem;
}

.inbound-shipment-detail .page-header-detail {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.inbound-shipment-detail .page-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.inbound-shipment-detail .page-header-detail .back-link {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.inbound-shipment-detail .page-header h1 {
  font-size: 1.35rem;
  margin: 0;
}

.inbound-shipment-detail .shipment-badges {
  margin-top: 0;
  gap: 0.35rem;
}

.inbound-shipment-detail .shipment-badges .shipment-badge {
  font-size: 0.8rem;
  padding: 0.15rem 0.4rem;
}

.inbound-shipment-detail .shipment-badges .lifecycle-badge {
  font-size: 0.8rem;
  padding: 0.15rem 0.4rem;
}

.inbound-shipment-detail .shipment-badges .lifecycle-badge .lifecycle-icon {
  width: 11px;
  height: 11px;
  min-width: 11px;
  min-height: 11px;
  max-width: 11px;
  max-height: 11px;
  flex: 0 0 11px;
}

.inbound-shipment-detail .page-header-actions {
  gap: 0.5rem;
  margin-left: auto;
}

.inbound-shipment-detail .page-header-actions .btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}

/* Inline forms were `display: inline`, which misaligns submit buttons vs anchor `.btn` in a flex row */
.inbound-shipment-detail .page-header-actions .page-header-action-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.inbound-shipment-detail .change-history-reveal {
  margin-bottom: 0.5rem;
}

.inbound-shipment-detail .change-history-summary {
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

/* Single column: avoids row-1 gap where line items sat in col 1 and col 2 was empty
   (details card uses grid-column: 1 / -1 on the next row). */
.inbound-shipment-detail .detail-grid {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.inbound-shipment-detail .detail-card {
  padding: 0.5rem 0.75rem;
}

.inbound-shipment-detail .detail-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.inbound-shipment-detail .detail-row {
  padding: 0.2rem 0;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.inbound-shipment-detail .detail-row dt {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #64748b);
}

.inbound-shipment-detail .detail-row dd {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text, #1e293b);
}

.inbound-shipment-detail .details-list .detail-section-title {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #64748b);
  margin: 0.75rem 0 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light, #e2e8f0);
}

.inbound-shipment-detail .details-list .detail-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.inbound-shipment-detail .milestone-item {
  padding: 0.4rem 0;
  font-size: 0.9375rem;
}

.inbound-shipment-detail .form-group-block {
  padding: 0.5rem 0;
}

.inbound-shipment-detail .form-group-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
}

.inbound-shipment-detail .form-group {
  margin-bottom: 0.5rem;
}

.inbound-shipment-detail .form-group label {
  font-size: 0.8rem;
}

.inbound-shipment-detail .form-input,
.inbound-shipment-detail .form-select {
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.inbound-shipment-detail .shipment-map-container {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.inbound-shipment-detail .detail-card h3 {
  font-size: 0.875rem;
  margin: 0 0 0.35rem;
}

.inbound-shipment-detail .container-items-block {
  margin-bottom: 1rem;
}

.inbound-shipment-detail .container-items-block:last-child {
  margin-bottom: 0;
}

.inbound-shipment-detail .container-items-block h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inbound-shipment-detail .container-size-suffix {
  color: var(--color-text-muted);
  font-size: 0.9em;
  white-space: nowrap;
}

.inbound-shipment-detail .empty-container-items {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted, #64748b);
}

.inbound-shipment-detail .shipment-table th,
.inbound-shipment-detail .shipment-table td {
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
}

.inbound-shipment-detail .shipment-table th {
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .inbound-shipment-detail .details-and-map {
    grid-template-columns: 1fr;
  }

  .inbound-shipment-detail .details-list {
    grid-template-columns: 1fr;
  }

  .inbound-shipment-detail .detail-map-inline {
    position: static;
  }

  .inbound-shipment-detail .detail-map-inline .shipment-map-container {
    min-height: 220px;
    height: 260px;
  }
}

/* Card container: rounded corners, light background */
.shipments-card {
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
}

/* Card title row — light bar, matches page (replaces former navy header) */
.shipments-card-header {
  background: var(--color-surface-muted, #f4f4f5);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--color-border-light);
}

.shipments-card-header-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-left: 0;
  min-width: 0;
}

.shipments-card-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.shipments-card-header-count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.shipments-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shipments-card-header .btn {
  flex-shrink: 0;
}

/* Bell/notification button placeholder */
.shipments-card-header .btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-border-light);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.shipments-card-header .btn-icon:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.shipments-card .shipments-section {
  padding: 1rem 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.page-header-detail {
  flex-direction: column;
  align-items: stretch;
}

.page-header-detail .back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.page-header-detail .back-link:hover {
  color: var(--color-accent);
}

.page-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.shipment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.actions-cell-form {
  display: inline;
}

.btn-danger,
.btn-outline.btn-danger {
  color: #dc2626;
  border: 1px solid #dc2626;
  background: transparent;
}

.btn-danger:hover,
.btn-outline.btn-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.table-link-danger {
  color: #dc2626;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.table-link-danger:hover {
  color: #b91c1c;
}

.delay-alerts {
  margin-bottom: 2.5rem;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Shipment table – RoRo-style */
.shipments-card .table-wrap {
  overflow-x: auto;
  border-radius: 0;
  border: none;
  background: #f8fafc;
  box-shadow: none;
}

.shipments-card .shipment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: #f8fafc;
}

.shipments-card .shipment-table th,
.shipments-card .shipment-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.shipments-card .shipment-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: none;
  letter-spacing: 0;
}

.shipments-card .shipment-table tbody tr {
  background: white;
}

.shipments-card .shipment-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.shipments-card .shipment-table tbody tr:hover {
  background: #f1f5f9;
}

/* Tracking/Shipment ID badge (BOL, AWB) — top-align with dense inbound rows (td uses vertical-align: top) */
.tracking-id-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.tracking-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: #e9d5ff;
  color: #6b21a8;
  flex-shrink: 0;
}

.tracking-id-value {
  font-weight: 600;
  color: var(--color-text);
}

/* Status badges with icons – light blue style */
.shipments-card .shipment-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #dbeafe;
  color: #1d4ed8;
}

.shipments-card .shipment-badge .status-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.9;
}

.shipments-card .shipment-badge.status-pending { background: #f1f5f9; color: #475569; }
.shipments-card .shipment-badge.status-in_transit { background: #dbeafe; color: #1d4ed8; }
.shipments-card .shipment-badge.status-out_for_delivery { background: #e0e7ff; color: #4338ca; }
.shipments-card .shipment-badge.status-delivered { background: #d1fae5; color: #047857; }
.shipments-card .shipment-badge.status-empty_returned { background: #ccfbf1; color: #0d9488; }
.shipments-card .shipment-badge.status-exception { background: #fee2e2; color: #b91c1c; }

.shipments-card .shipment-row-late-to-port {
  background: #fffbeb !important;
}

/* Background carrier sync: left-edge pulse on row + amber highlight on changed cells (cleared after ~3s) */
@keyframes inbound-row-left-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(59, 130, 246, 0);
  }
  40% {
    box-shadow: inset 5px 0 0 0 rgba(59, 130, 246, 0.45);
  }
}

.shipments-card .shipment-table tbody tr.shipment-row--bg-updated td:first-child {
  animation: inbound-row-left-pulse 1.05s ease-in-out 2;
}

.shipments-card .shipment-table td.inbound-cell--updated {
  box-shadow: inset 0 0 0 2px rgba(234, 179, 8, 0.85);
  background-color: rgba(254, 243, 199, 0.55);
  transition:
    box-shadow 2.4s ease-out,
    background-color 2.4s ease-out;
}

/* End inbound sync flash */

/* Compact inbound shipments listing */
.inbound-page .shipments-card-header {
  padding: 0.6rem 1rem;
}

.inbound-page .shipments-card-header h1 {
  font-size: 1.1rem;
}

.inbound-page .shipments-card-header-count {
  font-size: 0.8rem;
}

.inbound-page .shipments-card-header .btn {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}

.inbound-page .shipments-section {
  padding: 0.5rem 1rem;
}

/*
 * Inbound list: intrinsic column widths (auto layout + max-content width).
 * Wrapper scrolls horizontally when the table is wider than the viewport.
 * (Table lives inside .inbound-shipments-table-wrap, not as direct child of .shipments-section.)
 */
.inbound-page .shipments-card .shipments-section .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

.inbound-page .shipments-card .shipments-section .table-wrap > table.shipment-table {
  table-layout: auto;
  width: max-content;
  max-width: none;
}

.inbound-page .section-toolbar {
  margin-bottom: 0.5rem;
}

.inbound-page .section-toolbar .filter-select,
.inbound-page .section-toolbar .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.inbound-page .shipments-card .shipment-table {
  font-size: 0.75rem;
}

.inbound-page .shipments-card .shipment-table th,
.inbound-page .shipments-card .shipment-table td {
  padding: 0.35rem 0.5rem;
  vertical-align: top;
  /* Override global .shipment-table min-widths so columns size to content */
  min-width: 0;
  max-width: none;
}

.inbound-page .shipments-card .shipment-table th {
  font-size: 0.7rem;
}

/* Tracking # — single line; column grows with content */
.inbound-page .shipments-card .shipment-table th.col-tracking,
.inbound-page .shipments-card .shipment-table td.col-tracking {
  white-space: nowrap;
}

.inbound-page .shipments-card .shipment-badge {
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
}

.inbound-page .shipments-card .lifecycle-badge {
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
}

/* Inbound list: dense table — keep phase icon slightly smaller than detail */
.inbound-page .shipments-card .lifecycle-badge .lifecycle-icon {
  width: 9px;
  height: 9px;
  min-width: 9px;
  min-height: 9px;
  max-width: 9px;
  max-height: 9px;
  flex-basis: 9px;
}

/* --- Inbound list column widths (table uses width:max-content; cap wide PO/collective, give origin/destination room) --- */

.inbound-page .shipments-card .shipment-table th.col-carrier,
.inbound-page .shipments-card .shipment-table td.col-carrier {
  max-width: 9.5rem;
  width: 9.5rem;
}

.inbound-page .shipments-card .shipment-table th.col-phase,
.inbound-page .shipments-card .shipment-table td.col-phase {
  /* Wide enough for icon + "Exception"/long phase + SlimSelect badge; avoids bleeding into ETA */
  min-width: 11rem;
  max-width: 14rem;
  width: 13rem;
  box-sizing: border-box;
}

.inbound-page .shipments-card .shipment-table td.col-phase .lifecycle-cell {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.inbound-page .shipments-card .shipment-table td.col-phase .status-form.status-form--lifecycle-badge {
  max-width: 100%;
}

.inbound-page .shipments-card .shipment-table th.col-origin,
.inbound-page .shipments-card .shipment-table td.col-origin,
.inbound-page .shipments-card .shipment-table th.col-destination,
.inbound-page .shipments-card .shipment-table td.col-destination {
  min-width: 7.5rem;
  max-width: 15rem;
  overflow-wrap: break-word;
  word-break: normal;
}

.inbound-page .shipments-card .shipment-table th.col-transport-mode,
.inbound-page .shipments-card .shipment-table td.col-transport-mode {
  max-width: 6.75rem;
  width: 6.75rem;
}

.inbound-page .shipments-card .shipment-table th.col-cartons,
.inbound-page .shipments-card .shipment-table td.col-cartons,
.inbound-page .shipments-card .shipment-table th.col-total-units,
.inbound-page .shipments-card .shipment-table td.col-total-units {
  text-align: right;
  white-space: nowrap;
}

.inbound-page .shipments-card .shipment-table th.col-eta,
.inbound-page .shipments-card .shipment-table td.col-eta,
.inbound-page .shipments-card .shipment-table th.col-delivery-eta,
.inbound-page .shipments-card .shipment-table td.col-delivery-eta {
  min-width: 11rem;
  max-width: 15rem;
  white-space: nowrap;
  box-sizing: border-box;
}

.inbound-page .shipments-card .shipment-table th.col-on-time,
.inbound-page .shipments-card .shipment-table td.col-on-time {
  max-width: 7rem;
  width: 7rem;
}

.inbound-page .shipments-card .shipment-table th.col-po-asn-group,
.inbound-page .shipments-card .shipment-table td.col-po-asn-group {
  min-width: 28rem;
  max-width: 36rem;
  width: 32rem;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.inbound-page .shipments-card .shipment-table td.col-po-asn-group .table-link {
  word-break: normal;
  white-space: nowrap;
}

/* PO | Collective | ASN aligned like spreadsheet rows (inbound index). */
.shipment-po-asn-matrix {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
  font-size: inherit;
  line-height: 1.35;
}

.shipment-po-asn-matrix__head-cell {
  padding: 0.15rem 0.35rem;
  border-right: 1px solid rgba(148, 163, 184, 0.45);
  text-align: left;
  min-width: 0;
}

.shipment-po-asn-matrix__head-cell:last-child {
  border-right: none;
}

.shipment-po-asn-matrix__head-cell .sortable-header {
  white-space: nowrap;
}

.shipment-po-asn-matrix--header {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) minmax(5.5rem, 1fr) minmax(6rem, 1.25fr);
  align-items: end;
  font-weight: 600;
  color: inherit;
}

.shipment-po-asn-matrix__line {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) minmax(5.5rem, 1fr) minmax(6rem, 1.25fr);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.shipment-po-asn-matrix__line:first-child {
  border-top: none;
}

.shipment-po-asn-matrix__cell {
  padding: 0.28rem 0.35rem;
  border-right: 1px solid rgba(148, 163, 184, 0.35);
  text-align: left;
  min-width: 0;
}

.shipment-po-asn-matrix__cell:last-child {
  border-right: none;
}

.inbound-page .shipments-card .shipment-table th.col-carrier-status,
.inbound-page .shipments-card .shipment-table td.col-carrier-status {
  max-width: 10rem;
}

.inbound-page .shipments-card .shipment-table th.col-detail-link,
.inbound-page .shipments-card .shipment-table td.col-detail-link {
  width: 3.5rem;
  max-width: 4rem;
  white-space: nowrap;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.inbound-page .shipments-card .shipment-table .origin-secondary,
.inbound-page .shipments-card .shipment-table .destination-secondary {
  font-size: 0.7rem;
}

.inbound-page .status-select {
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .inbound-page .shipments-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .inbound-page .shipments-card-header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .inbound-page .shipments-card-header-actions .btn {
    flex: 1 1 auto;
    min-width: min(100%, 10rem);
    justify-content: center;
  }

  .inbound-page .shipments-section {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .inbound-page .section-toolbar .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inbound-page .section-toolbar .filter-form .filter-select,
  .inbound-page .section-toolbar .filter-form .btn {
    width: 100%;
    max-width: none;
  }
}

.shipments-card .shipment-row-late-to-port:hover {
  background: #fef3c7 !important;
}

/* Origin / Destination columns: primary + secondary lines */
.shipment-table .col-origin,
.shipment-table .col-destination {
  min-width: 11rem;
}

.shipment-table .col-eta {
  min-width: 10rem;
}

.carrier-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carrier-cell .carrier-sync-form,
.carrier-cell .carrier-sync-btn {
  display: inline;
}

.origin-cell,
.destination-cell {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.origin-primary,
.destination-primary {
  font-weight: 600;
  color: var(--color-text);
}

.origin-secondary,
.destination-secondary {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

/* Legacy table (non-card) */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.shipment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.shipment-table th,
.shipment-table td {
  padding: 0.35rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.shipment-table th.sortable {
  white-space: nowrap;
}

.shipment-table .sortable-header {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.shipment-table .sortable-header:hover {
  text-decoration: underline;
}

.shipment-table .sortable-header.sort-asc::after {
  content: " ↑";
  font-size: 0.75em;
  opacity: 0.8;
}

.shipment-table .sortable-header.sort-desc::after {
  content: " ↓";
  font-size: 0.75em;
  opacity: 0.8;
}

/* LiveView adds `phx-*-loading` on the triggering control until the server reply is handled. */
.shipment-table button.sortable-header.phx-click-loading {
  opacity: 0.65;
  pointer-events: none;
  cursor: wait;
}

.shipment-table button.sortable-header.phx-click-loading::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.35rem;
  border: 2px solid var(--color-border-light, #e2e8f0);
  border-top-color: var(--color-text-muted, #64748b);
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: catalog-inline-spin 0.65s linear infinite;
}

.btn.phx-click-loading {
  opacity: 0.75;
  cursor: wait;
  pointer-events: none;
}

.btn.phx-click-loading::after {
  content: "";
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.4rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: catalog-inline-spin 0.65s linear infinite;
}

.btn.btn-outline.phx-click-loading::after {
  border: 2px solid var(--color-border-light, #e2e8f0);
  border-top-color: var(--color-text-muted, #64748b);
}

.catalog-row-clickable.phx-click-loading {
  opacity: 0.7;
  cursor: wait;
}

.catalog-open-overlay.phx-click-loading {
  opacity: 0.7;
  cursor: wait;
}

@keyframes catalog-inline-spin {
  to {
    transform: rotate(360deg);
  }
}

.catalog-inline-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border: 2px solid var(--color-border-light, #e2e8f0);
  border-top-color: var(--color-text-muted, #64748b);
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: catalog-inline-spin 0.65s linear infinite;
}

p.catalog-loading-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shipment-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-border-light);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Do not apply to nested footwear grids (.shipment-table--footwear-sizes) */
.shipment-table:not(.shipment-table--footwear-sizes) tbody tr:last-child td {
  border-bottom: none;
}

.shipment-row:hover {
  background: var(--color-border-light);
}

.shipment-row-late-to-port {
  background: #fffbeb;
}

.shipment-row-late-to-port:hover {
  background: #fef3c7;
}

.table-link {
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

/* Native <button> defaults look like a grey pill; strip chrome so .table-link reads as text. */
button.table-link {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  text-align: inherit;
}

.table-link-external,
.tracking-link-external {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-form {
  display: inline-block;
  padding: 0;
  margin: 0;
  line-height: 1;
  border-radius: var(--radius-sm);
  vertical-align: middle;
}

.status-form .status-select {
  font-size: 0.75rem;
  padding: 0.05rem 0.2rem;
  min-height: 1.5em;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: menulist;
  appearance: menulist;
}

/* Colored options in dropdown - limited browser support but improves where available */
.status-form .status-select option[value="pending"] { background: #f3f4f6; color: #4b5563; }
.status-form .status-select option[value="in_transit"] { background: #dbeafe; color: #1d4ed8; }
.status-form .status-select option[value="out_for_delivery"] { background: #fef3c7; color: #b45309; }
.status-form .status-select option[value="delivered"] { background: #d1fae5; color: #047857; }
.status-form .status-select option[value="empty_returned"] { background: #ccfbf1; color: #0d9488; }
.status-form .status-select option[value="exception"] { background: #fee2e2; color: #b91c1c; }

/* Inbound list: one control — lifecycle-colored badge wraps the carrier status <select> */
.status-form.status-form--lifecycle-badge {
  display: inline-block;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  line-height: 1;
}

.lifecycle-badge.lifecycle-badge--select {
  margin: 0;
  cursor: pointer;
}

.lifecycle-badge.lifecycle-badge--select:focus-within {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 1px;
}

.lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select {
  display: inline-block;
  font-size: inherit;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0 0.15rem 0 0;
  margin: 0;
  min-height: 0;
  cursor: pointer;
  max-width: 12rem;
  min-width: 0;
  vertical-align: middle;
  -webkit-appearance: menulist;
  appearance: menulist;
}

.lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select:focus {
  outline: none;
}

.lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select option[value="pending"] { background: #f3f4f6; color: #4b5563; }
.lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select option[value="in_transit"] { background: #dbeafe; color: #1d4ed8; }
.lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select option[value="out_for_delivery"] { background: #fef3c7; color: #b45309; }
.lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select option[value="delivered"] { background: #d1fae5; color: #047857; }
.lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select option[value="empty_returned"] { background: #ccfbf1; color: #0d9488; }
.lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select option[value="exception"] { background: #fee2e2; color: #b91c1c; }

.inbound-page .shipments-card .lifecycle-badge.lifecycle-badge--select {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

.inbound-page .shipments-card .lifecycle-badge.lifecycle-badge--select .lifecycle-badge__select {
  font-size: 0.7rem;
  /* Global rule allows 12rem — wider than the phase column, so content painted into the next cell */
  max-width: 100%;
  box-sizing: border-box;
}

.ext-link-icon {
  flex-shrink: 0;
  opacity: 0.7;
  vertical-align: middle;
}

.table-link-external:hover .ext-link-icon,
.tracking-link-external:hover .ext-link-icon {
  opacity: 1;
}

.shipment-table td {
  color: var(--color-text);
}

.shipment-table .empty-cell {
  color: var(--color-text-subtle);
}

.shipment-table .notes-cell {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-badge {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-late-to-port {
  background: #fef3c7;
  color: #b45309;
}

.shipment-badge.carrier {
  background: var(--color-border-light);
  color: var(--color-text-muted);
}

/* Computed shipment lifecycle (derived from dates + carrier status; not a DB column) */
.lifecycle-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.lifecycle-badge {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.lifecycle-badge__label {
  white-space: nowrap;
}

/* Tight fixed box — prevents flex/grid from stretching SVG to column width (table cells + max-width:100% on svg) */
.lifecycle-badge .lifecycle-icon {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  max-width: 10px;
  max-height: 10px;
  flex: 0 0 10px;
  display: block;
}

.lifecycle-ordered {
  background: #f3f4f6;
  color: #374151;
}

.lifecycle-in_transit {
  background: #dbeafe;
  color: #1d4ed8;
}

.lifecycle-arrived {
  background: #e0f2fe;
  color: #0369a1;
}

.lifecycle-pending_delivery_appointment {
  background: #fef3c7;
  color: #b45309;
}

.lifecycle-delivery_scheduled {
  background: #fde68a;
  color: #92400e;
}

.lifecycle-delivered {
  background: #e0e7ff;
  color: #4338ca;
}

.lifecycle-received {
  background: #d1fae5;
  color: #047857;
}

.lifecycle-partially_received {
  background: #fef9c3;
  color: #854d0e;
}

.lifecycle-over_received {
  background: #fee2e2;
  color: #b91c1c;
}

.lifecycle-empty_return {
  background: #ccfbf1;
  color: #0f766e;
}

.shipment-badge.shipment-badge--container-return {
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 600;
}

.shipment-container-return-block {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e2e8f0);
}

.shipment-container-return__title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.shipment-container-return__cards {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lifecycle-exception {
  background: #fee2e2;
  color: #b91c1c;
}

.lifecycle-unknown {
  background: #f3f4f6;
  color: #6b7280;
}

.transport-mode-cell {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.transport-mode-cell .transport-mode-badge {
  margin-left: 0;
}

.transport-mode-cell__label {
  font-size: 0.85rem;
  color: var(--color-text);
}

.transport-mode-cell__empty {
  color: var(--color-text-muted);
}

.transport-mode-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.transport-mode-icon,
.drayage-required-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.transport-mode-icon--air {
  color: #0ea5e9;
}

.transport-mode-icon--ocean {
  color: #0369a1;
}

.transport-mode-badge--drayage .drayage-required-icon {
  color: #b45309;
}

.section-toolbar {
  margin-bottom: 1rem;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.filter-search {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  min-width: 12rem;
}

.text-muted {
  color: var(--color-text-muted);
}

/* Catalog area: inverted subnav + toolbars (no duplicate page title under main nav) */
.catalog-inline-count {
  display: inline;
  font-weight: 600;
  color: var(--color-text);
  margin-right: 0.35rem;
}

.catalog-subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.15rem;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.4rem;
  list-style: none;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  border: none;
}
.catalog-subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  margin-bottom: 0;
  transition: color var(--transition), background var(--transition);
}
.catalog-subnav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}
.catalog-subnav-link--active {
  color: var(--color-primary);
  font-weight: 600;
  background: #fff;
}
.catalog-subnav-link--active:hover {
  color: var(--color-primary);
  background: #fff;
}
.catalog-subnav-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.catalog-page .section-toolbar--catalog {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
}
.catalog-page .section-toolbar--catalog .filter-form {
  flex: 1 1 18rem;
  min-width: 0;
}
.catalog-page .catalog-pagination {
  margin: 0.75rem 0 1rem;
}

.catalog-page .section-toolbar--catalog .catalog-upload-btn {
  flex-shrink: 0;
}

.catalog-actions-row,
.admin-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
}
.catalog-actions-row__subtitle,
.admin-actions-row__subtitle {
  margin: 0 !important;
  flex: 1 1 16rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-weight: 400;
}
.catalog-actions-row__primary,
.admin-actions-row__back {
  flex-shrink: 0;
}

.catalog-taxonomy-filters {
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.catalog-taxonomy-leaf {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-text);
}
.catalog-taxonomy-leaf input {
  width: 1rem;
  height: 1rem;
}
.catalog-filter-label-text {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}
.catalog-taxonomy-table .catalog-taxonomy-full-name {
  max-width: 28rem;
}
.catalog-taxonomy-gid {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-page .filter-field-label {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
}
.catalog-page .filter-select--taxonomy {
  min-width: 12rem;
  max-width: min(22rem, 100%);
}
.catalog-page .page-subtitle {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.catalog-page .fo-report-help {
  margin: 0 0 1rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 8px);
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(30, 58, 95, 0.08);
}

.catalog-page .fo-report-help__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.catalog-page .fo-report-help__list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(5.5rem, max-content) 1fr;
  column-gap: 1rem;
  row-gap: 0.55rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

@media (max-width: 520px) {
  .catalog-page .fo-report-help__list {
    grid-template-columns: 1fr;
    row-gap: 0.35rem;
  }

  .catalog-page .fo-report-help__list dt:not(:first-child) {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
  }
}

.catalog-page .fo-report-help__list dt {
  margin: 0;
  font-weight: 600;
  color: var(--color-text);
}

.catalog-page .fo-report-help__list dd {
  margin: 0;
}

.catalog-table .quantity-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fo-links-cell {
  vertical-align: top;
  line-height: 1.35;
}

.fo-links-cell__line + .fo-links-cell__line {
  margin-top: 0.25rem;
}

.catalog-row-discrepancy {
  background: rgba(180, 60, 60, 0.06);
}

.catalog-row-clickable {
  cursor: pointer;
}
.catalog-row-clickable:hover {
  background: rgba(0, 0, 0, 0.02);
}
.catalog-row-clickable.catalog-row-discrepancy:hover {
  background: rgba(180, 60, 60, 0.1);
}

.catalog-table--style-tree .catalog-style-tbody + .catalog-style-tbody .catalog-style-row {
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
}

.catalog-style-row {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 500;
}

.catalog-style-row td {
  vertical-align: middle;
}

.catalog-color-row td {
  vertical-align: middle;
}

/* Hover without row-level phx-click (Safari-friendly overlay targets on cells). */
.catalog-table--style-tree tr.catalog-color-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* Safari / iOS: real click targets need explicit pointer + manipulation to avoid ghost taps. */
.catalog-open-overlay {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.catalog-color-sku-wrap {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.catalog-sku-cell-inner {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Product (colorway) disclosure + SKU sit one step right of the style row in the same column */
.catalog-color-row .catalog-sku-cell-inner {
  padding-left: 2.7rem;
}

/* Variants nest another step under products */
.catalog-variant-row .catalog-sku-cell-inner {
  padding-left: 5.4rem;
}

.catalog-disclosure-slot {
  flex: 0 0 3rem;
  width: 3rem;
  min-width: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.catalog-disclosure-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  vertical-align: middle;
  box-sizing: border-box;
}

.catalog-disclosure-btn--boxed {
  width: 3rem;
  height: 3rem;
  min-width: 3rem;
  min-height: 3rem;
  border: none;
  background: transparent;
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1;
  font-family: ui-sans-serif, system-ui, "Segoe UI Symbol", "Apple Symbols", sans-serif;
}

.catalog-disclosure-btn--boxed:hover {
  background: rgba(0, 0, 0, 0.06);
}

/*
 * Disclosure ⊞/⊟ via ::before only (no text-node children). WebKit often reports the Text node as
 * click target; Phoenix LiveView walks event.target with el.matches('[data-phx-click]'), which
 * throws on Text nodes — first tap looks dead until the user hits padding or uses another row.
 */
.catalog-disclosure-btn--glyph-toggle::before {
  content: "⊞";
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Boolean aria-expanded={true} is minimized (no ="true"); collapsed omits the attribute */
.catalog-disclosure-btn--glyph-toggle[aria-expanded]::before {
  content: "⊟";
}

.catalog-disclosure-placeholder {
  display: inline-block;
  width: 3rem;
  height: 3rem;
  min-width: 3rem;
  min-height: 3rem;
  flex-shrink: 0;
  box-sizing: border-box;
  visibility: hidden;
}

.catalog-style-sku,
.catalog-color-sku {
  font-weight: 600;
}

.catalog-variant-row td {
  border-top: none;
  vertical-align: middle;
  padding-top: 0.2rem;
  padding-bottom: 0.35rem;
}

.catalog-table--style-tree tr.catalog-variant-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.catalog-variant-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
}

.catalog-variant-size {
  margin-left: 0.35rem;
  font-weight: 400;
  font-family: inherit;
  color: var(--color-text-muted, #555);
}

.catalog-merge-backdrop {
  z-index: 920;
}
.catalog-merge-dialog {
  max-width: min(56rem, 96vw);
  max-height: 90vh;
  overflow: auto;
}
.catalog-merge-keep-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.catalog-merge-lead,
.catalog-merge-note {
  font-size: 0.9375rem;
  margin: 0.35rem 0;
}
.catalog-merge-table .catalog-merge-cell-value {
  margin-bottom: 0.35rem;
  word-break: break-word;
}
.catalog-merge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.col-merge-check {
  width: 2.5rem;
  text-align: center;
}

.catalog-sku-alias-hint {
  font-size: 0.875rem;
  margin: 0 0 0.35rem;
  color: var(--color-text-muted);
}
.catalog-sku-alias-list {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}
.catalog-sku-alias-code {
  font-size: 0.9375rem;
}

/* Admin: inverted subnav (matches .catalog-subnav) */
.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.15rem;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.4rem;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  border: none;
}
.admin-subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  margin-bottom: 0;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}
.admin-subnav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}
.admin-subnav-link--active {
  color: var(--color-primary);
  font-weight: 600;
  background: #fff;
}
.admin-subnav-link--active:hover {
  color: var(--color-primary);
  background: #fff;
}
.admin-subnav-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Admin: Facilities & Collections */
.admin-section {
  margin-bottom: 2rem;
}
.admin-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}
.admin-section-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.admin-section--jobs {
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface-elevated, rgba(0, 0, 0, 0.02));
}
.admin-job-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-job-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.admin-job-group-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 0;
}
.admin-job-group-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  width: 100%;
}
.admin-job-group-row > .admin-job-buttons {
  flex: 1 1 auto;
  min-width: 0;
}
.admin-job-group-row > .admin-job-buttons.admin-job-buttons--tight {
  flex: 0 1 auto;
}
.admin-job-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.admin-job-buttons--tight {
  flex: 0 1 auto;
}

/* Block job controls while a long-running job is active (replaces per-control disabled on <a>) */
.admin-job-toolbar[aria-busy] {
  pointer-events: none;
  opacity: 0.85;
}

.admin-job-buttons a.admin-job-phx {
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}

.admin-lv-diagnostics {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--color-border-light, rgba(0, 0, 0, 0.1));
}
.admin-lv-diagnostics > .admin-job-mix-task-form {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.admin-lv-diagnostics .admin-lv-diagnostics-desc {
  margin: 0.35rem 0 0.5rem;
  max-width: 40rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--color-text-muted, #64748b);
}
.admin-lv-diagnostics-toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.admin-lv-diagnostics-state {
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 2.5rem;
}

.admin-job-output-wrap {
  margin-top: 0.5rem;
}
.admin-job-output-label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}
.admin-job-output {
  margin: 0;
  padding: 0.75rem 1rem;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--radius-sm, 4px);
  line-height: 1.45;
}

.admin-sap-po-since-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border, rgba(0, 0, 0, 0.12));
}
.admin-sap-po-since-form--inline {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  flex: 1 1 18rem;
  min-width: min(100%, 14rem);
}
.admin-job-group-row > .admin-job-buttons + .admin-sap-po-since-form--inline {
  padding-left: 0.75rem;
  margin-left: 0.15rem;
  border-left: 1px dashed var(--color-border, rgba(0, 0, 0, 0.12));
}
.admin-job-group-row > .admin-sap-po-since-form--inline + .admin-job-buttons {
  padding-left: 0.75rem;
  margin-left: 0.15rem;
  border-left: 1px dashed var(--color-border, rgba(0, 0, 0, 0.12));
}
@media (max-width: 36rem) {
  .admin-job-group-row > .admin-job-buttons + .admin-sap-po-since-form--inline,
  .admin-job-group-row > .admin-sap-po-since-form--inline + .admin-job-buttons {
    width: 100%;
    padding-left: 0;
    margin-left: 0;
    border-left: none;
    border-top: 1px dashed var(--color-border, rgba(0, 0, 0, 0.12));
    padding-top: 0.65rem;
    margin-top: 0.35rem;
  }
}

.admin-job-mix-forms {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--color-border, rgba(0, 0, 0, 0.12));
  width: 100%;
}
.admin-job-mix-task-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  min-width: 0;
}
.admin-job-mix-task-form__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}
.admin-job-mix-task-form .admin-job-mix-task-form__doc {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
}
.admin-job-mix-task-form__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem 0.65rem;
  width: 100%;
}
.admin-job-mix-task-form .admin-job-inline-form-fields {
  max-width: none;
  width: auto;
}
.admin-job-mix-task-form .admin-job-inline-form-fields--row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
}
.admin-job-mix-task-form .admin-job-inline-field-stack {
  max-width: 16rem;
  width: auto;
  flex: 0 1 auto;
}
.admin-job-mix-task-form .admin-job-inline-checkbox {
  max-width: none;
}
.admin-job-mix-task-grid > .admin-job-mix-task-form {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
/* Destructive Mix tasks: strong cue (was easy to miss with faint tint only). */
.admin-sap-po-since-form--danger.admin-job-mix-task-form {
  border: 1px solid rgba(185, 28, 28, 0.55);
  border-radius: var(--radius-sm, 4px);
  background: rgba(254, 202, 202, 0.55);
  box-shadow: inset 5px 0 0 rgb(185, 28, 28);
  padding: 0.5rem 0.6rem 0.55rem 0.65rem;
}
.admin-sap-po-since-form--danger.admin-job-mix-task-form .admin-sap-po-since-label {
  color: rgb(127, 29, 29);
}
.admin-sap-po-since-form--danger.admin-job-mix-task-form .admin-sap-po-since-hint {
  color: rgb(153, 27, 27);
}
.admin-job-inline-form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0;
  max-width: 42rem;
}
.admin-job-inline-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.875rem;
  line-height: 1.45;
  max-width: 42rem;
}
.admin-job-inline-checkbox input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.admin-job-inline-field-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  max-width: 28rem;
}
.admin-job-inline-field-stack > .admin-sap-po-since-label {
  margin-bottom: 0;
}
.admin-job-inline-input-narrow {
  min-width: 6rem;
  max-width: 10rem;
}
.admin-job-inline-select {
  min-width: 10rem;
}
.admin-sap-po-since-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}
.admin-sap-po-since-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.admin-sap-po-since-input {
  min-width: 12rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.15));
  border-radius: var(--radius-sm, 4px);
  background: var(--color-surface, #fff);
}
.admin-sap-po-since-hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  max-width: 42rem;
}

.admin-job-mix-task-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.admin-user-form {
  margin-bottom: 0;
}
.admin-user-form--create {
  padding: 1rem 0;
}
.admin-user-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem 1rem;
}
.admin-user-field {
  display: flex;
  flex-direction: column;
}
.admin-user-field label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}
.admin-user-field-wide {
  grid-column: 1 / -1;
}
.admin-user-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.text-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
}
.role-pill {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--color-border-light);
}
.admin-users-table td {
  vertical-align: middle;
}

.facility-edit-form {
  padding: 1rem 0;
}
.facility-edit-row {
  margin-bottom: 1rem;
}
.facility-edit-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}
.facility-edit-section {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--color-border-light);
  border-radius: var(--radius-md);
}
.facility-edit-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--color-text);
}
.facility-edit-address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem 1rem;
}
.facility-edit-field {
  display: flex;
  flex-direction: column;
}
.facility-edit-field label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}
.facility-edit-field-wide {
  grid-column: 1 / -1;
}
.facility-edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Inventory comparison blocks */
.comparison-block {
  margin-bottom: 2.5rem;
}
.comparison-block:last-child {
  margin-bottom: 0;
}
.comparison-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--color-text);
}
.comparison-block-count {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
}
.comparison-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.discrepancy-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.discrepancy-mismatch {
  background: #fef3cd;
  color: #856404;
}

.discrepancy-missing_in_system {
  background: #f8d7da;
  color: #721c24;
}

.discrepancy-zero_vs_nonzero {
  background: #fff3cd;
  color: #856404;
}

.empty-state {
  color: var(--color-text-muted);
  padding: 1.5rem;
  text-align: center;
}

.empty-state a {
  color: var(--color-accent);
  font-weight: 500;
}

.form-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--color-border-light);
  max-width: 720px;
}

/* Add shipment: two columns — identity/route left, ocean/NRI right */
.form-section.form-section--inbound-new {
  width: 100%;
  max-width: min(1760px, 100%);
}

/* Add shipment: product line items section first, then main two-column fields */
.inbound-page--new-shipment form.inbound-form--inbound-new-split {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: min(1760px, 100%);
}

.inbound-page--new-shipment .form-section--inbound-line-items-top .product-line-items-wrap {
  margin-top: 0.35rem;
}

.product-line-items-qty-input--computed {
  cursor: default;
  background: var(--color-surface-muted, rgba(0, 0, 0, 0.04));
}

.inbound-form--two-col .inbound-form__grid {
  display: grid;
  /* Ocean (SSL) column 40% wider than identity/route: ratio 5 : 7 */
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem 2rem;
  align-items: start;
}

.inbound-form--two-col .inbound-form__primary,
.inbound-form--two-col .inbound-form__ocean {
  min-width: 0;
}

.inbound-form--two-col .inbound-form__ocean .form-fieldset {
  margin-top: 0;
}

.inbound-form--two-col .inbound-form__primary {
  container-type: inline-size;
  container-name: inbound-new-split;
}

.inbound-form--two-col .inbound-form__ocean {
  container-type: inline-size;
  container-name: inbound-new-split;
}

@container inbound-new-split (max-width: 560px) {
  .inbound-form--two-col .form-row--3,
  .inbound-form--two-col .form-row--4,
  .inbound-form--two-col .form-row--footwear,
  .inbound-form--two-col .form-row--containers-line {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .inbound-form--two-col .inbound-form__grid {
    grid-template-columns: 1fr;
  }
}

/* Add shipment — product line items table (item #, catalog autofill, per-size qty) */
.product-line-items-wrap {
  margin-top: 0.5rem;
}

.product-line-items-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.product-line-items-table {
  border-collapse: collapse;
  width: max(100%, max-content);
  font-size: 0.8125rem;
}

.product-line-items-table th,
.product-line-items-table td {
  padding: 0.35rem 0.4rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border-light);
}

.product-line-items-th--sku {
  min-width: 7rem;
}

.product-line-items-th--product {
  min-width: 9rem;
}

.product-line-items-th--color {
  min-width: 6rem;
}

.product-line-items-th--sizes {
  padding: 0;
  vertical-align: bottom;
}

.product-line-items-td-sizes {
  padding: 0;
  vertical-align: middle;
}

/* Single contiguous grid for all size columns (no number spinners; typeable cells) */
.product-line-items-size-grid {
  --size-cols: 27;
  display: grid;
  grid-template-columns: repeat(var(--size-cols), minmax(1.55rem, 1fr));
  border: 1px solid var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  background: var(--color-bg);
}

.product-line-items-size-cell {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  border-right: 1px solid var(--color-border);
  min-width: 0;
}

.product-line-items-size-cell:last-child {
  border-right: none;
}

.product-line-items-size-cell--head {
  justify-content: center;
  align-items: center;
  padding: 0.2rem 0.05rem;
  font-weight: 600;
  font-size: 0.65rem;
  line-height: 1.1;
  text-align: center;
  background: var(--color-border-light);
  color: var(--color-text-muted);
}

.product-line-items-size-input {
  width: 100%;
  min-width: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0.4rem 0.12rem;
  text-align: center;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}

.product-line-items-size-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  position: relative;
  z-index: 1;
  background: var(--color-surface);
}

.product-line-items-size-input::-webkit-outer-spin-button,
.product-line-items-size-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.product-line-items-qty-input {
  width: 3.25rem;
  min-width: 3.25rem;
  padding: 0.35rem 0.25rem;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.product-line-items-qty-input::-webkit-outer-spin-button,
.product-line-items-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-fieldset {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.form-fieldset legend {
  padding: 0 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.detail-card-legend {
  font-size: 1.125rem !important;
  margin-bottom: 1rem;
}

.upload-desc {
  margin: 0 0 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.upload-template {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--color-border-light);
  border-radius: var(--radius-md);
}

.upload-template h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.column-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.upload-form .form-group {
  margin-bottom: 1.25rem;
}

.inbound-form .form-group {
  margin-bottom: 1.25rem;
}

.inbound-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(74, 107, 74, 0.12);
}

.form-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: #dc2626;
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row .form-group {
  min-width: 0;
}

.form-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Footwear line items on add shipment: product wider, qty narrow */
.form-row--footwear {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(3.5rem, 4.5rem);
  gap: 0.5rem;
}

.form-row--footwear .form-group {
  margin-bottom: 0;
}

/* Two container # + size pairs per row on add shipment */
.form-row--containers-line {
  grid-template-columns: minmax(0, 1.5fr) minmax(3.5rem, 5.5rem) minmax(0, 1.5fr) minmax(3.5rem, 5.5rem);
  gap: 0.5rem;
}

.form-row--containers-line .form-group {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-row,
  .form-row--3,
  .form-row--4,
  .form-row--footwear,
  .form-row--containers-line {
    grid-template-columns: 1fr;
  }
}

.detail-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border-light);
}

.detail-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.form-group-block {
  padding: 1rem 0;
  border-top: 1px solid var(--color-border-light);
}

.form-group-block:first-child {
  padding-top: 0;
  border-top: none;
}

.form-group-block h3 {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-list {
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.detail-row:last-of-type {
  border-bottom: none;
}

.detail-row dt {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.detail-row dd {
  margin: 0;
  font-size: 0.9375rem;
}

.milestone-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.milestone-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.milestone-item:last-child {
  border-bottom: none;
}

.milestone-key {
  font-weight: 600;
  color: var(--color-text);
}

.milestone-time {
  color: var(--color-text-muted);
}

.milestone-location,
.milestone-desc {
  color: var(--color-text-subtle);
  font-size: 0.8125rem;
}

.empty-carrier-events {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Detail page: same carrier timeline as list disclosure (no extra bottom rule inside card) */
.detail-card.carrier-events-card > h2.carrier-events-card__heading {
  margin: 0 0 0.5rem;
}

.carrier-events-card .shipment-carrier-timeline--detail {
  border-bottom: none;
  padding-bottom: 0;
}

.shipment-phase-timeline__explainer {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #64748b);
  line-height: 1.4;
}

.shipment-phase-timeline {
  font-size: initial;
  line-height: initial;
}

.shipment-phase-timeline__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
  margin-bottom: 0.35rem;
  min-height: 2.5rem;
}

.shipment-phase-timeline__phase-name {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  color: #475569;
  hyphens: auto;
  word-break: break-word;
}

.shipment-phase-timeline__phase-name--current {
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shipment-phase-timeline__col--current {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
  border-radius: 4px;
  padding: 0.25rem;
}

.shipment-phase-timeline__col--empty .shipment-phase-timeline__placeholder {
  color: #cbd5e1;
}

.shipment-phase-timeline__stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.shipment-phase-timeline__placeholder {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: #cbd5e1;
  padding: 0.25rem 0;
}

.shipment-carrier-timeline__card--synthetic .shipment-carrier-timeline__card-bar {
  background: #0d9488;
}

.shipment-carrier-timeline__card--synthetic .shipment-carrier-timeline__card-body {
  background: #ecfdf5;
}

.shipment-carrier-timeline__card--synthetic .shipment-carrier-timeline__label {
  color: #115e59;
  font-weight: 600;
}

.change-history-reveal {
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.change-history-summary {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.change-history-summary::-webkit-details-marker {
  display: none;
}

.change-history-summary::before {
  content: "▸";
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.change-history-reveal[open] .change-history-summary::before {
  transform: rotate(90deg);
}

.change-history-content {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--color-border-light);
}

.change-history-content .journal-list {
  margin-top: 0.75rem;
}

.journal-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.journal-item {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.875rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
}

.journal-item:last-child {
  border-bottom: none;
}

.journal-item.journal-status {
  background: rgba(74, 107, 74, 0.08);
  margin: 0 -1rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
}

.journal-time {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.journal-action {
  color: var(--color-text);
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
}

.journal-source {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: lowercase;
}

.empty-journal {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.timeline-section {
  margin-bottom: 2.5rem;
}

.timeline-section .section-title {
  margin-top: 0;
}

.timeline-desc {
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border-light);
  align-items: start;
}

.timeline-item-delayed {
  border-left: 3px solid #dc2626;
  padding-left: 0.75rem;
  margin-left: -0.75rem;
}

.timeline-date {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.timeline-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.timeline-number {
  font-family: ui-monospace, monospace;
  font-weight: 600;
}

.timeline-carrier {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  padding: 0.15rem 0.4rem;
  background: var(--color-border-light);
  border-radius: var(--radius-sm);
}

.timeline-status {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.timeline-po {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

.timeline-link {
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
}

.timeline-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .timeline-item {
    grid-template-columns: 1fr;
  }
}

.welcome {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 48ch;
}

/* Flash messages */
.flash {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1rem;
  max-width: 32rem;
  width: 100%;
  pointer-events: none;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
  pointer-events: auto;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-info {
  background: var(--color-accent-muted);
  color: var(--color-accent-hover);
  border: 1px solid rgba(74, 107, 74, 0.25);
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 768px) {
  .app-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .app-nav-tabs {
    gap: 0;
    padding: 0 1rem;
  }

  .app-nav-tab {
    padding: 0.5rem 0.65rem;
    font-size: 0.875rem;
  }

  .app-header-actions {
    flex-wrap: wrap;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-actions {
    flex-direction: column;
  }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-form .filter-select {
    width: 100%;
  }
}

.table-wrap {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .container {
    padding: 1.25rem 1rem;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .dashboard-header h1 {
    text-align: center;
  }

  .app-header-actions {
    flex-direction: column;
  }

  .shipment-table th,
  .shipment-table td {
    padding: 0.4rem 0.6rem;
    font-size: 0.8125rem;
  }

  .page-header h1 {
    font-size: 1.25rem;
  }
}

/* Shipment overlay detail card */
.tracking-id-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-primary);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
}

.tracking-id-btn:hover {
  color: var(--color-accent);
}

.on-time-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.on-time-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.on-time-dot-red {
  background: #c5221f;
}

.on-time-dot-green {
  background: #137333;
}

.on-time-dot-gray {
  background: #9aa0a6;
}

.on-time-status-late {
  color: #c5221f;
}

.on-time-status-early {
  color: #137333;
}

.on-time-status-na {
  color: var(--color-text-muted);
}

.on-time-status-on-time {
  color: #137333;
}

.tracking-id-cell .tracking-id-value {
  min-width: 0;
  word-break: break-all;
}

.disclosure-icon {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  position: relative;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.disclosure-icon::before {
  content: "▶";
  display: block;
  font-size: 0.65rem;
  line-height: 1;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

/* Container line footwear: chevron rotation when size columns are shown */
.container-line-items-page thead tr.cl-footwear-sizes-head-row-expanded .disclosure-icon::before {
  transform: rotate(90deg);
}

/* Inbound list + detail: horizontal carrier milestone cards */
.shipment-carrier-timeline {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-light, #e2e8f0);
}

.shipment-carrier-timeline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.shipment-carrier-timeline__title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #64748b);
}

.shipment-carrier-timeline__ellipsis {
  color: var(--color-text-muted, #64748b);
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  user-select: none;
}

.shipment-carrier-timeline__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #64748b);
}

/* Grid (not flex): flex inside table colspan cells is buggy in some browsers — forces one horizontal row */
.shipment-carrier-timeline__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(4.5rem, 1fr);
  align-items: stretch;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  /* Collapse whitespace-only text nodes between loop iterations (they become extra grid columns) */
  font-size: 0;
  line-height: 0;
}

.shipment-carrier-timeline__card {
  font-size: initial;
  line-height: normal;
  min-width: 0;
  width: 100%;
  max-width: none;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.shipment-carrier-timeline__card-bar {
  background: #94a3b8;
  color: #fff;
  text-align: center;
  padding: 0.15rem 0;
  font-size: 0.75rem;
  line-height: 1;
}

.shipment-carrier-timeline__card--exception .shipment-carrier-timeline__card-bar {
  background: #dc2626;
}

/* Upcoming / not-yet-reached pipeline slots */
.shipment-carrier-timeline__card--pending .shipment-carrier-timeline__card-bar {
  background: #f1f5f9;
  color: #cbd5e1;
}

.shipment-carrier-timeline__card--pending .shipment-carrier-timeline__card-body {
  background: #fff;
}

.shipment-carrier-timeline__card--pending .shipment-carrier-timeline__label {
  font-weight: 500;
  color: #94a3b8;
}

.shipment-carrier-timeline__hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
}

.shipment-carrier-timeline__detail-head {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--color-border-light, #e2e8f0);
}

.shipment-carrier-timeline__detail-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #64748b);
}

.shipment-carrier-timeline__detail-card {
  min-width: 0;
  width: 100%;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.shipment-carrier-timeline__detail-card .shipment-carrier-timeline__card-bar {
  background: #64748b;
}

.shipment-carrier-timeline__detail-card .shipment-carrier-timeline__card-body {
  background: #f1f5f9;
}

.shipment-carrier-timeline__chev {
  opacity: 0.95;
}

.shipment-carrier-timeline__card-body {
  padding: 0.35rem 0.35rem 0.45rem;
  background: #f8fafc;
  flex: 1;
  min-height: 0;
  text-align: center;
}

.shipment-carrier-timeline__card--exception .shipment-carrier-timeline__label {
  color: #991b1b;
}

.shipment-carrier-timeline__label {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-align: center;
}

.shipment-carrier-timeline__meta {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: center;
  text-align: center;
}

.shipment-carrier-timeline__when {
  font-size: 0.65rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.2;
}

.shipment-carrier-timeline__where {
  font-size: 0.6rem;
  color: #64748b;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .shipment-carrier-timeline__track {
    grid-auto-columns: minmax(3.75rem, 1fr);
  }
}

/*
 * Footwear per-size tables: fill parent width (detail cards and line-item tables).
 * min-width:0 on the chain fixes nested tables shrinking inside table-layout:auto parents.
 */
.table-wrap--footwear-sizes {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 0;
}

.shipment-table--footwear-sizes {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  background: #fff;
  table-layout: fixed;
  border: 1px solid #64748b;
  box-sizing: border-box;
}

.shipment-table--footwear-sizes th,
.shipment-table--footwear-sizes td {
  border: 1px solid #94a3b8;
  vertical-align: middle;
  padding: 0.3rem 0.4rem;
  text-align: left;
  box-sizing: border-box;
}

.shipment-table--footwear-sizes thead th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
}

.shipment-table--footwear-sizes tbody tr:nth-child(even) {
  background: #fafbfc;
}

.shipment-table--footwear-sizes th.size-col,
.shipment-table--footwear-sizes td.size-col {
  padding: 0.2rem 0.1rem;
  text-align: center;
  white-space: nowrap;
}

/* Weight key columns; remaining width goes to size grid */
.shipment-table--footwear-sizes th:nth-child(1),
.shipment-table--footwear-sizes td:nth-child(1) {
  width: 18%;
}

.shipment-table--footwear-sizes th:nth-child(2),
.shipment-table--footwear-sizes td:nth-child(2) {
  width: 8%;
}

.shipment-table--footwear-sizes th:nth-child(3),
.shipment-table--footwear-sizes td:nth-child(3) {
  width: 8%;
}

.shipment-table--footwear-sizes th:last-child,
.shipment-table--footwear-sizes td:last-child {
  width: 4%;
}

/*
 * Container line items — footwear grid: content-based column widths.
 * Must override .inbound-page .shipments-card .table-wrap--footwear-sizes .shipment-table…
 * which uses table-layout:fixed and width:100% !important (same classes as disclosure grids).
 */
.inbound-page .shipments-card .container-lines-table-wrap.table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* Exclude SlimSelect filter headers: product / color / item columns stay narrow */
.container-line-items-page .shipment-table--line-items-grid th:nth-child(-n + 4):not(.cl-supply-th),
.container-line-items-page .shipment-table--line-items-grid td:nth-child(-n + 4) {
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.container-line-items-page .cl-supply-th {
  min-width: 28rem;
  text-align: left;
  vertical-align: top;
}

.container-line-items-page .cl-supply-th-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.container-line-items-page .cl-supply-th-title {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-text, #0f172a);
}

.container-line-items-page .cl-supply-th-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-start;
}

.container-line-items-page .cl-supply-th-filters .cl-filter-th {
  min-width: 10rem;
}

.container-line-items-page .cl-supply-summary-cell {
  vertical-align: top;
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--color-surface-muted, #f8fafc);
}

.container-line-items-page .cl-supply-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.container-line-items-page .cl-supply-block {
  flex: 1 1 10rem;
  min-width: 9rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.375rem;
  padding: 0.35rem 0.5rem;
  background: #fff;
}

.container-line-items-page .cl-supply-block-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-muted, #64748b);
}

.container-line-items-page .cl-supply-block-value {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.container-line-items-page .cl-supply-channels,
.container-line-items-page .cl-supply-etas {
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
  margin-top: 0.15rem;
}

.container-line-items-page .cl-supply-eta-label {
  display: inline-block;
  min-width: 5.5rem;
  font-weight: 500;
  color: var(--color-text, #334155);
}

.container-line-items-page .cl-supply-pipeline {
  display: flex;
  width: 100%;
  height: 0.65rem;
  border-radius: 0.25rem;
  overflow: hidden;
  background: var(--color-border, #e2e8f0);
  margin: 0.25rem 0 0.35rem;
}

.container-line-items-page .cl-supply-pipeline-empty {
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
  padding: 0.15rem 0;
}

.container-line-items-page .cl-supply-pipeline-seg {
  display: inline-block;
  height: 100%;
  min-width: 2px;
  box-sizing: border-box;
}

.container-line-items-page .cl-supply-pipeline-seg--on_hand {
  background: #0ea5e9;
}

.container-line-items-page .cl-supply-pipeline-seg--in_transit {
  background: #8b5cf6;
}

.container-line-items-page .cl-supply-pipeline-seg--remaining {
  background: #f97316;
}

.container-line-items-page .cl-supply-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
}

.container-line-items-page .cl-supply-sap-split {
  display: inline;
  font-size: 0.7rem;
  color: var(--color-text-muted, #64748b);
  margin-left: 0.25rem;
}

.container-line-items-page .cl-supply-eta-retail {
  margin-top: 0.1rem;
}

.container-line-items-page .cl-supply-eta-planning {
  font-style: italic;
  opacity: 0.92;
}

.container-line-items-page .cl-supply-eta-note {
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-muted, #64748b);
  margin-top: 0.1rem;
  line-height: 1.2;
}

.container-line-items-page .cl-size-rollup-h {
  text-align: left;
  font-size: 0.6875rem;
  white-space: nowrap;
  padding-right: 0.35rem;
}

.container-line-items-page .cl-filter-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #64748b);
  margin: 0 0 0.5rem;
}

.container-line-items-page .cl-supply-scope-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0.35rem;
}

.container-line-items-page .cl-supply-scope-nav .cpsp-bucket {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md, 0.375rem);
  border: 1px solid var(--color-border, #e2e8f0);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text, #0f172a);
  background: #fff;
}

.container-line-items-page .cl-supply-scope-nav .cpsp-bucket:visited {
  color: var(--color-text, #0f172a);
}

.container-line-items-page .cl-supply-scope-nav .cpsp-bucket:hover {
  border-color: var(--color-border-strong, #cbd5e1);
  background: var(--color-surface-muted, #f8fafc);
}

.container-line-items-page .cl-supply-scope-nav .cpsp-bucket--active {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
  font-weight: 600;
}

.container-line-items-page .cl-supply-scope-nav .cpsp-bucket--active:hover {
  background: rgba(37, 99, 235, 0.1);
}

.container-line-items-page .container-lines-supply-hint {
  font-size: 0.8125rem;
  margin: 0 0 0.75rem;
}

/* Catalog supply phases (SAP open vs inbound footwear vs uncommitted) */
.catalog-product-supply-page .cpsp-lead {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted, #475569);
  max-width: 52rem;
}

.catalog-product-supply-page .cpsp-buckets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.75rem;
}

.catalog-product-supply-page .cpsp-bucket {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md, 0.375rem);
  border: 1px solid var(--color-border, #e2e8f0);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text, #0f172a);
  background: #fff;
}

.catalog-product-supply-page .cpsp-bucket--active {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
  font-weight: 600;
}

.catalog-product-supply-page .cpsp-section {
  margin-top: 0.5rem;
}

.catalog-product-supply-page .cpsp-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #64748b);
  margin: 0.5rem 0;
  max-width: 56rem;
}

.catalog-product-supply-page .cpsp-phase-form {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 0.375rem);
  background: var(--color-surface-muted, #f8fafc);
}

.catalog-product-supply-page .cpsp-phase-fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.catalog-product-supply-page .cpsp-phase-legend {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.catalog-product-supply-page .cpsp-phase-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
}

.catalog-product-supply-page .cpsp-phase-list {
  margin: 0.25rem 0 0;
}

.catalog-product-supply-page .cpsp-table {
  font-size: 0.8125rem;
}

/*
 * FOUC: product/item filters use <select multiple> until SlimSelect initializes (deferred app.js).
 * Native multi-selects render as tall listboxes — hide until hook adds .cl-slimselect-ready.
 */
.container-line-items-page .cl-footwear-slimselect-root:not(.cl-slimselect-ready) .cl-filter-th-control {
  position: relative;
  min-height: 2.375rem;
  border-radius: 0.375rem;
  background: var(--color-surface-muted, #f1f5f9);
  box-sizing: border-box;
  overflow: hidden;
}

.container-line-items-page .cl-footwear-slimselect-root:not(.cl-slimselect-ready) select[data-cl-slim-select] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2.375rem;
  max-height: 2.375rem;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/*
 * Footwear line-items grid: header titles top-aligned and centered.
 * Must beat .inbound-page .shipments-card .table-wrap--footwear-sizes … th { vertical-align: middle }
 * (container-lines tables use the same footwear wrap + table classes).
 */
.container-line-items-page.inbound-page
  .shipments-card
  .container-lines-table-wrap.table-wrap--footwear-sizes
  .shipment-table.shipment-table--line-items-grid.shipment-table--footwear-sizes
  thead
  th {
  vertical-align: top !important;
  text-align: center;
}

/* Fallback if markup class order differs */
.container-line-items-page .shipment-table--line-items-grid thead th {
  vertical-align: top !important;
  text-align: center;
}

.container-line-items-page .shipment-table--line-items-grid thead th .disclosure-toggle-form {
  margin-left: auto;
  margin-right: auto;
}

.container-line-items-page .cl-filter-th {
  vertical-align: top;
  min-width: 7.5rem;
  max-width: 16rem;
  width: 16rem;
  overflow: hidden;
  box-sizing: border-box;
}

/* Column title on top, SlimSelect below — both centered */
.container-line-items-page .cl-filter-th-row {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.container-line-items-page .cl-filter-th-label {
  display: block;
  width: 100%;
  max-width: 100%;
  font-weight: 600;
  margin-bottom: 0;
  line-height: 1.25;
  text-align: center;
}

.container-line-items-page .cl-filter-th-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* SlimSelect: native <select> hidden by library; keep layout in filter headers */
.container-line-items-page .cl-filter-th .cl-slim-select-native {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 2rem;
  font-size: 0.8125rem;
}

/*
 * SlimSelect multi-select (all instances): one horizontal row + horizontal scroll instead of
 * wrapping/stacking chips vertically. On hover-capable pointers, each chip stays narrow until
 * hovered so filter headers stay short.
 */
.ss-main .ss-values {
  flex: 1 1 auto !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: 2.75rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.ss-main .ss-values .ss-placeholder {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  max-width: 100%;
}

.ss-main .ss-values .ss-value {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}

.ss-main .ss-values .ss-value .ss-value-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-main .ss-values .ss-value .ss-value-delete {
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .ss-main .ss-values .ss-value {
    max-width: 4.5rem;
    transition: max-width 0.15s ease;
  }

  .ss-main .ss-values .ss-value:hover {
    max-width: min(18rem, 70vw);
    z-index: 1;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  }
}

/*
 * SlimSelect loads after this file (assets/app.css) and sets .ss-values { flex: 1 1 100% },
 * which steals the full first flex line and drops .ss-arrow below. Pin arrow + deselect
 * absolutely so they always sit on the right of the control.
 */
.container-line-items-page .cl-filter-th .ss-main {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 0.8125rem;
  flex-wrap: nowrap !important;
  align-items: center;
  /* Reserve space for deselect (when shown) + caret */
  padding-right: 2.35rem;
  box-sizing: border-box;
}

.container-line-items-page .cl-filter-th .ss-main .ss-values {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.container-line-items-page .cl-filter-th .ss-main .ss-values .ss-placeholder {
  justify-content: center;
}

.container-line-items-page .cl-filter-th .ss-main .ss-arrow {
  position: absolute !important;
  right: 0.35rem;
  top: 0.45rem;
  margin: 0 !important;
  flex: none !important;
  flex-shrink: 0 !important;
  z-index: 2;
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
}

/* UAs / resets sometimes set svg { max-width: 100% }, stretching the caret to the column width. */
.container-line-items-page .cl-filter-th .ss-main .ss-arrow svg {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  display: block;
  flex: none !important;
}

.container-line-items-page .cl-filter-th .ss-main .ss-deselect:not(.ss-hide) {
  position: absolute !important;
  right: 1.35rem;
  top: 0.45rem;
  margin: 0 !important;
  flex: none !important;
  flex-shrink: 0 !important;
  z-index: 2;
}

.container-line-items-page .cl-filter-th .ss-main .ss-deselect svg {
  width: 8px !important;
  height: 8px !important;
  max-width: 8px !important;
  max-height: 8px !important;
  flex: none !important;
  display: block;
}

/*
 * Inbound shipments index (/inbound): status column multi-filter matches container line items.
 */
.inbound-page .inbound-slimselect-data-hook {
  display: none;
}

.inbound-page .inbound-shipments-table-wrap:not(.inbound-slimselect-ready) .cl-filter-th-control {
  position: relative;
  min-height: 2.375rem;
  border-radius: 0.375rem;
  background: var(--color-surface-muted, #f1f5f9);
  box-sizing: border-box;
  overflow: hidden;
}

/*
 * Must beat .cl-filter-th .cl-slim-select-native (otherwise min-height/display let the native
 * multi-select flash before SlimSelect mounts).
 */
.inbound-page
  .inbound-shipments-table-wrap:not(.inbound-slimselect-ready)
  .cl-filter-th
  select[data-inbound-slim-select] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2.375rem;
  max-height: 2.375rem;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  visibility: hidden;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th {
  vertical-align: top;
  min-width: 7.5rem;
  max-width: 16rem;
  width: 16rem;
  overflow: hidden;
  box-sizing: border-box;
}

/* Narrower than legacy 16rem so PO / origin columns get space */
.inbound-page .inbound-shipments-table-wrap .cl-filter-th.cl-filter-th--carrier {
  width: 9.5rem;
  max-width: 9.5rem;
  min-width: 7.5rem;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th.cl-filter-th--phase {
  width: 13rem;
  max-width: 13rem;
  min-width: 11rem;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th-row {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th-label {
  display: block;
  width: 100%;
  max-width: 100%;
  font-weight: 600;
  margin-bottom: 0;
  line-height: 1.25;
  text-align: center;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th .cl-slim-select-native {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 2rem;
  font-size: 0.8125rem;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th .ss-main {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 0.8125rem;
  flex-wrap: nowrap !important;
  align-items: center;
  padding-right: 2.35rem;
  box-sizing: border-box;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th .ss-main .ss-values {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th .ss-main .ss-values .ss-placeholder {
  justify-content: center;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th--carrier .ss-main .ss-values .ss-placeholder,
.inbound-page .inbound-shipments-table-wrap .cl-filter-th--carrier .ss-main .ss-values .ss-single {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  max-width: 100%;
  margin: 0 !important;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th .ss-main .ss-arrow {
  position: absolute !important;
  right: 0.35rem;
  top: 0.45rem;
  margin: 0 !important;
  flex: none !important;
  flex-shrink: 0 !important;
  z-index: 2;
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th .ss-main .ss-arrow svg {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  display: block;
  flex: none !important;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th .ss-main .ss-deselect:not(.ss-hide) {
  position: absolute !important;
  right: 1.35rem;
  top: 0.45rem;
  margin: 0 !important;
  flex: none !important;
  flex-shrink: 0 !important;
  z-index: 2;
}

.inbound-page .inbound-shipments-table-wrap .cl-filter-th .ss-main .ss-deselect svg {
  width: 8px !important;
  height: 8px !important;
  max-width: 8px !important;
  max-height: 8px !important;
  flex: none !important;
  display: block;
}

/* SlimSelect list panel is appended to body; class is copied from native <select> */
.cl-filter-slim-dropdown.ss-content {
  font-size: 0.75rem;
}

.cl-filter-slim-dropdown.ss-content .ss-search input {
  font-size: 0.75rem;
}

.cl-filter-slim-dropdown.ss-content .ss-option {
  font-size: 0.75rem;
  line-height: 1.35;
}

.cl-filter-slim-dropdown.ss-content .ss-optgroup-label {
  font-size: 0.6875rem;
}

.container-line-items-page .size-expand-th {
  width: auto;
  min-width: 4.5rem;
  max-width: 6rem;
  text-align: center;
  /* thead uses top + center via .shipment-table--line-items-grid thead th */
  vertical-align: top;
}

.container-line-items-page .size-expand-th .cl-footwear-sizes-label {
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Disclosure control in header (same pattern as inbound shipments tracking cell) */
.container-line-items-page .size-expand-th .disclosure-toggle-form {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.25rem;
  justify-content: center;
  margin: 0 auto;
}

.container-line-items-page .size-expand-spacer {
  width: 2.5rem;
  padding: 0.25rem;
}

.container-line-items-page .shipment-table--line-items-grid th:last-child,
.container-line-items-page .shipment-table--line-items-grid td:last-child {
  width: auto;
}

.container-line-items-page .container-lines-sections {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.container-line-items-page .container-lines-section-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-text, #0f172a);
}

.container-line-items-page .empty-state--section {
  margin: 0;
  font-size: 0.875rem;
}

/* Packaging / small package: intrinsic table width (no min-width:100% — that spreads columns equally) */
.container-line-items-page .shipments-card .container-lines-table-wrap .shipment-table.shipment-table--line-items-packaging,
.container-line-items-page .shipments-card .container-lines-table-wrap .shipment-table.shipment-table--line-items-small-package {
  table-layout: auto;
  width: max-content;
  min-width: 0;
}

.container-line-items-page .shipment-table--line-items-packaging th:nth-child(-n + 10),
.container-line-items-page .shipment-table--line-items-packaging td:nth-child(-n + 10) {
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.container-line-items-page .shipment-table--line-items-small-package th:nth-child(-n + 7),
.container-line-items-page .shipment-table--line-items-small-package td:nth-child(-n + 7) {
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.container-line-items-page .shipment-table--line-items-small-package th:nth-child(8),
.container-line-items-page .shipment-table--line-items-small-package td:nth-child(8) {
  width: 6.75rem;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-line-items-page .shipment-table--line-items-small-package th:nth-child(9),
.container-line-items-page .shipment-table--line-items-small-package td:nth-child(9) {
  width: 4.25rem;
  max-width: 5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-line-items-page .shipment-table--line-items-small-package th:nth-child(10),
.container-line-items-page .shipment-table--line-items-small-package td:nth-child(10) {
  width: 4.5rem;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-line-items-page .shipment-table--line-items-small-package th:nth-child(11),
.container-line-items-page .shipment-table--line-items-small-package td:nth-child(11) {
  min-width: 6rem;
  width: 7rem;
  white-space: nowrap;
}

.container-line-items-page .shipment-table--line-items-small-package th:nth-child(12),
.container-line-items-page .shipment-table--line-items-small-package td:nth-child(12) {
  min-width: 5rem;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-line-items-page .shipment-table--line-items-small-package th:nth-child(13),
.container-line-items-page .shipment-table--line-items-small-package td:nth-child(13) {
  min-width: 5rem;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-line-items-page .shipment-table--line-items-small-package th:nth-child(14),
.container-line-items-page .shipment-table--line-items-small-package td:nth-child(14) {
  min-width: 5.5rem;
  white-space: nowrap;
}

.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes th,
.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes td {
  font-size: 0.8rem;
  border: 1px solid #94a3b8 !important;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Products grid: use full card width; override global fixed % widths (wrong after Container column). */
.inbound-shipment-detail .table-wrap--footwear-sizes {
  max-width: none;
}

.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes {
  table-layout: auto;
  width: 100%;
  min-width: 100%;
}

.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes th:nth-child(1),
.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes td:nth-child(1),
.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes th:nth-child(2),
.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes td:nth-child(2),
.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes th:nth-child(3),
.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes td:nth-child(3),
.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes th:last-child,
.inbound-shipment-detail .table-wrap--footwear-sizes .shipment-table.shipment-table--footwear-sizes td:last-child {
  width: auto;
}

.shipment-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Inbound list: all filters in a modal (SlimSelects stay mounted; do not use display:none). */
.shipment-overlay-backdrop.inbound-filters-overlay.inbound-filters-overlay--dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s;
}

.shipment-overlay.inbound-filters-dialog {
  /* Extra-wide panel: carrier | phase, dense checkbox columns. */
  max-width: min(92rem, 98.5vw);
  width: 100%;
  max-height: none;
  position: relative;
  isolation: isolate;
}

.inbound-filters-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.inbound-export-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-left: auto;
}

@media (max-width: 640px) {
  .inbound-export-group {
    margin-left: 0;
  }
}

.inbound-export-label {
  font-size: 0.85rem;
  color: var(--color-text-muted, #64748b);
}

.inbound-filters-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.inbound-filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: var(--color-primary-strong, #1e3a5f);
  border-radius: 999px;
}

.inbound-filters-overlay-content {
  text-align: left;
}

.inbound-filters-overlay-header {
  padding: 1.25rem 1.25rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.inbound-filters-overlay-header .shipment-overlay-title {
  margin: 0;
  font-size: 1.2rem;
}

.inbound-filters-overlay-body {
  padding: 1rem 1.25rem 1.25rem;
  overflow: visible;
  max-height: none;
}

.inbound-filters-section-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #64748b);
}

.inbound-filters-preset-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

.inbound-filters-preset-link {
  flex: 1 1 9.5rem;
  min-width: 0;
  text-align: center;
  box-sizing: border-box;
}

.inbound-filters-field {
  margin-bottom: 0.9rem;
}

.inbound-filters-field:last-of-type {
  margin-bottom: 0;
}

.inbound-filters-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-text, #0f172a);
}

.shipment-overlay.inbound-filters-dialog .shipment-overlay-content.inbound-filters-overlay-content {
  position: relative;
  z-index: 0;
  max-height: none;
  overflow: visible;
}

.inbound-filters-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.25rem 2.25rem;
  align-items: start;
}

.inbound-filters-cols .inbound-filters-field {
  margin-bottom: 0;
}

@media (max-width: 52rem) {
  .inbound-filters-cols {
    grid-template-columns: 1fr;
  }
}

.shipment-overlay.inbound-filters-dialog .inbound-filters-overlay-close,
.shipment-overlay.inbound-filters-dialog .shipment-overlay-close.inbound-filters-overlay-close {
  z-index: 3;
  pointer-events: auto;
}

/* Responsive 3 → 2 → 1 columns of checkboxes inside each list (no scroll). */
.inbound-filters-checkbox-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: none;
  overflow: visible;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm, 0.375rem);
  background: var(--color-surface, #fff);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  align-content: start;
}

@media (max-width: 72rem) {
  .inbound-filters-checkbox-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 28rem) {
  .inbound-filters-checkbox-list {
    grid-template-columns: 1fr;
  }
}

.inbound-filters-checkbox-list li {
  border-bottom: 1px solid var(--color-border-light, #e2e8f0);
}

.inbound-filters-checkbox-list li:last-child {
  border-bottom: none;
}

.inbound-filters-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
}

.inbound-filters-check-label:hover {
  background: var(--color-surface-muted, #f1f5f9);
}

.inbound-filters-check-text {
  flex: 1;
  min-width: 0;
}

.inbound-filters-overlay-footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
  text-align: center;
}

/* Dimmed area behind the modal; `phx-click` lives here so panel clicks are not ancestors of close. */
.shipment-overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.shipment-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
}

.shipment-overlay-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

/* Full inbound shipment detail (former `/inbound/:id` page) inside overlay */
.shipment-detail-overlay-panel {
  max-width: min(1200px, 96vw);
  width: 100%;
}

.shipment-detail-overlay-content {
  overflow-y: auto;
  max-height: min(90vh, 920px);
  -webkit-overflow-scrolling: touch;
}

.inbound-shipment-detail--overlay {
  padding: 1.25rem 1rem 1.25rem;
}

/* Shipment detail modal: × vertically centered with the header row; reserve space on the right */
.shipment-detail-overlay-panel > .shipment-overlay-close {
  /* Match vertical center of first header row: overlay padding-top + ~half header row height */
  top: calc(1.25rem + 1.35rem);
  transform: translateY(-50%);
  right: 1rem;
  z-index: 11;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

/* Reserve horizontal space for the ×; vertically center title block vs action buttons */
.shipment-detail-overlay-panel .inbound-shipment-detail--overlay > .page-header.page-header-detail {
  padding-right: 3rem;
  align-items: center;
  gap: 0.75rem 1rem;
}

.shipment-detail-overlay-panel .inbound-shipment-detail--overlay .page-header-left {
  flex: 1;
  min-width: 0;
  align-items: center;
}

.shipment-detail-overlay-panel .inbound-shipment-detail--overlay .page-header-actions {
  margin-left: auto;
  justify-content: flex-end;
  align-items: center;
  align-self: center;
}

button.table-link.table-link--overlay,
button.table-link.po-overlay-shipment-link {
  color: inherit;
  text-decoration: underline;
}

/* Inbound shipments list: text-style links read as classic hyperlinks (blue + underlined). */
.inbound-page .shipment-table thead a.sortable-header {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.inbound-page .shipment-table thead a.sortable-header:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.inbound-page a.table-link,
.inbound-page button.table-link,
.inbound-page button.table-link.table-link--overlay {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.inbound-page a.table-link:hover,
.inbound-page button.table-link:hover,
.inbound-page button.table-link.table-link--overlay:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.inbound-page .page-header-detail .back-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.inbound-page .page-header-detail .back-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.inbound-page .tracking-link-external {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.inbound-page .tracking-link-external:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Shipment detail overlay uses the same detail markup without `.inbound-page`. */
.inbound-shipment-detail--overlay a.table-link,
.inbound-shipment-detail--overlay button.table-link,
.inbound-shipment-detail--overlay button.table-link.table-link--overlay {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.inbound-shipment-detail--overlay a.table-link:hover,
.inbound-shipment-detail--overlay button.table-link:hover,
.inbound-shipment-detail--overlay button.table-link.table-link--overlay:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.inbound-shipment-detail--overlay .tracking-link-external {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.inbound-shipment-detail--overlay .tracking-link-external:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.shipment-overlay-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}

.shipment-overlay-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.shipment-overlay-status {
  font-size: 0.8125rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-accent-muted);
  color: var(--color-accent);
}

.shipment-overlay-status.status-delivered,
.shipment-overlay-status.status-empty_returned {
  background: #e6f4ea;
  color: #137333;
}

.shipment-overlay-status.status-in_transit {
  background: #e8f0fe;
  color: #1967d2;
}

.shipment-overlay-status.status-exception {
  background: #fce8e6;
  color: #c5221f;
}

.shipment-overlay-edit-link {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.shipment-overlay-edit-link:hover {
  color: var(--color-accent);
}

.shipment-overlay-track-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  margin-left: auto;
  margin-right: 20px;
}

.shipment-overlay-track-link:hover {
  color: var(--color-accent-hover);
}

.shipment-overlay-track-link .ext-link-icon {
  flex-shrink: 0;
}

.shipment-overlay-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.shipment-overlay-close:hover {
  color: var(--color-text);
}

.shipment-overlay-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.shipment-overlay-details {
  flex: 0 0 50%;
  overflow-y: auto;
  padding: 1.25rem;
  border-right: 1px solid var(--color-border-light);
}

.shipment-overlay-map {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 280px;
  height: 320px;
  background: var(--color-border-light);
}

.shipment-detail-group {
  margin-bottom: 1.25rem;
}

.shipment-detail-group:last-child {
  margin-bottom: 0;
}

.detail-group-title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
}

.detail-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.25rem 0;
  font-size: 0.9375rem;
}

.detail-label {
  flex: 0 0 7rem;
  color: var(--color-text-muted);
}

.detail-value {
  flex: 1;
}

.shipment-map-container {
  position: relative;
  min-height: 280px;
  height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Route vertices: small squares (see assets/js/app.js SHIPMENT_ROUTE_LINE_WEIGHT) */
.leaflet-div-icon.shipment-map-route-point {
  background: transparent !important;
  border: none !important;
}

.shipment-map-route-point .shipment-map-route-point__square {
  width: 100%;
  height: 100%;
  background: #1967d2;
  opacity: 0.9;
  box-sizing: border-box;
}

.shipment-map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.shipment-map-placeholder p {
  margin: 0;
}

.shipment-map-debug {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.7rem;
  z-index: 1000;
  word-break: break-all;
}

@media (max-width: 768px) {
  .shipment-overlay-body {
    flex-direction: column;
  }

  .shipment-overlay-details {
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
  }

  .shipment-overlay-map {
    min-height: 220px;
  }
}

/* Purchase Orders page */
.purchase-orders-page {
  animation: fadeIn 0.3s ease;
}

.po-area-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin: 0.5rem 0 0.25rem;
  padding: 0;
  border-bottom: 1px solid var(--color-border-light);
  width: 100%;
  max-width: 100%;
}

a.po-area-tab {
  display: inline-block;
  padding: 0.35rem 0.15rem 0.5rem;
  margin-bottom: -1px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  border-radius: 2px 2px 0 0;
}

a.po-area-tab:hover {
  color: var(--color-text);
}

a.po-area-tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

a.po-area-tab--active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

.po-delivery-docs-table {
  font-size: 0.875rem;
}

.po-delivery-docs-table td {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-delivery-docs-table td:first-child {
  max-width: 10rem;
}

.po-delivery-docs-col-raw {
  vertical-align: top;
  white-space: normal;
  max-width: none;
}

.po-delivery-docs-raw-details pre.po-raw-payload {
  margin-top: 0.5rem;
  max-height: 24rem;
  overflow: auto;
}

.purchase-orders-page .po-list-fl-col {
  white-space: nowrap;
  font-size: 0.8125rem;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.po-first-line-filters {
  margin-bottom: 0.75rem;
}

.po-first-line-filters-fieldset {
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  padding: 0.65rem 0.85rem 0.75rem;
  margin: 0;
}

.po-first-line-filters-legend {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0 0.35rem;
}

.po-first-line-filters-hint {
  margin: 0 0 0.5rem;
  max-width: 52rem;
}

.po-first-line-filters-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.po-first-line-filters-row {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) auto auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.po-first-line-filters-label {
  color: var(--color-text-muted);
}

.po-first-line-filters-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  white-space: nowrap;
}

.po-number-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: none;
}

.po-number-btn:hover {
  text-decoration: underline;
  color: var(--color-accent-hover);
}

.po-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0;
}

.po-inbound-shipments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.po-inbound-shipments-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.po-overlay-inbound-shipments {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.po-overlay-inbound-shipment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.po-overlay-associated-asns {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.po-overlay-associated-asn-row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 0.15rem;
}

.po-overlay-associated-asn-dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.po-overlay-associated-asn-bol {
  font-size: 0.875rem;
  opacity: 0.85;
}

.po-section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

/* Hint sits below the toolbar row so it never shares a flex line with controls (avoids flex-end misalignment). */
.purchase-orders-page .po-toolbar-hint {
  margin: 0 0 0.75rem;
}

.purchase-orders-page .po-overlay-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.purchase-orders-page .po-overlay-search-form .filter-search {
  flex: 1 1 min(100%, 18rem);
  min-width: 0;
}

.po-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.po-pagination-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.po-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.po-pagination-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.po-fulfillment-filter-root {
  min-width: 0;
}

.po-filter-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

/* Keep SlimSelect from stretching across the full card width (matches inbound phase filter scale). */
.purchase-orders-page .po-filter-status-control {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 18rem;
  width: min(18rem, 100%);
}

.purchase-orders-page .po-filter-status-control .ss-main {
  position: relative;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  min-height: 2.375rem;
  padding-right: 2.35rem;
  box-sizing: border-box;
}

.purchase-orders-page .po-filter-status-control .ss-main .ss-values {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.2rem;
  row-gap: 0.25rem;
}

.purchase-orders-page .po-filter-status-control .ss-main .ss-arrow {
  position: absolute;
  right: 0.35rem;
  top: 0.45rem;
  margin: 0;
  flex: none;
}

.purchase-orders-page .po-filter-status-control .ss-main .ss-deselect:not(.ss-hide) {
  position: absolute;
  right: 1.35rem;
  top: 0.45rem;
  margin: 0;
  flex: none;
}

.po-filter-preset-incomplete {
  flex-shrink: 0;
  white-space: nowrap;
}

.po-filter-status-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.po-filtered-empty {
  margin-top: 0.5rem;
}

.po-inbound-shipments-wrap {
  min-width: 0;
}

.po-fulfillment-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  max-width: 100%;
  word-break: break-word;
}

.po-fulfillment-no_shipments {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
}

.po-fulfillment-asn_pending_no_inbound {
  background: #ede7f6;
  color: #4527a0;
}

.po-fulfillment-sap_marked_complete {
  background: #e0f2f1;
  color: #00695c;
}

.po-fulfillment-split_collective {
  background: #fce4ec;
  color: #880e4f;
}

.po-fulfillment-collective_mismatch {
  background: #fff3e0;
  color: #e65100;
}

.po-fulfillment-exception {
  background: #fde8e8;
  color: #8a1f1f;
}

.po-fulfillment-delayed {
  background: #fff4e5;
  color: #8a5a00;
}

.po-fulfillment-mixed_inbound {
  background: #e8f0fe;
  color: #174ea6;
}

.po-fulfillment-in_transit {
  background: #e8f4fd;
  color: #1557a0;
}

.po-fulfillment-at_dc_pending_receipt {
  background: #e6f4ea;
  color: #137333;
}

.po-fulfillment-received_qty_short {
  background: #fce8e6;
  color: #7a1f0a;
}

.po-fulfillment-received_qty_over {
  background: #e8eaf6;
  color: #283593;
}

.po-fulfillment-received_qty_complete {
  background: #e6f4ea;
  color: #0d652d;
}

.po-fulfillment-fully_received {
  background: #e8f5e9;
  color: #1b5e20;
}

.po-overlay-body .shipment-overlay-details {
  flex: 1;
}

/* Product catalog overlay */
.product-overlay.product-overlay--pim {
  max-width: min(1180px, 96vw);
}

.product-overlay-pim-header {
  align-items: flex-start;
  flex-direction: column;
  gap: 0;
  padding-bottom: 0.85rem;
}

.product-overlay-pim-header-text {
  flex: 1;
  min-width: 0;
  padding-right: 2.5rem;
}

.product-overlay-pim-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.pim-readonly-pill {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
}

.product-overlay-pim-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.product-overlay-pim-meta-sep {
  margin: 0 0.35rem;
  color: var(--color-text-subtle);
}

.pim-inline-code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Monaco, monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
}

.product-overlay-pim-title {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.product-overlay-pim-title--name {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
}

.product-overlay-pim-sku-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.product-overlay-pim-sku-label {
  font-weight: 600;
  color: var(--color-text-muted);
}

/* PIM overlay: use grid on the body itself so layout does not depend on flex item
   sizing (a nested grid inside a row flex child was not getting full width in production). */
.shipment-overlay-body.product-overlay-pim-body {
  display: block;
  padding: 1.25rem;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.product-overlay-pim-main {
  min-width: 0;
}

/* Identifiers (left) + storefront photo (right). Grid keeps the photo card from stretching
   full-width when stacked (flex-wrap was leaving a full-line grey bar beside a narrow image).
   Photo column max is 16.5vw (50% of prior 33vw cap). */
.pim-ident-photo-layout--with-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(16.5vw, 100%));
  grid-template-areas: "identifiers photo";
  gap: 1rem 1.25rem;
  align-items: start;
  margin-bottom: 0.35rem;
}

.pim-ident-photo-layout--with-photo > .pim-card--identifiers {
  grid-area: identifiers;
  min-width: 0;
}

.pim-ident-photo-layout--with-photo > .pim-card--rothys-photo {
  grid-area: photo;
  /* Shrink-wrap the bordered card to the image; column caps at min(16.5vw, 100%) — half of former 33vw. */
  width: fit-content;
  max-width: 100%;
  justify-self: end;
  box-sizing: border-box;
}

.pim-ident-photo-layout--with-photo .pim-field-grid--identifiers {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}

@media (max-width: 720px) {
  .pim-ident-photo-layout--with-photo {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "identifiers"
      "photo";
  }

  .pim-ident-photo-layout--with-photo > .pim-card--rothys-photo {
    justify-self: start;
    width: fit-content;
    max-width: min(16.5vw, 100%);
  }
}

.pim-rothys-photo {
  margin: 0;
  max-width: 100%;
}

.pim-rothys-photo-link {
  display: block;
  max-width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

.pim-rothys-photo-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.pim-rothys-photo-caption {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
}

.pim-rothys-photo-caption-link {
  color: var(--color-link, var(--color-accent));
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* Nested blocks inside a pim-card (variants / inventory moved from sidebar) */
.pim-card > section.pim-aside-block:first-of-type {
  border-top: none;
  padding-top: 0;
}

.pim-aside-block {
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-border-light);
}

.pim-aside-block:first-of-type {
  border-top: none;
  padding-top: 0;
}

.pim-aside-block-title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

.pim-aside-hint {
  margin-top: 0;
}

.pim-aside-empty {
  margin: 0;
  font-size: 0.875rem;
}

.pim-alias-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.pim-alias-chip-list li {
  margin: 0;
}

.pim-alias-chip {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

.pim-mini-table-wrap {
  overflow-x: auto;
  max-height: min(40vh, 320px);
  overflow-y: auto;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.pim-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.pim-mini-table th,
.pim-mini-table td {
  padding: 0.35rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

.pim-mini-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-bg-subtle);
  position: sticky;
  top: 0;
  z-index: 1;
}

.pim-mini-table tr:last-child td {
  border-bottom: none;
}

.pim-table-mono {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Monaco, monospace;
  font-size: 0.78rem;
}

.pim-inv-dl {
  margin: 0;
}

.pim-inv-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border-light);
}

.pim-inv-row:last-child {
  border-bottom: none;
}

.pim-inv-row dt {
  margin: 0;
  font-weight: 500;
  color: var(--color-text-muted);
}

.pim-inv-row dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.pim-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 1rem 1.125rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.pim-card:last-child {
  margin-bottom: 0;
}

.pim-card-title {
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
}

.pim-field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem 1rem;
}

.pim-field-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* PIM product overlay: Long SKU, Short SKU, Centric id, Shopify id on one row when space allows */
.pim-field-grid--identifiers {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pim-field {
  min-width: 0;
}

.pim-field--full {
  grid-column: 1 / -1;
}

.pim-field-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.pim-field-control {
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  min-height: 2.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text);
}

.pim-field-control--mono {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Monaco, monospace;
  font-size: 0.8125rem;
}

.pim-field-control--textarea {
  min-height: 5.5rem;
  align-items: flex-start;
}

.pim-field-control--external-row {
  justify-content: space-between;
}

.pim-external-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}

.pim-external-row--compact {
  gap: 0.15rem 0.3rem;
}

.pim-mini-table .pim-table-centric-cell {
  vertical-align: middle;
  font-size: 0.8125rem;
}

.pim-external-row-id {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.pim-external-icon-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0.1rem;
  margin-left: 0.35rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

.pim-external-icon-link:hover {
  color: var(--color-link, #2563eb);
  background: var(--color-bg-hover, rgba(0, 0, 0, 0.06));
}

.detail-value--external {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pim-field-value {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.pim-field-stack .pim-field--stacked .pim-field-control {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .pim-field-grid--identifiers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .pim-field-grid--2 {
    grid-template-columns: 1fr;
  }

  .pim-field-grid--identifiers {
    grid-template-columns: 1fr;
  }
}

.product-overlay .product-overlay-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.product-overlay .product-overlay-name.product-overlay-pim-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.35;
}

/* PIM overlay header uses product-overlay-pim-title--name + product-overlay-pim-sku-subtitle instead */

.catalog-field-source {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
  vertical-align: middle;
}

.product-overlay-body .shipment-overlay-details {
  flex: 1;
}

.po-raw-payload {
  font-size: 0.75rem;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Monaco, monospace;
  background: var(--color-bg-subtle);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.po-items-table-wrap {
  overflow-x: auto;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 0.5rem;
}

.po-items-table {
  font-size: 0.8125rem;
  width: 100%;
  border-collapse: collapse;
}

.po-items-table th,
.po-items-table td {
  padding: 0.35rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.po-items-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.po-items-table td {
  vertical-align: top;
}

/* Reports */
.reports-page .reports-page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.reports-page .reports-section-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.reports-page .reports-section-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  max-width: 42rem;
  line-height: 1.45;
}

.reports-page .reports-th-count,
.reports-page .reports-td-count {
  text-align: right;
  white-space: nowrap;
  width: 9rem;
}

.reports-page .reports-total {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Favorites (star) — SVG via .star-btn__icon so size & fill are reliable (Unicode stars ignore color in many UAs) */
.star-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  padding: 0.125rem;
  border-radius: var(--radius-sm);
  color: #94a3b8;
}

.star-btn__icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.star-btn:hover {
  color: #64748b;
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(241, 245, 249, 0.9);
}

.star-btn--on {
  color: #eab308;
  border-color: rgba(234, 179, 8, 0.55);
  background: rgba(254, 249, 195, 0.95);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.45);
}

.star-btn--on:hover {
  color: #ca8a04;
  background: rgba(254, 240, 138, 0.95);
}

.shipment-table th.col-star,
.shipment-table td.col-star {
  width: 2.25rem;
  min-width: 2.25rem;
  text-align: center;
  vertical-align: middle;
}

/* =============================================================
   McMaster-style density pass
   Goal: tighter lines, thin hairline borders, flatter surfaces.
   Colors are intentionally preserved from the variables above.
   ============================================================= */

/* Slightly tighter global rhythm */
body {
  line-height: 1.4;
}

/* App-level chrome: thinner, tighter, squared-off */
.app-header-bar {
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--color-border);
}

.app-nav-tabs {
  padding: 0.15rem 1.5rem 0;
  gap: 0.1rem;
  border-bottom: 1px solid var(--color-border);
}

.app-nav-tab {
  padding: 0.375rem 0.8rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Cards / panels: hairline border, flat surface */
.shipments-card,
.tracker-section,
.shipment-card,
.dashboard-header,
.login-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.shipments-card {
  /* Override hard-coded 12px radius so it matches tighter system */
  border-radius: var(--radius-md);
}

.shipments-card-header {
  padding: 0.625rem 0.875rem;
}

.shipments-card-header h1 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.shipments-card-header-count {
  font-size: 0.8125rem;
}

.shipments-card-header .btn-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.shipments-card .shipments-section {
  padding: 0.5rem 0.875rem;
}

/* Tracker / dashboard padding */
.tracker-section,
.dashboard-header,
.shipment-card {
  padding: 1rem 1.25rem;
}

/* Page header: tighter vertical rhythm */
.page-header {
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.page-header h1 {
  font-size: 1.125rem;
  font-weight: 600;
}

/* Buttons: flat, sharper, no bounce */
.btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.btn-primary,
.login-button,
.tracker-button {
  box-shadow: none;
}

.btn-primary:hover,
.login-button:hover,
.tracker-button:hover {
  transform: none;
  box-shadow: none;
}

.btn-outline {
  border: 1px solid var(--color-border);
}

.btn-sm {
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
}

.login-button {
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
}

.tracker-button {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* Form controls: tighter, thinner borders, sharper corners */
.form-input,
.form-select,
.filter-select,
.filter-search,
.tracker-input,
.login-password-form .form-input {
  padding: 0.375rem 0.55rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.filter-form {
  gap: 0.35rem;
}

/* Tables: hairline dividers, tight rows (McMaster-like density) */
.table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.shipment-table {
  font-size: 0.8125rem;
}

.shipment-table th,
.shipment-table td {
  padding: 0.3rem 0.65rem;
  border-bottom: 1px solid var(--color-border-light);
}

.shipment-table th {
  border-bottom: 1px solid var(--color-border);
}

/* Main shipments table (dashboard) — tighten from 0.75rem down */
.shipments-card .table-wrap {
  border: none;
}

.shipments-card .shipment-table {
  font-size: 0.8125rem;
}

.shipments-card .shipment-table th,
.shipments-card .shipment-table td {
  padding: 0.3rem 0.55rem;
  border-bottom: 1px solid var(--color-border-light);
}

.shipments-card .shipment-table th {
  background: var(--color-border-light);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
}

/* Catalog subnav: squared + tighter */
.catalog-subnav {
  padding: 0.2rem 0.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
}

.catalog-subnav-link {
  padding: 0.3rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

/* Roles popover / menu surfaces: hairline, minimal shadow */
.roles-popover-content {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* Section title spacing */
.section-title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.section-toolbar {
  margin-bottom: 0.6rem;
}

/* Detail pages: tighten outer padding */
.container {
  padding: 0.5rem 1rem 1rem;
}

/* DHL Unified Push status row (inbound shipment overlay / detail) */
.dhl-push-inline-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--color-accent-muted);
  border: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.dhl-push-inline-banner__title {
  font-weight: 600;
}

.dhl-push-inline-banner__err {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

