/* Barcode Panel */
.barcode-panel {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 22px;
  align-items: center;
}

.barcode-input-wrap {
  height: 54px;
  background: #ffffff;
  border: 1px solid #d0d5dd;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.barcode-input-wrap input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 15px;
}

.scan-result {
  grid-column: 1 / -1;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #667085;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 700;
}

/* Medicine Table */
.medicine-panel {
  overflow-x: auto;
}

.medicine-panel table {
  width: 100%;
  min-width: 1350px;
  border-collapse: collapse;
}

.medicine-panel th {
  text-align: left;
  font-size: 13px;
  color: #667085;
  padding-bottom: 14px;
}

.medicine-panel td {
  padding: 14px 0;
  border-top: 1px solid #eef2f6;
  font-size: 14px;
  font-weight: 650;
}

.medicine-name {
  font-weight: 900;
}

.barcode-code {
  font-family: Consolas, monospace;
  background: #f2f4f7;
  padding: 6px 10px;
  border-radius: 10px;
}

/* 💰 Profit Styling */
.profit-positive {
  color: #16a34a;
  font-weight: 900;
}

.profit-negative {
  color: #dc2626;
  font-weight: 900;
}

/* Status */
.status-pill {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-ok {
  background: #dcfce7;
  color: #15803d;
}

.status-low {
  background: #fef3c7;
  color: #92400e;
}

.status-expiring {
  background: #fee2e2;
  color: #b91c1c;
}

.status-expired {
  background: #7f1d1d;
  color: white;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.58);
  backdrop-filter: blur(7px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 22px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  background: white;
  border-radius: 28px;
  padding: 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}

.large-modal {
  width: 860px;
}

.xlarge-modal {
  width: min(1200px, 96vw);
}

/* Form */
.form-grid,
.receiving-header,
.bulk-scan-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.bulk-scan-row {
  grid-template-columns: repeat(4, 1fr);
}

.form-grid input,
.form-grid select,
.receiving-header input,
.bulk-scan-row input {
  margin-top: 7px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid #d0d5dd;
  padding: 0 13px;
  font-size: 14px;
  outline: none;
}

.form-grid input:focus,
.form-grid select:focus,
.receiving-header input:focus,
.bulk-scan-row input:focus {
  border-color: #16c79a;
  box-shadow: 0 0 0 4px rgba(22,199,154,0.18);
}

.form-submit {
  width: 100%;
  height: 50px;
}

/* Bulk Table */
.bulk-table-panel {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  padding: 18px;
  border-radius: 22px;
}

.bulk-table-panel table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
}

.bulk-table-panel th {
  text-align: left;
  color: #667085;
  font-size: 13px;
  padding-bottom: 12px;
}

.bulk-table-panel td {
  padding: 14px 0;
  border-top: 1px solid #eef2f6;
}

/* Action buttons */
.action-btn {
  border: none;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  margin-right: 6px;
}

.edit-btn {
  background: #dbeafe;
  color: #1d4ed8;
}

.delete-btn {
  background: #fee2e2;
  color: #b91c1c;
}

/* Summary */
.bulk-summary {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: center;
}

.bulk-summary > div {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 18px;
  padding: 14px;
}

.bulk-summary h3 {
  margin-top: 5px;
}

/* Responsive */
@media (max-width: 1000px) {
  .barcode-panel,
  .form-grid,
  .receiving-header,
  .bulk-summary {
    grid-template-columns: 1fr;
  }

  .bulk-scan-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .bulk-scan-row {
    grid-template-columns: 1fr;
  }
}