body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f5f5f5;
}

header {
  padding: 16px 24px;
  background: #111;
  color: white;
}

main {
  max-width: 1000px;
  margin: 30px auto;
  padding: 24px;
  background: white;
}

form {
  max-width: 420px;
}

label {
  display: block;
  margin-bottom: 18px;
}

input {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 6px;
}

button {
  padding: 10px 18px;
}

.flash {
  padding: 10px;
  margin-bottom: 15px;
}


/* AUTH UI 2F-B — authenticated header controls */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logout-form {
  margin: 0;
}

.logout-button {
  cursor: pointer;
}


/* INVENTORY UI 15E-1 — read-only active snapshot */

a {
  color: #174ea6;
}

.primary-link {
  display: inline-block;
  padding: 10px 16px;
  background: #174ea6;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

.summary-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.summary-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px;
}

.summary-card span,
.summary-card strong {
  display: block;
}

.summary-card span {
  color: #666;
  margin-bottom: 8px;
}

.summary-card strong {
  font-size: 1.35rem;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.muted {
  color: #666;
}

.inventory-filters {
  max-width: none;
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 24px 0;
  padding: 16px;
  background: #f7f7f7;
  border: 1px solid #ddd;
}

.inventory-filters label {
  margin: 0;
}

.inventory-filters input,
.inventory-filters select {
  box-sizing: border-box;
  width: 100%;
  padding: 9px;
  margin-top: 6px;
}

.filter-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 42px;
}

.inventory-result-count {
  margin: 16px 0;
}

.table-scroll {
  overflow-x: auto;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.inventory-table th,
.inventory-table td {
  border-bottom: 1px solid #ddd;
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
}

.inventory-table th {
  background: #f2f2f2;
}

.inventory-table td:nth-child(3) {
  white-space: normal;
  min-width: 240px;
}

.inventory-table .number {
  text-align: right;
}

.inventory-table .available {
  font-weight: bold;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 700px) {

  main {
    margin: 12px;
    padding: 16px;
  }

  .page-heading {
    display: block;
  }

}


/* INVENTORY UI 15E-2 — active snapshot row detail */

.inventory-row-link {
  text-decoration: none;
}

.inventory-row-link:hover {
  text-decoration: underline;
}

.detail-section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #ddd;
}

.detail-customer {
  color: #555;
  font-weight: bold;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.detail-title strong {
  display: block;
  margin-top: 4px;
  font-size: 1.6rem;
}

.detail-label {
  color: #666;
  font-size: 0.9rem;
}

.detail-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.detail-grid div {
  min-width: 0;
}

.detail-grid dt {
  color: #666;
  margin-bottom: 5px;
}

.detail-grid dd {
  margin: 0;
  font-weight: bold;
  overflow-wrap: anywhere;
}

.quantity-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.quantity-card {
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.quantity-card span,
.quantity-card strong {
  display: block;
}

.quantity-card span {
  color: #666;
  margin-bottom: 8px;
}

.quantity-card strong {
  font-size: 1.5rem;
}

.available-card {
  border-width: 2px;
}

.compliance-placeholder {
  background: #fafafa;
  padding: 18px;
}

@media (max-width: 700px) {

  .detail-title {
    display: block;
  }

}


/* INVENTORY UI 15E-2D1 — wider desktop inventory table */

.main-wide {
  max-width: 1400px;
}

.main-wide .inventory-table td:nth-child(3) {
  min-width: 220px;
}

.main-wide .inventory-table th:last-child,
.main-wide .inventory-table td:last-child {
  min-width: 135px;
}


/* COMPLIANCE UI 17B-1 — read-only operational workspace */

.app-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  margin-right: 18px;
}

.app-nav a {
  color: white;
  text-decoration: none;
}

.app-nav a:hover {
  text-decoration: underline;
}

.compliance-boundary-notice {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 20px 0 24px;
  padding: 14px 16px;
  border-left: 4px solid #555;
  background: #f7f7f7;
}

.compliance-boundary-notice span {
  color: #555;
}

.compliance-summary {
  margin-bottom: 30px;
}

.empty-state {
  margin-top: 28px;
  padding: 28px;
  border: 1px dashed #bbb;
  background: #fafafa;
  text-align: center;
}

.compliance-table {
  width: 100%;
  border-collapse: collapse;
}

.compliance-table th,
.compliance-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}

.compliance-table th {
  background: #f2f2f2;
}

.compliance-table .number {
  text-align: right;
}

.state-badge {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 4px 8px;
  border: 1px solid #bbb;
  border-radius: 999px;
  background: #f7f7f7;
  font-size: 0.8rem;
  font-weight: bold;
  line-height: 1.2;
}

.state-open,
.state-review,
.state-unmatched {
  background: #f5f5f5;
}

.state-hold,
.state-ambiguous {
  border-width: 2px;
}

.state-released,
.state-matched {
  background: #f0f0f0;
}

.state-conflict {
  border-width: 2px;
  border-style: dashed;
}

.compliance-restriction-card {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 7px;
}

.compliance-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.compliance-card-heading h3 {
  margin-top: 0;
  margin-bottom: 4px;
}

.binding-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 2px solid #ddd;
}

.binding-panel h4 {
  margin-top: 0;
}

.decision-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding: 14px;
  background: #fafafa;
  border-left: 4px solid #777;
}

.decision-box span,
.decision-box small {
  color: #666;
}

.compliance-warning {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #999;
  background: #fafafa;
  font-weight: bold;
}

.inventory-target-card {
  margin-top: 18px;
  padding: 18px;
  border: 2px solid #bbb;
  border-radius: 7px;
  background: white;
}

.inventory-target-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.inventory-target-heading h4 {
  margin: 5px 0;
  font-size: 1.3rem;
}

.inventory-fact-label {
  color: #555;
  font-size: 0.76rem;
  font-weight: bold;
  letter-spacing: 0.04em;
}

.active-target-label,
.historical-target-label {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: bold;
}

.historical-target-label {
  color: #666;
}

@media (max-width: 700px) {

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

  .app-nav {
    order: 3;
    width: 100%;
    margin: 8px 0 0;
    gap: 14px;
  }

  .compliance-card-heading,
  .inventory-target-heading {
    display: block;
  }

}


/* COMPLIANCE UI 17B-2 — governed mutation forms */

.page-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.compliance-form {
  max-width: 720px;
  margin-top: 26px;
}

.compliance-form-wide {
  max-width: 900px;
}

.compliance-form input,
.compliance-form select,
.compliance-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  font: inherit;
}

.compliance-form textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 20px;
}

.form-help {
  display: block;
  margin-top: 6px;
  color: #666;
  line-height: 1.35;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 700px) {

  .page-actions {
    margin-top: 14px;
    justify-content: flex-start;
  }

}


/* WAREHOUSE CONTROL UI 18G-A-2C */

.warehouse-control-page {
  display: grid;
  gap: 24px;
}

.warehouse-control-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  padding: 28px;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  background: #f8f9fa;
}

.warehouse-control-hero h1 {
  margin: 6px 0 8px;
  font-size: 2rem;
}

.warehouse-control-hero p {
  max-width: 720px;
  margin: 0;
  color: #5c6268;
}

.warehouse-control-eyebrow,
.warehouse-control-label {
  display: block;
  color: #6a7178;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.warehouse-control-mode {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #b7bdc3;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.08em;
}

.warehouse-control-search {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid #e0e3e6;
  border-radius: 8px;
}

.warehouse-control-search label {
  font-weight: bold;
}

.warehouse-control-search input {
  box-sizing: border-box;
  min-width: 260px;
  padding: 9px 10px;
  font: inherit;
}

.warehouse-control-search button {
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}

.warehouse-control-search a {
  padding: 9px 4px;
}

.warehouse-control-metrics {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.warehouse-control-metrics article {
  padding: 15px 17px;
  border: 1px solid #e0e3e6;
  border-radius: 8px;
}

.warehouse-control-metrics span,
.warehouse-control-metrics strong {
  display: block;
}

.warehouse-control-metrics span {
  margin-bottom: 5px;
  color: #6a7178;
  font-size: 0.85rem;
}

.warehouse-control-metrics strong {
  font-size: 1.25rem;
}

.warehouse-control-notice {
  padding: 18px 20px;
  border: 1px solid #d9b56d;
  border-radius: 8px;
  background: #fffaf0;
}

.warehouse-control-notice p:last-child {
  margin-bottom: 0;
}

.warehouse-control-movement {
  overflow: hidden;
  border: 1px solid #d9dde1;
  border-radius: 10px;
  background: #fff;
}

.warehouse-control-movement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding: 22px 24px;
  border-bottom: 1px solid #e2e5e8;
}

.warehouse-control-movement-header h2 {
  margin: 4px 0 0;
  font-size: 1.65rem;
}

.warehouse-control-entry {
  text-align: right;
}

.warehouse-control-entry strong {
  display: block;
  margin-top: 5px;
}

.warehouse-control-warehouse {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 22px 24px;
  border-bottom: 1px solid #e2e5e8;
  background: #f7f8fa;
}

.warehouse-control-warehouse-code {
  display: block;
  margin-top: 5px;
  font-size: 1.75rem;
}

.warehouse-control-warehouse-name {
  display: block;
  margin-top: 3px;
  color: #62686e;
}

.warehouse-control-warehouse-status {
  text-align: right;
}

.warehouse-control-warehouse-status strong {
  display: block;
  margin-top: 5px;
}

.warehouse-control-section {
  padding: 24px;
  border-bottom: 1px solid #e5e7e9;
}

.warehouse-control-section:last-child {
  border-bottom: 0;
}

.warehouse-control-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.warehouse-control-section-heading h3 {
  margin: 4px 0 0;
  font-size: 1.2rem;
}

.warehouse-control-regulatory-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.warehouse-control-regulatory-card {
  min-height: 115px;
  padding: 18px;
  border: 1px solid #dfe3e6;
  border-radius: 8px;
}

.warehouse-control-regulatory-card > span {
  display: block;
  color: #656c72;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.08em;
}

.warehouse-control-regulatory-card > strong {
  display: block;
  margin-top: 9px;
  font-size: 1.8rem;
}

.warehouse-control-regulatory-card p {
  margin: 8px 0 0;
  font-weight: bold;
  line-height: 1.35;
}

.warehouse-control-reconciliation {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.warehouse-control-reconciliation div {
  padding: 14px 15px;
  border-left: 3px solid #c8cdd2;
  background: #f7f8f9;
}

.warehouse-control-reconciliation span,
.warehouse-control-reconciliation strong {
  display: block;
}

.warehouse-control-reconciliation span {
  margin-bottom: 6px;
  color: #656c72;
  font-size: 0.8rem;
}

.warehouse-control-review {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warehouse-control-review span {
  padding: 8px 11px;
  border: 1px solid #d1a44f;
  border-radius: 999px;
  background: #fff9e9;
  font-size: 0.85rem;
  font-weight: bold;
}

.warehouse-control-event-count {
  color: #6a7178;
  font-size: 0.85rem;
}

.warehouse-control-table-wrap {
  overflow-x: auto;
}

.warehouse-control-timeline {
  width: 100%;
  border-collapse: collapse;
}

.warehouse-control-timeline th,
.warehouse-control-timeline td {
  padding: 11px 10px;
  border-bottom: 1px solid #e1e4e7;
  text-align: left;
  vertical-align: top;
}

.warehouse-control-timeline th {
  background: #f3f4f5;
  color: #555d64;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.warehouse-control-timeline td:first-child {
  white-space: nowrap;
}

.warehouse-control-timeline td:last-child {
  min-width: 230px;
}

.warehouse-control-empty {
  margin: 0;
  color: #6a7178;
}


@media (max-width: 900px) {

  .warehouse-control-regulatory-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-control-reconciliation {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


@media (max-width: 700px) {

  .warehouse-control-hero,
  .warehouse-control-movement-header,
  .warehouse-control-warehouse,
  .warehouse-control-section-heading {
    display: block;
  }

  .warehouse-control-mode {
    display: inline-block;
    margin-top: 18px;
  }

  .warehouse-control-search {
    display: grid;
    align-items: stretch;
  }

  .warehouse-control-search input {
    min-width: 0;
    width: 100%;
  }

  .warehouse-control-entry,
  .warehouse-control-warehouse-status {
    margin-top: 16px;
    text-align: left;
  }

  .warehouse-control-reconciliation {
    grid-template-columns: 1fr;
  }

  .warehouse-control-event-count {
    display: block;
    margin-top: 8px;
  }

}


/* WAREHOUSE CONTROL UI 18G-A-2D — PALETTE */


/* --------------------------------------------------
   ABD application header
   -------------------------------------------------- */

.app-header {
  background: #17324d;
  color: #ffffff;
}

.app-nav a {
  color: #ffffff;
}

.app-nav a:hover {
  color: #dce8ef;
}

.logout-button {
  border-color: #d5e0e7;
  background: #f7fafc;
  color: #17324d;
}


/* --------------------------------------------------
   Control Layer hero
   -------------------------------------------------- */

.warehouse-control-hero {
  border-color: #cdd9e1;
  border-left: 5px solid #2f5d75;
  background: #eef3f6;
}

.warehouse-control-hero h1 {
  color: #17324d;
}

.warehouse-control-eyebrow,
.warehouse-control-label {
  color: #587183;
}

.warehouse-control-mode {
  border-color: #2f5d75;
  background: #ffffff;
  color: #17324d;
}


/* --------------------------------------------------
   Search
   -------------------------------------------------- */

.warehouse-control-search {
  border-color: #d3dde4;
  background: #f8fafb;
}

.warehouse-control-search input {
  border: 1px solid #bfcbd3;
  background: #ffffff;
}

.warehouse-control-search button {
  border: 1px solid #17324d;
  background: #2f5d75;
  color: #ffffff;
}

.warehouse-control-search button:hover {
  background: #17324d;
}


/* --------------------------------------------------
   Top metrics
   -------------------------------------------------- */

.warehouse-control-metrics article {
  border-color: #d7e0e6;
  border-top: 3px solid #7c9aab;
  background: #ffffff;
}

.warehouse-control-metrics strong {
  color: #17324d;
}


/* --------------------------------------------------
   Movement header
   -------------------------------------------------- */

.warehouse-control-movement {
  border-color: #cad6de;
}

.warehouse-control-movement-header {
  border-bottom-color: #31536a;
  background: #17324d;
  color: #ffffff;
}

.warehouse-control-movement-header
.warehouse-control-label {
  color: #b9ccd8;
}

.warehouse-control-movement-header h2 {
  color: #ffffff;
}

.warehouse-control-entry strong {
  color: #ffffff;
}


/* --------------------------------------------------
   Warehouse identity
   -------------------------------------------------- */

.warehouse-control-warehouse {
  border-bottom-color: #d3dde4;
  background: #eaf0f4;
}

.warehouse-control-warehouse-code {
  color: #17324d;
}

.warehouse-control-warehouse-name {
  color: #496678;
}

.warehouse-control-warehouse-status strong {
  color: #2f5d75;
}


/* --------------------------------------------------
   Regulatory cards
   -------------------------------------------------- */

.warehouse-control-regulatory-card {
  border-color: #d2dde4;
  border-top: 4px solid #2f5d75;
  background: #ffffff;
}

.warehouse-control-regulatory-card > span {
  color: #587183;
}

.warehouse-control-regulatory-card > strong {
  color: #17324d;
}


/* --------------------------------------------------
   Extensiv reconciliation
   -------------------------------------------------- */

.warehouse-control-reconciliation div {
  border-left-color: #6f93a8;
  background: #eef3f6;
}

.warehouse-control-reconciliation strong {
  color: #17324d;
}


/* --------------------------------------------------
   Review warnings
   -------------------------------------------------- */

.warehouse-control-review span {
  border-color: #c8891e;
  background: #fff7e5;
  color: #6c4700;
}


/* --------------------------------------------------
   Timeline
   -------------------------------------------------- */

.warehouse-control-timeline th {
  border-bottom-color: #bfcdd6;
  background: #eaf0f4;
  color: #355264;
}

.warehouse-control-timeline td {
  border-bottom-color: #dfe6ea;
}

.warehouse-control-timeline tbody tr:hover {
  background: #f5f8fa;
}


/* --------------------------------------------------
   Section hierarchy
   -------------------------------------------------- */

.warehouse-control-section-heading h3 {
  color: #17324d;
}

.warehouse-control-section {
  border-bottom-color: #dce4e9;
}
