/* ================================
   Lot Manager Table
================================ */
.lotmanager-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.lotmanager-table th, 
.lotmanager-table td {
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  text-align: left;
}
.lotmanager-table th {
  background: #f9fafb;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}
.lotmanager-table tr:hover {
  background: #f3f4f6;
}
.lotmanager-edit {
  background: #2563eb;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, transform 0.1s;
}
.lotmanager-edit:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* ================================
   Pagination
================================ */
#lotmanager-pagination {
  margin-top: 15px;
  text-align: center;
}
.lotmanager-page {
  margin: 0 3px;
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}
.lotmanager-page.active {
  background: #2563eb;
  color: white;
  font-weight: bold;
}
.lotmanager-page:hover {
  background: #f1f5f9;
}

/* ================================
   Modal
================================ */
#lotmanager-modal {
  display: none; /* hidden */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  padding: 20px;
}
/* When shown, use flex to center */
#lotmanager-modal.active {
  display: flex;            /* flex only when active */
  justify-content: center;
  align-items: center;
}
.lotmanager-modal-content {
  background: white;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  position: relative;
  animation: fadeInUp 0.3s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.lotmanager-modal-content h2 {
  margin: 0 0 15px;
  font-size: 20px;
  color: #111827;
  font-weight: 600;
}
.lotmanager-modal-content label {
  display: block;
  margin-top: 12px;
  font-weight: 500;
  font-size: 14px;
  color: #374151;
}
.lotmanager-modal-content input,
.lotmanager-modal-content textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lotmanager-modal-content input:focus,
.lotmanager-modal-content textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
  outline: none;
}

/* Close Button */
.lotmanager-modal .close {
  position: absolute;
  right: 16px;
  top: 14px;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
}
.lotmanager-modal .close:hover {
  color: #111827;
}

/* ================================
   Actions
================================ */
.lotmanager-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.lotmanager-actions button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, transform 0.1s;
}

/* Save Button */
.lotmanager-actions button[type="submit"] {
  background: #2563eb;
  color: white;
  font-weight: 500;
}
.lotmanager-actions button[type="submit"]:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* Cancel Button */
#lotmanager-cancel {
  background: #e5e7eb;
  color: #374151;
  font-weight: 500;
}
#lotmanager-cancel:hover {
  background: #d1d5db;
  transform: translateY(-1px);
}

/* ================================
   Animations
================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ================================
   Mobile-first tweaks
================================ */
@media (max-width: 600px) {
  .lotmanager-modal-content {
    width: 100%;
    margin: 0 10px;
    padding: 20px;
    border-radius: 10px;
  }

  .lotmanager-modal-content h2 {
    font-size: 18px;
  }

  .lotmanager-modal-content input,
  .lotmanager-modal-content textarea {
    font-size: 14px;
    padding: 8px 10px;
  }

  .lotmanager-actions {
    flex-direction: column;
    gap: 10px;
  }

  .lotmanager-actions button {
    width: 100%;
  }
}
/* Lot list pills */
#edit-lot-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

#edit-lot-list li {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    display: flex;
    align-items: center;
}

#edit-lot-list li button {
    background: transparent;
    border: none;
    color: #0369a1;
    font-weight: bold;
    margin-left: 4px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}
#edit-lot-list li button:hover {
    color: #dc2626;
}
@media (max-width: 600px) {
    .lotmanager-table th:nth-child(n+3),
    .lotmanager-table td:nth-child(n+3):not(:nth-child(3)):not(:last-child) {
        display: none;
    }

    .lotmanager-table {
        font-size: 14px;
    }

    #lotmanager-table td,
    #lotmanager-table th {
        padding: 6px;
    }
}
#edit-lot-list li {
    margin-bottom: 5px;
}

#edit-lot-list li button {
    margin-left: 5px;
    font-size: 0.9em;
    color: #c00;
    cursor: pointer;
}
/* ---------- Search ---------- */
#lotmanager-search-container {
    padding: 10px;
    text-align: center;
}
#lotmanager-search {
    width: 95%;
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* ---------- Lot pills ---------- */
.lotmanager-lot-pill {
    display: inline-block;
    margin: 3px 3px 3px 0;
    padding: 5px 8px;
    border-radius: 12px;
    background-color: #f0f0f0;
    font-size: 14px;
}
.lot-number {
    font-weight: bold;
    margin-right: 5px;
}
.lot-qty {
    color: #555;
}

/* ---------- Modal improvements ---------- */
.lotmanager-modal-content {
    width: 90%;
    max-width: 400px;
    padding: 20px;
    border-radius: 12px;
    font-size: 16px;
}
#edit-lot-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}
.lotmanager-lot-pill {
    display: inline-flex;
    align-items: center;
    margin: 2px 4px 2px 0;
    padding: 4px 6px;
    background: #f0f0f0;
    border-radius: 16px;
    font-size: 0.9em;
}

.lotmanager-lot-pill .lot-number {
    font-weight: bold;
    margin-right: 4px;
}

.lotmanager-lot-pill .lot-qty {
    font-size: 0.85em;
    color: #555;
}
