/* XENTRA OWNER DASHBOARD — STOCK & INVENTORY MODULE CSS */
/* ==========================================================================
   OWNER STOCK OVERVIEW — read-only inventory health surface
   ========================================================================== */
.x-owner-stock-view {
  padding: 0 0 44px;
}
.x-owner-stock-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
/* Header Stok memakai blok header child page yang sama dengan halaman Bisnis lain. */
.x-owner-stock-header .x-owner-child-mobile-header {
  margin-bottom: 0;
}
.x-owner-stock-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.x-owner-stock-scope {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #e4e8ed;
  border-radius: 11px;
  background: #fff;
  color: #47515d;
  font-size: 12px;
  font-weight: 700;
}
.x-owner-stock-refresh {
  min-height: 38px;
}
.x-owner-stock-refresh:disabled {
  opacity: .6;
  cursor: wait;
}
.x-owner-stock-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.x-owner-stock-kpi {
  min-height: 88px;
  padding: 15px;
  border: 1px solid #e6eaf0;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 11px;
  box-sizing: border-box;
}
.x-owner-stock-kpi-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  overflow: hidden;
  background: #f5f7f9;
}
.x-owner-stock-kpi-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}
.x-owner-stock-kpi-icon.warning { background: #fff8e8; }
.x-owner-stock-kpi-icon.danger { background: #fff2f2; }
.x-owner-stock-kpi-icon.units { background: #edf9f3; }
.x-owner-stock-kpi-label {
  display: block;
  margin-bottom: 3px;
  color: #7a838f;
  font-size: 11.5px;
  font-weight: 700;
}
.x-owner-stock-kpi strong {
  color: #1d2731;
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
}
.x-owner-stock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 14px;
  margin-bottom: 14px;
}
.x-owner-stock-panel {
  border: 1px solid #e5e9ee;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.x-owner-stock-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 13px;
}
.x-owner-stock-panel-head h3 {
  margin: 0;
  color: #202831;
  font-size: 15px;
  font-weight: 800;
}
.x-owner-stock-panel-head p {
  margin: 3px 0 0;
  color: #7b8590;
  font-size: 11.5px;
  line-height: 1.35;
}
.x-owner-stock-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 32px;
  padding: 4px 2px 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #198b3a;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.x-owner-stock-link:hover { background: #f2f8f3; }
.x-owner-stock-alerts,
.x-owner-stock-branches,
.x-owner-stock-movements {
  padding: 0 18px 14px;
}
.x-owner-stock-alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border-top: 1px solid #f0f2f5;
}
.x-owner-stock-alert-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.x-owner-stock-alert-main strong {
  color: #27313b;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-owner-stock-alert-main small {
  margin-top: 2px;
  color: #8a939e;
  font-size: 10.5px;
}
.x-owner-stock-alert-status {
  align-self: flex-start;
  margin-bottom: 3px;
  color: #b06b00;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.x-owner-stock-alert-row.is-out .x-owner-stock-alert-status { color: #c63d3d; }
.x-owner-stock-alert-number {
  min-width: 52px;
  text-align: right;
}
.x-owner-stock-alert-number strong {
  display: block;
  color: #27313b;
  font-size: 15px;
  font-weight: 800;
}
.x-owner-stock-alert-number small {
  color: #919aa4;
  font-size: 9.5px;
}
.x-owner-stock-alert-arrow {
  color: #a3acb5;
  font-size: 22px;
  line-height: 1;
}
.x-owner-stock-more {
  width: 100%;
  margin-top: 8px;
  min-height: 40px;
  border: 1px solid #e4e8ed;
  border-radius: 11px;
  background: #fff;
  color: #56616d;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
}
.x-owner-stock-more:hover { background: #f8fafb; }
.x-owner-stock-branch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  border-top: 1px solid #f0f2f5;
}
.x-owner-stock-branch-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.x-owner-stock-branch-copy strong {
  color: #27313b;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-owner-stock-branch-copy span {
  margin-top: 2px;
  color: #89929c;
  font-size: 10.5px;
}
.x-owner-stock-branch-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.x-owner-stock-branch-meta small {
  color: #89929c;
  font-size: 9.5px;
}
.x-owner-stock-branch-badge {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
}
.x-owner-stock-branch-badge.good { background: #eaf8ef; color: #23824b; }
.x-owner-stock-branch-badge.warning { background: #fff6df; color: #ae7004; }
.x-owner-stock-branch-badge.danger { background: #fff0f0; color: #c54141; }
.x-owner-stock-movement-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border-top: 1px solid #f0f2f5;
}
.x-owner-stock-movement-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}
.x-owner-stock-movement-icon.in { background: #ebf8f1; color: #22804b; }
.x-owner-stock-movement-icon.out { background: #fff1f1; color: #c54242; }
.x-owner-stock-movement-icon.adjust { background: #f3f5f7; color: #65707c; }
.x-owner-stock-movement-copy {
  display: flex;
  flex-direction: column;
}
.x-owner-stock-movement-copy strong {
  color: #303943;
  font-size: 12.5px;
  font-weight: 750;
}
.x-owner-stock-movement-copy span {
  margin-top: 2px;
  color: #8c959f;
  font-size: 10.5px;
}
.x-owner-stock-movement-value {
  font-size: 12.5px;
  font-weight: 800;
}
.x-owner-stock-movement-value.in { color: #20814a; }
.x-owner-stock-movement-value.out { color: #c54242; }
.x-owner-stock-movement-value.adjust { color: #65707c; }
.x-owner-stock-empty,
.x-owner-stock-empty-compact,
.x-owner-stock-error,
.x-owner-stock-loading {
  color: #87919b;
  font-size: 11.5px;
}
.x-owner-stock-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 96px;
}
.x-owner-stock-empty-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eaf8ef;
  color: #24854d;
  font-weight: 900;
}
.x-owner-stock-empty p { margin: 2px 0 0; color: #98a0a9; font-size: 10.5px; }
.x-owner-stock-empty-compact,
.x-owner-stock-loading,
.x-owner-stock-error { padding: 20px 0; }
.x-owner-stock-error { color: #b73c3c; }
.x-owner-stock-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #f6f8fa;
  color: #717b86;
  font-size: 10.5px;
  line-height: 1.45;
}
.x-owner-stock-note svg { flex: 0 0 auto; margin-top: 1px; }

/* Owner Stock Items (Panel 4) Styling */
.x-owner-stock-panel-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.x-owner-stock-search {
  font-size: 12.5px;
  padding: 7px 12px;
  width: 220px;
  border-radius: 9px;
  border: 1px solid #dce2e8;
  background: #fff;
}
.x-owner-stock-filter-select {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid #dce2e8;
  background: #fff;
}
.x-owner-stock-items-wrap {
  padding: 0 18px 16px;
}
.x-owner-stock-items-mobile-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.x-owner-stock-items-desktop-table {
  display: block;
  overflow-x: auto;
}
.x-owner-stock-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.x-owner-stock-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.x-owner-stock-table thead th {
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 750;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.x-owner-stock-table-tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s ease;
}
.x-owner-stock-table-tr:hover {
  background: #fcfdfe;
}
.x-owner-stock-table-td {
  padding: 11px 12px;
  font-size: 12.5px;
  color: #334155;
  vertical-align: middle;
}
.x-owner-stock-table-td.main-col {
  font-size: 13px;
}
.x-owner-stock-td-title {
  font-weight: 750;
  color: #0f172a;
}
.x-owner-stock-td-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}
.x-owner-stock-table-td.text-center { text-align: center; }
.x-owner-stock-table-td.text-right { text-align: right; }
.x-owner-stock-table-td strong.text-danger,
.x-owner-stock-item-card-cur.text-danger strong { color: #dc2626; }
.x-owner-stock-table-td strong.text-warning,
.x-owner-stock-item-card-cur.text-warning strong { color: #b45309; }

/* Mobile Card Styling */
.x-owner-stock-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.x-owner-stock-item-card.is-out {
  border-color: #fecaca;
  background: #fffafa;
}
.x-owner-stock-item-card-main {
  min-width: 0;
  flex: 1 1 auto;
}
.x-owner-stock-item-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.x-owner-stock-item-card-branch {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-owner-stock-item-card-title {
  display: block;
  font-size: 13.5px;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}
.x-owner-stock-item-card-sub {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}
.x-owner-stock-item-sku {
  font-family: inherit;
  color: #475569;
}
.x-owner-stock-item-card-stock {
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.x-owner-stock-item-card-cur strong {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}
.x-owner-stock-item-card-cur small {
  font-size: 11px;
  color: #64748b;
}
.x-owner-stock-item-card-min {
  font-size: 10.5px;
  color: #8a939e;
}

@media (max-width: 768px) {
  .x-owner-stock-view {
    padding: 4px 0 28px;
  }
  .x-owner-stock-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
  }
  .x-owner-stock-header .x-owner-mobile-page-sub {
    max-width: 290px;
  }
  .x-owner-stock-header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .x-owner-stock-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }
  .x-owner-stock-kpi {
    min-height: 78px;
    padding: 12px;
    border-radius: 15px;
  }
  .x-owner-stock-kpi-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 11px;
  }
  .x-owner-stock-kpi-icon svg { width: 29px; height: 29px; }
  .x-owner-stock-kpi-label { font-size: 10px; }
  .x-owner-stock-kpi strong { font-size: 18px; }
  .x-owner-stock-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .x-owner-stock-panel { border-radius: 16px; }
  .x-owner-stock-panel-head { padding: 14px 14px 10px; }
  .x-owner-stock-panel-head h3 { font-size: 14px; }
  .x-owner-stock-panel-head p { font-size: 10.5px; }
  .x-owner-stock-alerts,
  .x-owner-stock-branches,
  .x-owner-stock-movements { padding: 0 14px 12px; }
  .x-owner-stock-alert-row { min-height: 56px; }
  .x-owner-stock-alert-main strong { font-size: 12px; }
  .x-owner-stock-alert-main small { font-size: 9.5px; }
  .x-owner-stock-branch-copy strong { font-size: 12px; }
  .x-owner-stock-branch-copy span { font-size: 9.5px; }
  .x-owner-stock-movement-copy strong { font-size: 11.5px; }
  .x-owner-stock-movement-copy span { font-size: 9.5px; }
  .x-owner-stock-note { font-size: 10px; }

  /* Mobile panel head & stock items responsiveness */
  .x-owner-stock-panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .x-owner-stock-panel-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .x-owner-stock-search {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 9px 12px;
  }
  .x-owner-stock-filter-select {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 9px 10px;
  }
  .x-owner-stock-items-wrap {
    padding: 0 14px 16px;
  }
  .x-owner-stock-items-desktop-table {
    display: none;
  }
  .x-owner-stock-items-mobile-list {
    display: flex;
  }

  /* Subtab header & CTA responsiveness on mobile */
  .x-stock-subtab-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .x-stock-subtab-cta {
    width: 100% !important;
    min-height: 44px !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
}

/* Base styles for subtab headers & CTAs */
.x-stock-subtab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.x-stock-subtab-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  background: #0F172A;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.x-stock-subtab-cta:hover {
  background: #1E293B;
}

/* ==========================================================================
   RECIPE FORMULA EDITOR PAGE (BOM)
   ========================================================================== */
#recipe-editor-view {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 0 5px 0;
}

#recipe-editor-view .x-product-editor-main-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.x-recipe-ingredient-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 10px 14px;
  border-radius: 12px;
  box-sizing: border-box;
}

.x-recipe-ing-top {
  display: flex;
  flex: 2;
  gap: 10px;
  align-items: center;
}

.x-recipe-ing-top .recipe-ing-material {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.x-recipe-ing-bottom {
  display: flex;
  flex: 2;
  gap: 10px;
  align-items: center;
}

.x-recipe-ing-bottom .recipe-ing-qty {
  flex: 1.2;
  font-size: 13px;
}

.x-recipe-ing-bottom .recipe-ing-uom {
  flex: 1;
  font-size: 13px;
}

.x-recipe-ing-del-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid #FEE2E2;
  background: #FEF2F2;
  color: #EF4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.x-recipe-ing-del-btn:hover {
  background: #FEE2E2;
  color: #DC2626;
}

@media (max-width: 640px) {
  #recipe-editor-view {
    padding: 0 0 5px 0 !important;
  }
  #recipe-editor-view .x-product-editor-main-card {
    padding: 16px !important;
    border-radius: 14px !important;
  }
  .x-recipe-ingredient-row {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  .x-recipe-ing-top {
    width: 100%;
    flex: none;
    gap: 8px;
  }
  .x-recipe-ing-bottom {
    width: 100%;
    flex: none;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 8px;
  }
}

/* =========================================================================
   MODERN MATERIAL CARDS & FORM STYLING (bahan baku.png)
   ========================================================================= */
.x-material-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.x-material-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.x-material-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #EFF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #2563EB;
}
.x-material-card-body {
  flex: 1;
  min-width: 0;
}
.x-material-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-material-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748B;
}
.x-material-card-code {
  color: #64748B;
}
.x-material-card-uom {
  background: #F1F5F9;
  color: #475569;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 11.5px;
}
.x-material-card-toggle {
  flex-shrink: 0;
}

.x-filter-pill {
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s ease;
}
.x-filter-pill.active {
  background: #DCFCE7;
  color: #15803D;
  border-color: #86EFAC;
  font-weight: 700;
}

/* =========================================================================
   RECIPE GOAL CARDS & SIMPAN BUTTON (resep produksi.png)
   ========================================================================= */
.x-recipe-goal-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-bottom: 10px;
  transition: all 0.15s ease;
}
.x-recipe-goal-card.active {
  background: #FFFFFF;
  border-color: #CBD5E1;
}

.x-recipe-ing-fields {
  display: flex;
  flex: 1;
  gap: 10px;
  align-items: center;
}
.x-recipe-ing-fields .recipe-ing-material {
  flex: 2;
  min-width: 0;
}
.x-recipe-ing-fields .recipe-ing-qty {
  flex: 1;
  min-width: 70px;
}
.x-recipe-ing-fields .recipe-ing-uom {
  flex: 1.2;
  min-width: 90px;
}
@media (max-width: 640px) {
  .x-recipe-ingredient-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .x-recipe-ing-top-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .x-recipe-ing-fields {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
}


