/**
 * Kho hàng FIFO — control + hierarchy sync (scoped .inventory-module--kho-sync)
 * Parity with Kho lưu trữ flat tokens (KHO-CONTROLS).
 */

body.use-new-ui.route-inventory .inventory-module--kho-sync {
  --kho-ctrl-radius: 10px;
  --kho-ctrl-h: 40px;
  --kho-ctrl-h-touch: 44px;
  --kho-ctrl-border: #e2e8f0;
  --kho-ctrl-border-accent: rgba(249, 115, 22, 0.34);
  --kho-ctrl-primary: #ea580c;
  --kho-ctrl-primary-hover: #c2410c;
  --kho-ctrl-focus: 0 0 0 2px #fff, 0 0 0 4px rgba(249, 115, 22, 0.38);
}

/* ---- Module tabs ---- */
body.use-new-ui.route-inventory .inventory-module--kho-sync #inventoryTabs.inventory-tabs--mo-pills .btn {
  background: #fff;
  border: 1px solid var(--kho-ctrl-border);
  box-shadow: none;
  font-weight: 700;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync #inventoryTabs.inventory-tabs--mo-pills .btn.primary {
  background: #fff7ed;
  border-color: #f97316;
  color: #9a3412;
  box-shadow: none;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inventory-page .inventory-tabs .btn {
  box-shadow: none;
  transform: none;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inventory-page .inventory-tabs .btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: #fff7ed;
  border-color: var(--kho-ctrl-border-accent);
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inventory-page .inventory-tabs .btn.primary {
  background: #fff7ed;
  border: 1px solid #f97316;
  color: #9a3412;
  font-weight: 800;
}

/* ---- Primary / secondary buttons in module ---- */
body.use-new-ui.route-inventory button#addBatch.btn.primary.kho-sync-cta,
body.use-new-ui.route-inventory button#addProduct.btn.primary.kho-sync-cta,
body.use-new-ui.route-inventory button#reconcileNegativeStock.btn.primary.kho-sync-cta,
body.use-new-ui.route-inventory .btn.primary.kho-sync-cta,
body.use-new-ui.route-inventory .inventory-module--kho-sync .btn.primary,
body.use-new-ui.route-inventory .inventory-module.inventory-module--mo-owner.inventory-module--kho-sync .btn.primary,
body.use-new-ui.route-inventory .inventory-module--kho-sync #addProduct.btn.primary,
body.use-new-ui.route-inventory .inventory-module--kho-sync #addBatch.btn.primary,
body.use-new-ui.route-inventory .inventory-module--kho-sync #reconcileNegativeStock.btn.primary {
  border: none;
  background: var(--kho-ctrl-primary) !important;
  background-image: none !important;
  background-color: var(--kho-ctrl-primary) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
  font-weight: 800;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .btn.primary:hover:not(:disabled) {
  background: var(--kho-ctrl-primary-hover);
  background-image: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .btn:not(.primary):not(.link-like):not(.danger) {
  border: 1px solid var(--kho-ctrl-border);
  background: #fff;
  color: #475569;
  box-shadow: none;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .btn:focus-visible {
  outline: none;
  box-shadow: var(--kho-ctrl-focus);
}

/* ---- Inputs ---- */
body.use-new-ui.route-inventory .inventory-module--kho-sync input.input,
body.use-new-ui.route-inventory .inventory-module--kho-sync input[type="search"],
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-stock-search,
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-product-toolbar input,
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-batch-desk-toolbar input,
body.use-new-ui.route-inventory .inventory-module--kho-sync select {
  border-radius: var(--kho-ctrl-radius);
  border: 1px solid var(--kho-ctrl-border);
  min-height: var(--kho-ctrl-h);
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync input:focus-visible,
body.use-new-ui.route-inventory .inventory-module--kho-sync select:focus-visible {
  outline: none;
  border-color: #f97316;
  box-shadow: var(--kho-ctrl-focus);
}

/* Custom checkboxes (lô desktop + mobile) */
body.use-new-ui.route-inventory .inventory-module--kho-sync label.stock-toggle,
body.use-new-ui.route-inventory .inventory-module--kho-sync label.inv-mo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync label.stock-toggle input,
body.use-new-ui.route-inventory .inventory-module--kho-sync label.inv-mo-toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--kho-ctrl-primary);
  border-radius: 4px;
}

/* ---- Overview mobile hero ---- */
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-hero-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-hero-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--kho-ctrl-border);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-hero-metric--value .inv-mo-hero-v {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  line-height: 1.15;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-hero-v {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-hero-k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-hero-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  padding: 0 2px;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-kpi-strip {
  display: none;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-fifo-line {
  display: none;
}

/* ---- Product scan tools ---- */
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-prod-mo-tool-btn {
  border: 1px solid var(--kho-ctrl-border);
  background: #fff;
  box-shadow: none;
  border-radius: var(--kho-ctrl-radius);
  min-height: var(--kho-ctrl-h-touch);
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-prod-mo-tool-btn--fn.has-active {
  border-color: #f97316;
  background: #fff7ed;
  color: #9a3412;
}

/* ---- Batch KPI strip ---- */
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-batch-kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--kho-ctrl-border);
  background: #f8fafc;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-batch-kpi {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  font-size: 12px;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-batch-kpi em {
  display: block;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-batch-kpi strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-batch-kpi--fifo strong {
  color: #9a3412;
}

/* ---- Movements type chip ---- */
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-movement-type {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-movement-type-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--kho-ctrl-border);
  background: #f8fafc;
  color: #475569;
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-movement-type-pill.profit-good {
  background: #ecfdf5;
  color: #15803d;
  border-color: rgba(16, 185, 129, 0.25);
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-movement-type-pill.profit-low {
  background: #fffbeb;
  color: #b45309;
  border-color: rgba(252, 211, 77, 0.35);
}

body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-movement-type-pill.profit-warn {
  background: #fff7ed;
  color: #ea580c;
  border-color: rgba(249, 115, 22, 0.28);
}

@media (min-width: 901px) {
  body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-batch-desk-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-batch-desk-toolbar .btn.primary {
    min-height: var(--kho-ctrl-h);
  }
}

@media (max-width: 900px) {
  body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-stock-toolbar #addBatch,
  body.use-new-ui.route-inventory .inventory-module--kho-sync .product-center-toolbar #addProduct {
    min-height: var(--kho-ctrl-h-touch);
    border-radius: var(--kho-ctrl-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }
}

/* Beat global button-safety gradient on module CTAs */
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-mo-stock-toolbar #addBatch.btn.primary,
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-batch-desk-toolbar #addBatch.btn.primary,
body.use-new-ui.route-inventory .inventory-module--kho-sync .product-center-toolbar #addProduct.btn.primary,
body.use-new-ui.route-inventory .inventory-module--kho-sync .inv-prod-mo-toolbar #addProduct.btn.primary {
  background: var(--kho-ctrl-primary) !important;
  background-image: none !important;
  background-color: var(--kho-ctrl-primary) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}
