/* ══════ PAGE WRAPPER ══════ */
.calc-page-wrapper {
  padding: 24px 16px 60px;
  background: #f0f2f5;
  min-height: 100vh;
}

/* ══════ HEADING CARD ══════ */
.calc-header-card {
  background: #fff;
  border-top: 3px solid;
  border-image: linear-gradient(to right, #1A237E, #D40511) 1;
  border-radius: 10px;
  text-align: center;
  padding: 24px 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.calc-main-title {
  font-size: 26px;
  font-weight: 700;
  color: #1A237E;
  margin: 0 0 6px;
}
.calc-main-title i {
  color: #D40511;
  margin-right: 8px;
}
.calc-subtitle {
  font-size: 14px;
  color: #6b7785;
  margin: 0;
}



/* ══════ CALCULATOR TABLE ══════ */
.dashboard-grid { display: grid; }
.calc-table-wrapper {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow-x: auto;
  margin-bottom: 16px;
}
.rate-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #e8ecf0;
}
.rate-row:last-child { border-bottom: none; }

/* Header row — matches screenshot: light blue-gray bg, navy bold uppercase text */
.rate-row-header {
  background: #EEF0F8;
  font-size: 10.5px;
  font-weight: 700;
  color: #1A237E;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  min-height: 60px;
  border-radius: 8px 8px 0 0;
}
.rate-cell-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px 6px;
  border-right: 1px solid #dde3ed;
  line-height: 1.3;
}
.rate-cell-header:last-child { border-right: none; }
.rate-cell-header small {
  font-size: 9.5px;
  font-weight: 500;
  color: #5c6bc0;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* DIMENSIONS header spans all 3 sub-columns */
.dim-header {
  flex-direction: column;
  gap: 4px;
}
.dim-sub-headers {
  display: flex;
  gap: 0;
  font-size: 9px;
  color: #5c6bc0;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.dim-sub-headers span {
  text-align: center;
  padding: 0 4px;
  border-right: 1px solid #dde3ed;
}
.dim-sub-headers span:last-child { border-right: none; }

/* Input row cells */
.rate-row-input { background: #fff; min-height: 64px; }
.rate-row-input:hover { background: #fafbff; }
.rate-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 5px;
  border-right: 1px solid #eef1f5;
  min-width: 80px;
}
.rate-cell:last-child { border-right: none; }
.rate-cell input,
.rate-cell textarea,
.rate-cell select {
  width: 100%;
  padding: 7px 8px;
  border: 1.5px solid #e0e4ea;
  border-radius: 6px;
  font-size: 12.5px;
  background: #fff;
  color: #1d1f23;
  outline: none;
  transition: border 0.2s;
  resize: none;
}
.rate-cell input:focus,
.rate-cell textarea:focus { border-color: #1A237E; }
.rate-cell input[readonly] {
  background: #f5f7fa;
  color: #D40511;
  font-weight: 600;
  cursor: default;
}
.rate-cell textarea { min-height: 52px; font-size: 12px; }

/* Last cell — wider to fit total + controls */
.cell-actions {
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
}

/* Total charges input */
.row-total {
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid #e0e4ea;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #D40511;          /* red text — matches screenshot */
  background: #fff5f5;
  cursor: default;
  text-align: right;
}

/* Action controls row */
.row-action-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

/* Auto fill label */
.autofill-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #444;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.autofill-label input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: #1A237E;
  cursor: pointer;
  margin: 0;
}

/* Shared action button base */
.action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

/* ADD button — green border + icon, white bg */
.btn-add {
  border: 1.5px solid #2e7d32;
  color: #2e7d32;
  background: #fff;
}
.btn-add:hover {
  background: #2e7d32;
  color: #fff;
  transform: scale(1.1);
}

/* RESET button — gray border + icon, white bg */
.btn-reset-row {
  border: 1.5px solid #6c757d;
  color: #6c757d;
  background: #fff;
}
.btn-reset-row:hover {
  background: #6c757d;
  color: #fff;
  transform: scale(1.1);
}

/* DELETE button — red border + icon, white bg */
.btn-delete {
  border: 1.5px solid #e74c3c;
  color: #e74c3c;
  background: #fff;
}
.btn-delete:hover {
  background: #e74c3c;
  color: #fff;
  transform: scale(1.1);
}

/* ══════ NOTE LINE ══════ */
.calc-note {
  padding: 14px 20px;
  font-size: 13px;
  color: #555;
  background: #f9f9f9;
  border-top: 1px solid #eee;
  border-radius: 0 0 10px 10px;
}
.note-highlight { color: #1A237E; font-weight: 600; }

/* ══════ MAIL WRAPPER ══════ */
.mail-wrapper {
  background: #fff;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mail-icon { font-size: 42px; color: #1A237E; margin-bottom: 14px; }
.mail-wrapper h3 { font-size: 20px; font-weight: 700; color: #1A237E; margin-bottom: 8px; }
.mail-wrapper p  { color: #555; font-size: 14px; max-width: 440px; margin: 0 auto 20px; line-height: 1.7; }
.btn-mail {
  background: #1A237E; color: #fff; border: none;
  padding: 12px 32px; border-radius: 8px; font-size: 15px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-mail:hover { background: #283593; transform: translateY(-2px); }

/* ══════ SUMMARY + ACTIONS ══════ */
.summary-action-row {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.summary-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  min-width: 280px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.summary-title {
  font-size: 15px; font-weight: 700; color: #1d1f23;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}
.summary-row {
  display: flex; justify-content: space-between;
  font-size: 13.5px; color: #555;
  padding: 6px 0; border-bottom: 1px solid #f5f5f5;
}
.summary-row:last-child { border-bottom: none; }
.summary-net { margin-top: 6px; padding-top: 10px; border-top: 2px solid #eee; }
.summary-amount { color: #D40511; font-weight: 600; }

.go-payment-wrapper { display: flex; align-items: center; }
.btn-go-payment {
  background: #1A237E; color: #fff; border: none;
  padding: 12px 28px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.btn-go-payment:hover { background: #283593; }

/* ══════ BOTTOM BUTTONS ══════ */
.bottom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-proceed {
  background: #1A237E; color: #fff; border: none;
  padding: 13px 28px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-proceed:hover { background: #283593; transform: translateY(-2px); }
.btn-reset {
  background: #D40511; color: #fff; border: none;
  padding: 13px 28px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-reset:hover { background: #b3000d; transform: translateY(-2px); }

/* ══════ MODAL ══════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-box-wide { max-width: 740px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid #eee;
}
.modal-header h4 { font-size: 17px; font-weight: 700; color: #1A237E; margin: 0; }
.modal-close {
  background: none; border: none; font-size: 24px;
  color: #888; cursor: pointer; line-height: 1;
}
.modal-body  { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid #eee;
  display: flex; justify-content: flex-end;
}
.modal-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 16px; }
.modal-row {
  display: flex; justify-content: space-between;
  font-size: 13.5px; color: #555;
  padding: 6px 0; border-bottom: 1px dashed #eee;
}
.modal-net { font-size: 15px; color: #1A237E; border-bottom: none; }
.payment-options { display: flex; gap: 20px; margin-top: 12px; }
.pay-option {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 14px; color: #333;
}
.gateway-select {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid #d0d5dd; border-radius: 8px;
  font-size: 14px; outline: none;
}
.btn-submit-pay {
  background: #1A237E; color: #fff; border: none;
  padding: 12px 32px; border-radius: 8px; font-size: 15px;
  font-weight: 600; cursor: pointer;
}
.btn-submit-pay:hover { background: #283593; }

/* ══════ RECEIPT CARD ══════ */
.receipt-card { padding: 24px; }
.receipt-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; border-bottom: 2px solid #eee; padding-bottom: 16px; }
.receipt-logo { width: 70px; height: auto; object-fit: contain; }
.receipt-company-name { font-size: 17px; font-weight: 700; color: #D40511; }
.receipt-tagline { font-size: 11px; letter-spacing: 2px; color: #888; text-transform: uppercase; margin-top: 2px; }
.receipt-meta { margin-left: auto; text-align: right; font-size: 13px; }
.receipt-meta div { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 4px; }
.receipt-meta span { color: #888; }
.receipt-section-title { text-align: center; font-size: 13px; letter-spacing: 4px; font-weight: 700; color: #1A237E; margin: 12px 0; text-transform: uppercase; }
.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.receipt-panel { border: 1px solid #e8ecf0; border-radius: 8px; padding: 12px 14px; background: #f9fbfd; }
.receipt-panel-head { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: #888; font-weight: 700; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed #dde3ed; }
.receipt-line { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid #f0f0f0; }
.receipt-line:last-child { border-bottom: none; }
.receipt-table { width: 100%; border-collapse: collapse; border: 1px solid #e3e7ec; border-radius: 8px; overflow: hidden; margin-bottom: 14px; font-size: 13.5px; }
.receipt-table th { background: #eaf1f9; padding: 10px 14px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: #5a6b7b; }
.receipt-table th:last-child, .receipt-table td:last-child { text-align: right; }
.receipt-table td { padding: 10px 14px; border-top: 1px solid #eef1f5; }
.receipt-total-row { background: #f1f6ff; }
.receipt-total-row td { color: #1A237E; font-size: 15px; }
.receipt-footer { text-align: center; font-size: 11px; letter-spacing: 4px; color: #888; text-transform: uppercase; margin-top: 12px; }
.btn-print {
  background: #fff; color: #1A237E; border: 2px solid #1A237E;
  padding: 10px 24px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; margin-right: 8px;
}
.btn-save-pdf {
  background: #D40511; color: #fff; border: none;
  padding: 10px 24px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer;
}

/* Validation errors */
.location-error, .pincode-error {
  color: #b30000; font-size: 12px; margin-top: 4px; display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .summary-action-row { flex-direction: column; }
  .bottom-actions { justify-content: center; }
  .modal-summary-grid { grid-template-columns: 1fr; }
  .receipt-grid { grid-template-columns: 1fr; }
  .location-bar { flex-direction: column; }
}
