@import url("./infoboard.css");
@import url("./responsive.css");

.inventory {
  flex: 1;
  padding: 34px;
  overflow-y: auto;
}

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 34px;
}

.inventory-header h1 {
  font-size: 34px;
  margin-bottom: 8px;
}

.inventory-header p {
  color: #6b7280;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-bottom: 34px;
  max-height: 604px;
  overflow-y: scroll;
}

.product-card {
  background: white;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  text-align: center;
  border-top: 5px solid #2563eb;
  transition: 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card.warning {
  border-top-color: #f59e0b;
}

.product-card.danger {
  border-top-color: #dc2626;
}

.product-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 18px;
  background: #f1f5f9;
  font-size: 34px;
}

.product-card h3 {
  font-size: 17px;
  margin-bottom: 14px;
  color: #0f172a;
}

.stock-number {
  font-size: 42px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.stock-label {
  display: block;
  margin-top: 8px;
  margin-bottom: 18px;
  color: #64748b;
  font-size: 14px;
}

.stock-actions {
  display: grid;
  grid-template-columns: repeat(2, 2fr);
  gap: 24px;
}

.custom-product-label {
  display: inline-block;

  margin-top: 8px;

  padding: 6px 10px;

  border-radius: 999px;

  background: #fef3c7;
  color: #92400e;

  font-size: 12px;
  font-weight: 800;
}

/* =========================================================
   BUCHUNGSVERLAUF
========================================================= */

.history-btn {
  padding: 12px 16px;
  margin-top: 24px;

  border-radius: 12px;

  background: #2563eb;
  color: white;

  font-weight: 800;
}

.history-btn:hover {
  background: #1d4ed8;
}

/* MODAL */

#history-modal {
  position: fixed;
  inset: 0;

  display: none;

  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(15, 23, 42, 0.55);

  z-index: 9999;
}

#history-modal.show {
  display: flex;
}

.history-modal-content {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;

  overflow-y: auto;

  background: white;

  padding: 26px;

  border-radius: 20px;

  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

/* HEADER */

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 24px;
  color: #0f172a;
}

/* CLOSE */

#close-history-modal {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  background: #f1f5f9;
  color: #0f172a;

  font-size: 26px;
  font-weight: 900;
}

#close-history-modal:hover {
  background: #e2e8f0;
}

/* HISTORY LIST */

.booking-history-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ITEM */

.booking-item {
  display: grid;
  grid-template-columns: 1fr auto;

  gap: 18px;

  padding: 18px;

  border-radius: 16px;

  background: #f8fafc;

  border-left: 5px solid #2563eb;
}

.booking-item.in {
  border-left-color: #22c55e;
}

.booking-item.out {
  border-left-color: #ef4444;
}

/* INFO */

.booking-info h3 {
  color: #0f172a;
  margin-bottom: 8px;
}

.booking-info p,
.booking-info span {
  display: block;

  color: #64748b;

  font-size: 14px;

  margin-bottom: 4px;
}

/* BADGE */

.booking-badge {
  height: fit-content;

  padding: 8px 12px;

  border-radius: 999px;

  color: white;

  font-size: 13px;
  font-weight: 800;
}

.booking-badge.in {
  background: #22c55e;
}

.booking-badge.out {
  background: #ef4444;
}

/* MOBILE */

@media (max-width: 700px) {
  .booking-item {
    grid-template-columns: 1fr;
  }

  .history-modal-content {
    padding: 20px;
  }
}

@media (max-width: 1200px) {
  .stock-actions {
    grid-template-columns: 1fr;
  }
}

.ordered-status {
  background: #fef3c7;
  color: #92400e;
}

.delivery-actions button {
  padding: 12px 16px;
  border-radius: 10px;
  background: #22c55e;
  color: white;
  font-weight: 800;
}

.delivery-actions button:hover {
  background: #16a34a;
}

.product-card button {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: #2563eb;
  color: white;
  font-weight: 800;
}

.product-card button:hover {
  background: #1d4ed8;
}

.warning button {
  background: #f59e0b;
}

.warning button:hover {
  background: #d97706;
}

.danger button {
  background: #dc2626;
}

.danger button:hover {
  background: #b91c1c;
}

.order-panel {
  background: white;
  padding: 26px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.order-panel h2 {
  font-size: 22px;
  margin-bottom: 22px;
}

.order-form {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
}

.order-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.order-form select,
.order-form input,
.order-form textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #f8fafc;
  color: #1f2937;
  font: inherit;
}

.order-form textarea {
  grid-column: 1 / -1;
  min-height: 100px;
  resize: vertical;
}

.order-form button {
  grid-column: 1 / -1;
  justify-self: flex-end;
  padding: 14px 22px;
  border-radius: 12px;
  background: #2563eb;
  color: white;
  font-weight: 800;
}

.order-form button:hover {
  background: #1d4ed8;
}

.order-form select:focus,
.order-form input:focus,
.order-form textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: white;
}

.delivery-panel {
  background: white;
  padding: 26px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin-top: 24px;
}

.delivery-panel h2 {
  font-size: 22px;
  margin-bottom: 22px;
}

.delivery-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 18px;

  padding: 18px;
  margin-bottom: 14px;

  background: #f8fafc;
  border-left: 4px solid #2563eb;
  border-radius: 14px;
}

.delivery-icon {
  width: 56px;
  height: 56px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 16px;
  background: #eef2f7;
  font-size: 30px;
}

.delivery-info h3 {
  color: #0f172a;
  margin-bottom: 6px;
}

.delivery-info p {
  color: #334155;
  font-weight: 700;
  margin-bottom: 4px;
}

.delivery-info span {
  color: #64748b;
  font-size: 14px;
}

.delivery-status {
  padding: 8px 13px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .delivery-item {
    grid-template-columns: 56px 1fr;
  }

  .delivery-status {
    grid-column: 2;
    width: fit-content;
  }
}

@media (max-width: 700px) {
  .delivery-item {
    grid-template-columns: 1fr;
  }

  .delivery-status {
    grid-column: auto;
    width: fit-content;
  }
}

@media (max-width: 1100px) {
  .inventory-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .inventory {
    padding: 22px;
  }

  .inventory-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .order-form button {
    width: 100%;
  }
}
