/* ==========================================================
   ADD CUSTOMER PAGE
========================================================== */

.add-customer-page,
.add-customer-page * {
  box-sizing: border-box;
}

.add-customer-page {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================
   BACK BUTTON
========================================================== */

.add-customer-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #334155;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.add-customer-back:hover {
  color: #0f8b4c;
}

/* ==========================================================
   MAIN LAYOUT
========================================================== */

.add-customer-layout {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 20px;
}

.add-customer-form {
  min-width: 0;
}

.add-customer-card,
.customer-summary-card {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.add-customer-card {
  padding: 24px;
}

.customer-summary-card {
  position: sticky;
  top: 24px;
  padding: 22px;
}

/* ==========================================================
   SECTION TITLES
========================================================== */

.add-customer-section-title,
.customer-summary-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.add-customer-section-title {
  margin-bottom: 22px;
}

.add-customer-section-title > span,
.customer-summary-heading > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 50%;
  background: #e8f8ee;
  color: #0f8b4c;
  font-size: 1rem;
}

.add-customer-section-title h2,
.customer-summary-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.08rem;
  font-weight: 900;
}

.add-customer-divider {
  height: 1px;
  margin: 28px 0;
  background: #e8eef5;
}

/* ==========================================================
   FORM GRIDS
========================================================== */

.add-customer-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.add-customer-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.add-customer-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.add-customer-grid.one-column {
  grid-template-columns: minmax(0, 1fr);
}

.add-customer-account-grid {
  display: grid;
  grid-template-columns:
    minmax(160px, 0.8fr)
    minmax(190px, 0.9fr)
    minmax(300px, 1.8fr);
  gap: 18px;
  align-items: start;
}

/* ==========================================================
   LABELS AND CONTROLS
========================================================== */

.add-customer-page label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-customer-page label > span {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
}

.add-customer-page label > span > b {
  color: #ef4444;
}

.add-customer-page input:not([type="checkbox"]),
.add-customer-page select,
.add-customer-page textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.87rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.add-customer-page input:not([type="checkbox"]),
.add-customer-page select {
  height: 48px;
  padding: 0 14px;
}

.add-customer-page textarea {
  min-height: 96px;
  padding: 14px;
  resize: vertical;
}

.add-customer-page input:focus,
.add-customer-page select:focus,
.add-customer-page textarea:focus {
  border-color: #0f8b4c;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(15, 139, 76, 0.09);
}

.add-customer-page input::placeholder,
.add-customer-page textarea::placeholder {
  color: #94a3b8;
}

.add-customer-page label > small {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.45;
}

/* ==========================================================
   PHONE FIELDS
========================================================== */

.add-customer-phone {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
}

.add-customer-country {
  width: 112px;
  min-width: 112px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  cursor: pointer;
}

.add-customer-country b {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 800;
}

.add-customer-country i {
  margin-left: auto;
  font-size: 0.7rem;
}

/* ==========================================================
   NOTES
========================================================== */

.customer-notes-field {
  position: relative;
}

.customer-note-counter {
  align-self: flex-end;
  margin-top: -2px;
  color: #64748b;
  font-size: 0.74rem;
}

/* ==========================================================
   WELCOME MESSAGE
========================================================== */

.welcome-message-option {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 12px !important;
  padding: 2px 0;
}

.welcome-message-option input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: #0f8b4c;
  cursor: pointer;
}

.welcome-message-option > span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.welcome-message-option > span > b {
  color: #0f172a !important;
  font-size: 0.84rem;
  font-weight: 800;
}

.welcome-message-option > span > small {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==========================================================
   ACTION BUTTONS
========================================================== */

.add-customer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #edf2f7;
}

.add-customer-cancel,
.add-customer-submit {
  min-height: 46px;
  padding: 0 24px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.add-customer-cancel {
  min-width: 130px;
  border: 1px solid #dbe4ef;
  background: #fff;
  color: #0f172a;
}

.add-customer-submit {
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  background: #0f8b4c;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 139, 76, 0.2);
}

.add-customer-submit:hover {
  background: #0b773f;
}

/* ==========================================================
   CUSTOMER SUMMARY
========================================================== */

.customer-summary-heading {
  padding-bottom: 18px;
}

.customer-summary-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 10px 24px;
  text-align: center;
}

.customer-summary-avatar {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, #dcfce7, #bbf7d0);
  color: #0f8b4c;
  font-size: 2.2rem;
}

.customer-summary-preview h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 900;
}

.customer-summary-preview p {
  max-width: 100%;
  margin: 7px 0 0;
  overflow: hidden;
  color: #64748b;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-summary-divider {
  height: 1px;
  background: #e8eef5;
}

.customer-summary-list {
  display: grid;
  gap: 4px;
  padding: 16px 0;
}

.customer-summary-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 9px 4px;
}

.customer-summary-item > i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #0f8b4c;
  font-size: 0.88rem;
}

.customer-summary-item > div {
  min-width: 0;
}

.customer-summary-item span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}

.customer-summary-item b {
  display: block;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 800;
}

.customer-summary-status {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 3px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
}

.customer-summary-status.active {
  background: #dcfce7;
  color: #0f8b4c;
}

.customer-summary-status.inactive {
  background: #f1f5f9;
  color: #64748b;
}

.customer-summary-status.blocked {
  background: #fee2e2;
  color: #ef4444;
}

.customer-summary-metrics .orange {
  color: #f97316;
}

.customer-summary-metrics .blue {
  color: #2563eb;
}

.customer-summary-metrics .green {
  color: #0f8b4c;
}

.customer-summary-note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: #f4f8ff;
}

.customer-summary-note > i {
  margin-top: 2px;
  color: #2563eb;
}

.customer-summary-note b {
  display: block;
  margin-bottom: 5px;
  color: #0f172a;
  font-size: 0.82rem;
}

.customer-summary-note p {
  margin: 0;
  color: #475569;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 1050px) {
  .add-customer-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-summary-card {
    position: static;
  }

  .customer-summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-summary-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .add-customer-grid.two-columns,
  .add-customer-grid.three-columns,
  .add-customer-account-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-summary-list,
  .customer-summary-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .add-customer-card,
  .customer-summary-card {
    padding: 18px;
    border-radius: 14px;
  }

  .add-customer-phone {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .add-customer-country {
    width: 104px;
    min-width: 104px;
  }

  .add-customer-actions {
    flex-direction: column-reverse;
  }

  .add-customer-actions button {
    width: 100%;
  }
}
/* ==========================================================
   ADD CUSTOMER. IPAD AND TABLET ACCOUNT SECTION FIX
========================================================== */

@media (max-width: 1450px) {
  .add-customer-page .add-customer-account-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
    align-items: start !important;
  }

  .add-customer-page .add-customer-account-grid > label {
    width: 100% !important;
    min-width: 0 !important;
  }

  .add-customer-page .add-customer-account-grid > label:last-child {
    grid-column: 1 / -1 !important;
  }

  .add-customer-page .add-customer-account-grid input,
  .add-customer-page .add-customer-account-grid select,
  .add-customer-page .add-customer-account-grid textarea {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .add-customer-page .add-customer-account-grid textarea {
    min-height: 105px !important;
  }
}

@media (max-width: 900px) {
  .add-customer-page .add-customer-account-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .add-customer-page .add-customer-account-grid > label:last-child {
    grid-column: auto !important;
  }
}
