/* Logisto shell overrides — layered AFTER the Manifest design package
   (console.css, views.css) so the copied assets stay pristine.

   The prototype shell chrome is desktop-first (console.css has no media
   queries). This adds a minimal mobile treatment so the top bar never forces
   horizontal page overflow: it scrolls within the viewport instead. */

html, body { max-width: 100%; }

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
}

.brand {
  align-items: center;
  grid-column: 1;
  min-width: 96px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 82px;
  max-height: 32px;
}

.topnav a {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  --topnav-icon-color: var(--ink-4);
}

.topnav {
  grid-column: 2;
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar { height: 0; }

.topnav a svg {
  color: var(--topnav-icon-color);
  flex: none;
  height: 14px;
  width: 14px;
}
.topnav a[data-nav-key="setup"] { --topnav-icon-color: #1f7a52; }
.topnav a[data-nav-key="upload"] { --topnav-icon-color: #2766c4; }
.topnav a[data-nav-key="autopilot"] { --topnav-icon-color: #1f49d6; }
.topnav a[data-nav-key="replenishment"] { --topnav-icon-color: #6b4fc0; }
.topnav a[data-nav-key="orders"] { --topnav-icon-color: #c2691a; }
.topnav a[data-nav-key="inventory"] { --topnav-icon-color: #2c8456; }
.topnav a[data-nav-key="reports"] { --topnav-icon-color: #847e6f; }

.top-spacer {
  display: none;
}

.icon-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent);
}

.top-logout-form {
  display: inline-grid;
  flex: 0 0 auto;
  margin: 0;
  place-items: center;
}

.top-logout-form .icon-btn {
  flex: 0 0 33px;
  min-width: 33px;
  overflow: visible;
}

.top-tools {
  flex: 0 0 auto;
  grid-column: 3;
  justify-self: end;
  min-width: max-content;
}

.data-connections-link {
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink-2);
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  gap: 6px;
  height: 33px;
  padding: 0 11px;
  text-decoration: none;
  white-space: nowrap;
}

.data-connections-link:hover,
.data-connections-link.active {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent);
}

.data-connections-link:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

.data-connections-link svg {
  height: 15px;
  width: 15px;
}

.kbd-head {
  border-bottom: 1px solid var(--hairline);
  display: grid;
  gap: 2px;
  padding: 17px 20px 12px;
}

.kbd-head h3 {
  border: 0;
  padding: 0;
}

.kbd-head span {
  color: var(--ink-3);
  font-size: var(--fs-xs);
}

.shortcut-list {
  grid-template-columns: 1fr;
}

.shortcut-list .kbd-line {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(110px, auto) 120px;
}

.kbd-line .then {
  color: var(--ink-4);
  font-size: 10px;
  padding: 2px 1px;
}

.shortcut-input {
  background: var(--surface-0);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  height: 28px;
  padding: 0 8px;
  width: 100%;
}

.shortcut-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

.kbd-actions {
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px 16px;
}

.policy-impact-box {
  width: min(760px, 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface-1);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.policy-impact-box.high { border-color: var(--danger-line); background: var(--danger-bg); }
.policy-impact-box.medium { border-color: var(--caution-line); background: var(--caution-bg); }

.policy-impact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-1);
}

.policy-impact-head span,
.policy-impact-detail,
.policy-impact-row {
  color: var(--ink-3);
  font-size: var(--fs-xs);
}

.policy-impact-detail { margin-top: 4px; }

.policy-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.policy-impact-card {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.7);
  padding: 8px 9px;
}

.pic-label {
  color: var(--ink-4);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pic-main {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-family: var(--font-mono);
}

.pic-delta {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  margin-top: 2px;
}

.policy-impact-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 12px;
  margin-top: 10px;
}

.policy-impact-skus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

@media (max-width: 760px) {
  #app { max-width: 100vw; }
  body { overflow-x: hidden; }

  /* Let the top bar scroll its own content horizontally rather than widening
     the page. All nav items + tools stay reachable by swipe. */
  .topbar {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .topbar::-webkit-scrollbar { height: 0; }

  .top-spacer { flex: 0 0 6px; }
}
