/* =========================================================
   TAJRIVO - RECIPIENTS
========================================================= */


/* =========================================================
   PAGE
========================================================= */

.recipients-page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding-bottom: 50px;
}


/* =========================================================
   HEADING
========================================================= */

.recipients-heading {
  margin-bottom: 24px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.recipients-heading h1 {
  margin: 5px 0 7px;

  color: #0f172a;

  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.1;
  font-weight: 800;

  letter-spacing: -0.04em;
}

.recipients-heading p {
  max-width: 620px;
  margin: 0;

  color: #64748b;

  font-size: 14px;
  line-height: 1.7;
}


/* =========================================================
   ADD BUTTON
========================================================= */

.recipients-add-button {
  min-height: 46px;
  padding: 0 18px;

  border: 0;
  border-radius: 13px;

  background: var(--primary);
  color: #ffffff;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  font-family: inherit;
  font-size: 12px;
  font-weight: 800;

  cursor: pointer;

  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.18);

  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.recipients-add-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);

  box-shadow:
    0 12px 26px rgba(37, 99, 235, 0.22);
}

.recipients-add-button span {
  font-size: 16px;
}


/* =========================================================
   STATS
========================================================= */

.recipients-stats {
  margin-bottom: 20px;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.recipient-stat-card {
  min-height: 105px;

  padding: 18px;

  border: 1px solid #e8edf5;
  border-radius: 19px;

  background: #ffffff;

  display: flex;
  align-items: center;
  gap: 14px;

  box-shadow:
    0 7px 22px rgba(15, 23, 42, 0.045);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.recipient-stat-card:hover {
  transform: translateY(-2px);

  border-color: #dbe4f0;

  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.07);
}

.recipient-stat-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  border-radius: 14px;

  background: #eef5ff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 19px;
}

.recipient-stat-card:nth-child(2)
.recipient-stat-icon {
  background: #fff8e8;
}

.recipient-stat-card:nth-child(3)
.recipient-stat-icon {
  background: #effcf6;
}

.recipient-stat-card > div:last-child {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 5px;
}

.recipient-stat-card span {
  color: #64748b;

  font-size: 11px;
  font-weight: 700;
}

.recipient-stat-card strong {
  color: #0f172a;

  font-size: 21px;
  line-height: 1;
  font-weight: 800;
}


/* =========================================================
   CARD
========================================================= */

.recipients-card {
  overflow: hidden;

  border: 1px solid #e8edf5;
  border-radius: 22px;

  background: #ffffff;

  box-shadow:
    0 10px 34px rgba(15, 23, 42, 0.05);
}


/* =========================================================
   CARD HEADER
========================================================= */

.recipients-card-header {
  min-height: 82px;

  padding: 18px 21px;

  border-bottom: 1px solid #eef2f7;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.recipients-card-header h2 {
  margin: 5px 0 0;

  color: #0f172a;

  font-size: 19px;
  font-weight: 800;
}


/* =========================================================
   SEARCH
========================================================= */

.recipients-search {
  width: min(330px, 100%);
  min-height: 44px;

  padding: 0 13px;

  border: 1px solid #e2e8f0;
  border-radius: 12px;

  background: #ffffff;

  display: flex;
  align-items: center;
  gap: 9px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.recipients-search:focus-within {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.08);
}

.recipients-search span {
  flex-shrink: 0;

  color: #94a3b8;

  font-size: 14px;
}

.recipients-search input {
  width: 100%;
  min-width: 0;

  border: 0;
  outline: 0;

  background: transparent;
  color: #0f172a;

  font-family: inherit;
  font-size: 12px;
}

.recipients-search input::placeholder {
  color: #94a3b8;
}


/* =========================================================
   STATES
========================================================= */

.recipients-state {
  min-height: 300px;

  padding: 45px 20px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.recipients-state[hidden] {
  display: none !important;
}

.recipients-state-icon {
  width: 58px;
  height: 58px;

  margin-bottom: 14px;

  border-radius: 18px;

  background: #f1f5f9;
  color: #64748b;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 22px;
  font-weight: 800;
}

.recipients-state strong {
  margin-bottom: 6px;

  color: #0f172a;

  font-size: 15px;
  font-weight: 800;
}

.recipients-state > span {
  max-width: 390px;

  color: #64748b;

  font-size: 12px;
  line-height: 1.65;
}

.recipients-error-state
.recipients-state-icon {
  background: #fef2f2;
  color: #dc2626;
}


/* =========================================================
   LOADER
========================================================= */

.recipients-loader {
  width: 37px;
  height: 37px;

  margin-bottom: 16px;

  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;

  animation:
    recipients-spin 0.75s linear infinite;
}

@keyframes recipients-spin {
  to {
    transform: rotate(360deg);
  }
}


/* =========================================================
   STATE BUTTONS
========================================================= */

.recipients-retry-button,
.recipients-empty-button {
  min-height: 42px;

  margin-top: 16px;
  padding: 0 16px;

  border: 0;
  border-radius: 12px;

  background: var(--primary);
  color: #ffffff;

  font-family: inherit;
  font-size: 11px;
  font-weight: 800;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.recipients-retry-button:hover,
.recipients-empty-button:hover {
  transform: translateY(-1px);

  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.18);
}


/* =========================================================
   RECIPIENTS GRID
========================================================= */

.recipients-grid {
  padding: 18px;

  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.recipients-grid[hidden] {
  display: none !important;
}


/* =========================================================
   RECIPIENT CARD
========================================================= */

.recipient-card {
  min-width: 0;

  padding: 15px;

  border: 1px solid #e8edf5;
  border-radius: 17px;

  background: #ffffff;

  box-shadow:
    0 4px 15px rgba(15, 23, 42, 0.035);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.recipient-card:hover {
  transform: translateY(-2px);

  border-color: #d7e2ef;

  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.065);
}


/* =========================================================
   CARD TOP
========================================================= */

.recipient-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.recipient-profile {
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 11px;
}

.recipient-avatar {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;

  border-radius: 13px;

  background:
    linear-gradient(
      135deg,
      #eef5ff,
      #e5efff
    );

  color: var(--primary);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 15px;
  font-weight: 800;
}

.recipient-profile-info {
  min-width: 0;
}

.recipient-profile-info strong {
  display: block;

  overflow: hidden;

  color: #0f172a;

  font-size: 12px;
  font-weight: 800;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.recipient-profile-info span {
  display: block;

  margin-top: 4px;

  overflow: hidden;

  color: #64748b;

  font-size: 10px;

  white-space: nowrap;
  text-overflow: ellipsis;
}


/* =========================================================
   FAVORITE BUTTON
========================================================= */

.recipient-favorite-button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;

  padding: 0;

  border: 1px solid #e2e8f0;
  border-radius: 10px;

  background: #ffffff;
  color: #cbd5e1;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 15px;

  cursor: pointer;

  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.recipient-favorite-button:hover {
  border-color: #fde68a;

  background: #fffbeb;
  color: #f59e0b;
}

.recipient-favorite-button.active {
  border-color: #fde68a;

  background: #fffbeb;
  color: #f59e0b;
}


/* =========================================================
   RECIPIENT META
========================================================= */

.recipient-meta {
  margin-top: 14px;

  padding: 11px 12px;

  border-radius: 13px;

  background: #f8fafc;

  display: flex;
  flex-direction: column;
  gap: 7px;
}

.recipient-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recipient-meta-row span {
  color: #94a3b8;

  font-size: 9px;
  font-weight: 700;
}

.recipient-meta-row strong {
  max-width: 65%;

  overflow: hidden;

  color: #475569;

  text-align: right;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
  text-overflow: ellipsis;
}


/* =========================================================
   CARD ACTIONS
========================================================= */

.recipient-card-actions {
  margin-top: 14px;

  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 7px;
}

.recipient-topup-button {
  min-height: 38px;

  padding: 0 12px;

  border: 0;
  border-radius: 11px;

  background: var(--primary);
  color: #ffffff;

  font-family: inherit;
  font-size: 10px;
  font-weight: 800;

  cursor: pointer;
}

.recipient-edit-button,
.recipient-delete-small-button {
  width: 38px;
  height: 38px;

  padding: 0;

  border: 1px solid #e2e8f0;
  border-radius: 11px;

  background: #ffffff;
  color: #64748b;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

.recipient-edit-button:hover {
  background: #f5f8ff;
  color: var(--primary);
}

.recipient-delete-small-button:hover {
  border-color: #fecaca;

  background: #fef2f2;
  color: #dc2626;
}


/* =========================================================
   RECENT SECTION
========================================================= */

.recent-recipients-section {
  margin-top: 20px;

  padding: 20px;

  border: 1px solid #e8edf5;
  border-radius: 22px;

  background: #ffffff;

  box-shadow:
    0 10px 34px rgba(15, 23, 42, 0.05);
}

.recent-recipients-heading {
  margin-bottom: 15px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.recent-recipients-heading h2 {
  margin: 5px 0 0;

  color: #0f172a;

  font-size: 18px;
  font-weight: 800;
}

.recent-recipients-description {
  color: #94a3b8;

  font-size: 10px;
}


/* =========================================================
   RECENT GRID
========================================================= */

.recent-recipients-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.recent-recipient-card {
  min-width: 0;

  padding: 13px;

  border: 1px solid #e8edf5;
  border-radius: 15px;

  background: #f8fafc;

  cursor: pointer;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.recent-recipient-card:hover {
  border-color: #cfe0f5;

  background: #f5f9ff;

  transform: translateY(-1px);
}

.recent-recipient-card-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.recent-recipient-flag {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;

  border-radius: 10px;

  background: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
}

.recent-recipient-info {
  min-width: 0;
}

.recent-recipient-info strong {
  display: block;

  overflow: hidden;

  color: #0f172a;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-recipient-info span {
  display: block;

  margin-top: 3px;

  overflow: hidden;

  color: #94a3b8;

  font-size: 9px;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-recipient-bottom {
  margin-top: 11px;
  padding-top: 9px;

  border-top: 1px solid #e8edf5;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recent-recipient-bottom span {
  color: #94a3b8;

  font-size: 8px;
}

.recent-recipient-bottom strong {
  color: var(--primary);

  font-size: 9px;
  font-weight: 800;
}


/* =========================================================
   RECENT EMPTY
========================================================= */

.recent-recipients-empty {
  grid-column: 1 / -1;

  min-height: 160px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.recent-recipients-empty > span {
  margin-bottom: 8px;

  font-size: 28px;
}

.recent-recipients-empty strong {
  color: #0f172a;

  font-size: 12px;
}

.recent-recipients-empty small {
  margin-top: 5px;

  color: #94a3b8;

  font-size: 9px;
}


/* =========================================================
   MODAL
========================================================= */

.recipient-modal {
  position: fixed;
  inset: 0;

  z-index: 2000;

  padding: 20px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.recipient-modal[hidden] {
  display: none !important;
}

.recipient-modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(15, 23, 42, 0.5);

  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.recipient-modal-card,
.recipient-delete-card {
  position: relative;
  z-index: 2;

  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 40px);

  overflow-y: auto;

  padding: 22px;

  border-radius: 22px;

  background: #ffffff;

  box-shadow:
    0 30px 80px rgba(15, 23, 42, 0.22);

  animation:
    recipient-modal-in 0.22s ease;
}

@keyframes recipient-modal-in {
  from {
    opacity: 0;
    transform:
      translateY(10px)
      scale(0.98);
  }

  to {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
  }
}


/* =========================================================
   MODAL HEADER
========================================================= */

.recipient-modal-header {
  margin-bottom: 19px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.recipient-modal-header h2 {
  margin: 5px 0 0;

  color: #0f172a;

  font-size: 19px;
  font-weight: 800;
}

.recipient-modal-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;

  padding: 0;

  border: 1px solid #e2e8f0;
  border-radius: 11px;

  background: #ffffff;
  color: #64748b;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 21px;

  cursor: pointer;
}

.recipient-modal-close:hover {
  background: #f8fafc;
  color: #0f172a;
}


/* =========================================================
   FORM FIELD
========================================================= */

.recipient-form-field {
  margin-bottom: 15px;
}

.recipient-form-field label {
  display: block;

  margin-bottom: 7px;

  color: #334155;

  font-size: 11px;
  font-weight: 800;
}

.recipient-form-field > input,
.recipient-form-field > select {
  width: 100%;
  height: 48px;

  padding: 0 13px;

  border: 1px solid #dfe6ef;
  border-radius: 12px;
  outline: none;

  background: #ffffff;
  color: #0f172a;

  font-family: inherit;
  font-size: 12px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.recipient-form-field > input:focus,
.recipient-form-field > select:focus {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.08);
}


/* =========================================================
   PHONE
========================================================= */

.recipient-phone-input {
  height: 48px;

  overflow: hidden;

  border: 1px solid #dfe6ef;
  border-radius: 12px;

  display: flex;
  align-items: center;

  background: #ffffff;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.recipient-phone-input:focus-within {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.08);
}

.recipient-phone-input > span {
  height: 100%;

  padding: 0 13px;

  border-right: 1px solid #edf1f5;

  background: #f8fafc;
  color: #475569;

  display: flex;
  align-items: center;

  font-size: 11px;
  font-weight: 800;
}

.recipient-phone-input input {
  flex: 1;
  min-width: 0;
  height: 100%;

  padding: 0 13px;

  border: 0;
  outline: 0;

  background: transparent;
  color: #0f172a;

  font-family: inherit;
  font-size: 12px;
}


/* =========================================================
   FIELD ERROR
========================================================= */

.recipient-field-error {
  display: block;

  min-height: 14px;

  margin-top: 5px;

  color: #dc2626;

  font-size: 9px;
}


/* =========================================================
   FAVORITE CHECKBOX
========================================================= */

.recipient-favorite-checkbox {
  margin-top: 4px;

  padding: 12px;

  border: 1px solid #e8edf5;
  border-radius: 13px;

  background: #f8fafc;

  display: flex;
  align-items: center;
  gap: 10px;

  cursor: pointer;
}

.recipient-favorite-checkbox input {
  display: none;
}

.recipient-favorite-check {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;

  border-radius: 10px;

  background: #ffffff;
  color: #cbd5e1;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 16px;

  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.recipient-favorite-checkbox input:checked
+ .recipient-favorite-check {
  background: #fff8e8;
  color: #f59e0b;
}

.recipient-favorite-checkbox > div {
  min-width: 0;
}

.recipient-favorite-checkbox strong {
  display: block;

  color: #0f172a;

  font-size: 10px;
}

.recipient-favorite-checkbox
div span {
  display: block;

  margin-top: 3px;

  color: #94a3b8;

  font-size: 9px;
}


/* =========================================================
   MODAL ACTIONS
========================================================= */

.recipient-modal-actions {
  margin-top: 18px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.recipient-cancel-button,
.recipient-save-button,
.recipient-delete-button {
  min-height: 44px;

  padding: 0 14px;

  border-radius: 12px;

  font-family: inherit;
  font-size: 11px;
  font-weight: 800;

  cursor: pointer;
}

.recipient-cancel-button {
  border: 1px solid #e2e8f0;

  background: #ffffff;
  color: #475569;
}

.recipient-cancel-button:hover {
  background: #f8fafc;
}

.recipient-save-button {
  border: 0;

  background: var(--primary);
  color: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.recipient-save-button:hover {
  background: var(--primary-dark);
}

.recipient-save-button:disabled {
  opacity: 0.6;

  cursor: not-allowed;
}


/* =========================================================
   BUTTON LOADER
========================================================= */

.recipient-button-loader {
  width: 14px;
  height: 14px;

  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;

  animation:
    recipients-spin 0.7s linear infinite;
}


/* =========================================================
   DELETE CARD
========================================================= */

.recipient-delete-card {
  max-width: 420px;

  text-align: center;
}

.recipient-delete-icon {
  width: 58px;
  height: 58px;

  margin: 0 auto 15px;

  border-radius: 17px;

  background: #fef2f2;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 23px;
}

.recipient-delete-card h2 {
  margin: 0;

  color: #0f172a;

  font-size: 19px;
  font-weight: 800;
}

.recipient-delete-card p {
  max-width: 330px;

  margin: 9px auto 0;

  color: #64748b;

  font-size: 11px;
  line-height: 1.65;
}

.recipient-delete-actions {
  margin-top: 20px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.recipient-delete-button {
  border: 0;

  background: #dc2626;
  color: #ffffff;
}

.recipient-delete-button:hover {
  background: #b91c1c;
}


/* =========================================================
   BODY LOCK
========================================================= */

body.recipient-modal-open {
  overflow: hidden;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

  .recipients-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .recent-recipients-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

  .recipients-page {
    padding-bottom: 30px;
  }


  .recipients-heading {
    align-items: flex-start;
  }

  .recipients-heading h1 {
    font-size: 27px;
  }

  .recipients-heading p {
    font-size: 12px;
  }


  .recipients-add-button {
    flex-shrink: 0;

    min-width: 44px;
    width: 44px;

    padding: 0;

    font-size: 0;
  }

  .recipients-add-button span {
    font-size: 18px;
  }


  .recipients-stats {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  .recipients-card {
    border-radius: 18px;
  }


  .recipients-card-header {
    padding: 16px;

    align-items: stretch;
    flex-direction: column;
  }

  .recipients-search {
    width: 100%;
  }


  .recipients-grid {
    padding: 12px;

    grid-template-columns: 1fr;
  }


  .recent-recipients-section {
    padding: 16px;

    border-radius: 18px;
  }


  .recent-recipients-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }


  .recent-recipients-grid {
    grid-template-columns: 1fr;
  }


  .recipient-modal {
    padding: 12px;
  }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

  .recipients-stats {
    grid-template-columns: 1fr;
  }


  .recipient-stat-card {
    min-height: 82px;
  }


  .recipient-card {
    padding: 13px;
  }


  .recipient-modal {
    padding: 0;

    align-items: flex-end;
  }


  .recipient-modal-card,
  .recipient-delete-card {
    width: 100%;
    max-width: none;
    max-height: 92dvh;

    padding: 18px;

    border-radius:
      22px 22px 0 0;
  }


  .recipient-modal-actions,
  .recipient-delete-actions {
    grid-template-columns: 1fr;
  }

}


/* =========================================================
   HIDDEN
========================================================= */

[hidden] {
  display: none !important;
}