/* ================= RESET ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  background: #f4f6f9;
  color: #0f172a;
}

/* ================= HEADER ================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.back-btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
}

.logout-btn {
  padding: 10px 18px;
  border-radius: 10px;
  background: #0f172a;
  color: white;
  border: none;
  cursor: pointer;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}

/* ================= MAIN CARD ================= */
.main-content {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
}

.card {
  background: hwb(168 76% 4% / 0.927);
  border-radius: 10px;
  padding: 13px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.card h2 {
  font-size: 26px;
  margin-bottom: 24px;
}

/* ================= FORM GRID ================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  grid-column: span 3;
}

.input-wrapper label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.input-wrapper input,
.input-wrapper select,
textarea {
  padding: 20px 14px;
  font-size: 14px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  outline: none;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
textarea:focus {
  border-color: #2563eb;
}

/* ================= GRID WIDTH CONTROL ================= */
.input-wrapper:nth-child(1),
.input-wrapper:nth-child(2) {
  grid-column: span 6;
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  margin-top: 12px;
}

/* ================= FILE UPLOAD ================= */
.file-row {
  margin-top: 18px;
}

/* ================= SECTION HEADINGS ================= */
h3 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-size: 20px;
  color: #1e293b;
}

/* ================= BILLING ================= */
.billing-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.billing-row .input-wrapper {
  grid-column: span 2;
}

/* ================= SERVICES ================= */
#servicesContainer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.service-row .input-wrapper {
  grid-column: span 2;
}

.service-name-wrapper {
  grid-column: span 4;
}

.remove-service-btn {
  align-self: flex-end;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

/* ================= BUTTONS ================= */
.add-service-btn,
.calculate-btn {
  margin-top: 14px;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.add-service-btn {
  background: #2563eb;
  color: white;
}

.calculate-btn {
  background: #16a34a;
  color: white;
}

/* ================= TOTALS ================= */
.totals-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  background: #f1f5f9;
  padding: 16px;
  border-radius: 12px;
}

.total-item {
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

.total-item.highlight {
  background: #dcfce7;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
}

/* ================= ACTION BUTTONS ================= */
.btn-row {
  display: flex;
  gap: 16px;
  margin-top: 28px;
}

.btn-primary {
  background: #1e4fa1;
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
}

.btn-secondary {
  background: white;
  border: 2px solid #cbcce1;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
}
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
.main-content {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
  width: 100%;
}
.totals-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  background: #f1f5f9;
  padding: 16px;
  border-radius: 12px;
}
.totals-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  background: #f1f5f9;
  padding: 16px;
  border-radius: 12px;
}
.card {
  overflow: visible;
}

h2, h3 {
  color: #1f3c88;
}

input, select, textarea {
  border: 1px solid #cfd8dc;
  padding: 10px;
  border-radius: 6px;
}

input:focus, select:focus, textarea:focus {
  border-color: #1f3c88;
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 60, 136, 0.1);
}

button {
  background-color: #1f3c88;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background-color: #163172;
}
/* FIX: Show + button next to Select Doctor */

/* Doctor field alignment fix */

.doctor-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Doctor field alignment fix */
.input-wrapper.doctor-wrapper {
  display: block;
}

.doctor-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doctor-field select {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #cfd8dc;
  outline: none;
}

.doctor-field select:focus {
  border-color: #1f3c88;
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 60, 136, 0.1);
}

/* Small aligned + button */
.add-doctor-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #16a34a;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  padding: 0;
}

.add-doctor-btn:hover {
  background: #15803d;
}
.card {
  background: #c8f0e5;  /* More card-like light green color */
  border-radius: 12px;
  padding: 32px;  /* Increased from 13px */
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  overflow: visible;
}

/* Add some spacing for the form sections */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;  /* Increased gap */
  margin-bottom: 20px;
}

/* Better spacing for the "Add Custom Test" section */
.custom-test-section {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

/* Add margin to headings */
h2 {
  margin-bottom: 28px;
}

h3 {
  margin-top: 32px;
  margin-bottom: 20px;
}
.card {
  background: #c8f0e5;  /* Light green card color */
  border-radius: 12px;
  padding: 24px;  /* Reduced padding */
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  overflow: visible;
}

.main-content {
  max-width: 1400px;  /* Increased max-width */
  margin: 32px auto;
  padding: 0 20px;
  width: 100%;
}

/* Custom test section should fit inside */
.custom-test-section {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.form-grid-2col textarea {
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.form-grid-2col textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 768px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
  }
}
/* ===== FIX BILLING SECTION OVERLAP ===== */
/* Add this at the end of your new_patient.css file */

/* Billing Section Heading */
.card h3 {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  border-left: 4px solid #10b981 !important;
  color: #064e3b !important;
  font-weight: 700 !important;
  padding: 12px 16px !important;
  margin-bottom: 0 !important;
  border-radius: 8px 8px 0 0 !important;
}

/* Billing Grid Container - Fix Overlap */
.card h3 + .form-grid {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  padding: 25px !important;
  border-radius: 0 0 10px 10px !important;
  border: 2px solid #10b981 !important;
  border-top: none !important;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 15px !important;
  align-items: end !important;
}

/* Billing Second Row */
.card h3 + .form-grid + .form-grid {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  padding: 25px !important;
  border-radius: 10px !important;
  border: 2px solid #10b981 !important;
  margin-bottom: 20px !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 15px !important;
  align-items: end !important;
}

/* Individual Fields - Proper Spacing */
.card h3 + .form-grid > div,
.card h3 + .form-grid + .form-grid > div {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
}

/* Labels in Billing Section */
.card h3 + .form-grid label,
.card h3 + .form-grid + .form-grid label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #064e3b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 6px !important;
  white-space: nowrap !important;
}

/* Input Fields in Billing */
.card h3 + .form-grid input,
.card h3 + .form-grid select,
.card h3 + .form-grid + .form-grid input,
.card h3 + .form-grid + .form-grid select {
  width: 100% !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  border-radius: 6px !important;
  border: 2px solid #10b981 !important;
  background: #ffffff !important;
}

/* Specific Field Colors */
#billNumber {
  background: #f9fafb !important;
  border: 2px solid #d1d5db !important;
  color: #6b7280 !important;
  font-weight: 600 !important;
}

#discountAmount {
  background: #fef3c7 !important;
  color: #92400e !important;
  font-weight: 700 !important;
  border: 2px solid #fbbf24 !important;
}

#finalAmount {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 18px !important;
  border: 2px solid #059669 !important;
}

#dueAmount {
  background: #fef3c7 !important;
  color: #dc2626 !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  border: 2px solid #f59e0b !important;
}

#paidAmount {
  background: #ffffff !important;
  border: 2px solid #10b981 !important;
}

#paymentType {
  background: #ffffff !important;
  border: 2px solid #10b981 !important;
}

/* Payment Status Box */
.card h3 + .form-grid + .form-grid + div {
  padding: 14px !important;
  background: #e0f2fe !important;
  border-radius: 8px !important;
  margin-top: 15px !important;
  border: 2px solid #0284c7 !important;
  text-align: center !important;
}

/* Responsive - Stack on Mobile */
@media (max-width: 1200px) {
  .card h3 + .form-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .card h3 + .form-grid,
  .card h3 + .form-grid + .form-grid {
    grid-template-columns: 1fr !important;
  }
}
/* ================= FORM GRID ================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns layout */
  gap: 16px;
  margin-bottom: 20px;
}

.form-grid input,
.form-grid select {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  outline: none;
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: #2563eb;
}

/* Remove the grid-column spans from inline styles */