/* Gur Asees Ayurveda */
:root {
  --gaa-teal: #0d5c4d;
  --gaa-teal-dark: #094539;
  --gaa-teal-light: #e8f3f0;
  --gaa-gold: #c4a035;
  --gaa-cream: #f6f4ef;
  --gaa-text: #1e2d2a;
  --gaa-muted: #5c6f6a;
}

/* Dashboard */
.reception-body {
  background: var(--gaa-cream);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Gurmukhi", "Nirmala UI", sans-serif;
  min-height: 100vh;
}

.reception-header {
  background: linear-gradient(135deg, var(--gaa-teal-dark) 0%, var(--gaa-teal) 100%);
  color: #fff;
}

.reception-header .d-flex.align-items-center.justify-content-between {
  flex-wrap: wrap;
}

.header-patient-search {
  position: relative;
  flex: 1 1 12rem;
  max-width: 22rem;
  min-width: 10rem;
  margin: 0 auto;
}

.header-patient-search-input {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 2rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

.header-patient-search-input:focus {
  background: #fff;
  border-color: var(--gaa-gold);
  box-shadow: 0 0 0 0.2rem rgba(196, 160, 53, 0.25);
}

.header-patient-search-input::placeholder {
  color: var(--gaa-muted);
  opacity: 0.85;
}

.header-patient-search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(13, 92, 77, 0.18);
  border: 1px solid rgba(13, 92, 77, 0.12);
  max-height: 16rem;
  overflow-y: auto;
}

.header-patient-search-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  color: var(--gaa-text);
  border-bottom: 1px solid rgba(13, 92, 77, 0.06);
}

.header-patient-search-item:last-child {
  border-bottom: 0;
}

.header-patient-search-item:hover,
.header-patient-search-item.active {
  background: var(--gaa-teal-light);
  color: var(--gaa-teal-dark);
}

.header-patient-search-code {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gaa-teal);
}

.header-patient-search-name {
  font-size: 0.9rem;
}

.header-patient-search-phone {
  font-size: 0.8rem;
  color: var(--gaa-muted);
}

.header-patient-search-empty {
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: var(--gaa-muted);
}

.header-patient-search-register {
  display: block;
  padding: 0.6rem 0.85rem;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gaa-teal-dark);
  background: rgba(13, 92, 77, 0.06);
  border-top: 1px solid rgba(13, 92, 77, 0.12);
}

.header-patient-search-register:hover,
.header-patient-search-register.active {
  background: var(--gaa-teal-light);
  color: var(--gaa-teal-dark);
}

@media (max-width: 767.98px) {
  .header-patient-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0.25rem 0 0;
  }
}

.reception-brand {
  color: #fff;
  font-weight: 600;
  font-size: 1.15rem;
}

.reception-role-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(196, 160, 53, 0.35);
  color: #f5e6b8;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  vertical-align: middle;
}

.reception-page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gaa-teal-dark);
}

.reception-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(13, 92, 77, 0.08);
  border: 1px solid rgba(13, 92, 77, 0.1);
}

.reception-card-title {
  color: var(--gaa-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reception-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gaa-muted);
  border-bottom-width: 1px;
  white-space: nowrap;
  vertical-align: bottom;
}

.reception-table-sortable thead th {
  vertical-align: bottom;
  white-space: nowrap;
}

.reception-table-sortable thead th.col-actions {
  cursor: default;
}

.reception-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: transparent;
}

.reception-table-sortable th.text-end .reception-sort-link {
  justify-content: flex-end;
  width: 100%;
}

.reception-sort-link:hover {
  color: var(--gaa-teal);
  text-decoration: none;
}

.reception-sort-link.active {
  color: var(--gaa-teal-dark);
}

.reception-sort-icon {
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.85;
  flex-shrink: 0;
}

.reception-table .col-address {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reception-table-sortable tbody td {
  font-size: 0.9rem;
  vertical-align: middle;
}

.reception-table .col-actions {
  width: 1%;
  white-space: nowrap;
}

.patient-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.patient-action-delete-form {
  display: inline;
  margin: 0;
}

.patient-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--gaa-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.patient-action-btn:hover {
  background: var(--gaa-teal-light);
  color: var(--gaa-teal-dark);
}

.patient-action-delete:hover {
  background: #fde8e8;
  color: #b02a37;
}

.page-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.page-header-bar .reception-page-title {
  flex: 1;
  min-width: 0;
}

.page-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--gaa-teal-dark);
  background: #fff;
  border: 1px solid rgba(13, 92, 77, 0.15);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.page-back-btn:hover {
  background: var(--gaa-teal-light);
  border-color: var(--gaa-teal);
  color: var(--gaa-teal-dark);
}

.patient-register-success-body {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gaa-teal-dark);
}

.patient-view-page .reception-card {
  padding: 0.875rem 1rem;
}

.patient-view-page .page-header-bar {
  margin-bottom: 0.75rem;
}

.patient-view-total-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid rgba(13, 92, 77, 0.12);
}

.patient-view-total-balance-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(13, 92, 77, 0.65);
}

.patient-view-total-balance-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gaa-teal-dark);
}

.patient-view-total-balance--due .patient-view-total-balance-value {
  color: #b45309;
}

.patient-view-total-balance--due {
  border-color: rgba(180, 83, 9, 0.25);
  background: #fffbeb;
}

.patient-view-page .patient-profile-card {
  margin-bottom: 0.5rem;
}

.patient-profile-card .patient-detail-list {
  margin: 0;
}

.patient-profile-card .patient-detail-item {
  display: grid;
  grid-template-columns: minmax(6rem, 7.5rem) 1fr;
  gap: 0.2rem 0.5rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.patient-profile-card .patient-detail-item:last-child {
  margin-bottom: 0;
}

.patient-profile-card .patient-detail-list dt {
  font-weight: 500;
  color: var(--gaa-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.35;
}

.patient-profile-card .patient-detail-list dd {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--gaa-text);
}

.patient-profile-card .patient-detail-grid .patient-symptoms-item {
  align-items: start;
}

.patient-detail-list {
  margin: 0;
}

.patient-detail-item {
  display: grid;
  grid-template-columns: minmax(5.5rem, 6.75rem) 1fr;
  gap: 0.15rem 0.5rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.patient-detail-item:last-child {
  margin-bottom: 0;
}

.patient-detail-list dt {
  font-weight: 500;
  color: var(--gaa-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.3;
}

.patient-detail-list dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.patient-detail-grid .patient-symptoms-item {
  align-items: start;
}

/* Patient symptom picker — search left, selected list right */
.patient-symptom-picker-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
}

.patient-symptom-search-col {
  min-width: 0;
}

.patient-symptom-search .visit-medicine-search-results.patient-symptom-results-panel {
  position: static;
  left: auto;
  right: auto;
  margin-top: 0.5rem;
  max-height: 14rem;
  border-radius: 0.375rem;
  box-shadow: none;
}

.patient-symptom-list-col {
  min-width: 0;
  min-height: 14rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(13, 92, 77, 0.12);
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.65);
}

.patient-symptom-list {
  max-height: 12rem;
  overflow-y: auto;
}

.patient-symptom-list-label {
  font-size: 0.9rem;
}

.patient-symptom-list-item {
  padding: 0.45rem 0.75rem;
  border-color: rgba(13, 92, 77, 0.12);
}

.patient-symptom-list-item + .patient-symptom-list-item {
  border-top-width: 1px;
}

@media (max-width: 767.98px) {
  .patient-symptom-picker-body {
    grid-template-columns: 1fr;
  }

  .patient-symptom-list-col {
    min-height: 0;
  }
}

.symptom-add-fields .col-auto {
  padding-top: 0;
}

.symptom-manage-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.symptom-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(13, 92, 77, 0.08);
}

.symptom-manage-item:last-child {
  border-bottom: 0;
}

.symptom-manage-label {
  font-size: 0.95rem;
}

.symptom-remove-form {
  margin: 0;
  flex-shrink: 0;
}

.symptom-in-use-hint {
  flex-shrink: 0;
  font-size: 0.8rem;
  max-width: 11rem;
  text-align: right;
  line-height: 1.3;
}

.payment-status-group .btn {
  font-size: 0.75rem;
  padding: 0.375rem 0.4rem;
}

.payment-section-heading {
  font-weight: 600;
  color: var(--gaa-teal-dark);
}

.payment-fields-grid {
  display: grid;
  gap: 0.75rem 1rem;
  align-items: start;
}

.payment-field {
  min-width: 0;
}

.payment-field .form-label {
  margin-bottom: 0.35rem;
}

.patient-payment-row .payment-field-body {
  display: flex;
  flex-direction: column;
}

.patient-payment-row .payment-field-control {
  min-height: 2.5rem;
  display: flex;
  align-items: stretch;
}

.patient-payment-row .payment-field-control > .input-group,
.patient-payment-row .payment-field-control > .form-select,
.patient-payment-row .payment-field-control > .payment-status-group {
  width: 100%;
}

.patient-payment-row .payment-field-meta {
  min-height: 1.35rem;
  margin-top: 0.35rem;
  line-height: 1.35;
}

.patient-payment-row .payment-field-meta--spacer {
  visibility: hidden;
  pointer-events: none;
}

.patient-payment-row .payment-gst-summary {
  margin: 0;
  white-space: nowrap;
}

.payment-field--status .payment-status-group {
  display: flex;
  flex-wrap: wrap;
}

.payment-field--status .payment-status-group .btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.payment-gst-summary {
  margin: 0.35rem 0 0;
  line-height: 1.35;
}

.visit-payment-fields {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.visit-payment-fields--hidden {
  display: none;
}

.visit-payment-fields .payment-field--partial .input-group {
  max-width: 10rem;
}

@media (max-width: 767.98px) {
  .visit-payment-fields {
    grid-template-columns: 1fr;
  }

  .patient-payment-row .payment-field-meta--spacer {
    display: none;
  }

  .patient-payment-row .payment-gst-summary {
    white-space: normal;
  }

  .visit-payment-fields .payment-field--partial .input-group {
    max-width: none;
  }
}

.patient-list-filters-row {
  display: grid;
  width: 100%;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 0.2fr)
    minmax(0, 0.25fr)
    minmax(0, 0.4fr)
    auto;
  gap: 0.75rem 1rem;
  align-items: end;
}

.patient-list-filters .form-label {
  white-space: nowrap;
}

.patient-list-filter-search,
.patient-list-filter-gender,
.patient-list-filter-age,
.patient-list-filter-date {
  min-width: 0;
}

.patient-list-filter-search {
  max-width: 100%;
}

.patient-list-filter-gender .form-select {
  width: 100%;
}

.patient-list-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.patient-list-range-inputs .form-control {
  min-width: 0;
  flex: 1 1 0;
}

.patient-list-range-sep {
  color: var(--gaa-muted);
  flex-shrink: 0;
}

.patient-list-filter-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  align-self: end;
}

.patient-list-filter-actions .btn {
  white-space: nowrap;
}

.patient-list-pagination .page-link {
  color: var(--gaa-teal-dark);
}

.patient-list-pagination .page-item.active .page-link {
  background-color: var(--gaa-teal);
  border-color: var(--gaa-teal);
}

.visit-list-filters-row {
  grid-template-columns:
    minmax(0, 2fr)
    minmax(0, 1fr)
    minmax(0, 0.75fr)
    auto;
}

.patient-list-filter-medicine .form-select {
  width: 100%;
}

@media (max-width: 767.98px) {
  .patient-list-filters-row,
  .visit-list-filters-row,
  .medicine-list-filters-row,
  .courier-list-filters-row {
    grid-template-columns: 1fr;
  }

  .patient-list-filter-actions {
    justify-content: flex-start;
  }

  .courier-list-filters .patient-list-filter-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .courier-list-filters .patient-list-filter-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.patient-payment-section .input-group-text {
  background: var(--gaa-teal-light);
  color: var(--gaa-teal-dark);
  border-color: rgba(13, 92, 77, 0.15);
}

.delivery-address-input.delivery-address-synced {
  background-color: #f4f6f5;
  color: var(--gaa-muted);
  opacity: 0.85;
  cursor: not-allowed;
}

.delivery-same-check .form-check-label {
  font-size: 0.875rem;
  color: var(--gaa-muted);
}

.patient-code {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: var(--gaa-teal);
  font-size: 0.9rem;
}

.reception-form .form-label {
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.reception-form .form-control:focus,
.reception-form .form-select:focus {
  border-color: var(--gaa-teal);
  box-shadow: 0 0 0 0.2rem rgba(13, 92, 77, 0.15);
}

/* Patient form row 1 */
.patient-row-1 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 5.5rem 4.75rem minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
}

.patient-field-gender .patient-gender-input {
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.patient-field {
  min-width: 0;
}

.patient-field .invalid-feedback.d-block {
  margin-top: 0.25rem;
}

.patient-field .form-label {
  display: block;
}

.reception-form .form-control,
.reception-form .phone-country-trigger,
.reception-form .gender-toggle-group .btn {
  min-height: 2.5rem;
}

.patient-field-phone .phone-input-group {
  width: 100%;
}

.patient-field-phone .form-control {
  flex: 1;
  min-width: 0;
}

.gender-toggle-group {
  display: flex;
  width: 100%;
}

.gender-toggle-group .btn {
  flex: 1;
  padding: 0.375rem 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--gaa-text);
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0;
  white-space: nowrap;
}

.gender-toggle-group .btn:first-of-type {
  border-radius: 0.375rem 0 0 0.375rem;
}

.gender-toggle-group .btn:last-of-type {
  border-radius: 0 0.375rem 0.375rem 0;
}

.gender-toggle-group .btn + .btn {
  margin-left: -1px;
}

.gender-toggle-group .btn-check:checked + .btn {
  background: var(--gaa-teal);
  border-color: var(--gaa-teal);
  color: #fff;
  z-index: 1;
}

.gender-toggle-group .btn:hover {
  border-color: #adb5bd;
  z-index: 2;
}

.gender-toggle-group.is-invalid .btn {
  border-color: var(--bs-form-invalid-border-color, #dc3545);
}

.reception-form .invalid-feedback.d-block {
  color: var(--bs-form-invalid-color, #dc3545);
}

@media (max-width: 1199.98px) {
  .patient-row-1 {
    grid-template-columns: 5.5rem 4.75rem minmax(0, 1fr);
  }

  .patient-field-name {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575.98px) {
  .patient-row-1 {
    grid-template-columns: 1fr;
  }
}

.btn-reception-primary {
  background: var(--gaa-teal);
  border-color: var(--gaa-teal);
  color: #fff;
  font-weight: 600;
}

.btn-reception-primary:hover {
  background: var(--gaa-teal-dark);
  border-color: var(--gaa-teal-dark);
  color: #fff;
}

.btn-reception-primary:focus,
.btn-reception-primary:focus-visible,
.btn-reception-primary:active {
  background-color: var(--gaa-teal-dark) !important;
  border-color: var(--gaa-teal-dark) !important;
  color: #fff !important;
  box-shadow: 0 0 0 0.2rem rgba(13, 92, 77, 0.3);
}

.reception-success {
  border-left: 4px solid var(--gaa-gold);
}

.phone-country-picker {
  position: relative;
  flex: 0 0 auto;
}

.phone-country-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(1.5em + 0.75rem + 2px);
  min-width: 5.5rem;
  padding: 0.375rem 0.65rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gaa-text);
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem 0 0 0.375rem;
  cursor: pointer;
  white-space: nowrap;
}

.phone-country-trigger:hover {
  border-color: #adb5bd;
}

.phone-country-picker.is-open .phone-country-trigger,
.phone-country-trigger:focus {
  border-color: var(--gaa-teal);
  box-shadow: 0 0 0 0.2rem rgba(13, 92, 77, 0.15);
  outline: 0;
}

.phone-country-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 1050;
  min-width: 16rem;
  max-width: min(20rem, 90vw);
  max-height: 14rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(13, 92, 77, 0.15);
  border-radius: 0.375rem;
  box-shadow: 0 4px 16px rgba(13, 92, 77, 0.15);
}

.phone-country-menu-inner {
  max-height: 14rem;
  overflow-y: auto;
}

.phone-country-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 0.875rem;
  color: var(--gaa-text);
  cursor: pointer;
}

.phone-country-option:hover,
.phone-country-option.active {
  background: var(--gaa-teal-light);
}

.phone-country-option[aria-selected="true"] {
  font-weight: 600;
  color: var(--gaa-teal-dark);
}

.phone-country-option[hidden] {
  display: none;
}

.phone-country-option-code {
  flex: 0 0 auto;
  white-space: nowrap;
}

.phone-country-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gaa-muted);
}

.phone-input-group .phone-country-trigger {
  border-right: 0;
}

.phone-input-group > .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.phone-input-group.is-invalid .phone-country-trigger,
.phone-input-group.is-invalid .form-control {
  border-color: var(--bs-form-invalid-border-color, #dc3545);
}

/* App shell + sidebar */
.app-layout {
  --sidebar-width: 15rem;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 3.25rem);
}

.app-sidebar {
  position: fixed;
  top: 3.25rem;
  left: 0;
  z-index: 1040;
  width: var(--sidebar-width);
  height: calc(100vh - 3.25rem);
  background: #fff;
  border-right: 1px solid rgba(13, 92, 77, 0.12);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.app-sidebar.is-open {
  transform: translateX(0);
}

.app-sidebar-nav {
  padding: 0.75rem 0.5rem;
}

.app-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.15rem;
  border-radius: 0.5rem;
  color: var(--gaa-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar-link:hover {
  background: var(--gaa-teal-light);
  color: var(--gaa-teal-dark);
}

.app-sidebar-link.active {
  background: var(--gaa-teal-light);
  color: var(--gaa-teal-dark);
  font-weight: 600;
}

.app-sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.35rem;
  color: var(--gaa-muted);
}

.app-sidebar-link.active .app-sidebar-icon,
.app-sidebar-link:hover .app-sidebar-icon {
  color: var(--gaa-teal);
}

.app-sidebar-label {
  line-height: 1.3;
}

.app-sidebar-backdrop {
  position: fixed;
  inset: 3.25rem 0 0 0;
  z-index: 1035;
  background: rgba(0, 0, 0, 0.35);
}

.app-sidebar-backdrop[hidden] {
  display: none;
}

.app-main {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.app-main-inner {
  padding: 1.25rem 1rem;
  max-width: 100%;
}

body.sidebar-open {
  overflow: hidden;
}

@media (min-width: 992px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    transform: none;
    flex-shrink: 0;
    height: calc(100vh - 3.25rem);
  }

  .app-shell {
    align-items: flex-start;
  }

  .app-main-inner {
    padding: 1.5rem 1.75rem;
  }

  .app-sidebar-backdrop {
    display: none !important;
  }
}

/* Login */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--gaa-cream) 0%, #e8f0ed 50%, var(--gaa-teal-light) 100%);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Gurmukhi", "Nirmala UI", sans-serif;
}

.auth-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(13, 92, 77, 0.12);
  border: 1px solid rgba(13, 92, 77, 0.1);
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gaa-teal-dark);
}

.captcha-img {
  border-radius: 6px;
  border: 1px solid rgba(13, 92, 77, 0.2);
  display: block;
}

/* Visit log form */
.visit-records-card .visit-log-form {
  margin-bottom: 0;
}

.visit-records-card-head {
  width: 100%;
}

#patientVisitModal .patient-visit-modal-body {
  padding-top: 0.25rem;
}

#patientVisitModal .visit-billing-layout {
  margin-bottom: 0;
}

#patientVisitModal .patient-visit-billing-row {
  --patient-visit-col-gap: 1rem;
}

#patientVisitModal .patient-visit-medicines-col .visit-form-panel {
  min-height: 320px;
}

#patientVisitModal .patient-visit-charges-col .visit-summary-panel {
  height: 100%;
  min-height: 320px;
  position: sticky;
  top: 0;
  box-shadow: none;
  margin-top: 0;
}

@media (max-width: 767.98px) {
  #patientVisitModal .patient-visit-charges-col .visit-summary-panel {
    position: static;
    min-height: 0;
  }
}

#patientVisitModal .visit-billing-summary-row--detail {
  font-size: 0.8125rem;
  color: #6c757d;
}

#patientVisitModal .visit-billing-summary-row--detail dt,
#patientVisitModal .visit-billing-summary-row--detail dd {
  font-weight: 400;
}

#patientVisitModal .visit-billing-visit-charge-input-row .visit-visit-charge-input,
#patientVisitModal .visit-medicine-total-input,
#patientVisitModal .visit-courier-charge-input {
  width: 8.5rem;
}

#patientVisitModal .visit-billing-summary-total {
  background: rgba(13, 92, 77, 0.06);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin-top: 0.5rem;
  border-top: none;
}

#patientVisitModal .visit-payment-section {
  margin-top: 0.75rem !important;
  padding-top: 0.75rem !important;
}

#patientVisitModal .patient-visit-details-panel {
  padding: 0.85rem 1rem;
}

.patient-visit-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem 1.25rem;
  background: rgba(13, 92, 77, 0.04);
  border-top: 1px solid rgba(13, 92, 77, 0.1);
}

.patient-visit-footer-total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-right: auto;
  min-width: 0;
}

.patient-visit-footer-total-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

.patient-visit-footer-total-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gaa-teal-dark, #0d5c4d);
  line-height: 1.2;
}

.patient-visit-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.visit-history-block--standalone {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.visit-form-section {
  border: 0;
  padding: 0;
  margin: 0;
}

.visit-form-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gaa-teal-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(13, 92, 77, 0.12);
  width: 100%;
}

.visit-form-panel,
.visit-summary-panel {
  background: rgba(13, 92, 77, 0.04);
  border: 1px solid rgba(13, 92, 77, 0.1);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.visit-form-panel-header {
  margin-bottom: 0.85rem;
}

.visit-form-panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gaa-teal-dark);
}

.visit-form-panel-hint {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.15rem;
}

.visit-summary-panel {
  background: #fff;
  border-color: rgba(13, 92, 77, 0.18);
  box-shadow: 0 2px 12px rgba(13, 92, 77, 0.06);
}

@media (min-width: 992px) {
  .visit-summary-panel {
    position: sticky;
    top: 1rem;
  }
}

.visit-medicine-search {
  position: relative;
}

.visit-search-icon {
  color: var(--gaa-teal-dark);
  background: rgba(13, 92, 77, 0.06);
  border-color: rgba(13, 92, 77, 0.15);
}

.visit-medicine-table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gaa-muted);
  font-weight: 600;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.visit-medicine-table tbody td {
  vertical-align: middle;
  font-size: 0.875rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.visit-medicine-th-qty {
  width: 5.5rem;
}

.visit-medicine-th-courier {
  width: 4.5rem;
}

.visit-medicine-th-action {
  width: 2.75rem;
}

.visit-cart-courier-cell {
  vertical-align: middle;
}

.visit-cart-courier-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.courier-delivery-address {
  max-width: 14rem;
  white-space: normal;
  line-height: 1.35;
}

.courier-pending-table .col-actions {
  white-space: nowrap;
}

.courier-actions .patient-action-dispatch:hover {
  background: var(--gaa-teal-light);
  color: var(--gaa-teal-dark);
}

.courier-actions .patient-action-cancel:hover {
  background: rgba(220, 53, 69, 0.12);
  color: #b02a37;
}

.courier-status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 999px;
  white-space: nowrap;
}

.courier-status-pending {
  background: rgba(255, 193, 7, 0.18);
  color: #856404;
  border: 1px solid rgba(255, 193, 7, 0.45);
}

.courier-status-sent {
  background: rgba(13, 92, 77, 0.12);
  color: var(--gaa-teal-dark);
  border: 1px solid rgba(13, 92, 77, 0.2);
}

.courier-status-canceled {
  background: rgba(108, 117, 125, 0.14);
  color: #495057;
  border: 1px solid rgba(108, 117, 125, 0.35);
}

.payment-summary-card {
  padding: 0.75rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(13, 92, 77, 0.12);
  background: rgba(255, 255, 255, 0.7);
  height: 100%;
}

.payment-summary-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin: 0;
}

.payment-summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gaa-teal-dark);
  line-height: 1.2;
}

.payment-summary-paid {
  border-color: rgba(13, 92, 77, 0.2);
}

.payment-summary-pending {
  border-color: rgba(255, 193, 7, 0.45);
  background: rgba(255, 193, 7, 0.08);
}

.payment-summary-partial {
  border-color: rgba(13, 110, 253, 0.25);
  background: rgba(13, 110, 253, 0.06);
}

.payment-summary-outstanding .payment-summary-value {
  color: #b45309;
}

.payment-period-toggle {
  width: auto;
  flex-wrap: wrap;
}

/* Reports */
.reports-page .reports-page-title {
  font-size: 1.35rem;
}

.report-type-pills .nav-link {
  border-radius: 999px;
  color: var(--gaa-teal-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
}

.report-type-pills .nav-link.active {
  background: var(--gaa-teal);
  color: #fff;
}

.report-toolbar-card {
  padding: 0.65rem 0.85rem;
}

.report-period-toggle .btn {
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
}

.report-metric-card .payment-summary-value {
  font-size: 1.1rem;
}

.reports-page .reception-card {
  padding: 0.75rem 0.9rem;
}

.reports-page .reception-card-title {
  font-size: 0.7rem;
}

.reports-page .report-detail-card {
  margin-top: 0.75rem;
}

.reports-page .report-detail-table {
  font-size: 0.8125rem;
}

.reports-page .report-detail-table th {
  white-space: nowrap;
}

.reports-page .report-export-btn {
  font-size: 0.8125rem;
}

.payment-period-toggle .btn {
  flex: 0 1 auto;
  min-width: 3.5rem;
  text-decoration: none;
}

.payment-period-toggle .btn.active {
  background: var(--gaa-teal);
  border-color: var(--gaa-teal);
  color: #fff;
  z-index: 1;
}

@media (max-width: 575.98px) {
  .payment-period-toggle,
  .report-period-toggle {
    width: 100%;
  }

  .payment-period-toggle .btn,
  .report-period-toggle .btn {
    flex: 1 1 auto;
    font-size: 0.75rem;
    padding: 0.35rem 0.25rem;
  }
}

.payment-status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 999px;
  white-space: nowrap;
}

.payment-status-paid {
  background: rgba(13, 92, 77, 0.12);
  color: var(--gaa-teal-dark);
  border: 1px solid rgba(13, 92, 77, 0.2);
}

.payment-status-pending {
  background: rgba(255, 193, 7, 0.18);
  color: #856404;
  border: 1px solid rgba(255, 193, 7, 0.45);
}

.payment-status-partial {
  background: rgba(13, 110, 253, 0.1);
  color: #084298;
  border: 1px solid rgba(13, 110, 253, 0.25);
}

.payment-status-canceled {
  background: rgba(108, 117, 125, 0.12);
  color: #495057;
  border: 1px solid rgba(108, 117, 125, 0.25);
}

.payment-list-filters-row {
  grid-template-columns:
    minmax(0, 1.4fr)
    minmax(0, 0.55fr)
    minmax(0, 0.55fr)
    minmax(0, 1fr)
    auto;
}

@media (max-width: 991.98px) {
  .payment-list-filters-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 575.98px) {
  .payment-list-filters-row {
    grid-template-columns: 1fr;
  }
}

.courier-label-body {
  margin: 0;
  min-height: 100vh;
  padding: 1.25rem 1rem 2rem;
  background: #e5e5e5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #000;
}

.courier-label-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 11cm;
  margin: 0 auto;
}

.courier-label-sheet {
  position: relative;
  width: 100%;
  max-width: 10cm;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 2px solid #000;
  border-radius: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  color: #000;
}

.courier-label-date {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  margin: 0;
  max-width: 45%;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: right;
  color: #000;
}

.courier-label-to-section,
.courier-label-from-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.courier-label-to-section > *,
.courier-label-from-section > * {
  margin: 0;
}

.courier-label-header.courier-label-to-section {
  border-bottom: 2px solid #000;
  padding-bottom: 0.6rem;
  padding-right: 42%;
  margin-bottom: 0.75rem;
}

.courier-label-to-section .courier-label-section-title {
  font-size: 0.72rem;
}

.courier-label-to-section .courier-label-party-name {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: #000;
}

.courier-label-to-section .courier-label-party-phone,
.courier-label-to-section .courier-label-party-address {
  font-size: 0.88rem;
  line-height: 1.35;
  color: #000;
}

.courier-label-to-section .courier-label-party-address {
  line-height: 1.4;
}

.courier-label-from-section .courier-label-section-title {
  font-size: 0.62rem;
}

.courier-label-from-section .courier-label-party-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  color: #000;
}

.courier-label-from-section .courier-label-party-phone,
.courier-label-from-section .courier-label-party-address {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #000;
}

.courier-label-section {
  margin-bottom: 0.75rem;
}

.courier-label-medicines-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 2px solid #000;
}

.courier-label-medicines-section > * {
  margin: 0;
}

.courier-label-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #333;
}

.courier-label-meta-key {
  color: #444;
}

.courier-label-medicines li {
  font-size: 0.85rem;
  padding: 0.15rem 0;
  color: #000;
}

.courier-label-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 10cm;
}

.courier-label-btn {
  min-width: 5.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.courier-label-btn-print {
  background: #000;
  color: #fff;
  border: 2px solid #000;
}

.courier-label-btn-print:hover {
  background: #222;
  border-color: #222;
}

.courier-label-btn-cancel {
  background: #fff;
  color: #000;
  border: 2px solid #000;
}

.courier-label-btn-cancel:hover {
  background: #f0f0f0;
}

@media print {
  .no-print {
    display: none !important;
  }

  .courier-label-body {
    min-height: auto;
    padding: 0;
    background: #fff !important;
  }

  .courier-label-page {
    gap: 0;
    max-width: none;
  }

  .courier-label-sheet {
    max-width: none;
    margin: 0;
    border: 1px solid #000;
    box-shadow: none;
    border-radius: 0;
    background: #fff !important;
    color: #000 !important;
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }

  .courier-label-sheet * {
    color: #000 !important;
    box-shadow: none !important;
  }

  .courier-label-header {
    border-bottom-color: #000 !important;
  }

  .courier-label-medicines-section {
    border-top-color: #000 !important;
  }

  @page {
    margin: 0.8cm;
    size: auto;
  }
}

.visit-cart-qty {
  width: 4.25rem;
  text-align: center;
}

.visit-medicine-cart-empty {
  padding: 0.75rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(13, 92, 77, 0.2);
  border-radius: 8px;
}

.patient-profile-history-card .patient-profile-history-hint {
  color: rgba(13, 92, 77, 0.65);
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-bottom: 1rem;
}

.patient-profile-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.patient-profile-history-entry {
  border-left: 2px solid rgba(13, 92, 77, 0.14);
  list-style: none;
  margin: 0 0 0 0.4rem;
  padding: 0 0 1.15rem 1rem;
  position: relative;
}

.patient-profile-history-entry:last-child {
  padding-bottom: 0;
}

.patient-profile-history-entry::before {
  background: var(--reception-primary, #0d5c4d);
  border: 2px solid #fff;
  border-radius: 50%;
  content: '';
  height: 8px;
  left: -5px;
  position: absolute;
  top: 0.3rem;
  width: 8px;
}

.patient-profile-history-entry-meta {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  gap: 0.2rem 0.65rem;
  line-height: 1.35;
  margin-bottom: 0.55rem;
}

.patient-profile-history-entry-meta time {
  color: var(--reception-primary, #0d5c4d);
  font-weight: 600;
}

.patient-profile-history-editor {
  color: #6c757d;
  font-weight: 400;
}

.patient-profile-history-changes {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.patient-profile-history-change {
  list-style: none;
  margin: 0;
}

.patient-profile-history-change-label {
  color: rgba(13, 92, 77, 0.8);
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.patient-profile-history-diff {
  border: 1px solid rgba(13, 92, 77, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.patient-profile-history-diff-row {
  align-items: start;
  display: grid;
  font-size: 0.875rem;
  gap: 0.35rem 0.75rem;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  line-height: 1.45;
  padding: 0.45rem 0.65rem;
}

.patient-profile-history-diff-row--previous {
  background: #f6f8f7;
}

.patient-profile-history-diff-row--new {
  background: rgba(13, 92, 77, 0.04);
  border-top: 1px solid rgba(13, 92, 77, 0.08);
}

.patient-profile-history-diff-key {
  color: #6c757d;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding-top: 0.1rem;
  text-transform: uppercase;
}

.patient-profile-history-diff-row--new .patient-profile-history-diff-key {
  color: var(--reception-primary, #0d5c4d);
}

.patient-profile-history-diff-text {
  color: #495057;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.patient-profile-history-diff-row--new .patient-profile-history-diff-text {
  color: var(--reception-primary, #0d5c4d);
  font-weight: 500;
}

@media (max-width: 575.98px) {
  .patient-profile-history-diff-row {
    gap: 0.2rem 0.5rem;
    grid-template-columns: 1fr;
    padding: 0.4rem 0.55rem;
  }

  .patient-profile-history-diff-key {
    padding-top: 0;
  }
}

.visit-history-block {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(13, 92, 77, 0.12);
}

.visit-history-table-wrap,
.patient-visit-history-wrap.table-responsive {
  border: 1px solid rgba(13, 92, 77, 0.1);
  border-radius: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.visit-history-medicines {
  max-width: 14rem;
  line-height: 1.35;
}

.patient-visit-history-table {
  table-layout: fixed;
  width: 100%;
  font-size: 1rem;
}

.patient-visit-history-table thead th {
  background: rgba(13, 92, 77, 0.06);
  border-bottom: 1px solid rgba(13, 92, 77, 0.14);
  color: var(--gaa-teal-dark, #0d5c4d);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.85rem;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.patient-visit-history-table tbody td {
  border-bottom: 1px solid rgba(13, 92, 77, 0.08);
  font-size: 1rem;
  line-height: 1.45;
  padding: 0.85rem;
  vertical-align: top;
}

.patient-visit-history-table .payment-status-badge {
  font-size: 0.8125rem;
  padding: 0.25rem 0.6rem;
}

.patient-visit-history-table .table-cell-na {
  font-size: 0.9375rem;
}

.patient-visit-history-table tbody tr.patient-visit-history-row:hover {
  background: rgba(13, 92, 77, 0.03);
}

.patient-visit-history-table .visit-col-medicines {
  width: 18%;
}

.patient-visit-history-table .visit-col-total {
  width: 10%;
}

.patient-visit-history-table .visit-col-method {
  width: 9%;
}

.patient-visit-history-table .visit-col-status {
  width: 11%;
}

.patient-visit-history-table .visit-col-paid {
  width: 9%;
}

.patient-visit-history-table .visit-col-balance {
  width: 9%;
}

.visit-cols-with-paid .visit-col-notes {
  width: 22%;
}

.visit-cols-no-paid .visit-col-notes {
  width: 31%;
}

.patient-visit-history-table .visit-col-datetime {
  width: 11%;
}

.patient-visit-history-table .visit-col-actions {
  width: 3.5rem;
}

.patient-visit-history-table .visit-history-medicines {
  font-size: 0.9375rem;
  max-width: 12rem;
  line-height: 1.45;
}

.patient-visit-history-table .visit-history-datetime {
  white-space: normal;
}

.visit-datetime-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.3;
  min-width: 6.5rem;
}

.visit-datetime-date {
  color: var(--gaa-teal-dark, #0d5c4d);
  font-weight: 600;
}

.visit-datetime-time {
  color: #6c757d;
  font-size: 0.875rem;
}

.patient-visit-history-table .col-actions {
  text-align: center;
  vertical-align: middle;
}

.visit-detail-list {
  margin: 0;
}

.visit-detail-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.visit-detail-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.visit-delete-form {
  margin: 0;
}

.patient-view-page .visit-records-card .reception-card-title {
  font-size: 1.05rem;
}

.patient-view-page .visit-records-card,
.patient-view-page .visit-history-block {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.patient-view-page .visit-records-card {
  overflow-x: hidden;
}

.visit-records-date-row td {
  background: transparent;
  border-bottom: none;
  color: var(--reception-primary, #0d5c4d);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.75;
  padding: 0.65rem 0.75rem 0.2rem 0.1rem;
}

.visit-records-date-row:first-child td {
  padding-top: 0.35rem;
}

.visit-records-date-row + tr td {
  border-top: none;
}

.table-cell-na {
  color: var(--reception-primary, #0d5c4d);
  font-size: 0.8125rem;
  font-style: italic;
  font-weight: 500;
  opacity: 0.45;
}

.medicine-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

/* Medicines manager — compact layout */
.medicine-manage-page .medicine-manage-title {
  font-size: 1.35rem;
  margin-bottom: 0.65rem;
}

.medicine-manage-page .medicine-manage-card {
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.85rem;
}

.medicine-manage-page .medicine-manage-card-title {
  font-size: 0.7rem;
  margin-bottom: 0.45rem;
}

.medicine-manage-page .alert {
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.75rem;
}

.medicine-manage-page .medicine-add-toolbar {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}

.medicine-manage-page .medicine-add-toolbar-field {
  flex: 1 1 12rem;
  max-width: 100%;
  min-width: 10rem;
}

.medicine-manage-page .medicine-add-toolbar-actions {
  flex: 0 0 auto;
}

.medicine-manage-page .medicine-add-toolbar .form-control,
.medicine-manage-page .medicine-list-filters .form-control,
.medicine-manage-page .medicine-list-filters .btn {
  min-height: 2.125rem;
}

.medicine-manage-page .medicine-list-filters-row {
  gap: 0.4rem 0.5rem;
}

.medicine-manage-page .medicine-list-filters .form-label {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.medicine-manage-page .medicine-inventory-table thead th,
.medicine-manage-page .medicine-inventory-table tbody td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
}

.medicine-manage-page .medicine-inventory-table tbody td {
  font-size: 0.9rem;
}

.medicine-manage-page .medicine-manage-list-card .table-responsive {
  margin-top: 0.35rem;
}

.medicine-manage-page .medicine-inline-edit-row {
  gap: 0.25rem;
}

.medicine-edit-trigger:hover {
  background: rgba(13, 92, 77, 0.12);
  color: var(--gaa-teal-dark);
}

/* Users manager (admin) */
.user-manage-page .user-manage-title {
  font-size: 1.35rem;
  margin-bottom: 0.65rem;
}

.user-manage-page .user-manage-card {
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.85rem;
}

.user-manage-page .user-manage-card-title {
  font-size: 0.7rem;
  margin-bottom: 0.45rem;
}

.user-manage-page .alert {
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.75rem;
}

.user-manage-page .user-add-fields .form-label {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.user-manage-page .user-add-fields .form-control,
.user-manage-page .user-add-fields .form-select,
.user-manage-page .user-add-submit-wrap .btn {
  min-height: 2.125rem;
}

.user-manage-page .user-manage-table thead th,
.user-manage-page .user-manage-table tbody td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
}

.user-manage-page .user-row-inactive {
  opacity: 0.72;
}

.user-manage-page .user-row-inactive .user-name-display,
.user-manage-page .user-row-inactive .user-username-display {
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.25);
}

.user-role-badge,
.user-status-badge {
  border-radius: 4px;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.4rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.user-role-admin {
  background: rgba(13, 92, 77, 0.15);
  color: var(--gaa-teal-dark);
}

.user-role-manager {
  background: rgba(13, 92, 77, 0.1);
  color: var(--reception-primary, #0d5c4d);
}

.user-role-receptionist {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.user-status-active {
  background: rgba(25, 135, 84, 0.12);
  color: #157347;
}

.user-status-inactive {
  background: rgba(108, 117, 125, 0.15);
  color: #5c636a;
}

.user-actions {
  align-items: center;
  display: inline-flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

.user-edit-row td {
  background: rgba(13, 92, 77, 0.04);
  border-top: none;
  padding-bottom: 0.65rem;
  padding-top: 0;
}

.user-edit-row .user-inline-edit-grid {
  align-items: end;
  display: grid;
  gap: 0.5rem 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
}

.user-edit-row .user-inline-edit-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.user-edit-trigger:hover,
.user-activate-trigger:hover {
  background: rgba(13, 92, 77, 0.12);
  color: var(--gaa-teal-dark);
}

.user-deactivate-trigger:hover:not(.disabled) {
  background: rgba(220, 53, 69, 0.1);
  color: #b02a37;
}

.medicine-name-cell {
  min-width: 12rem;
}

.medicine-inline-edit-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.medicine-inline-edit-input {
  flex: 1 1 10rem;
  max-width: 100%;
  min-width: 8rem;
}

@media (min-width: 768px) {
  .medicine-list-filters-row {
    grid-template-columns: minmax(12rem, 2fr) auto;
  }

  .courier-list-filters-row {
    grid-template-columns: minmax(12rem, 2fr) minmax(8rem, 1fr) auto;
  }
}

.visit-medicine-search-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(13, 92, 77, 0.2);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(13, 92, 77, 0.12);
  margin-top: 0.25rem;
}

.visit-medicine-search-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-bottom: 1px solid rgba(13, 92, 77, 0.08);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.visit-medicine-search-item:last-child {
  border-bottom: none;
}

.visit-medicine-search-item:hover,
.visit-medicine-search-item.active {
  background: rgba(13, 92, 77, 0.08);
}

.visit-medicine-search-empty {
  padding: 0.75rem;
  color: #6c757d;
  font-size: 0.875rem;
}

.visit-billing-summary {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.visit-billing-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.visit-billing-summary-row dt {
  margin: 0;
  font-weight: 400;
  color: #495057;
}

.visit-billing-summary-row dd {
  margin: 0;
  font-weight: 500;
}

.visit-billing-medicine-total-row dd,
.visit-billing-courier-total-row dd {
  flex: 0 0 auto;
}

.visit-medicine-total-input,
.visit-courier-charge-input {
  width: 7.5rem;
  max-width: 100%;
}

.visit-billing-summary-total {
  margin-top: 0.35rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(13, 92, 77, 0.18);
}

.visit-billing-summary-total dt,
.visit-billing-summary-total dd {
  font-weight: 700;
  color: var(--gaa-teal-dark);
  font-size: 1.05rem;
}

/* ——— Responsive (app-wide) ——— */

.table-responsive {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
  html {
    overflow-x: hidden;
    max-width: 100%;
  }

  body.reception-body.app-layout {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .app-shell,
  .app-main,
  .app-main-inner,
  .patient-view-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .reception-card,
  .visit-records-card,
  .patient-profile-history-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .reception-card > .row {
    margin-left: 0;
    margin-right: 0;
  }

  .table-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .table-responsive > .reception-table,
  .table-responsive > .reception-table-sortable,
  .table-responsive > .courier-pending-table {
    width: auto;
    min-width: 44rem;
  }

  .patient-visit-history-wrap > .patient-visit-history-table {
    width: 58rem;
    min-width: 58rem;
    max-width: none;
    table-layout: fixed;
  }

  .reception-page-title {
    font-size: 1.35rem;
  }

  .reception-card {
    padding: 1rem 1.1rem;
  }

  .app-main-inner {
    padding: 1rem 0.75rem;
  }
}

@media (max-width: 767.98px) {
  .reception-page-title {
    font-size: 1.2rem;
    margin-bottom: 0.85rem !important;
  }

  .reception-card {
    padding: 0.85rem 0.9rem;
    border-radius: 8px;
  }

  .page-header-bar {
    gap: 0.5rem;
  }

  .page-header-bar .reception-page-title {
    flex: 1 1 100%;
    order: 2;
  }

  .page-header-bar .page-back-btn {
    order: 1;
  }

  .page-header-bar .page-header-actions {
    order: 3;
    width: 100%;
    margin-left: 0 !important;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .patient-view-page .page-header-bar,
  .page-header-bar--inline {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .patient-view-page .page-header-bar .reception-page-title,
  .page-header-bar--inline .reception-page-title {
    flex: 1 1 auto;
    order: 0;
    font-size: 1rem;
    margin-bottom: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .patient-view-page .page-header-bar .page-back-btn,
  .page-header-bar--inline .page-back-btn {
    order: 0;
  }

  .patient-view-page .page-header-bar .page-header-actions {
    order: 0;
    width: auto;
    margin-left: auto !important;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 0.35rem;
  }

  .patient-view-page .patient-view-total-balance {
    align-items: flex-end;
    padding: 0.2rem 0.45rem;
  }

  .patient-view-page .patient-view-total-balance-label {
    font-size: 0.6rem;
  }

  .patient-view-page .patient-view-total-balance-value {
    font-size: 0.85rem;
  }

  .patient-view-page .page-header-actions .btn {
    padding: 0.25rem 0.55rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .visit-records-card-head .btn,
  .report-toolbar-card .report-export-btn {
    width: 100%;
  }

  .report-toolbar-card .d-flex.flex-wrap.align-items-center.justify-content-between {
    flex-direction: column;
    align-items: stretch !important;
  }

  .report-toolbar-card .d-flex.flex-wrap.align-items-center.gap-2 {
    width: 100%;
  }

  #patientVisitModal.modal {
    --bs-modal-margin: 0;
  }

  #patientVisitModal .patient-visit-modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
  }

  #patientVisitModal .modal-content {
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    display: flex;
    flex-direction: column;
  }

  #patientVisitModal .visit-log-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  #patientVisitModal .modal-header {
    flex-shrink: 0;
  }

  #patientVisitModal .patient-visit-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #patientVisitModal .patient-visit-modal-footer {
    flex-shrink: 0;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  #patientVisitModal .visit-billing-summary-row {
    align-items: center;
    gap: 0.5rem;
  }

  #patientVisitModal .visit-billing-summary-row dt {
    flex: 1 1 55%;
    min-width: 0;
    font-size: 0.8125rem;
    line-height: 1.25;
  }

  #patientVisitModal .visit-billing-summary-row dd {
    flex: 0 0 auto;
    min-width: 5.5rem;
  }

  #patientVisitModal .patient-visit-medicines-col .visit-form-panel {
    min-height: 0;
  }

  #patientVisitModal .visit-billing-visit-charge-input-row .visit-visit-charge-input,
  #patientVisitModal .visit-medicine-total-input,
  #patientVisitModal .visit-courier-charge-input {
    width: 100%;
    max-width: 100%;
  }

  .medicine-manage-page .medicine-name-cell {
    min-width: 0;
  }

  .symptom-manage-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .symptom-in-use-hint {
    max-width: none;
    text-align: left;
  }

  .payment-field--status .payment-status-group .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: calc(50% - 0.25rem);
  }

  .auth-main {
    padding: 1.25rem 0.75rem;
    align-items: flex-start;
  }

  .auth-card {
    padding: 1.5rem 1.1rem;
  }

  .auth-card .d-flex.align-items-center.gap-2 {
    flex-wrap: wrap;
  }

  .captcha-img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 575.98px) {
  .reception-header .container-fluid {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .patient-list-pagination .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .user-inline-edit-grid {
    grid-template-columns: 1fr !important;
  }

  .visit-medicine-cart-table-wrap {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }

  .visit-medicine-table .visit-medicine-th-courier {
    min-width: 4.5rem;
  }
}

