body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
}

#phoneAuthForm #phoneInput,
#phoneAuthForm #codeInput {
  font-size: 16px !important;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.client-card .badge {
  border-radius: 999px;
}

.search-field--solid input::placeholder {
  color: #94a3b8;
}

#appAlert {
  transition: all 0.2s ease;
}

#appAlert.alert-info {
  background: #e0f2fe;
  color: #075985;
  border-color: #bfdbfe;
}

#appAlert.alert-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecdd3;
}

#appAlert.alert-success {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

#appAlert.alert-warning {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fcd34d;
}

.d-none {
  display: none !important;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal.show {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.modal-dialog {
  max-width: 720px;
  margin: 2rem auto;
}

.modal-content {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header .btn-close {
  margin-left: auto;
  flex: 0 0 auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-close {
  width: 32px;
  height: 32px;
  
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-close::before {
  content: "✕";
  font-size: 14px;
}

.offcanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 60;
  padding: 1rem;
}

.offcanvas.show {
  transform: translateX(0);
}

.form-control,
.form-select {
  width: 100%;
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}

.form-control:focus,
.form-select:focus {
  outline: 2px solid #b6d8ff;
  border-color: #4f9fff;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.row.g-3 {
  gap: 16px;
}

.row.g-4 {
  gap: 24px;
}

.col-md-4 {
  flex: 1 1 calc(33.333% - 16px);
}

.col-md-5 {
  flex: 1 1 calc(41.666% - 16px);
}

.col-md-6 {
  flex: 1 1 calc(50% - 16px);
}

.col-md-12 {
  flex: 1 1 100%;
}

.col-sm-4 {
  flex: 1 1 calc(33.333% - 16px);
}

.col-lg-2 {
  flex: 1 1 calc(16.666% - 16px);
}

.col-lg-3 {
  flex: 1 1 calc(25% - 16px);
}

.col-lg-4 {
  flex: 1 1 calc(33.333% - 16px);
}

.col-lg-5 {
  flex: 1 1 calc(41.666% - 16px);
}

.col-lg-6 {
  flex: 1 1 calc(50% - 16px);
}

@media (max-width: 767px) {
  .col-md-4,
  .col-md-5,
  .col-md-6,
  .col-md-12 {
    flex: 1 1 100%;
  }
}

@media (max-width: 991px) {
  .col-lg-2,
  .col-lg-3,
  .col-lg-4,
  .col-lg-5,
  .col-lg-6 {
    flex: 1 1 100%;
  }
}

.loyalty-status-item {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  transition: all 0.2s ease;
}

.loyalty-status-item.is-active,
.loyalty-status-item:hover {
  border-color: #1d7eff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.12);
}

.loyalty-status-number {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0f172a;
}

.loyalty-status-badge {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 600;
}

.loyalty-status-name {
  font-weight: 600;
}

.loyalty-premium-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.loyalty-premium-title {
  font-size: 14px;
  color: #334155;
}

.loyalty-premium-value {
  font-size: 20px;
  font-weight: 700;
}

.loyalty-premium-note {
  color: #94a3b8;
  font-size: 13px;
}

.loyalty-summary {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(14, 165, 233, 0.08));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.loyalty-summary__title {
  font-size: 14px;
  color: #334155;
}

.loyalty-summary__value {
  font-size: 26px;
  font-weight: 800;
}

.loyalty-summary__amount {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 180px;
}

.loyalty-summary__note {
  color: #475569;
}

.chip.active {
  background: #0f172a;
  color: #fff;
}

.data-table th,
.data-table td {
  padding: 10px 8px;
}
.max-w-7xl {
  max-width: 90rem !important;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}
.text-sm {
  font-size: 13px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 8px;
}

.select2-container--default .select2-selection--single {
  border: 1px solid #e2e8f0;
  margin-top: 0.25rem !important;
  height: 42px;
  border-radius: 0.75rem;
  font-size: 13px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #fff;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #0f172a;
  line-height: 40px;
  padding-left: 0;
  padding-right: 20px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
  right: 10px;
  top: 0;
}

.select2-dropdown {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.select2-results__option--highlighted.select2-results__option--selectable {
  background: #1063e6 !important;
  color: #ffffff !important;
}

.select2-container--default .select2-results__option--selected {
  background: #1063e6 !important;
  color: #ffffff !important;
}

.select2-container {
  width: 100% !important;
}

.select2-option-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.select2-option-with-logo__img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 18px;
  border-radius: 4px;
}

.select2-option-with-logo__text {
  min-width: 0;
}

.select2-results__option--highlighted .select2-option-with-logo__text,
.select2-results__option--selected .select2-option-with-logo__text {
  color: #ffffff !important;
}

/* Top row in product select: uniform look for client/product/term controls */
#productSelectPage .offer-top-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#productSelectPage .offer-top-select + .select2 .select2-selection--single {
  margin-top: 0.25rem !important;
  min-height: 44px !important;
  border-radius: 0.75rem !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 0.75rem !important;
}

#productSelectPage .offer-top-select + .select2 .select2-selection--single .select2-selection__rendered {
  line-height: 42px !important;
  font-size: 0.875rem !important;
  color: #0f172a !important;
  padding-left: 0 !important;
  padding-right: 1.5rem !important;
}

#productSelectPage .offer-top-select + .select2 .select2-selection--single .select2-selection__arrow {
  height: 42px !important;
  right: 0.625rem !important;
  top: 0 !important;
}

#productSelectPage .offer-top-select + .select2.select2-container--focus .select2-selection--single {
  border-color: #4f9fff !important;
  box-shadow: 0 0 0 2px rgba(182, 216, 255, 0.6) !important;
}

/* Mortgage panel: align Select2 controls with regular inputs */
#mortgageCalcPanel .select2-container--default .select2-selection--single {
  margin-top: 0.25rem !important;
  height: 42px !important;
  border-radius: 0.75rem !important;
  border: 1px solid #e2e8f0 !important;
  padding: 0 0.75rem !important;
  display: flex !important;
  align-items: center !important;
  background: #fff !important;
}

#mortgageCalcPanel .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px !important;
  padding-left: 0 !important;
  padding-right: 20px !important;
  color: #0f172a !important;
  font-size: 0.875rem !important;
}

#mortgageCalcPanel .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px !important;
  right: 0.5rem !important;
  top: 0 !important;
}

#mortgageCalcPanel .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #4f9fff !important;
  box-shadow: 0 0 0 2px rgba(182, 216, 255, 0.6) !important;
}

@media (min-width: 768px) and (max-width: 1279px) {
  .offcanvas {
    width: min(380px, 86vw);
    padding: 1.25rem;
  }

  .offcanvas .offcanvas-body nav a {
    min-height: 44px;
    font-size: 14px;
  }

  .offcanvas .offcanvas-body nav a span.w-8.h-8 {
    width: 2.25rem;
    height: 2.25rem;
  }

  #plannerPage .planner-controls-row {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
  }

  #plannerPage .planner-controls-form {
    flex-wrap: wrap;
    width: 100%;
  }

  #plannerPage .planner-controls-form select,
  #plannerPage .planner-controls-form button,
  #plannerPage .planner-controls-row > a,
  #plannerPage .planner-controls-row > button {
    min-height: 42px;
  }

  #plannerPage .planner-calendar-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #plannerPage .planner-calendar-grid {
    min-width: 980px;
  }

  #plannerPage .planner-day-cell {
    min-height: 110px;
    padding: 0.45rem;
  }

  #plannerPage .planner-legend {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
}

@media (min-width: 1280px) and (max-width: 1536px) {
  #sidebarMenu nav a {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
    font-size: 13px;
  }

  #sidebarMenu nav a > span.w-8.h-8 {
    width: 1.875rem;
    height: 1.875rem;
  }
}

div.fixed.inset-0.z-50 {
    margin-top: 0 !important;
}

.field-required-error {
  border-color: #ef4444 !important;
}

    
