/* ==================================================
   EDIT MODAL – Unified Look & Feel
   Matches View / Delete / Warning Modals
================================================== */

/* Modal card already handled globally — enhance form area only */
#editStockModal .modal-body,
#purchaseItemModal .modal-body {
  background: var(--panel);
}

/* Grid spacing */
#editStockModal .form-grid,
#purchaseItemModal .form-grid {
  display: grid;
  gap: 1rem;
}

/* Field wrapper */
#editStockModal .form-field,
#purchaseItemModal .form-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

/* Labels */
#editStockModal label,
#purchaseItemModal label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Inputs (match products + stock UI) */
#editStockModal input,
#purchaseItemModal input {
  width: 100%;
  padding: .7rem .85rem;

  border-radius: 12px;
  border: 1px solid var(--line);

  background: var(--panel2);
  color: var(--text);

  font-size: .92rem;
  font-weight: 500;

  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease;
}

/* Placeholder */
#editStockModal input::placeholder,
#purchaseItemModal input::placeholder {
  color: rgba(255,255,255,.45);
}

/* Focus state (same as other modals) */
#editStockModal input:focus,
#purchaseItemModal input:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

/* Readonly field (Current Stock) */
#purchaseItemModal input[readonly] {
  opacity: .75;
  cursor: not-allowed;
  background: rgba(255,255,255,.05);
}

/* Full-width field */
#editStockModal .form-field.full,
#purchaseItemModal .form-field.full {
  grid-column: 1 / -1;
}

/* Modal footer buttons – visual hierarchy */
#editStockModal .modal-foot,
#purchaseItemModal .modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
}

/* Primary save button emphasis */
#editStockModal .btn.primary,
#purchaseItemModal .btn.primary,
#purchaseItemModal .btn:not(.ghost) {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
}

/* Hover polish */
#editStockModal .btn.primary:hover,
#purchaseItemModal .btn.primary:hover {
  filter: brightness(1.05);
}

/* ==================================================
   MOBILE REFINEMENT
================================================== */
@media (max-width: 480px) {

  #editStockModal input,
  #purchaseItemModal input {
    padding: .75rem .9rem;
    font-size: .95rem;
  }

  #editStockModal label,
  #purchaseItemModal label {
    font-size: .72rem;
  }
}

/* ==================================================
   EDIT MODAL – SAVE BUTTON COLOR FIX
================================================== */

/* ==================================================
   SAVE BUTTON – SAME STYLE AS DELETE MODAL
   (Green Confirm Action)
================================================== */

/* Save button styled like delete, but positive */
#editStockModal .btn.primary,
#purchaseItemModal .btn.primary {
  background: var(--accent2);   /* GREEN background */
  color: #ffffff;               /* white text like delete */
  border: none;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 10px 25px rgba(108, 255, 82, .25);
}

/* Icon inherits same color */
#editStockModal .btn.primary i,
#purchaseItemModal .btn.primary i {
  color: #ffffff;
}

/* Hover – same energy as delete */
#editStockModal .btn.primary:hover,
#purchaseItemModal .btn.primary:hover {
  background: #57e94a; /* slightly deeper green */
  box-shadow: 0 12px 28px rgba(108, 255, 82, .35);
  transform: translateY(-1px);
}

/* Active / pressed */
#editStockModal .btn.primary:active,
#purchaseItemModal .btn.primary:active {
  transform: scale(.97);
  box-shadow: 0 6px 18px rgba(108, 255, 82, .35);
}
/* ==================================================
   EDIT MODAL – SAVE BUTTON VISIBILITY FIX
   Same strength as DELETE button
================================================== */

/* Force correct contrast for Save button */
#editStockModal .modal-foot .btn.primary,
#purchaseItemModal .modal-foot .btn.primary {
  background: var(--accent2) !important; /* green */
  color: #ffffff !important;             /* visible text */
  border: none;
  font-weight: 700;
  letter-spacing: .25px;
  box-shadow: 0 10px 25px rgba(108, 255, 82, .3);
}

/* Icon must also be white */
#editStockModal .modal-foot .btn.primary i,
#purchaseItemModal .modal-foot .btn.primary i {
  color: #ffffff !important;
}

/* Hover — same energy as delete modal */
#editStockModal .modal-foot .btn.primary:hover,
#purchaseItemModal .modal-foot .btn.primary:hover {
  background: #4fe043 !important;
  box-shadow: 0 12px 28px rgba(108, 255, 82, .45);
  transform: translateY(-1px);
}

/* Active / pressed */
#editStockModal .modal-foot .btn.primary:active,
#purchaseItemModal .modal-foot .btn.primary:active {
  transform: scale(.97);
  box-shadow: 0 6px 18px rgba(108, 255, 82, .35);
}

