/* ==========================================================================
   INNO BRAIN — Business section
   Everything here is prefixed .biz- so it cannot collide with the rest of the
   dashboard. Colours come from the same tokens as every other screen, so the
   accent picker moves this section too.
   The global prefers-reduced-motion rule in core.css already tames all of it.
   ========================================================================== */

/* --- tabs ---------------------------------------------------------------- */

.biz-head .biz-tabs {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  scrollbar-width: none;
}
.biz-head .biz-tabs::-webkit-scrollbar { display: none; }

.biz-tab {
  position: relative;
  flex: 1;
  min-width: 96px;
  padding: 9px 14px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--quick), background var(--quick);
}
.biz-tab:hover { color: var(--ink); background: var(--panel-2); }
.biz-tab.is-on {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 6px 18px -8px var(--accent-glow);
}

.biz-badge {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--coral);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  vertical-align: 1px;
}
.biz-tab.is-on .biz-badge { background: rgba(0, 0, 0, .28); }

/* --- small shared bits --------------------------------------------------- */

.biz-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-right: 2px;
}

/* The key under the sales-and-profit curve: two words, no chart library. */
.biz-key {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
}
.biz-key i {
  display: inline-block;
  width: 16px;
  height: 3px;
  margin-right: 7px;
  border-radius: 2px;
  vertical-align: 3px;
}

.biz-invite {
  border-color: var(--accent-line);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 58%),
    var(--panel);
}

/* Said plainly rather than in red: the numbers are not wrong, they are
   incomplete, and the fix is one tab away. */
.biz-warn {
  border-color: rgba(245, 181, 68, .32);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(245, 181, 68, .10), transparent 60%),
    var(--panel);
}
.biz-warn h3 { color: var(--amber); }
.biz-warn p { color: var(--ink-2); line-height: 1.65; }

/* --- stock --------------------------------------------------------------- */

.biz-product + .biz-product { margin-top: var(--gap); }

table.data.biz-stock th,
table.data.biz-stock td { vertical-align: middle; }

/* Rows land one after another rather than all at once — the same stagger the
   rest of the dashboard uses, just applied per row. */
.biz-row { animation: biz-row-in 380ms var(--ease) backwards; }

@keyframes biz-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.biz-row.is-low { background: rgba(245, 181, 68, .045); }
.biz-row.is-low:hover { background: rgba(245, 181, 68, .075); }

.biz-actions { white-space: nowrap; }
.biz-actions .btn { opacity: .5; transition: opacity var(--quick); }
tr:hover .biz-actions .btn,
.biz-actions .btn:focus-visible { opacity: 1; }

@media (hover: none) {
  /* Four buttons in a stock row, on a phone, with no hover to reveal them. */
  .biz-actions .btn { opacity: 1; }
  .biz-actions { display: flex; gap: 2px; justify-content: flex-end; }
  .biz-price-head .btn { opacity: 1; }
  table.data.biz-stock th,
  table.data.biz-stock td { padding: 12px 10px; }
}

/* A soft ring that breathes, so "running low" reads before the words do. */
.biz-pulse {
  position: relative;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}
.biz-pulse::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: .5;
  animation: biz-pulse 2.4s var(--ease) infinite;
}

@keyframes biz-pulse {
  0%   { transform: scale(.6); opacity: .55; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

.biz-arrow {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.biz-arrow.in     { background: rgba(45, 212, 167, .14); color: var(--mint); }
.biz-arrow.out    { background: rgba(255, 107, 107, .13); color: var(--coral); }
.biz-arrow.adjust { background: var(--panel-3); color: var(--ink-2); }

/* --- the sale composer --------------------------------------------------- */

/* Tap-through picker: what, then which, then how many. */
.biz-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.biz-step-label {
  flex: 0 0 64px;
  padding-top: 9px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-4);
}
.biz-chips { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }

.biz-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--quick), color var(--quick), border-color var(--quick), transform var(--quick);
}
.biz-chip:hover { color: var(--ink); border-color: var(--panel-3); }
.biz-chip:active { transform: scale(.96); }
.biz-chip.is-on {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 550;
}
.biz-chip.is-on .biz-dot { background: var(--accent-ink) !important; opacity: .75; }

.biz-ready {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  animation: biz-row-in 300ms var(--ease) backwards;
}
.biz-ready-name { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }

.biz-stepper { display: flex; align-items: center; gap: 4px; }
.biz-stepper .input {
  width: 62px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.biz-stepper .input::-webkit-outer-spin-button,
.biz-stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.biz-stepper .btn { font-size: 17px; line-height: 1; min-width: 40px; }

.biz-price-box { display: flex; flex-direction: column; gap: 4px; }
.biz-price-box > span {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-4);
}
.biz-price-box .input { width: 118px; }

.biz-add { gap: 10px; margin-bottom: 4px; }

.biz-cart-row { animation: biz-row-in 300ms var(--ease) backwards; }

.biz-total {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.biz-total-value {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.biz-voided td { opacity: .45; }
.biz-voided .strong { text-decoration: line-through; }

/* --- the price list ------------------------------------------------------ */

.biz-price-group + .biz-price-group { margin-top: 20px; }

.biz-price-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 2px 9px;
  border-bottom: 1px solid var(--line-soft);
}
.biz-price-head .btn { opacity: .45; transition: opacity var(--quick); }
.biz-price-head:hover .btn { opacity: 1; }

.biz-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, 108px) 48px;
  align-items: end;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-soft);
  animation: biz-row-in 340ms var(--ease) backwards;
}
.biz-price-row:last-child { border-bottom: 0; }

/* A row that a bulk fill just touched: bright for a moment, so sixty rows
   changing at once is something you see happen rather than have to trust. */
.biz-price-row.is-filled { animation: biz-filled 1100ms var(--ease); }

@keyframes biz-filled {
  0%   { background: var(--accent-soft); }
  60%  { background: var(--accent-soft); }
  100% { background: transparent; }
}

.biz-price-name {
  align-self: center;
  font-size: 13.5px;
  color: var(--ink);
}

.biz-field { display: block; }
.biz-field > span {
  display: block;
  margin-bottom: 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-4);
}
/* Only the first row needs the labels; the rest read as a column. */
.biz-price-row:not(:first-child) .biz-field > span { visibility: hidden; height: 0; margin: 0; }

.input.sm { padding: 7px 10px; font-size: 13px; }

.biz-margin {
  align-self: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--mint);
  text-align: right;
  cursor: help;
}
.biz-margin.is-warn { color: var(--amber); font-size: 10.5px; }

/* --- narrow screens ------------------------------------------------------ */

@media (max-width: 900px) {
  .biz-price-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "name name name"
      "cost price reorder";
    gap: 8px 10px;
  }
  .biz-price-name { grid-area: name; font-weight: 550; }
  .biz-price-row .biz-field > span { visibility: visible; height: auto; margin-bottom: 4px; }
  .biz-margin { display: none; }
}

@media (max-width: 620px) {
  .biz-tab { min-width: 78px; padding: 8px 10px; font-size: 12.5px; }
  .biz-total { gap: 18px; }
  .biz-total-value { font-size: 19px; }

  /* The label sits above its chips rather than beside them, and everything
     the thumb has to hit gets bigger. */
  .biz-step { flex-direction: column; gap: 6px; }
  .biz-step-label { flex: none; padding-top: 0; }
  .biz-chip { min-height: 42px; padding: 9px 15px; font-size: 13.5px; }
  .biz-ready { gap: 10px; }
  .biz-ready-name { flex: 1 1 100%; }
  .biz-stepper .btn { min-width: 46px; padding: 11px; }
  .biz-stepper .input { width: 66px; }
  .biz-price-box { flex: 1; }
  .biz-price-box .input { width: 100%; }
  .biz-add-btn { flex: 1 1 100%; justify-content: center; }
}
