.ams-wh-root {
  --navy: #161C34;
  --crimson: #AE2129;
  --muted: #4b5163;
  --border: #d9dde6;
  --soft: #eef2f8;
  --sand: #f7f3ee;
  color: var(--navy);
  font-family: "Source Sans 3", Manrope, "IBM Plex Sans", Tahoma, system-ui, sans-serif;
  padding: 8px 4px 40px;
  width: 100%;
  box-sizing: border-box;
}
.ams-wh-root *,
.ams-wh-root *::before,
.ams-wh-root *::after { box-sizing: border-box; }
.ams-wh-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ams-wh-head h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.02em; }
.ams-wh-head p { margin: 4px 0 0; color: var(--muted); }
.ams-wh-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 10px 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
}
.ams-wh-sources { align-items: center; }
.ams-wh-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-right: 4px; }
.ams-wh-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 6px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: #fff; color: var(--navy);
  text-decoration: none; font-weight: 600; cursor: pointer; white-space: nowrap; font-size: 13px;
}
.ams-wh-btn.primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.ams-wh-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.ams-wh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* Warehouse overrides — command deck handled by ams-module-ui.css */
.ams-wh-root {
  font-family: var(--ams-mod-font, "Manrope", system-ui, sans-serif);
}
.ams-wh-hero {
  /* shared .ams-mod-hero supplies atmosphere */
  background:
    radial-gradient(1000px 280px at 85% -30%, rgba(174, 33, 41, 0.28), transparent 55%),
    linear-gradient(135deg, #161C34 0%, #2a334f 48%, #1a2138 100%) !important;
}
.ams-wh-panel-title {
  font-family: var(--ams-mod-font, Manrope, system-ui, sans-serif);
}
.ams-wh-btn.primary {
  box-shadow: 0 8px 18px rgba(174, 33, 41, 0.28);
}

.ams-wh-total p { margin: 0; opacity: 0.75; font-size: 12px; letter-spacing: 0.08em; font-weight: 700; }
.ams-wh-total strong { display: block; font-size: 2.2rem; margin: 4px 0; letter-spacing: -0.03em; }
.ams-wh-total span { opacity: 0.7; font-size: 13px; }
.ams-wh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ams-wh-cards-dense { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ams-wh-card {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 10px 12px;
}
.ams-wh-cards-dense .ams-wh-card { padding: 8px 10px; border-radius: 10px; }
.ams-wh-card p { margin: 0; font-size: 11px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.04em; }
.ams-wh-cards-dense .ams-wh-card p { font-size: 10px; letter-spacing: 0.03em; }
.ams-wh-card strong { display: block; margin-top: 4px; font-size: 1.15rem; }
.ams-wh-cards-dense .ams-wh-card strong { font-size: 1.02rem; margin-top: 2px; }
.ams-wh-tabs-scroll { overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; }
.ams-wh-tabs-scroll::-webkit-scrollbar { height: 6px; }
.ams-wh-tabs-scroll::-webkit-scrollbar-thumb { background: #c5cad6; border-radius: 4px; }
.ams-wh-sources-secondary { opacity: 0.92; padding: 6px 10px !important; margin-bottom: 16px; }
.ams-wh-sources-secondary .ams-wh-btn { min-height: 30px; font-size: 12px; padding: 4px 10px; }
.ams-wh-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  text-transform: capitalize; letter-spacing: 0.02em; border: 1px solid transparent;
}
.ams-wh-badge-ok { background: #e8f5ee; color: #1b5e3b; border-color: #b7e0c7; }
.ams-wh-badge-warn { background: #fff6e5; color: #7a5410; border-color: #f0d9a0; }
.ams-wh-badge-info { background: #eef2f8; color: #243056; border-color: #c9d2e4; }
.ams-wh-badge-bad { background: #fdecee; color: #8f1a22; border-color: #f0b4b8; }
.ams-wh-badge-muted { background: #f3f4f7; color: #4b5163; border-color: #d9dde6; }
.ams-wh-row-actions { white-space: nowrap; }
.ams-wh-row-actions .ams-wh-btn { margin: 2px 2px 2px 0; min-height: 30px; font-size: 12px; padding: 4px 8px; }
.ams-wh-mode { text-transform: capitalize; font-size: 1rem !important; }
.ams-wh-panel {
  margin: 0 0 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden;
}
.ams-wh-panel-title {
  margin: 0; padding: 10px 16px; background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.ams-wh-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; padding: 16px;
}
.ams-wh-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ams-wh-form input, .ams-wh-form select {
  min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; color: var(--navy); background: #fff;
}
.ams-wh-check { flex-direction: row !important; align-items: center; gap: 8px !important; grid-column: 1 / -1; }
.ams-wh-table-wrap { overflow: auto; }
.ams-wh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ams-wh-table th, .ams-wh-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ams-wh-table th { background: var(--soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.ams-wh-chip {
  display: inline-block; margin: 0 4px 2px 0; padding: 2px 8px; border-radius: 6px;
  background: var(--sand); border: 1px solid #e5ddd2; font-size: 11px; font-weight: 600;
}
.ams-wh-chip.muted { background: #eef2f8; border-color: var(--border); color: var(--muted); }
.ams-wh-hint { margin: 0; padding: 12px 16px; color: var(--muted); font-size: 13px; }
.ams-wh-banner {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px;
  background: #fff8e8; border: 1px solid #f0d9a0; color: #5c4a1e; font-size: 13px;
}
.ams-wh-error { color: var(--crimson); padding: 16px; }
.ams-wh-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 99999;
  background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(22,28,52,0.25); max-width: 360px;
}
.ams-wh-toast.err { background: var(--crimson); }
body.ams-wh-page #ams-wh-slot { flex: 1; min-width: 0; width: 100%; }
#ams-wh-slot.ams-wh-slot-fallback,
body.ams-wh-fixed-fallback #ams-wh-slot {
  position: fixed; inset: 64px 0 0 0; z-index: 40; overflow: auto;
  background: #f5f6fa; padding: 12px 16px 40px;
}
@media (max-width: 768px) {
  .ams-wh-total strong { font-size: 1.7rem; }
  .ams-wh-form { grid-template-columns: 1fr; }
}
