/* Forecast Inventario · La Gaviota
   Builds on sales_dashboard.css (sd-* design tokens) and adds the
   provider-settings panel + status pill restyle.
*/

/* ---------- Info chip ---------- */
.fcst-info-chip {
  background: var(--sd-brand-navy-050);
  border: 1px solid var(--sd-slate-200);
  border-left: 3px solid var(--sd-brand-navy-600);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--sd-slate-700);
  line-height: 1.55;
}
.fcst-info-chip svg { flex-shrink: 0; color: var(--sd-brand-navy-700); }
.fcst-info-chip strong { color: var(--sd-ink); font-weight: 600; }

/* ---------- Provider settings panel ---------- */
.fcst-panel { margin-top: 12px; }
.fcst-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--sd-slate-200);
  border-radius: 6px;
  transition: background 0.15s ease;
}
.fcst-panel summary:hover { background: var(--sd-slate-050); }
.fcst-panel[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.fcst-panel summary::-webkit-details-marker { display: none; }
.fcst-panel__title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sd-font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--sd-ink);
}
.fcst-panel__count {
  font-family: var(--sd-font-mono);
  font-size: 11px;
  color: var(--sd-slate-500);
  background: var(--sd-slate-100);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.fcst-panel__chev {
  color: var(--sd-slate-400);
  transition: transform 0.2s ease;
}
.fcst-panel[open] .fcst-panel__chev { transform: rotate(180deg); }

.fcst-panel__body {
  background: #ffffff;
  border: 1px solid var(--sd-slate-200);
  border-top: 0;
  border-radius: 0 0 6px 6px;
}
.fcst-panel__head {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) auto;
  gap: 14px;
  padding: 8px 16px;
  background: var(--sd-slate-050);
  border-bottom: 1px solid var(--sd-slate-200);
  font-family: var(--sd-font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sd-slate-500);
}
.fcst-panel__head span:nth-child(1) { text-align: left; }
.fcst-panel__head span:nth-child(2),
.fcst-panel__head span:nth-child(3) { text-align: left; }
.fcst-panel__head span:nth-child(4) { text-align: right; }

.fcst-prov-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) auto;
  gap: 14px;
  padding: 10px 16px;
  align-items: center;
  border-bottom: 1px solid var(--sd-slate-100);
}
.fcst-prov-row:last-child { border-bottom: 0; }
.fcst-prov-row:hover { background: var(--sd-slate-050); }

.fcst-prov-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sd-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fcst-prov-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.fcst-num-input {
  width: 64px;
  padding: 5px 8px;
  font-family: var(--sd-font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  border: 1px solid var(--sd-slate-300);
  border-radius: 4px;
  background: #ffffff;
  color: var(--sd-ink);
}
.fcst-num-input:focus {
  outline: none;
  border-color: var(--sd-brand-navy-600);
  box-shadow: 0 0 0 2px var(--sd-brand-navy-100);
}
.fcst-num-input::placeholder { color: var(--sd-slate-400); }

.fcst-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--sd-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.fcst-tag--default {
  color: var(--sd-slate-500);
  background: var(--sd-slate-100);
  text-transform: uppercase;
}
.fcst-tag--override {
  color: var(--sd-brand-amber-dark);
  background: var(--sd-brand-amber-050);
  border: 1px solid var(--sd-brand-amber-border);
  text-decoration: line-through;
  text-decoration-color: var(--sd-brand-amber);
}

.fcst-prov-action { text-align: right; }
.fcst-btn-save {
  background: var(--sd-brand-navy-700);
  color: #ffffff;
  font-family: var(--sd-font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.fcst-btn-save:hover { background: var(--sd-brand-navy-800); }

/* ---------- Mobile: stack the row vertically ---------- */
@media (max-width: 720px) {
  .fcst-panel__head { display: none; }
  .fcst-prov-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
  }
  .fcst-prov-input::before {
    content: attr(data-label);
  }
  .fcst-prov-action { text-align: left; }
}

/* ---------- Forecast products table tweaks (extends sd-table) ---------- */
.sd-table .fcst-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--sd-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.fcst-pill--out_of_stock      { background: #fee2e2; color: #991b1b; }
.fcst-pill--below_minimum     { background: #ffedd5; color: #9a3412; }
.fcst-pill--reorder_now       { background: #fef3c7; color: #92400e; }
.fcst-pill--ok                { background: #dcfce7; color: #166534; }
.fcst-pill--no_demand         { background: #f1f5f9; color: #475569; }
.fcst-pill--insufficient_history { background: #f1f5f9; color: #94a3b8; }

/* ---------- Inline minimum form (compact) ---------- */
.fcst-min-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.fcst-min-form input[type="number"] {
  width: 64px;
  padding: 4px 6px;
  font-family: var(--sd-font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  border: 1px solid var(--sd-slate-300);
  border-radius: 4px;
}
.fcst-min-form input[type="number"]:focus {
  outline: none;
  border-color: var(--sd-brand-navy-600);
  box-shadow: 0 0 0 2px var(--sd-brand-navy-100);
}
.fcst-min-form input[type="submit"] {
  background: var(--sd-brand-navy-700);
  color: #ffffff;
  font-family: var(--sd-font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.fcst-min-form input[type="submit"]:hover { background: var(--sd-brand-navy-800); }

/* ---------- Mobile cards ---------- */
.fcst-mcard {
  background: #ffffff;
  border: 1px solid var(--sd-slate-200);
  border-radius: 6px;
  padding: 12px;
}
.fcst-mcard__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sd-ink);
  margin-bottom: 2px;
}
.fcst-mcard__meta {
  font-family: var(--sd-font-mono);
  font-size: 10.5px;
  color: var(--sd-slate-500);
  letter-spacing: 0.02em;
}
.fcst-mcard__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.fcst-mcard__cell {
  background: var(--sd-slate-050);
  border: 1px solid var(--sd-slate-100);
  border-radius: 4px;
  padding: 6px 8px;
}
.fcst-mcard__cell--span2 { grid-column: span 2; }
.fcst-mcard__lbl {
  font-family: var(--sd-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sd-slate-500);
}
.fcst-mcard__val {
  font-family: var(--sd-font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--sd-ink);
  margin-top: 1px;
}
