/* ============================================================
   STICKY BOOKS — COMPONENT STYLES
   Loads after tokens.css. Every rule reads SEMANTIC tokens only.
   ============================================================ */

/* ---------- Page shell ----------
   Scoped wrapper (not `body`) so the brand system can be dropped
   onto the public landing page without reskinning the rest of the
   app, which still runs on the plain Tailwind look. */
.sb-page {
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  line-height: 1;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  border: var(--border-width) solid var(--action-border);
  background: var(--action-bg);
  color: var(--text-on-honey);
  box-shadow: var(--action-shadow);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.btn:hover  { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px);  box-shadow: 2px 2px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.btn--ghost { background: transparent; box-shadow: none; }

/* ---------- Card ---------- */
.card {
  background: var(--bg-surface);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sticker);
  padding: var(--space-6);
}
.card--honey { background: var(--bg-highlight); }
.card--grape { background: var(--bg-accent); color: var(--text-on-accent); }
.card__header { margin-bottom: var(--space-4); }
.card--grape .card__body { color: rgba(255, 255, 255, 0.88); }

/* ---------- Status pill ---------- */
.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-pill[data-state="open"]  { background: var(--status-open);  color: var(--status-open-text); }
.status-pill[data-state="cured"] { background: var(--status-cured); color: var(--status-cured-text); }
.status-pill[data-state="empty"] { background: var(--status-empty); color: var(--status-empty-text); }

/* ---------- Order card ---------- */
.order-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}
.order-card__po { font-size: var(--text-sm); color: var(--grape); }
.order-card__title {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
}
.order-card__vendor { font-size: var(--text-sm); color: var(--text-muted); }
.order-card__lines { list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.order-card__line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  border-top: 1.5px solid var(--cream-2);
}
.order-card__line-row { display: flex; justify-content: space-between; }
.order-card__line-detail { font-size: var(--text-xs); color: var(--text-muted); }
.order-card__sku { font-size: var(--text-xs); color: var(--text-muted); }
.order-card__total {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
}

/* ---------- Data rule ---------- */
.numeric { font-family: var(--font-mono); font-weight: var(--weight-bold); }

/* ---------- Flag row (inventory urgency, e.g. days-on-hand running low) --- */
.flag-row[data-flag="critical"] { background: var(--flag-critical); color: var(--flag-critical-text); }
.flag-row[data-flag="warning"]  { background: var(--flag-warning);  color: var(--flag-warning-text); }

/* ---------- Segmented toggle (e.g. dashboard's 7d/30d/90d window picker) --- */
.segmented {
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--bg-surface);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
}
.segmented a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  text-decoration: none;
}
.segmented a[aria-current="true"] { background: var(--honey); color: var(--text-on-honey); }
.segmented a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- Filter field (dashboard-style select/label pairs) ---------- */
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border: var(--border-width) solid var(--cream-2);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-body);
}
.field select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--ink); }

/* ---------- Text input (auth/marketing forms) ---------- */
.text-field-label {
  display: block;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}
.text-field {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.text-field:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }

/* ---------- Data table ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-4);
  border-bottom: var(--border-width) solid var(--ink);
}
.data-table th.numeric, .data-table td.numeric { text-align: right; }
.data-table td { padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--cream-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
