/* PartyPrints — storefront brand system.
   Navy (#1F3B73) + raspberry (#C41E5A) duotone on cool blue-gray, mirroring
   the Amazon store. Poppins for display/logo, Inter for body. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Cool neutrals — storefront white / blue-gray */
  --bg:           #F3F6FB;   /* cool page background */
  --surface:      #FFFFFF;   /* card / panel */
  --surface-alt:  #EEF2F9;   /* hover state, muted areas */
  --border:       #E2E8F2;
  --border-strong:#CDD6E5;

  /* Ink — cool near-black */
  --ink:          #141A26;
  --ink-soft:     #44506A;
  --ink-muted:    #6B7689;

  /* Brand — navy + raspberry duotone from the storefront */
  --navy:         #1F3B73;
  --navy-dark:    #16294F;
  --navy-soft:    #E5ECF7;
  --brand:        #C41E5A;   /* raspberry "Shop Now" pink */
  --brand-dark:   #A1164A;
  --brand-soft:   #FBE4EE;

  /* Functional */
  --success:      #15803D;
  --success-bg:   #ECFDF5;
  --warning:      #B45309;
  --warning-bg:   #FEF3C7;
  --danger:       #B91C1C;
  --danger-bg:    #FEF2F2;
  --info:         #1E40AF;
  --info-bg:      #EFF6FF;

  /* Legacy aliases (workflow page references some of these) */
  --color-primary:      var(--navy);
  --color-on-primary:   #FFFFFF;
  --color-secondary:    var(--ink-soft);
  --color-accent:       var(--brand);
  --color-accent-hover: var(--brand-dark);
  --color-background:   var(--bg);
  --color-surface:      var(--surface);
  --color-foreground:   var(--ink);
  --color-muted:        var(--surface-alt);
  --color-muted-fg:     var(--ink-muted);
  --color-border:       var(--border);
  --color-border-strong:var(--border-strong);
  --color-destructive:  var(--danger);
  --color-destructive-bg:var(--danger-bg);
  --color-success:      var(--success);
  --color-ring:         var(--navy);
  --brand-pink:         var(--brand);
  --brand-pink-soft:    var(--brand-soft);

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 80px;

  /* Radii — softer than before */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Subtle shadows — almost imperceptible */
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 2px 8px rgba(26, 26, 26, 0.05);
  --shadow-lg: 0 8px 24px rgba(26, 26, 26, 0.07);
  --shadow-xl: 0 20px 40px rgba(26, 26, 26, 0.10);

  --t-fast:   150ms ease;
  --t-base:   200ms ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-md);
}
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }

a { color: var(--ink); text-decoration: none; transition: color var(--t-base); }
a:hover { color: var(--brand); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--brand); color: #FFFFFF; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-2xl);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}
.brand-mark {
  width: 30px; height: 30px;
  flex: none;
  display: block;
}
.brand-word-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand-word-logo .lp-party  { color: var(--brand); }
.brand-word-logo .lp-prints { color: var(--navy); }
.brand:hover .brand-word-logo { opacity: 0.92; }

.site-nav { display: flex; align-items: center; gap: var(--space-lg); }
.site-nav a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--ink); }
.nav-login {
  border: 1px solid var(--navy);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.875rem;
  color: var(--navy);
  font-weight: 600;
}
.nav-login:hover { background: var(--navy); color: #FFFFFF !important; }

.who {
  font-size: 0.875rem;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}
.role-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-owner    { background: var(--navy); color: #FFFFFF; }
.role-supplier { background: var(--brand-soft); color: var(--brand-dark); }

.logout-form { margin: 0; }
.link-button {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.link-button:hover { background: var(--surface-alt); color: var(--ink); border-color: var(--border-strong); }
.link-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

.site-footer {
  padding: var(--space-2xl) var(--space-xl);
  color: var(--ink-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  margin-top: var(--space-3xl);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}
.footer-meta a {
  color: var(--ink-muted);
  font-weight: 500;
}
.footer-meta a:hover { color: var(--ink); }
.footer-sep { color: var(--border-strong); }
.footer-login-link::after {
  content: " \2192";
  margin-left: 2px;
}
.footer-login-link {
  color: var(--ink);
  font-weight: 600;
}

/* Buttons */
.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 13px 26px;
  border-radius: var(--radius-md);   /* rounded rect, like the store "Shop Now" */
  font-family: 'Poppins', inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  min-height: 44px;
  letter-spacing: -0.005em;
}
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.btn-primary { background: var(--brand); color: #FFFFFF; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(196, 30, 90, 0.25); }

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover { background: var(--navy); color: #FFFFFF; }

/* Hero — centered, product grid carries the visuals */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-3xl) 0 var(--space-2xl);
}
.hero-copy { max-width: 640px; }
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: var(--space-md);
}
.hero h1 .brand-word { color: var(--brand); }
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 var(--space-md);
  line-height: 1.6;
}
.cta-row {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 880px) {
  .hero { padding: var(--space-xl) 0; }
}

/* Feature cards — photo-led, minimal chrome */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
}
.feature-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}
.feature {
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.feature:hover { transform: translateY(-2px); }
.feature-photo {
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.feature-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}
.feature:hover .feature-photo img { transform: scale(1.03); }
.feature-body { padding: 0 var(--space-xs); }
.feature h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }

/* Product banner tiles — self-contained store banners */
.section-heading {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: var(--space-3xl) 0 var(--space-xl);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}
.product-banner {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.product-banner img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.product-banner:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}
.product-banner:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Auth — chooser screen */
.auth-chooser {
  max-width: 760px;
  margin: var(--space-3xl) auto var(--space-2xl);
  text-align: center;
}
.auth-chooser h1 { font-size: 2.25rem; margin-bottom: var(--space-sm); }
.auth-chooser .muted { font-size: 1.05rem; margin: 0 0 var(--space-2xl); }
.chooser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  text-align: left;
}
.chooser-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  color: var(--ink) !important;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  text-decoration: none;
  overflow: hidden;
}
.chooser-card:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--ink) !important;
}
.chooser-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.chooser-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--ink);
  transition: background var(--t-base);
}
.chooser-card-owner .chooser-icon {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.chooser-card h2 {
  font-size: 1.25rem;
  margin: 0 0 var(--space-xs);
  letter-spacing: -0.015em;
}
.chooser-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.chooser-arrow {
  position: absolute;
  bottom: var(--space-lg);
  right: var(--space-lg);
  font-size: 1.25rem;
  color: var(--ink-muted);
  transition: transform var(--t-base), color var(--t-base);
}
.chooser-card:hover .chooser-arrow {
  transform: translateX(4px);
  color: var(--brand);
}

/* Auth card — credentials form */
.auth-card {
  max-width: 420px;
  margin: var(--space-3xl) auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
}
.auth-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}
.auth-back {
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.auth-back:hover { color: var(--ink); }
.auth-card h1 { margin-top: 0; font-size: 1.75rem; }
.auth-card .muted { color: var(--ink-muted); }
.auth-form { display: flex; flex-direction: column; gap: var(--space-md); }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.input,
.auth-form input,
.filter-row select {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--t-base), box-shadow var(--t-base);
  min-height: 44px;
}
.input:focus,
.auth-form input:focus,
.filter-row select:focus {
  border-color: var(--navy);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 59, 115, 0.14);
}

.error-banner {
  background: var(--danger-bg);
  border: 1px solid #FCA5A5;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
}

/* Dashboard chrome */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.page-header h1 { margin: 0; font-size: 1.75rem; }
.page-header p { margin: var(--space-xs) 0 0; color: var(--ink-muted); }

.filter-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}
.filter-row label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.filter-row select { padding: 8px 14px; min-height: 40px; }

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin: var(--space-md) 0;
}
.source-meta code {
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--ink);
}

/* Forecast table */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

table.forecast {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.875rem;
}
table.forecast th,
table.forecast td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.forecast thead th {
  background: var(--surface-alt);
  position: sticky;
  top: 0;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-strong);
}
table.forecast tbody tr { transition: background var(--t-fast); }
table.forecast tbody tr:hover { background: var(--surface-alt); }
table.forecast tbody tr:last-child td { border-bottom: none; }
table.forecast td.num {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
table.forecast td.zero { color: var(--border-strong); }
/* Forecast scrolls inside its own box so the header row stays pinned (sticky top)
   on vertical scroll and the ASIN column stays pinned on horizontal scroll. */
.forecast-wrap { max-height: 70vh; overflow: auto; }

/* Frozen ASIN column — first column, stays pinned while the grid scrolls right. */
table.forecast td.asin {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  border-right: 1px solid var(--border);
}
table.forecast thead th:first-child {
  position: sticky;
  left: 0;
  background: var(--surface-alt);
  z-index: 3;
  border-right: 1px solid var(--border-strong);
}
table.forecast tbody tr:hover td.asin { background: var(--surface-alt); }
table.forecast td.sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  color: var(--ink);
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  margin-top: var(--space-md);
}
.empty-state p { margin: var(--space-xs) 0; }
.empty-state strong { color: var(--ink); }
.empty-state code {
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Contact section — cream-on-cream, brand pink CTA */
.contact { margin: var(--space-3xl) 0 var(--space-xl); }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-lg);
  max-width: 640px;
  margin: 0 auto;
}
.contact-copy h2 { color: var(--ink); margin: 0 0 var(--space-sm); }
.contact-copy .muted { color: var(--ink-muted); }
.contact-list {
  margin: var(--space-md) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}
.contact-list > div { margin: 0; }
.contact-list dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: var(--space-xs);
}
.contact-list dd { margin: 0; color: var(--ink); font-size: 0.95rem; font-weight: 500; }
.contact-list dd a {
  color: var(--ink);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color var(--t-base), color var(--t-base);
}
.contact-list dd a:hover { border-color: var(--brand); color: var(--brand); }
.contact-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}
.contact-cta .btn-primary {
  background: var(--brand);
  color: #FFFFFF;
}
.contact-cta .btn-primary:hover { background: var(--brand-dark); }
.contact-cta .muted { color: var(--ink-muted); }

@media (max-width: 760px) {
  .contact-card { grid-template-columns: 1fr; padding: var(--space-xl); }
}

/* Workflow pages — same tokens, slightly denser */
.crumb {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: var(--space-md);
}
.crumb a { color: var(--ink-muted); }
.crumb a:hover { color: var(--ink); }

.banner {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
  border: 1px solid;
}
.banner-info    { background: var(--info-bg);    color: var(--info);    border-color: #BFDBFE; }
.banner-success { background: var(--success-bg); color: var(--success); border-color: #A7F3D0; }
.banner a       { color: inherit; text-decoration: underline; }

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-running  { background: var(--warning-bg); color: var(--warning); }
.status-success  { background: var(--success-bg); color: var(--success); }
.status-failed   { background: var(--danger-bg);  color: var(--danger); }
.status-aborted  { background: var(--surface-alt); color: var(--ink-muted); }

.token-badge {
  display: inline-block;
  margin-top: var(--space-sm);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.token-ok      { background: var(--success-bg); color: var(--success); border-color: #A7F3D0; }
.token-warn    { background: var(--warning-bg); color: var(--warning); border-color: #FCD34D; }
.token-expired { background: var(--danger-bg);  color: var(--danger);  border-color: #FCA5A5; }
.token-unknown { background: var(--surface-alt); color: var(--ink-muted); border-color: var(--border); }

.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-lg) 0 var(--space-2xl);
}
.vendor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.vendor-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
}
.vendor-card-head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
}
.vendor-id {
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.vendor-summary {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xs);
}
.vendor-summary > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: 0.875rem;
}
.vendor-summary dt {
  color: var(--ink-muted);
  margin: 0;
}
.vendor-summary dd {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 500;
  text-align: right;
}
.vendor-last-run {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}
.vendor-last-run.muted { color: var(--ink-muted); }
.vendor-card .btn { align-self: flex-start; margin-top: auto; }

.runs-table { font-size: 0.9375rem; }
.runs-table td.num { font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.runs-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border); }
.runs-table th { padding: var(--space-sm) var(--space-md); text-align: left; color: var(--ink-muted); font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-strong); }

.config-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin: 0 0 var(--space-md);
  background: var(--surface);
}
.config-form legend {
  font-weight: 700;
  color: var(--ink);
  padding: 0 var(--space-sm);
  font-size: 0.95rem;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}
.config-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.config-form input[type="number"],
.config-form input[type="text"],
.config-form select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.9375rem;
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
}
.config-form input:focus,
.config-form select:focus {
  border-color: var(--navy);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 59, 115, 0.14);
}
.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 500;
  color: var(--ink);
}
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.step-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-sm); }
.form-actions { margin-top: var(--space-md); }

.run-actions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
}
.run-actions h2 { margin-top: 0; }
.run-form { margin: var(--space-md) 0; }
.run-form .muted { margin: var(--space-xs) 0 0; }
.btn-apply {
  background: var(--danger);
  color: #FFFFFF;
  border: 1px solid var(--danger);
}
.btn-apply:hover:not([disabled]) { background: #991B1B; border-color: #991B1B; }
.btn[disabled], .btn-apply[disabled] { opacity: 0.45; cursor: not-allowed; }

.run-history { margin-top: var(--space-xl); }
.run-history h2 { font-size: 1.25rem; }
.run-list { list-style: none; padding: 0; margin: 0; font-size: 0.9375rem; }
.run-list li { padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); color: var(--ink-soft); }
.run-list li:last-child { border-bottom: none; }

/* Log viewer */
.log-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-md) 0 var(--space-sm);
  flex-wrap: wrap;
}
.log-view {
  background: var(--ink);
  color: #E8E8E8;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow-y: auto;
  margin: 0 0 var(--space-xl);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.60);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-md);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-2xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
}
.modal h2 { margin: 0 0 var(--space-sm); color: var(--ink); }
.modal p { margin: 0 0 var(--space-md); color: var(--ink-soft); }
.modal-input-label {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: var(--space-lg);
}
.modal-input-label input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 44px;
}
.modal-input-label input:focus {
  border-color: var(--danger);
  outline: none;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.18);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* Utilities */
.muted { color: var(--ink-muted); }
.small { font-size: 0.875rem; }
.icon-inline { width: 1em; height: 1em; vertical-align: -0.125em; }

code {
  background: var(--surface-alt);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}

/* ============================================================
   Order-plan feature — supplier stock upload + production plan.
   Navy/raspberry duotone; planning columns banded; Need to Make is the hero.
   ============================================================ */

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-2xl) 0;
}
.plan-section h2,
.forecast-section h2 { font-size: 1.25rem; }

/* --- Upload card --- */
.upload-card {
  margin: var(--space-md) 0 var(--space-lg);
}
.upload-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "art copy"
    "art actions";
  align-items: center;
  gap: var(--space-xs) var(--space-xl);
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
  transition: border-color var(--t-base), background var(--t-base), box-shadow var(--t-base);
}
/* Hero variant: first thing the supplier sees when no plan exists yet */
.upload-card-hero .upload-dropzone {
  padding: var(--space-2xl);
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--surface) 60%, var(--navy-soft) 320%);
  border-color: var(--border-strong);
}
.upload-dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px rgba(196, 30, 90, 0.10);
}
.upload-card.has-file .upload-dropzone {
  border-style: solid;
  border-color: var(--navy);
  background: var(--surface);
}

.upload-illustration {
  grid-area: art;
  width: 64px;
  height: 64px;
  flex: none;
}
.upload-copy { grid-area: copy; }
.upload-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--navy);
  margin: 0 0 var(--space-xs);
  letter-spacing: -0.01em;
}
.upload-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.upload-trigger {
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base);
}
.upload-trigger:hover { border-bottom-color: var(--brand); }
.upload-trigger input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.upload-trigger:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}
.upload-chosen {
  margin: var(--space-sm) 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.upload-chosen::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--success);
  flex: none;
}
.upload-help {
  margin: var(--space-sm) 0 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.5;
  max-width: 52ch;
}
.upload-help strong { color: var(--ink-soft); font-weight: 600; }

.upload-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-md);
}
.upload-meta {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* --- Friendly error banner --- */
.plan-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: var(--danger-bg);
  border: 1px solid #FCA5A5;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}
.plan-error-icon {
  width: 22px; height: 22px;
  color: var(--danger);
  flex: none;
  margin-top: 1px;
}
.plan-error-body { display: flex; flex-direction: column; gap: 2px; }
.plan-error-body strong { color: var(--danger); font-size: 0.95rem; }
.plan-error-body span { color: var(--ink-soft); font-size: 0.9375rem; }
.plan-error-hint { color: var(--ink-muted) !important; font-size: 0.8125rem !important; }

/* --- Results: summary bar + download --- */
.plan-results { margin: var(--space-md) 0 var(--space-lg); }
.plan-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
.plan-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}
.plan-stat {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.plan-stat strong { font-weight: 700; }
.plan-stat-ok   { background: var(--navy-soft);   color: var(--navy);    border-color: #C9D7EE; }
.plan-stat-warn { background: var(--warning-bg);  color: var(--warning); border-color: #FCD34D; }
.plan-stat-note { background: var(--surface-alt); color: var(--ink-muted); }
.plan-download { white-space: nowrap; }

.plan-legend {
  margin: 0 0 var(--space-md);
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.plan-legend-key {
  font-weight: 600;
  color: var(--navy);
}
.plan-legend-key-hero {
  color: var(--brand);
}

/* --- Plan table: banded planning columns --- */
/* Scroll the plan table inside its own box so the header row stays pinned on
   vertical scroll and the ASIN column stays frozen on horizontal scroll. */
.table-wrap.plan-wrap { max-height: 70vh; overflow: auto; }
/* Header sits above the sticky ASIN column as rows scroll up beneath it;
   the top-left ASIN header cell (corner) sits above both. */
table.forecast.plan thead th { z-index: 2; }
table.forecast.plan thead th:first-child { z-index: 3; }
/* The three actionable columns get a tinted band the whole way down */
table.forecast.plan thead th.col-plan { background: var(--brand-soft); color: var(--brand-dark); }
table.forecast.plan td.col-plan {
  background: rgba(251, 228, 238, 0.45);
  font-weight: 600;
  color: var(--ink);
}
/* Left edge of the band, so it reads as one group */
table.forecast.plan th.col-plan:first-of-type,
table.forecast.plan td.col-plan:first-of-type {
  border-left: 1px solid #F2C4D6;
}
/* Need to Make — the hero column */
table.forecast.plan th.col-hero {
  background: var(--brand);
  color: #FFFFFF;
  letter-spacing: 0.04em;
}
table.forecast.plan td.col-hero {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.95rem;
  border-left: 1px solid #F2C4D6;
}
table.forecast.plan td.col-hero.zero {
  color: var(--ink-muted);
  font-weight: 600;
}
/* Keep hover legible over the bands */
table.forecast.plan tbody tr:hover td.col-plan { background: rgba(251, 228, 238, 0.7); }
table.forecast.plan tbody tr:hover td.col-hero { background: #F8D4E2; }

.cell-name { white-space: normal; min-width: 0; }

/* Unmatched / no-forecast rows: muted, not hidden */
table.forecast.plan tr.row-unmatched td,
table.forecast.plan tr.row-noforecast td {
  color: var(--ink-muted);
  background: var(--surface-alt);
}
table.forecast.plan tr.row-unmatched td.col-plan,
table.forecast.plan tr.row-unmatched td.col-hero,
table.forecast.plan tr.row-noforecast td.col-plan,
table.forecast.plan tr.row-noforecast td.col-hero {
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-weight: 500;
}
table.forecast.plan tr.row-unmatched:hover td,
table.forecast.plan tr.row-noforecast:hover td { background: #E7ECF4; }

.plan-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.plan-badge-unmatched  { background: var(--surface);    color: var(--ink-muted); border: 1px solid var(--border-strong); }
.plan-badge-noforecast { background: var(--warning-bg);  color: var(--warning); }

/* ---- Demand table ("What we need from you") ---- */
.demand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: var(--space-md) 0 var(--space-sm);
}
.demand-lead { margin: 0; color: var(--ink); }
.demand-lead strong { color: var(--ink); }

/* Product / Size / Pack are the frozen identity columns (the supplier's own
   words), replacing the ASIN-led freeze. They stay pinned while the months /
   plan columns scroll horizontally. Fixed widths so the left offsets line up. */
/* As tight as stays readable = narrowest overall = least left/right scrolling.
   Smaller type + minimal padding; numeric columns shrink to their content. */
table.forecast.demand-table { font-size: 0.8125rem; }
table.forecast.demand-table th,
table.forecast.demand-table td { padding: 6px 7px; }

table.forecast.demand-table th.col-product,
table.forecast.demand-table td.col-product { width: 128px; min-width: 128px; }
table.forecast.demand-table th.col-size,
table.forecast.demand-table td.col-size { width: 56px; min-width: 56px; }
table.forecast.demand-table th.col-pack,
table.forecast.demand-table td.col-pack { width: 40px; min-width: 40px; }

table.forecast.demand-table td.col-product,
table.forecast.demand-table td.col-size,
table.forecast.demand-table td.col-pack {
  position: sticky;
  background: var(--surface);
  z-index: 1;
}
table.forecast.demand-table td.col-product { left: 0; font-weight: 600; color: var(--ink); }
table.forecast.demand-table td.col-size { left: 128px; }
table.forecast.demand-table td.col-pack { left: 184px; border-right: 1px solid var(--border); }

/* Header cells of the frozen columns are corners: sticky both top and left. */
table.forecast.demand-table thead th.col-product,
table.forecast.demand-table thead th.col-size,
table.forecast.demand-table thead th.col-pack {
  position: sticky;
  background: var(--surface-alt);
  z-index: 3;
}
table.forecast.demand-table thead th.col-product { left: 0; }
table.forecast.demand-table thead th.col-size { left: 128px; }
table.forecast.demand-table thead th.col-pack { left: 184px; border-right: 1px solid var(--border-strong); }

/* Keep the frozen cells opaque on row hover so scrolled content can't bleed through. */
table.forecast.demand-table tbody tr:hover td.col-product,
table.forecast.demand-table tbody tr:hover td.col-size,
table.forecast.demand-table tbody tr:hover td.col-pack { background: var(--surface-alt); }

/* Smaller, wrapping headers so a multi-word title ("Total 3 months") wraps to two
   lines instead of forcing the whole column wide. */
table.forecast.demand-table thead th {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  white-space: normal;
  line-height: 1.15;
  vertical-align: bottom;
}

/* Long product names clamp to 2 lines (…) so one giant name can't widen the
   frozen Product column; the full name is on hover (title). */
.cell-name-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  max-width: 118px;
}

/* "Need to make" — THE number. Bold + YELLOW so it pops out from the pink plan
   band and everything else in the row. */
table.forecast.demand-table thead th.col-need { background: #FACC15; color: #3F2D00; font-weight: 800; }
table.forecast.demand-table td.col-need {
  background: #FDE047;
  color: #3F2D00;
  font-weight: 800;
  font-size: 0.95rem;
}
table.forecast.demand-table td.col-need.zero { background: #FEF3C7; color: #92791F; }
table.forecast.demand-table tbody tr:hover td.col-need { background: #FACC15; }
table.forecast.demand-table tfoot td.col-need { background: #FDE047; color: #3F2D00; font-weight: 800; }

/* ── Dashboard view toggle (What we need / Reconciled) ──────────────── */
.view-tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 1.25rem;
  background: var(--navy-soft, #E5ECF7); border: 1px solid var(--border, #E3E8F0);
  border-radius: 12px;
}
.view-tab {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
  padding: 0.5rem 1.15rem; border-radius: 9px;
  font: inherit; font-size: 0.9rem; font-weight: 650; color: var(--ink-soft, #44506A);
  background: transparent; transition: background var(--t-base, .15s), color var(--t-base, .15s);
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.view-tab:hover { color: var(--ink, #141A26); }
.view-tab.is-active { background: #fff; color: var(--navy, #1F3B73); box-shadow: 0 1px 3px rgba(20, 26, 38, 0.14); }
.view-tab:focus-visible { outline: 2px solid var(--navy, #1F3B73); outline-offset: 2px; }
.view-tab-badge {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--brand, #C41E5A); color: #fff; padding: 1px 6px; border-radius: 999px;
}
.view-tab.is-active .view-tab-badge { background: var(--brand, #C41E5A); }
.view-panel[hidden] { display: none; }
@media (max-width: 560px) {
  .view-tabs { display: flex; }
  .view-tab { flex: 1; justify-content: center; }
}

/* ── PO reconcile ───────────────────────────────────────────────────── */
.reconcile-block { margin-top: 0.75rem; }
.reconcile-intro { margin: 0 0 1rem; max-width: 60ch; }
.reconcile-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.po-upload-form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.po-file input[type="file"] {
  font-size: 0.85rem; color: var(--ink-soft);
  max-width: 15rem;
}
.po-file input[type="file"]::file-selector-button {
  margin-right: 0.6rem; padding: 0.4rem 0.7rem; cursor: pointer;
  border: 1px solid var(--navy); border-radius: 8px;
  background: #fff; color: var(--navy); font-weight: 600; font-size: 0.82rem;
}
.po-file input[type="file"]::file-selector-button:hover { background: var(--navy-soft); }
.po-clear-form { margin: 0; }
.po-clear { color: var(--brand-dark); }
.po-clear:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.po-meta { margin: 0 0 0.75rem; }
.reconcile-empty { margin-top: 0.5rem; }
.plan-warnbar.plan-warnbar-error { border-left-color: var(--brand); background: var(--brand-soft); }

/* Headline tiles: Ordered / Ship now / Still to make */
.reconcile-tiles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem; margin: 0.25rem 0 1rem;
}
.rec-tile {
  border: 1px solid var(--border, #E3E8F0); border-radius: 12px;
  padding: 0.85rem 1rem; background: var(--surface, #fff);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.rec-tile-num { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.rec-tile-label { font-size: 0.78rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rec-tile-hero { background: #FDE047; border-color: #EAB308; }
.rec-tile-hero .rec-tile-num { color: #3F2D00; }
.rec-tile-hero .rec-tile-label { color: #6B5400; }

/* Reconcile table: mirror the demand table's yellow "Still to make" hero. */
table.forecast.reconcile-table thead th.col-need { background: #FACC15; color: #3F2D00; font-weight: 800; }
table.forecast.reconcile-table td.col-need { background: #FDE047; color: #3F2D00; font-weight: 800; }
table.forecast.reconcile-table td.col-need.zero { background: #FEF3C7; color: #92791F; font-weight: 600; }
table.forecast.reconcile-table tbody tr:hover td.col-need { background: #FACC15; }
table.forecast.reconcile-table tfoot td.col-need { background: #FDE047; color: #3F2D00; font-weight: 800; }
table.forecast.reconcile-table .asin-cell { font-size: 0.72rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* Stock left — the other hero, navy-tinted so it's clearly distinct from the
   yellow "Need to make". Overrides the brand col-hero background by cascade order. */
table.forecast.reconcile-table thead th.col-left { background: var(--navy); color: #fff; font-weight: 800; }
table.forecast.reconcile-table td.col-left { background: var(--navy-soft); color: var(--navy-dark); font-weight: 800; }
table.forecast.reconcile-table td.col-left.zero { background: #EEF2F9; color: var(--ink-muted); font-weight: 600; }
table.forecast.reconcile-table tbody tr:hover td.col-left { background: #D5E1F2; }
table.forecast.reconcile-table tfoot td.col-left { background: var(--navy-soft); color: var(--navy-dark); font-weight: 800; }

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

/* "Stock last updated by …" stamp above the sheet. */
.stock-updated {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--space-sm);
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.stock-updated .icon-inline { width: 15px; height: 15px; flex: none; }
.stock-updated strong { color: var(--ink); font-weight: 600; }
.stock-updated-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ───────────────────────── Contact page (public) ───────────────────────── */
.contact-page { max-width: 1040px; margin: 0 auto; }
.contact-intro { margin-bottom: var(--space-lg); }
.contact-intro h1 { margin: 0 0 var(--space-sm); }
/* Primary path — hand off to the visitor's own mail app. */
.mail-choice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl, 2rem);
}
.mail-choice h2 { margin: 0 0 var(--space-sm); font-size: 1.25rem; }
.mail-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0 var(--space-sm);
}
.form-heading { font-size: 1.05rem; margin: 0 0 var(--space-sm); color: var(--navy); }

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-xl, 2rem);
  align-items: start;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 400;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.contact-form .req { color: var(--brand); }
.contact-form .optional,
.contact-form .field-hint {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.contact-form button { align-self: flex-start; }
.contact-errors { margin: 0; padding-left: 1.1rem; }

.contact-aside h2 {
  font-size: 1rem;
  margin: 0 0 var(--space-sm);
  color: var(--navy);
}
.contact-aside h2 + p { margin-top: 0; }
.contact-aside > * + h2 { margin-top: var(--space-lg); }

/* Honeypot — must stay reachable to bots but invisible to people. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 760px) {
  .contact-layout { grid-template-columns: 1fr; gap: var(--space-lg); }
}

/* ───────────────────────── Products (admin catalog) ───────────────────────── */
.products-head { margin-bottom: var(--space-md); }
.products-head h1 { margin: 0 0 4px; }
.needs-count { color: var(--brand); }
.plan-okbar {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  color: #065F46;
}
.product-add {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.product-add h2 { margin: 0 0 var(--space-md); font-size: 1.125rem; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.product-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.product-grid input {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
}
.product-grid input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
tr.row-needs-asin td { background: var(--warning-bg); }
tr.row-needs-asin:hover td { background: #FDECC8; }
.upb-hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  margin-top: 2px;
}
/* ASIN shown small + mono under the product name (frozen column — adds no width). */
.asin-hint {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-muted);
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.upload-section { margin-top: var(--space-lg); }
.upload-section .upload-card { margin-top: var(--space-sm); }

.demand-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }

/* Amber "some rows didn't match" warning — distinct from the red read-error. */
.plan-warnbar {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: var(--warning-bg);
  border: 1px solid #F5C97A;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
}
.plan-warnbar .plan-error-icon { color: var(--warning); }
.plan-warnbar strong { color: var(--ink); }
.plan-warnbar a { color: var(--brand); font-weight: 600; }
.plan-warnbar .muted { display: block; margin-top: 4px; font-size: 0.85rem; }

/* Inline-editable stock cell */
.stock-cell { padding-top: 4px; padding-bottom: 4px; }
.stock-input {
  width: 5.5rem;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
.stock-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(196, 30, 90, 0.12);
}
/* Save button nudges the user once there are unsaved edits */
.btn.is-dirty {
  box-shadow: 0 0 0 3px rgba(196, 30, 90, 0.18);
  animation: save-pulse 1.4s ease-in-out infinite;
}
@keyframes save-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(196, 30, 90, 0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(196, 30, 90, 0.10); }
}

@media (max-width: 720px) {
  .upload-dropzone {
    grid-template-columns: 1fr;
    grid-template-areas: "art" "copy" "actions";
    justify-items: start;
    gap: var(--space-md);
    text-align: left;
  }
  .plan-bar { align-items: stretch; }
  .plan-download { width: 100%; }
}

/* Responsive */
@media (max-width: 640px) {
  .site-header { padding: var(--space-md); }
  .site-main { padding: var(--space-lg) var(--space-md); }
  .site-nav { gap: var(--space-md); }
  .site-nav a:not(.btn):not(.nav-login) { display: none; }
  .hero { padding-top: var(--space-md); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ───────────────────────── Sortable columns (demand table) ───────────────────────── */
.demand-table th.sortable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.demand-table th.sortable:hover { color: var(--brand, #C41E5A); }
.demand-table th.sortable.sorted { color: var(--brand, #C41E5A); }
.demand-table th.sortable .sort-arrow { font-size: 0.85em; }

/* Reconcile table reuses the same sortable-header affordances. */
.reconcile-table th.sortable { cursor: pointer; user-select: none; -webkit-user-select: none; }
.reconcile-table th.sortable:hover { color: var(--brand, #C41E5A); }
.reconcile-table th.sortable.sorted { color: var(--brand, #C41E5A); }
.reconcile-table th.sortable .sort-arrow { font-size: 0.85em; }
.reconcile-table thead th[data-tip] { cursor: help; }
.reconcile-table th.sortable[data-tip] { cursor: pointer; }
.reconcile-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 0.5rem; }
.reconcile-count { margin: 0; font-size: 0.82rem; }
/* Mark the rows actually on the PO so they stand out among the full sheet. */
table.forecast.reconcile-table tbody tr.has-order td.col-product { box-shadow: inset 3px 0 0 var(--brand); font-weight: 600; }

/* Floating column-header explanation (see _demand_table.html JS). */
.demand-table thead th[data-tip] { cursor: help; }
.demand-table th.sortable[data-tip] { cursor: pointer; }
.col-tip {
  position: fixed;
  z-index: 1200;
  max-width: 280px;
  padding: 8px 11px;
  background: var(--navy, #1F3B73);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 26, 38, 0.28);
  pointer-events: none;
}

/* ───────────────────────── Week-over-week delta (owner) ───────────────────────── */
.delta-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta-up   { color: var(--success, #15803D); font-weight: 600; }
.delta-down { color: var(--brand, #C41E5A); font-weight: 600; }
.delta-flat { color: var(--ink-muted, #6B7689); }

/* ───────────────────────── "Calculating…" upload overlay ───────────────────────── */
.calc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20, 26, 38, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: calc-fade 0.15s ease-out;
}
@keyframes calc-fade { from { opacity: 0; } to { opacity: 1; } }
.calc-box {
  background: var(--surface, #fff);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  text-align: center;
  max-width: 340px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.calc-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  border: 4px solid var(--navy-soft, #E5ECF7);
  border-top-color: var(--brand, #C41E5A);
  animation: calc-spin 0.8s linear infinite;
}
@keyframes calc-spin { to { transform: rotate(360deg); } }
.calc-msg {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.1rem;
  margin: 0 0 0.3rem;
}
.calc-sub {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ───────────────────────── SSO (Sign in with Google) ───────────────────────── */
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  background: #fff;
  color: #3c4043;
  border: 1px solid var(--border-strong, #C4CBD6);
  font-weight: 600;
}
.btn-google:hover { background: #f7f8fa; }
.auth-sso { margin-bottom: 0.25rem; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ───────────────────────── Guide / help page ───────────────────────── */
.guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.guide-header .lede { max-width: 60ch; }
.guide-print { white-space: nowrap; flex: 0 0 auto; }

.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 1rem;
  margin: 0 0 2rem;
  background: var(--navy-soft);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}
.guide-toc a { color: var(--navy); text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }

.guide-section { margin: 0 0 1.5rem; }
.guide-section > h2 { margin-bottom: 0.35rem; }
.guide-steps { max-width: 72ch; }
.guide-steps li { margin-bottom: 0.6rem; line-height: 1.55; }
.guide-tip { max-width: 72ch; margin-top: 1rem; }

.guide-table td, .guide-table th { vertical-align: top; }
.guide-table td:first-child { white-space: nowrap; }

.guide-faq dt {
  font-weight: 700;
  color: var(--navy);
  margin-top: 1rem;
}
.guide-faq dd {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  max-width: 72ch;
  line-height: 1.55;
}

@media print {
  .site-header, .site-footer, .guide-toc, .guide-print { display: none !important; }
  .site-main { padding: 0; }
  .guide-section, .guide-faq dd, .guide-steps { max-width: none; }
  a { color: inherit; text-decoration: none; }
  .section-divider { border-color: #ccc; }
}

/* ───────────────────────── Subtotal + grand-total rows ───────────────────────── */
table.forecast.demand-table .subtotal-row td {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--ink-soft);
  border-top: 1px solid var(--border);
}
table.forecast.demand-table .subtotal-row td.col-product { font-style: italic; }
table.forecast.demand-table tfoot .grand-total-row td {
  background: var(--navy-soft);
  font-weight: 700;
  color: var(--navy);
  border-top: 2px solid var(--navy);
}
table.forecast.demand-table tfoot .grand-total-row td.col-product { color: var(--navy); }

/* Reconcile table: same compact sizing + frozen Product/Size/Pack + wrapping
   headers as the demand table, so it fits and scrolls the same way. */
table.forecast.reconcile-table { font-size: 0.8125rem; }
table.forecast.reconcile-table th,
table.forecast.reconcile-table td { padding: 6px 7px; }

table.forecast.reconcile-table th.col-product,
table.forecast.reconcile-table td.col-product { width: 128px; min-width: 128px; }
table.forecast.reconcile-table th.col-size,
table.forecast.reconcile-table td.col-size { width: 56px; min-width: 56px; }
table.forecast.reconcile-table th.col-pack,
table.forecast.reconcile-table td.col-pack { width: 40px; min-width: 40px; }

table.forecast.reconcile-table td.col-product,
table.forecast.reconcile-table td.col-size,
table.forecast.reconcile-table td.col-pack {
  position: sticky; background: var(--surface); z-index: 1;
}
table.forecast.reconcile-table td.col-product { left: 0; font-weight: 600; color: var(--ink); }
table.forecast.reconcile-table td.col-size { left: 128px; }
table.forecast.reconcile-table td.col-pack { left: 184px; border-right: 1px solid var(--border); }

table.forecast.reconcile-table thead th.col-product,
table.forecast.reconcile-table thead th.col-size,
table.forecast.reconcile-table thead th.col-pack {
  position: sticky; background: var(--surface-alt); z-index: 3;
}
table.forecast.reconcile-table thead th.col-product { left: 0; }
table.forecast.reconcile-table thead th.col-size { left: 128px; }
table.forecast.reconcile-table thead th.col-pack { left: 184px; border-right: 1px solid var(--border-strong); }

table.forecast.reconcile-table tbody tr:hover td.col-product,
table.forecast.reconcile-table tbody tr:hover td.col-size,
table.forecast.reconcile-table tbody tr:hover td.col-pack { background: var(--surface-alt); }

table.forecast.reconcile-table thead th {
  font-size: 0.68rem; letter-spacing: 0.02em; white-space: normal;
  line-height: 1.15; vertical-align: bottom;
}

table.forecast.reconcile-table .subtotal-row td {
  background: var(--surface-alt); font-weight: 600; color: var(--ink-soft);
  border-top: 1px solid var(--border);
}
table.forecast.reconcile-table .subtotal-row td.col-product { font-style: italic; }
table.forecast.reconcile-table tfoot .grand-total-row td {
  background: var(--navy-soft); font-weight: 700; color: var(--navy);
  border-top: 2px solid var(--navy);
}

/* Mobile: no special table handling — it's the plain table with native
   horizontal scroll (base .table-wrap has overflow-x: auto). Users can pinch/zoom
   or use "Desktop mode" as before. */
.demand-table tr.row-detail { display: none; }   /* unused (full table shows everything) */
