/* Warehouse overview: a quiet surface, a clear stock picture, and one primary action. */
@media (min-width: 1100px) {
  #content .warehouse-layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }
}

#content .warehouse-group-card {
  gap: 22px;
  padding: 24px;
  border-color: #dfe4e7;
  background: #f7f9fac9;
  box-shadow: none;
}

#content .warehouse-group-card:is([data-active="true"], .is-active) {
  border-color: #d8e1e8;
  background: linear-gradient(125deg, #f3f1f880, #f0f7f980);
}

#content .warehouse-group-locations {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  align-items: stretch;
  gap: 18px;
  padding-top: 22px;
  border-color: #dfe5e8;
}

#content .warehouse-overview-card {
  --warehouse-text: #263139;
  --warehouse-muted: #616c75;
  --warehouse-line: #e5e9ed;
  --warehouse-healthy: #b8b0df;
  --warehouse-low: #9ac6d8;
  --warehouse-ended: #d2a4b3;
  --warehouse-track: #eceff3;
  --warehouse-control: #f5f7f9;
  --warehouse-control-line: #dce3e9;
  --warehouse-action: linear-gradient(115deg, #eae5f7, #dceef5);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 24px;
  border: 1px solid #e1e6eb;
  border-radius: 26px;
  background: linear-gradient(150deg, #ffffff, #fcfdff);
  color: var(--warehouse-text);
  box-shadow: 0 5px 18px #27374c05, inset 0 1px 0 #ffffff;
  container-type: inline-size;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#content .warehouse-overview-card:is([data-active="true"], .is-active) {
  border-color: #b9c5dc;
  background: radial-gradient(ellipse at 100% 0, #e6f1f880, transparent 64%),
    linear-gradient(135deg, #f3f0fc, #fbfcff 65%);
  color: var(--warehouse-text);
  box-shadow: 0 8px 24px #5369870a, inset 0 1px 0 #ffffff;
}

#content .warehouse-overview-card .warehouse-card-head {
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
  gap: 12px;
}

#content .warehouse-overview-card .warehouse-card-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

#content .warehouse-overview-card .warehouse-card-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 1px solid #e7e7f0;
  border-radius: 16px;
  background: linear-gradient(135deg, #f1eef8, #eaf3f7);
  color: #637089;
}

#content .warehouse-overview-card .warehouse-card-symbol svg {
  width: 23px;
  height: 23px;
}

#content .warehouse-overview-card .warehouse-card-summary {
  gap: 6px;
}

#content .warehouse-overview-card .warehouse-point-badge {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--warehouse-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#content .warehouse-overview-card:is([data-active="true"], .is-active) .warehouse-point-badge {
  color: #66588c;
}

#content .warehouse-overview-card:is([data-active="true"], .is-active) .warehouse-point-badge::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9d8acc;
  box-shadow: 0 0 0 3px #a995d416;
}

#content .warehouse-overview-card .warehouse-card-name,
#content .warehouse-overview-card .warehouse-simple-copy > strong {
  margin: 0;
  color: var(--warehouse-text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.6px;
  overflow-wrap: anywhere;
}

#content .warehouse-overview-card .warehouse-edit-toggle {
  border-color: var(--warehouse-control-line);
  background: var(--warehouse-control);
  color: var(--warehouse-muted);
  box-shadow: none;
}

#content .warehouse-overview-card .warehouse-overview-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 24px 0;
  margin: 30px 0 0;
}

#content .warehouse-overview-stats > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: start;
  box-shadow: none;
}

#content .warehouse-overview-card .warehouse-overview-stats span {
  margin: 0;
  color: var(--warehouse-muted);
  font-size: 14px;
  line-height: 1.4;
}

#content .warehouse-overview-card .warehouse-stock-total {
  grid-column: 1 / span 3;
  align-self: center;
  gap: 8px;
  padding-inline-end: 12px;
}

#content .warehouse-overview-card .warehouse-stock-total strong {
  max-width: 100%;
  color: var(--warehouse-text);
  font-size: clamp(38px, 14cqi, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -2.5px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#content .warehouse-overview-card .warehouse-stock-chart {
  display: block;
  grid-column: 4 / span 3;
  align-self: center;
  justify-self: end;
  width: min(100%, 170px);
  height: auto;
  overflow: visible;
}

#content .warehouse-overview-card .warehouse-chart-track,
#content .warehouse-overview-card .warehouse-chart-segment {
  fill: none;
  stroke-width: 18;
}

#content .warehouse-overview-card .warehouse-chart-track {
  stroke: var(--warehouse-track);
}

#content .warehouse-overview-card .warehouse-chart-segment[data-stock="healthy"] {
  stroke: var(--warehouse-healthy);
}

#content .warehouse-overview-card .warehouse-chart-segment[data-stock="low"] {
  stroke: var(--warehouse-low);
}

#content .warehouse-overview-card .warehouse-chart-segment[data-stock="ended"] {
  stroke: var(--warehouse-ended);
}

#content .warehouse-overview-card .warehouse-stock-category {
  grid-column: span 2;
  align-self: stretch;
  justify-content: flex-start;
  padding: 0 12px;
  border-inline-start: 1px solid var(--warehouse-line);
}

#content .warehouse-overview-card .warehouse-stock-category[data-category="healthy"] {
  padding-inline-start: 0;
  border-inline-start: 0;
}

#content .warehouse-overview-card .warehouse-stock-category:last-child {
  padding-inline-end: 0;
}

#content .warehouse-overview-card .warehouse-stock-category strong {
  max-width: 100%;
  color: var(--warehouse-text);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#content .warehouse-overview-card .warehouse-stock-category span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

#content .warehouse-overview-card .warehouse-stock-category span::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warehouse-healthy);
}

#content .warehouse-overview-card .warehouse-stock-category[data-category="low"] span::before {
  background: var(--warehouse-low);
}

#content .warehouse-overview-card .warehouse-stock-category[data-category="ended"] span::before {
  background: var(--warehouse-ended);
}

#content .warehouse-overview-card .warehouse-stock-category[data-zero="true"] strong {
  color: var(--warehouse-muted);
}

#content .warehouse-overview-card .warehouse-stock-caption,
#content .warehouse-overview-card .warehouse-simple-copy > p {
  margin: 20px 0 0;
  color: var(--warehouse-muted);
  font-size: 14px;
  line-height: 1.5;
}

#content .warehouse-overview-card .warehouse-stock-caption[data-empty="true"] {
  color: var(--warehouse-muted);
}

#content .warehouse-overview-card .warehouse-point-expiry-warning {
  margin: 12px 0 0 !important;
  color: #85635a !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

#content .warehouse-overview-card .warehouse-point-expiry-warning > span {
  width: 20px;
  height: 20px;
  border-color: #d8c2bc;
  background: #f4e9e4;
  color: #85635a;
  font-size: 12px;
}

#content .warehouse-overview-card .warehouse-point-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

#content .warehouse-overview-card .warehouse-point-actions .button {
  justify-content: space-between;
  gap: 9px;
  min-height: 48px;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--warehouse-action);
  color: #35465c;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: start;
  white-space: normal;
  box-shadow: none;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

#content .warehouse-overview-card .warehouse-point-actions .button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#content .warehouse-overview-card .warehouse-point-actions .button svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

#content .warehouse-overview-card .warehouse-point-actions .warehouse-transfer-action {
  border-color: var(--warehouse-control-line);
  background: transparent;
  color: var(--warehouse-text);
  font-weight: 500;
}

#content .warehouse-overview-card .warehouse-point-actions .button:disabled {
  opacity: .5;
}

#content .warehouse-overview-card .warehouse-rename-form {
  border-color: var(--warehouse-line);
}

#content .warehouse-overview-card .warehouse-rename-form label,
#content .warehouse-overview-card .warehouse-rename-actions .button {
  font-size: 14px;
}

#content .warehouse-overview-card .warehouse-rename-form input {
  border-color: var(--warehouse-control-line);
  background: var(--warehouse-control);
  color: var(--warehouse-text);
}

#content .warehouse-overview-card .warehouse-rename-actions .button {
  border-color: var(--warehouse-control-line);
  background: var(--warehouse-action);
  color: #35465c;
}

#content .warehouse-overview-card .warehouse-rename-actions .warehouse-rename-cancel {
  border-color: transparent;
  background: transparent;
  color: var(--warehouse-muted);
}

#content .warehouse-overview-card[data-editing="true"] {
  border-color: #a3b6d0;
  box-shadow: 0 0 0 3px #b8c8e019;
}

#content .warehouse-overview-card[data-editing="true"] .warehouse-edit-toggle {
  border-color: #a8b6ce;
  background: var(--warehouse-action);
  color: #35465c;
}

#content .warehouse-overview-card .warehouse-simple-copy {
  gap: 8px;
}

#content .warehouse-overview-card .warehouse-simple-copy > p {
  margin: 0;
}

html[data-theme="dark"] #content .warehouse-group-card {
  border-color: #ffffff0a;
  background: #181d21a6;
}

html[data-theme="dark"] #content .warehouse-group-card:is([data-active="true"], .is-active) {
  border-color: #a5b7ca1a;
  background: linear-gradient(125deg, #21222b80, #17242a80);
}

html[data-theme="dark"] #content .warehouse-group-locations {
  border-color: #ffffff0d;
}

html[data-theme="dark"] #content .warehouse-overview-card {
  --warehouse-text: #eff1f5;
  --warehouse-muted: #b0b9c4;
  --warehouse-line: #ffffff10;
  --warehouse-healthy: #bcb4e9;
  --warehouse-low: #9dccdf;
  --warehouse-ended: #d4a6b6;
  --warehouse-track: #353b46;
  --warehouse-control: #ffffff06;
  --warehouse-control-line: #ffffff1a;
  --warehouse-action: linear-gradient(115deg, #d7d0ef, #badce8);
  border-color: #ffffff0c;
  background: linear-gradient(145deg, #252a33, #222930);
  color: var(--warehouse-text);
  box-shadow: 0 6px 20px #0000000d, inset 0 1px 0 #ffffff04;
}

html[data-theme="dark"] #content .warehouse-overview-card:is([data-active="true"], .is-active) {
  border-color: #a6b6d65e;
  background: radial-gradient(ellipse at 100% 0, #3854653d, transparent 68%),
    linear-gradient(135deg, #302d40, #26343e);
  box-shadow: 0 8px 24px #00000010, inset 0 1px 0 #ffffff0a;
}

html[data-theme="dark"] #content .warehouse-overview-card .warehouse-card-symbol {
  border-color: #d1c4f51a;
  background: linear-gradient(135deg, #c6b5f114, #b5e1f114);
  color: #d0d3e5;
}

html[data-theme="dark"] #content .warehouse-overview-card:is([data-active="true"], .is-active) .warehouse-point-badge {
  color: #d0c5ef;
}

html[data-theme="dark"] #content .warehouse-overview-card .warehouse-point-expiry-warning {
  color: #e2b9ad !important;
}

html[data-theme="dark"] #content .warehouse-overview-card .warehouse-point-expiry-warning > span {
  border-color: #d8aa984d;
  background: #d8aa9814;
  color: #e2b9ad;
}

html[data-theme="dark"] #content .warehouse-overview-card[data-editing="true"] {
  border-color: #b8c1df;
  box-shadow: 0 0 0 3px #b8c8e019;
}

@media (hover: hover) {
  #content .warehouse-overview-card .warehouse-edit-toggle:hover {
    border-color: #aab9ce;
    background: var(--warehouse-action);
    color: #35465c;
  }

  #content .warehouse-overview-card .warehouse-point-actions .button:not(:disabled):hover {
    border-color: #a8bdd4;
    box-shadow: 0 3px 12px #6a86a014;
  }

  #content .warehouse-overview-card .warehouse-transfer-action:not(:disabled):hover {
    background: var(--warehouse-control);
  }
}

@container (max-width: 350px) {
  #content .warehouse-overview-card .warehouse-point-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  #content .warehouse-overview-card .warehouse-stock-category {
    padding-inline: 9px;
  }

  #content .warehouse-overview-card .warehouse-card-identity {
    gap: 10px;
  }

  #content .warehouse-overview-card .warehouse-card-symbol {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }
}

@media (max-width: 600px) {
  #content .warehouse-group-card {
    gap: 18px;
    padding: 16px;
    border-radius: 24px;
  }

  #content .warehouse-group-locations {
    gap: 14px;
    padding-top: 18px;
  }

  #content .warehouse-overview-card {
    padding: 20px;
    border-radius: 22px;
  }

  #content .warehouse-overview-card .warehouse-overview-stats {
    margin-top: 26px;
  }
}

@media (max-width: 360px) {
  #content .warehouse-group-card {
    padding: 12px;
  }

  #content .warehouse-overview-card {
    padding: 16px;
  }

  #content .warehouse-overview-card .warehouse-card-identity {
    align-items: flex-start;
  }

  #content .warehouse-overview-card .warehouse-card-symbol {
    display: none;
  }

  #content .warehouse-overview-card .warehouse-card-name {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #content .warehouse-overview-card,
  #content .warehouse-overview-card .warehouse-edit-toggle,
  #content .warehouse-overview-card .warehouse-point-actions .button {
    transition: none;
  }

  #content .warehouse-overview-card .warehouse-rename-form {
    animation: none;
  }
}

@media (forced-colors: active) {
  #content .warehouse-overview-card,
  #content .warehouse-overview-card:is([data-active="true"], .is-active) {
    border-color: CanvasText;
    background: Canvas;
    box-shadow: none;
  }

  #content .warehouse-overview-card:is([data-active="true"], .is-active) {
    outline: 2px solid Highlight;
    outline-offset: -3px;
  }

  #content .warehouse-overview-card .warehouse-stock-chart {
    forced-color-adjust: none;
  }
}
