/*
 * Component CSS classes — lifted verbatim from .design-docs/LAYOUTS_PROTOTYPE.html.
 *
 * These exist as named classes (rather than pure Tailwind utility soup)
 * because they're reused across every surface and the prototype's HTML
 * uses them by name. Each class composes Tailwind-equivalent declarations
 * but pulls colors from the tokens in tokens.css so per-tenant theme
 * overrides flow through.
 *
 * Add new classes here only when the same composition appears 3+ times
 * across templates. Otherwise prefer Tailwind utility classes inline.
 */

/* ---------- Pills (status badges) -------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
}
.pill-sage  { background: var(--pill-sage-bg);  color: var(--pill-sage-fg); }
.pill-kiln  { background: var(--pill-kiln-bg);  color: var(--pill-kiln-fg); }
.pill-cool  { background: var(--pill-cool-bg);  color: var(--pill-cool-fg); }
.pill-rose  { background: var(--pill-rose-bg);  color: var(--pill-rose-fg); }
.pill-clay  { background: var(--pill-clay-bg);  color: var(--pill-clay-fg); }
.pill-slate { background: var(--slate);         color: var(--charcoal-2); }

/* ---------- Cards ------------------------------------------------------- */
.card {
  background: white;
  border: 1px solid var(--slate);
  border-radius: 10px;
}
.card-soft {
  background: var(--cream-2);
  border: 1px solid var(--slate);
  border-radius: 10px;
}

/* ---------- Buttons ---------------------------------------------------- */
.btn-primary {
  background: var(--terracotta);
  color: white;
  border-radius: 8px;
  padding: 0.5rem 0.95rem;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s ease;
  cursor: pointer;
  border: none;
}
.btn-primary:hover { background: var(--clay); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  color: var(--charcoal-2);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--slate-2);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s ease;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--cream-2); }

/* ---------- Inputs ---------------------------------------------------- */
.input {
  background: white;
  border: 1px solid var(--slate-2);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.875rem;
  color: var(--charcoal);
  width: 100%;
  font-family: inherit;
}
.input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px #c2674c33;
}
textarea.input { resize: vertical; min-height: 4rem; }

/* ---------- Navigation ------------------------------------------------ */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--charcoal-2);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--cream-2); }
.nav-item.active {
  background: var(--charcoal);
  color: var(--cream);
}
.nav-item.active svg { color: var(--cream); }

/* ---------- Role chips (the role selector in the topbar) -------------- */
.role-chip {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--slate-2);
  background: white;
  color: var(--charcoal-2);
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.role-chip:hover:not(.active) { background: var(--cream-2); }
.role-chip.active {
  background: var(--charcoal);
  color: var(--cream);
  border-color: var(--charcoal);
}

/* ---------- Kiln stage pills (LOADING / FIRING / COOLING / UNLOADED) -- */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.stage-loading  { background: #e6e2d6; color: #5a533f; }
.stage-firing   { background: #fbd4b6; color: #7d3a13; }
.stage-cooling  { background: #cfe0e7; color: #2a4c5c; }
.stage-unloaded { background: #d4dec8; color: #4a5b3d; }

/* ---------- Kiln capacity / progress bar ------------------------------ */
.kiln-strip {
  height: 10px;
  border-radius: 999px;
  background: var(--slate);
  overflow: hidden;
}
.kiln-strip > div {
  height: 100%;
  background: var(--kiln);
  transition: width 0.4s;
}

/* ---------- Ledger amounts ------------------------------------------- */
.ledger-pos { color: #4f6043; font-weight: 500; }
.ledger-neg { color: #8a3e10; font-weight: 500; }

/* ---------- Row hover (table rows) ----------------------------------- */
.row-hover { transition: background 0.15s ease; }
.row-hover:hover { background: var(--cream-2); }

/* ---------- Misc helpers --------------------------------------------- */
.divider { border-color: var(--slate); }
.kbd {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  background: var(--slate);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--charcoal-2);
}

/* Onboarding step indicator */
.step-active  { background: var(--terracotta); color: white; }
.step-done    { background: var(--sage); color: white; }
.step-pending { background: white; border: 1px solid var(--slate-2); color: var(--charcoal-2); }

/* Scrollbar styling for sidebars and scroll areas */
.scroll-area::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-area::-webkit-scrollbar-thumb {
  background: var(--slate-2);
  border-radius: 999px;
}
