* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(202, 160, 90, 0.16), transparent 55%),
    radial-gradient(90% 80% at -10% 110%, rgba(47, 125, 79, 0.10), transparent 50%),
    var(--cream);
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--forest); font-weight: 600; }

a { color: var(--leaf); }

.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
}
/* M4: wordmark must never wrap; shrink font slightly on very narrow widths */
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--forest); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 400px) { .wordmark { font-size: 18px; } }
.wordmark .accent { color: var(--gold); }
.site-nav .links { display: flex; gap: 22px; align-items: center; font-size: 14px; }

/* --- Phase 6A customer nav --- */
.cart-indicator { font-family:var(--font-body); font-size:14px; color:var(--forest);
  text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
.cart-count { display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:20px; padding:0 6px; border-radius:20px;
  background:var(--forest); color:var(--paper); font-size:11px; font-weight:600; }

.container { max-width: 880px; margin: 0 auto; padding: 24px 40px 64px; }

.btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--leaf); color: #fff; font-family: var(--font-body);
  font-weight: 600; font-size: 14px; padding: 10px 22px; border-radius: 999px;
  text-decoration: none;
}
.btn-forest { background: var(--forest); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input {
  width: 100%; padding: 9px 12px; border: 1px solid rgba(15, 61, 46, 0.2);
  border-radius: 8px; font-size: 14px; font-family: var(--font-body); background: var(--paper);
}
.field .error { color: var(--status-out); font-size: 12px; margin-top: 4px; }

.card {
  background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 28px; max-width: 420px;
}

/* --- Admin page title (H1 consistency across all admin pages) --- */
.admin-page-title { font-family:var(--font-display); font-size:var(--display-lg); color:var(--forest); font-weight:600; margin:0 0 4px; }

/* --- Order detail supporting line --- */
.detail-sub { font-family:var(--font-body); font-size:var(--text-sm); color:#8a8a80; margin:2px 0 8px; }

/* ----- Landing hero ----- */
.hero-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--leaf);
}
.hero-title { font-size: 56px; line-height: 1; margin: 12px 0 8px; }
.hero-title em { color: var(--leaf); font-style: italic; }
.hero-lede { max-width: 430px; color: #3b3b34; font-size: 15px; line-height: 1.6; }
.hero-cta { margin-top: 22px; }

/* ----- Catalog page ----- */
.catalog-head { margin-bottom: 28px; }
.catalog-head .eyebrow, .catalog-empty .eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--leaf); margin: 0 0 6px;
}
.catalog-head h1, .catalog-empty h1 { font-size: 40px; line-height: 1.05; margin: 0; }
.catalog-head .lede, .catalog-empty .lede { color: #3b3b34; font-size: 15px; margin-top: 8px; }
.catalog-empty { padding: 48px 0; }

.catalog-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.product-card {
  background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow-card); overflow: hidden;
  display: flex; flex-direction: column;
}
.product-card__media { aspect-ratio: 4 / 3; background: rgba(15, 61, 46, 0.06); }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card__body { padding: 18px 20px 20px; }
.product-card__name { font-size: 22px; margin: 0; }
.product-card__sci { font-style: italic; color: #7a7a70; font-size: 13px; margin: 2px 0 0; }
.product-card__unit {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--leaf); margin: 8px 0 0;
}
.product-card__desc { color: #3b3b34; font-size: 13.5px; line-height: 1.5; margin: 10px 0 0; }
.product-card__signin { margin: 14px 0 0; font-size: 13.5px; }
.product-card__price { font-size: 18px; font-weight: 600; color: var(--forest); margin: 12px 0 0; }
.product-card__per { font-size: 12px; font-weight: 500; color: #7a7a70; }

/* --- Phase 6A catalog re-skin --- */
/* status pills (Foundation .pill base; these are the per-status colors) */
.pill--in_stock { background:#e3efe7; color:var(--leaf); }
.pill--low { background:#fbf0d9; color:#9a7b18; }
.pill--sold_out { background:#f3e3df; color:#c4604f; }

/* pick-of-the-week featured card breaks the grid into a full-width banner */
.product-card--featured { grid-column:1 / -1; flex-direction:row;
  background:linear-gradient(120deg, var(--forest) 0%, var(--forest-deep) 100%);
  color:var(--paper); }
.product-card--featured .product-card__media { flex:0 0 42%; aspect-ratio:auto; }
.product-card--featured .product-card__body { flex:1; padding:28px 32px; }
.product-card--featured .product-card__name { color:var(--paper); font-size:30px; }
.product-card--featured .product-card__desc { color:rgba(255,253,248,.82); }
.product-card--featured .sci { color:rgba(255,253,248,.9); }
.product-card--featured .product-card__price { color:var(--paper); }
.product-card__eyebrow { font-family:var(--font-body); font-size:11px; font-weight:600;
  letter-spacing:.14em; text-transform:uppercase; color:var(--forest); margin:0 0 6px; }
/* gold is only legible on the dark featured gradient — scope it there so
   gold-on-light Paper is structurally impossible (§11/§4.1 contrast guardrail). */
.product-card--featured .product-card__eyebrow { color:var(--gold); }

/* ----- Stock bar + status badge ----- */
.stock { margin-top: 14px; }
.stock__bar {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: rgba(15, 61, 46, 0.10);
}
.stock__fill { display: block; height: 100%; border-radius: 999px; }
.stock__fill--in_stock { background: var(--status-instock); }
.stock__fill--low { background: var(--status-low); }
.stock__fill--sold_out { background: var(--status-out); }
.stock__meta { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 12px; }
.stock__count { color: #7a7a70; }
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px;
}
.badge--in_stock { background: rgba(47, 125, 79, 0.14); color: var(--status-instock); }
.badge--low { background: rgba(200, 150, 47, 0.18); color: #6b5320; }
.badge--sold_out { background: rgba(177, 74, 59, 0.14); color: var(--status-out); }

/* ----- Cart ----- */
.cart-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.cart-table th, .cart-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(15, 61, 46, 0.10);
  font-size: 14px;
}
.cart-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #7a7a70; }
.cart-qty { display: flex; gap: 10px; align-items: center; }
/* the stepper supplies its own sizing; keep the row's helper text aligned */
.cart-qty .qty { flex: none; }

#cart-subtotal { font-size: 18px; color: var(--forest); font-weight: 600; }
.cart-subtotal-row td { border-top: 2px solid rgba(15,61,46,0.12); }
.cart-subtotal-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: #7a7a70; }
.cart-subtotal { margin-top: 18px; font-size: 18px; color: var(--forest); }
.add-to-cart { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.add-to-cart input[type="number"] {
  width: 64px; padding: 7px 9px; border: 1px solid rgba(15, 61, 46, 0.2); border-radius: 8px;
}

/* --- Phase 6 R3 catalog card polish --- */
.product-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
/* the featured banner is large + dark — don't lift it, just deepen its shadow */
.product-card--featured:hover { transform: none; box-shadow: var(--shadow-lift); }

.product-card__media { overflow: hidden; position: relative; }
/* faint forest hairline over photos so they sit on-brand against Paper */
.product-card__media img {
  transition: transform .5s var(--ease);
}
.product-card__media img::after { content: ""; }
.product-card__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(15, 61, 46, 0.10);
}
.product-card:hover .product-card__media img { transform: scale(1.045); }

/* motif placeholder: centered faint line-art on a cream wash */
.product-card__media--placeholder {
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--cream), rgba(15,61,46,0.05));
}
.product-card__motif { color: var(--leaf); opacity: .38; line-height: 0; }
.product-card__motif svg { width: 56%; height: auto; }
.product-card--featured .product-card__motif { color: var(--paper); opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .product-card:hover { transform: none; }
  .product-card:hover .product-card__media img { transform: none; }
}

/* H2: featured card stacks vertically on narrow screens so stepper+button don't clip */
@media (max-width: 600px) {
  .product-card--featured { flex-direction: column; }
  .product-card--featured .product-card__media { flex: none; aspect-ratio: 4 / 3; }
}

/* --- Phase 6 shared components --- */
.data-table { width:100%; border-collapse:collapse; font-family:var(--font-body); font-size:14px; }
.data-table thead th { text-align:left; color:#6b7a6f; font-size:11px; text-transform:uppercase;
  letter-spacing:.06em; padding:12px 16px; background:var(--cream); }
.data-table td { padding:12px 16px; border-top:1px solid rgba(15,61,46,.08); }

.btn-outline { background:transparent; border:1px solid var(--forest); color:var(--forest); }
.btn-danger  { background:transparent; border:1px solid #c4604f; color:#c4604f; }

.pill { display:inline-block; padding:2px 9px; border-radius:20px; font-size:11px; font-weight:600;
  background:#e3efe7; color:var(--leaf); }
.pill-out { background:#f3e3df; color:#c4604f; }

.stat { background:var(--cream); border-radius:9px; padding:9px 12px; }
.stat .k { font-size:9px; color:#8a8a80; text-transform:uppercase; letter-spacing:.05em; }
.stat .v { font-size:16px; color:var(--ink); margin-top:2px; font-family:var(--font-body); }

.section-head { display:flex; justify-content:space-between; align-items:center; margin:18px 0 8px; }
.section-head h2, .section-head h3 { margin:0; }

/* muted secondary text (empty states, captions, metadata) */
.muted { color:#7a7a70; }

.detail-header { display:flex; justify-content:space-between; align-items:flex-start;
  padding:16px 0; border-bottom:1px solid var(--hair); margin-bottom:14px; }
.detail-header .crumb { font-size:11px; color:#8a8a80; }
.detail-header .actions { display:flex; gap:8px; }

/* --- Phase 6 refinements (spec §4.1) --- */
/* botanical Latin-name signature: always Playfair italic */
.sci { font-family:var(--font-display); font-style:italic; color:var(--leaf); font-weight:400; }

/* flash / toast — fixed bottom-right stack; OOB toasts append here via HTMX */
.flash-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 900;           /* above rails/sticky bars, below hypothetical modals */
  display: flex;
  flex-direction: column; /* newest (appended last) is closest to the corner */
  gap: 8px;
  width: 320px;
  max-width: calc(100vw - 48px);
  pointer-events: none;   /* don't block clicks on content behind the empty stack */
}
@media (max-width: 480px) {
  /* stretch edge-to-edge with side margins so toasts aren't clipped on phones */
  .flash-stack { left:16px; right:16px; bottom:16px; width:auto; max-width:none; }
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 10px;
  font-size: var(--text-sm); border: 1px solid var(--hair);
  box-shadow: var(--shadow-card); background: var(--paper);
  pointer-events: auto;   /* re-enable clicks on actual toast elements */
  cursor: pointer;
}
.toast--success { background:#e8f1ea; border-color:#bcd9c6; color:#1c5b38; }
.toast--warning { background:#fbf2dd; border-color:#e8d6a6; color:#7a5c12; }
.toast--error, .toast--danger { background:#f7e4de; border-color:#e3bdb0; color:#9a3520; }
/* dismiss × button sits at the right edge; inherits the toast's text color */
.toast__dismiss {
  margin-left: auto; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 4px;
  color: inherit; opacity: 0.6;
}
.toast__dismiss:hover { opacity: 1; }
.toast__dismiss:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* HTMX leaf-pulse loading indicator (hidden until a request is in flight) */
.leaf-pulse { width:18px; height:18px; display:inline-block; }
.htmx-indicator { opacity:0; transition:opacity .12s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity:1; }
.leaf-pulse svg { transform-origin:50% 90%; animation:leaf-sway 1s ease-in-out infinite; }
@keyframes leaf-sway { 0%,100% { transform:rotate(-12deg); opacity:.5; } 50% { transform:rotate(12deg); opacity:1; } }

/* HTMX settle: added/swapped content eases in */
.htmx-added { animation:settle var(--dur) var(--ease); }
@keyframes settle { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* accessibility: visible keyboard focus + brand selection color */
:focus-visible { outline:none; box-shadow:0 0 0 3px var(--paper), 0 0 0 5px var(--gold); border-radius:6px; }
::selection { background:rgba(47,125,79,.22); color:var(--ink); }

/* honor reduced-motion: kill all the page-load / hover / settle animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; }
  .stagger > * { opacity:1 !important; transform:none !important; }
}

/* --- Phase 6A customer home --- */
.hero { position:relative; overflow:hidden; }
.hero-week { font-family:var(--font-body); font-size:13px; color:var(--leaf);
  letter-spacing:.04em; margin:10px 0 0; }

.motif-watermark { position:absolute; top:-30px; right:-20px; color:var(--leaf);
  opacity:.07; pointer-events:none; z-index:0; }
.hero > :not(.motif-watermark) { position:relative; z-index:1; }

.trust-badges { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px; margin:48px 0; }
.trust-badge h3 { font-family:var(--font-display); margin:0 0 6px; color:var(--forest); }
.trust-badge p { font-family:var(--font-body); font-size:14px; color:var(--ink); margin:0; }

.grower-story { max-width:680px; margin:48px 0; }
.grower-story h2 { font-family:var(--font-display); color:var(--forest); }
.grower-story p { font-family:var(--font-body); font-size:15px; line-height:1.7; color:var(--ink); }

.how-it-works { background:var(--cream); border-radius:12px; padding:28px 32px; margin:48px 0; }
.how-it-works h2 { font-family:var(--font-display); color:var(--forest); }
.how-steps { list-style:none; margin:0; padding:0; display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; }
.how-steps li { font-family:var(--font-body); font-size:14px; color:var(--ink); }
.how-num { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px;
  border-radius:50%; background:var(--forest); color:var(--paper); font-size:13px; margin-right:8px; }

.invite-prompt { margin:48px 0; }
.invite-prompt .invite-or { margin:0 8px; color:#8a8a80; font-family:var(--font-body); }
.invite-note { font-family:var(--font-body); font-size:13px; color:#8a8a80; margin-top:10px; }

/* staggered page-load reveal for home sections */
.stagger > * { opacity:0; animation:rise var(--dur) var(--ease) forwards; }
.stagger > *:nth-child(1) { animation-delay:.02s; }
.stagger > *:nth-child(2) { animation-delay:.08s; }
.stagger > *:nth-child(3) { animation-delay:.14s; }
.stagger > *:nth-child(4) { animation-delay:.20s; }
.stagger > *:nth-child(5) { animation-delay:.26s; }
@keyframes rise { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* --- Phase 6 R0 admin app-shell --- */
.admin-canvas { display:flex; align-items:stretch; min-height:100vh; }
.admin-rail {
  width:240px; flex:none; align-self:stretch;
  background:linear-gradient(180deg,#15462f,#0a2a20);
  color:rgba(255,253,248,.82); padding:20px 14px;
  display:flex; flex-direction:column; gap:2px;
}
.admin-brand { display:flex; align-items:center; gap:8px; color:var(--paper);
  font-family:var(--font-display); font-weight:700; font-size:18px;
  text-decoration:none; margin-bottom:18px; }
.admin-brand svg { width:26px; height:26px; }
.admin-rail .admin-group { font-size:10px; text-transform:uppercase; letter-spacing:.1em;
  color:rgba(255,253,248,.45); padding:14px 10px 4px; }
.admin-rail a { color:rgba(255,253,248,.82); text-decoration:none; font-size:14px;
  padding:8px 10px; border-radius:7px; }
.admin-rail a:hover { background:rgba(255,255,255,.07); color:var(--paper); }
.admin-rail a.active { background:rgba(255,255,255,.10); color:var(--paper);
  box-shadow:inset 3px 0 0 var(--gold); }
.admin-rail__foot { margin-top:auto; padding-top:18px; display:flex; flex-direction:column;
  gap:4px; font-size:13px; border-top:1px solid rgba(255,255,255,.10); }
.admin-rail__foot span { color:rgba(255,253,248,.6); padding:8px 10px 0; }

.admin-main { flex:1; min-width:0; display:flex; justify-content:center;
  background:transparent; }
.admin-content { width:100%; max-width:1320px; padding:32px 48px 64px; }
@media (max-width:880px) {
  .admin-canvas { flex-direction:column; }
  .admin-rail { width:auto; flex-direction:row; flex-wrap:wrap; align-items:center; gap:6px; }
  .admin-rail .admin-group, .admin-rail__foot { display:none; }
  .admin-content { padding:20px; }
}

/* --- Phase 6 R0 styled select --- */
.select-wrap { position:relative; display:inline-block; }
.select-wrap::after {
  content:""; position:absolute; right:12px; top:50%; width:8px; height:8px;
  margin-top:-5px; border-right:2px solid var(--leaf); border-bottom:2px solid var(--leaf);
  transform:rotate(45deg); pointer-events:none;
}
.select {
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  font-family:var(--font-body); font-size:14px; color:var(--ink);
  background:var(--paper); border:1px solid var(--hair); border-radius:8px;
  padding:9px 34px 9px 12px; cursor:pointer;
}
.select:focus-visible { outline:none; box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--gold); }

/* --- Phase 6 R0 quantity stepper --- */
.qty { display:inline-flex; align-items:center; border:1px solid rgba(15,61,46,.22);
  border-radius:999px; background:var(--paper); overflow:hidden; }
.qty__btn { border:none; background:transparent; color:var(--leaf); font-size:17px;
  width:34px; height:34px; cursor:pointer; line-height:1; }
.qty__btn:hover { background:rgba(47,125,79,.10); }
.qty__input { width:42px; text-align:center; border:none; background:transparent;
  font-family:var(--font-body); font-weight:600; font-size:14px; color:var(--ink);
  -moz-appearance:textfield; }
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button {
  -webkit-appearance:none; margin:0; }
.qty__input:focus-visible { outline:none; box-shadow:0 0 0 2px var(--gold); border-radius:6px; }

/* --- Phase 6 R0 toggle switch --- */
.switch { display:inline-block; width:38px; height:22px; border-radius:999px; border:none;
  background:#d8d2c2; position:relative; cursor:pointer; padding:0; vertical-align:middle;
  transition:background var(--dur) var(--ease); }
.switch--on { background:var(--leaf); }
.switch__knob { position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%;
  background:#fff; transition:left var(--dur) var(--ease); }
.switch--on .switch__knob { left:18px; }
.switch:focus-visible { outline:none; box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--gold); }

/* --- Phase 6 R0 searchable combobox --- */
.combobox { position:relative; display:inline-block; }
/* Once JS enhances the combobox, hide the native select wrapper entirely so its
   ::after chevron can't show through next to the search input (no-JS keeps it). */
.combobox[data-cb-ready] .select-wrap { display:none; }
.combobox__input { font-family:var(--font-body); font-size:14px; color:var(--ink);
  background:var(--paper); border:1px solid var(--hair); border-radius:8px;
  padding:9px 12px 9px 32px; min-width:230px; }
.combobox__input:focus-visible { outline:none; box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--gold); }
.combobox__search-ic { position:absolute; left:11px; top:50%; transform:translateY(-50%);
  color:var(--leaf); pointer-events:none; }
.combobox__menu { position:absolute; z-index:20; top:calc(100% + 4px); left:0; min-width:250px;
  max-height:240px; overflow:auto; background:var(--paper); border:1px solid var(--hair);
  border-radius:8px; box-shadow:var(--shadow-lift); }
.combobox__opt { padding:8px 12px; font-size:13px; color:var(--ink); cursor:pointer;
  display:flex; align-items:center; gap:8px; }
.combobox__opt:hover, .combobox__opt[aria-selected="true"] { background:#eef5f0; }
.combobox__badge { background:var(--gold); color:var(--ink); font-size:9px; font-weight:700;
  padding:1px 6px; border-radius:10px; text-transform:uppercase; letter-spacing:.04em; }

/* --- Phase 6 R0 button polish --- */
.btn { transition:transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.btn:hover { transform:translateY(-1px); box-shadow:var(--shadow-lift); }
.btn:active { transform:translateY(0); box-shadow:none; }
.btn-sm { padding:5px 12px; font-size:12px; }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform:none; } }

/* --- Phase 6 R2 customers table --- */
.customers-table td { vertical-align:top; padding:14px 16px; }
.customers-table .cust-name { font-weight:600; }
.customers-table .cust-email { font-size:12px; margin-top:2px; }
.customers-table .agg-num { font-family:var(--font-body); font-weight:600; font-size:15px; }
/* invoice-pending emphasis: amber chip, NOT small gold text (AA guardrail) */
.customers-table .needs-attn {
  display:inline-block; min-width:20px; text-align:center; padding:1px 8px;
  border-radius:999px; background:#8a5a12; color:var(--paper);
}
.qbo-chip {
  display:inline-block; padding:2px 10px; border-radius:999px;
  background:rgba(47,125,79,.12); color:var(--forest); font-size:12px; font-weight:600;
  margin-right:6px;
}

/* --- Phase 6 6C QBO import picker --- */
.import-summary { font-size:11px; text-transform:uppercase; letter-spacing:.06em;
  color:#6b7a6f; margin:0 0 10px; }
.import-toolbar { display:flex; align-items:center; gap:16px; margin-bottom:12px; }
.import-filter { flex:1; max-width:360px; }
.import-filter input { width:100%; padding:9px 12px; border:1px solid var(--hair);
  border-radius:8px; font-family:var(--font-body); font-size:14px; background:var(--paper); }
.import-allnew { font-size:14px; color:var(--forest); display:inline-flex;
  align-items:center; gap:6px; white-space:nowrap; }
.import-table tr.is-imported td { color:#9a988e; }
.pill--new { background:var(--gold); color:var(--forest); }      /* forest-on-gold passes AA; gold is not the text */
.pill--imported { background:#ece8de; color:#8a8575; }
.import-actionbar { position:sticky; bottom:0; margin-top:14px; padding:14px 0;
  display:flex; justify-content:flex-end; border-top:1px solid var(--hair);
  background:linear-gradient(180deg, rgba(255,253,248,0), var(--paper) 45%); }
.import-actionbar .btn[disabled] { opacity:.5; cursor:not-allowed; }
.import-empty { padding:48px 0; text-align:center; color:#6b7a6f; }
.import-empty .motif { color:var(--leaf); opacity:.3; }

/* --- Phase 6 6D week builder --- */
/* two-pane workbench: sticky LEFT summary/picker + scrolling RIGHT item cards */
.builder { display:grid; grid-template-columns:320px minmax(0,1fr); gap:24px;
  align-items:start; margin-top:8px; }
.builder-aside { position:sticky; top:24px; display:flex; flex-direction:column; gap:16px; }
.builder-main { min-width:0; }
@media (max-width:900px) {
  .builder { grid-template-columns:1fr; }
  .builder-aside { position:static; }
}

/* M6: week-builder section-head collapses gracefully on narrow screens */
@media (max-width: 600px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .week-header__edit { width: 100%; }
}

/* product picker (LEFT, draft only) */
.picker { padding:16px; }
.picker__label { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.06em;
  color:#6b7a6f; margin-bottom:6px; }
.picker__field { position:relative; display:flex; align-items:center; gap:8px; }
.picker__field input[type="search"] { flex:1; padding:9px 12px; border:1px solid var(--hair);
  border-radius:8px; font-family:var(--font-body); font-size:14px; background:var(--paper);
  color:var(--ink); }
.picker__field input[type="search"]:focus-visible { outline:none;
  box-shadow:0 0 0 3px var(--paper),0 0 0 5px var(--gold); }
.picker__results { margin-top:8px; max-height:320px; overflow:auto; }
.picker__result { display:flex; flex-direction:column; align-items:flex-start; gap:1px;
  width:100%; text-align:left; padding:8px 10px; border:none; border-top:1px solid var(--hair);
  background:transparent; cursor:pointer; border-radius:6px; }
.picker__result:first-child { border-top:none; }
.picker__result:hover, .picker__result:focus-visible { background:#eef5f0; }
.picker__result:focus-visible { outline:none; box-shadow:0 0 0 2px var(--gold); }
.picker__result-name { font-size:14px; color:var(--ink); }
.picker__result-sku { font-size:11px; color:#8a8a80; letter-spacing:.03em; }
.picker__empty { padding:8px 10px; color:#8a8a80; font-size:13px; }

/* week summary (LEFT) */
.week-summary { padding:16px; background:var(--cream); border-radius:12px;
  display:flex; flex-direction:column; gap:10px; }
.week-summary__count { margin:0; font-family:var(--font-display); font-size:22px;
  color:var(--forest); }
.week-summary form { margin:0; }
.week-summary .btn { width:100%; }
.week-summary__hint, .week-summary__outbox { margin:0; font-size:12px; color:#7a7a70; }

/* item cards (RIGHT) */
.item-card { max-width:none; margin-bottom:16px; }
.item-card__sku { font-size:13px; color:#8a8a80; font-weight:400; margin-left:4px; }
.item-card__actions { display:flex; gap:10px; align-items:end; flex-wrap:wrap; margin-top:12px; }
.item-card__addlot { display:flex; gap:8px; align-items:end; }
.item-card__lbl { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:#6b7a6f;
  display:flex; flex-direction:column; gap:4px; }

/* week-status pills (status text always present → not color-only) */
/* draft pill gets a hairline border so it doesn't vanish on cream backgrounds */
.pill--draft { background:#ece8de; color:#6b6457; border:1px solid var(--hair); }
.pill--published { background:#e3efe7; color:var(--leaf); }
.pill--closed { background:#f0eae6; color:#8a6f5a; }
/* invited customers are neutral-pending, not errors (pill-out is salmon/danger) */
/* placed here, AFTER the base .pill rule, so the cascade doesn't override it */
.pill--invited { background:#ece8de; color:#6b6457; }

/* --- Phase 6 6E/6F week-builder controls (owner-led action-rail overhaul) --- */

/* Carry-over: a calm "start here" callout, not floating bold text. */
.carryover { margin-bottom:16px; padding:14px 16px; background:var(--cream);
  border:1px solid var(--hair); border-radius:var(--radius); }
.carryover__lead { margin:0 0 10px; font-family:var(--font-body); font-weight:600;
  font-size:var(--text-sm); letter-spacing:.04em; text-transform:uppercase;
  color:var(--forest); }
.carryover__form { margin:0; }
.carryover .btn { width:100%; }

/* ── Lot row ──────────────────────────────────────────────────────────────────
   Each allocation row is a hover target. The action rail (pencil + trash) lives
   in .lot-row__rail and fades in on hover/focus-within on devices that support
   hover. On touch devices (@media hover:none) the rail stays visible always. */
.lot-row__avail { vertical-align:middle; }
.lot-row__rail  { width:68px; padding:6px 10px 6px 4px; vertical-align:middle;
  text-align:right; }

/* Rail container: flex row of icon buttons. Default = always visible (safe touch
   baseline). On pointer devices: hide until the row is hovered or focus-within. */
.lot-rail { display:inline-flex; gap:2px; align-items:center; justify-content:flex-end; }

@media (hover: hover) {
  .lot-rail {
    opacity:0; pointer-events:none;
    transition:opacity var(--dur) var(--ease);
  }
  .lot-row:hover .lot-rail,
  .lot-row:focus-within .lot-rail { opacity:1; pointer-events:auto; }

  /* While the edit form is open, suppress the rail so trash isn't mis-tapped. */
  .lot-row--editing .lot-rail { opacity:0 !important; pointer-events:none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .lot-rail { transition:none; }
}

/* Collapse rail form wrapper to a flex item (no intrinsic block spacing). */
.lot-rail form { display:contents; margin:0; }

/* Icon button base: compact square hit target, neutral at rest. */
.lot-rail__btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0;
  border:none; border-radius:6px; cursor:pointer;
  background:transparent; color:#8a8a80;
  transition:color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.lot-rail__btn svg { width:15px; height:15px; flex-shrink:0; }

.lot-rail__btn--edit:hover   { color:var(--leaf);       background:rgba(47,125,79,.10); }
.lot-rail__btn--remove:hover { color:var(--status-out); background:rgba(177,74,59,.10); }

.lot-rail__btn:focus-visible {
  outline:none;
  box-shadow:0 0 0 2px var(--paper), 0 0 0 4px var(--gold);
}

/* ── Inline tray-count edit ──────────────────────────────────────────────────
   No-JS baseline: number input + text "Save" button always visible.
   With JS: form collapses (hidden); pencil reveal swaps in the form in place of
   the [data-alloc-display] span. Save becomes a check icon, Cancel a × icon. */
.alloc-edit { display:inline-flex; gap:6px; align-items:center; margin:0; }
.alloc-edit[hidden] { display:none; }
.alloc-edit__input { width:5.5em; padding:5px 8px; font-family:var(--font-body);
  font-size:var(--text-sm); color:var(--ink); background:var(--paper);
  border:1px solid var(--hair); border-radius:7px; }
.alloc-edit__input:focus-visible { outline:none;
  box-shadow:0 0 0 2px var(--paper), 0 0 0 4px var(--gold); }

/* Check (save) icon button */
.alloc-edit__save {
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; padding:0; border:none; border-radius:6px; cursor:pointer;
  background:rgba(47,125,79,.12); color:var(--leaf);
  transition:color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.alloc-edit__save:hover { background:var(--leaf); color:var(--paper); }
.alloc-edit__save svg   { width:14px; height:14px; flex-shrink:0; }

/* × (cancel) icon button */
.alloc-edit__cancel {
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; padding:0; border:none; border-radius:6px; cursor:pointer;
  background:transparent; color:#8a8a80;
  transition:color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.alloc-edit__cancel:hover { background:rgba(15,61,46,.08); color:var(--ink); }
.alloc-edit__cancel svg   { width:14px; height:14px; flex-shrink:0; }

.alloc-edit__save:focus-visible,
.alloc-edit__cancel:focus-visible {
  outline:none;
  box-shadow:0 0 0 2px var(--paper), 0 0 0 4px var(--gold);
}

[data-alloc-display] { font-variant-numeric:tabular-nums; color:var(--ink); }

/* Status notes: small inset note with a left accent bar, not bare colored text.
   Gold is never used here (AA on small text); status colors are darkened for contrast. */
.hint { font-family:var(--font-body); }
.hint--warn, .hint--error { font-size:var(--text-sm); line-height:1.4;
  margin:8px 0 0; padding:8px 12px; border-radius:8px; border-left:3px solid; }
.hint--warn { color:#7a5a16; background:rgba(200,150,47,.12);
  border-left-color:var(--status-low); }
.hint--error { color:#8a2f22; background:rgba(177,74,59,.12);
  border-left-color:var(--status-out); }

/* ── Inline destructive confirm ──────────────────────────────────────────────
   A compact inset card with a danger left-bar. Buttons are compact (no pill radius)
   so they read as a card-native action pair, not full-bleed pill buttons. */
.confirm-inline { margin-top:10px; padding:11px 14px; background:var(--cream);
  border:1px solid var(--hair); border-left:3px solid var(--status-out);
  border-radius:8px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.confirm-inline__msg { margin:0; flex:1 1 auto; font-family:var(--font-body);
  font-size:var(--text-sm); line-height:1.4; color:var(--ink); }
/* Override pill radius + sizing for action buttons within the confirm box */
.confirm-inline .btn { flex:none; padding:4px 12px; font-size:12px; border-radius:6px; }
