/* ==========================================================
   EDIT CUSTOMER
========================================================== */

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

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

.page-back-btn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1e293b;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.page-back-btn:hover {
  color: #0f8b4c;
}

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

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

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

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

.edit-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-card {
  padding: 22px;
}

/* ==========================================================
   EDIT SECTIONS
========================================================== */

.edit-section + .edit-section {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px dashed #dce5ef;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.title-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 50%;
  background: #e8f8ee;
  color: #0f8b4c;
  font-size: 1rem;
}

.section-title h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 900;
}

.section-title p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.77rem;
  font-weight: 600;
}

.section-title > small {
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
}

.required {
  color: #ef4444;
}

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

.edit-customer-page .three-columns,
.edit-customer-page .two-columns,
.account-grid {
  display: grid;
  gap: 20px;
  align-items: start;

  grid-template-columns:
    minmax(170px, 1fr)
    minmax(170px, 1fr)
    minmax(320px, 2fr);
}

.account-grid > label {
  min-width: 0;
}

.account-grid input,
.account-grid select,
.account-grid textarea {
  min-width: 0;
}

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

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

.account-grid {
  grid-template-columns: 170px 190px minmax(260px, 1fr);
  align-items: start;
}

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

.edit-customer-page label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #475569;
  font-size: 0.81rem;
  font-weight: 700;
}

.edit-customer-page input,
.edit-customer-page select,
.edit-customer-page textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.87rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.edit-customer-page input,
.edit-customer-page select {
  height: 48px;
  padding: 0 14px;
}

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

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

.edit-customer-page input:disabled {
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}

/* ==========================================================
   WELCOME OPTION
========================================================== */

.welcome-option {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 12px !important;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #edf2f7;
}

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

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

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

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

/* ==========================================================
   ACTIONS
========================================================== */

.edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #edf2f7;
}

.edit-actions > div {
  display: flex;
  gap: 12px;
}

.danger-btn,
.secondary-btn,
.primary-btn {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #ef4444;
}

.secondary-btn {
  min-width: 120px;
  border: 1px solid #dbe4ef;
  background: #fff;
  color: #0f172a;
}

.primary-btn {
  min-width: 160px;
  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);
}

.primary-btn:hover {
  background: #0b773f;
}

/* ==========================================================
   SIDEBAR
========================================================== */

.summary-card h3 {
  margin: 0 0 18px;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 900;
}

.summary-list {
  display: grid;
  gap: 14px;
}

.summary-list > div {
  padding-bottom: 14px;
  border-bottom: 1px solid #edf2f7;
}

.summary-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

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

.summary-list b {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 900;
}

.summary-card > p {
  margin: 0;
  padding: 30px 10px;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

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

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

  .edit-sidebar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .edit-customer-page .three-columns,
  .edit-customer-page .two-columns,
  .account-grid {
    display: grid;
    gap: 20px;
    align-items: start;

    grid-template-columns:
      minmax(170px, 1fr)
      minmax(170px, 1fr)
      minmax(320px, 2fr);
  }

  .edit-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-title {
    flex-direction: column;
  }

  .edit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .edit-actions > div {
    width: 100%;
  }

  .edit-actions > div button,
  .danger-btn {
    flex: 1;
  }
}

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

  .edit-actions > div {
    flex-direction: column-reverse;
  }

  .edit-actions button {
    width: 100%;
  }
}
/* ==========================================================
   EDIT CUSTOMER PHONE FIELDS
========================================================== */

.edit-phone-field {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  width: 100%;
}

.edit-country-picker {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #dbe4ef;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.edit-country-picker i {
  margin-left: auto;
  font-size: 0.68rem;
}

.edit-country-flag {
  font-size: 1rem;
}

.edit-phone-field input {
  border-radius: 0 10px 10px 0;
}

.edit-field-help {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ==========================================================
   EDIT CUSTOMER SIDEBAR
========================================================== */

.edit-summary-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.edit-summary-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 20px;
}

.edit-summary-heading-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 50%;
  background: #e8f8ee;
  color: #0f8b4c;
}

.edit-summary-heading h3 {
  margin: 0;
  color: #0f172a;
  font-size: 0.94rem;
  font-weight: 900;
}

.edit-overview-list {
  display: grid;
  gap: 16px;
}

.edit-overview-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.edit-overview-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.edit-overview-icon.green {
  background: #e4f8ec;
  color: #0f9f5c;
}

.edit-overview-icon.blue {
  background: #e8efff;
  color: #2563eb;
}

.edit-overview-icon.amber {
  background: #fff5dc;
  color: #d89500;
}

.edit-overview-icon.orange {
  background: #fff0e1;
  color: #f97316;
}

.edit-overview-item small {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 0.69rem;
  font-weight: 700;
}

.edit-overview-item b {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 900;
}

.edit-empty-state {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 14px;
  text-align: center;
}

.edit-empty-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #eef3fb;
  color: #40558c;
  font-size: 1.7rem;
}

.edit-empty-state b {
  color: #14213a;
  font-size: 0.83rem;
  font-weight: 900;
}

.edit-empty-state p {
  margin: 7px 0 0;
  color: #64748b;
  font-size: 0.73rem;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .edit-phone-field {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .edit-country-picker {
    padding: 0 9px;
  }
}
/* ==========================================================
   ACCOUNT INFORMATION. TABLET AND IPAD FIX
========================================================== */

@media (max-width: 1180px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-grid > label:last-child {
    grid-column: 1 / -1;
  }

  .account-grid textarea {
    min-height: 110px;
  }
}

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

  .account-grid > label:last-child {
    grid-column: auto;
  }
}
/* ===============================
   EDIT CUSTOMER RESPONSIVE
=================================*/

@media (max-width: 1200px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-grid label:nth-child(3) {
    grid-column: 1 / -1;
  }

  .account-grid textarea {
    min-height: 110px;
  }
}

@media (max-width: 768px) {
  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-grid label:nth-child(3) {
    grid-column: auto;
  }
}
/* ==========================================================
   IPAD LANDSCAPE. ACCOUNT INFORMATION FIX
========================================================== */

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

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

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

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

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

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