/* =========================================================
   ADMIN CUSTOMERS — EMPERIAL BLOXX
   ========================================================= */

/* =========================
   NAVEGAÇÃO
   ========================= */

.admin-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 38px;
  padding: 0 14px;

  border: 1px solid rgba(250, 204, 21, 0.18);
  border-radius: 12px;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01)
    );

  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.admin-nav-button:hover {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.45);
  transform: translateY(-1px);
}

.admin-nav-button--active {
  color: #111;
  border-color: #facc15;

  background:
    linear-gradient(
      180deg,
      #fde047,
      #eab308
    );

  box-shadow:
    0 8px 24px rgba(234, 179, 8, 0.16);
}

/* =========================
   ESTATÍSTICAS
   ========================= */

.customers-stats {
  margin-bottom: 18px;
}

/* =========================
   FORMULÁRIO
   ========================= */

.admin-card--customer-form {
  margin-bottom: 18px;
  overflow: hidden;
}

.customer-form {
  padding: 0 24px 24px;
}

.customer-form__description {
  margin: 8px 0 0;

  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  line-height: 1.55;
}

.customer-form__grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.4fr)
    minmax(0, 0.8fr)
    minmax(180px, 0.5fr);

  align-items: end;
  gap: 14px;
}

.customer-form__field {
  display: flex;
  flex-direction: column;
  gap: 8px;

  min-width: 0;
}

.customer-form__field > span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.customer-form__field input,
.customer-form__field textarea {
  width: 100%;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;

  background: #090909;
  color: rgba(255, 255, 255, 0.9);

  font-family: inherit;
  font-size: 13px;

  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.customer-form__field input {
  min-height: 44px;
  padding: 0 13px;
}

.customer-form__field textarea {
  min-height: 92px;
  padding: 12px 13px;

  resize: vertical;
  line-height: 1.5;
}

.customer-form__field input::placeholder,
.customer-form__field textarea::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.customer-form__field input:focus,
.customer-form__field textarea:focus {
  border-color: rgba(250, 204, 21, 0.55);

  box-shadow:
    0 0 0 3px rgba(250, 204, 21, 0.07);

  background: #0c0c0c;
}

.customer-form__field--full {
  margin-top: 14px;
}

.customer-form__money {
  display: flex;
  align-items: center;

  min-height: 44px;

  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;

  background: #090909;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.customer-form__money:focus-within {
  border-color: rgba(250, 204, 21, 0.55);

  box-shadow:
    0 0 0 3px rgba(250, 204, 21, 0.07);
}

.customer-form__money > span {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;
  padding: 0 12px;

  border-right: 1px solid rgba(255, 255, 255, 0.07);

  color: #facc15;
  font-size: 13px;
  font-weight: 900;
}

.customer-form__money input {
  flex: 1;

  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.customer-form__preview {
  min-height: 78px;
  padding: 11px 14px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  border: 1px solid rgba(250, 204, 21, 0.22);
  border-radius: 12px;

  background:
    linear-gradient(
      180deg,
      rgba(250, 204, 21, 0.11),
      rgba(250, 204, 21, 0.035)
    );
}

.customer-form__preview span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.customer-form__preview strong {
  margin-top: 3px;

  color: #facc15;
  font-size: 25px;
  line-height: 1;
}

.customer-form__preview small {
  margin-top: 5px;

  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.customer-form__actions {
  display: flex;
  justify-content: flex-end;

  margin-top: 16px;
}

.customer-submit-button {
  min-height: 44px;
  padding: 0 18px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 1px solid #eab308;
  border-radius: 11px;

  background:
    linear-gradient(
      180deg,
      #fde047,
      #eab308
    );

  color: #111;
  font-size: 13px;
  font-weight: 900;

  cursor: pointer;

  box-shadow:
    0 10px 26px rgba(234, 179, 8, 0.16);

  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    opacity 0.2s ease;
}

.customer-submit-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.customer-submit-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.customer-submit-button > span {
  font-size: 18px;
  line-height: 1;
}

.customer-form__message {
  display: none;

  margin: 14px 0 0;
  padding: 11px 13px;

  border-radius: 10px;

  font-size: 12px;
  font-weight: 700;
}

.customer-form__message.is-visible {
  display: block;
}

.customer-form__message.is-success {
  border: 1px solid rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}

.customer-form__message.is-error {
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

/* =========================
   LISTA DE CLIENTES
   ========================= */

.admin-card--customers {
  overflow: hidden;
}

.admin-card__header--customers {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;

  padding: 22px 24px;
}

.customers-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.customers-filters .admin-search {
  min-width: 260px;
}

.customers-filter-select,
.customers-refresh-button {
  min-height: 42px;
  border-radius: 11px;

  font-size: 13px;
  font-weight: 700;
}

.customers-filter-select {
  padding: 0 36px 0 13px;

  border: 1px solid rgba(255, 255, 255, 0.08);

  background: #090909;
  color: rgba(255, 255, 255, 0.78);

  outline: none;
  cursor: pointer;
}

.customers-filter-select:focus {
  border-color: rgba(250, 204, 21, 0.55);
}

.customers-refresh-button {
  padding: 0 16px;

  border: 1px solid rgba(250, 204, 21, 0.35);

  background:
    linear-gradient(
      180deg,
      rgba(250, 204, 21, 0.12),
      rgba(250, 204, 21, 0.05)
    );

  color: #facc15;
  cursor: pointer;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.customers-refresh-button:hover {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.65);

  background:
    linear-gradient(
      180deg,
      rgba(250, 204, 21, 0.18),
      rgba(250, 204, 21, 0.08)
    );
}

.customers-refresh-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.customers-message {
  display: none;

  margin: 0 24px 18px;
  padding: 12px 14px;

  border-radius: 11px;

  font-size: 13px;
  font-weight: 700;
}

.customers-message.is-visible {
  display: block;
}

.customers-message.is-success {
  border: 1px solid rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}

.customers-message.is-error {
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.customers-table-wrapper {
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.customers-table td {
  vertical-align: middle;
}

.customer-email {
  display: flex;
  flex-direction: column;
  gap: 4px;

  min-width: 190px;
}

.customer-email strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.customer-email span {
  max-width: 220px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.customer-money {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-code-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 38px;
  min-height: 30px;
  padding: 0 10px;

  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;

  background: rgba(255, 255, 255, 0.025);

  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.customer-code-count--redeemed {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.07);
  color: #93c5fd;
}

.customer-code-count--available {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}

.customer-code-count--empty {
  border-color: rgba(239, 68, 68, 0.23);
  background: rgba(239, 68, 68, 0.07);
  color: #fca5a5;
}

.customer-action-button--redeem {
  color: #86efac !important;

  border-color:
    rgba(34, 197, 94, 0.28) !important;

  background:
    rgba(34, 197, 94, 0.08) !important;
}

.customer-action-button--redeem:hover {
  border-color:
    rgba(34, 197, 94, 0.55) !important;

  background:
    rgba(34, 197, 94, 0.14) !important;
}

.customer-action-button--edit {
  color: #93c5fd !important;

  border-color:
    rgba(59, 130, 246, 0.28) !important;

  background:
    rgba(59, 130, 246, 0.08) !important;
}

.customer-action-button--edit:hover {
  border-color:
    rgba(59, 130, 246, 0.55) !important;

  background:
    rgba(59, 130, 246, 0.14) !important;
}

.customers-mobile-list {
  display: none;
}

/* =========================
   MODAIS
   ========================= */

.customer-modal__content {
  width: min(560px, calc(100vw - 28px));
}

.customer-modal__icon {
  width: 58px;
  height: 58px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 14px;

  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 16px;

  background:
    linear-gradient(
      180deg,
      rgba(250, 204, 21, 0.15),
      rgba(250, 204, 21, 0.05)
    );

  color: #facc15;
  font-size: 25px;
  font-weight: 900;
}

.customer-modal__title {
  margin: 7px 0 8px;

  color: #fff;
  font-size: 25px;
  line-height: 1.15;
}

.customer-modal__description {
  margin: 0 0 18px;

  color: rgba(255, 255, 255, 0.48);
  font-size: 13px;
  line-height: 1.55;
}

.customer-modal__customer {
  padding: 13px;
  margin-bottom: 12px;

  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.025);
}

.customer-modal__customer span {
  display: block;
  margin-bottom: 5px;

  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.customer-modal__customer strong {
  display: block;
  overflow-wrap: anywhere;

  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.customer-modal__balance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;

  margin-bottom: 16px;
}

.customer-modal__balance > div {
  padding: 12px;

  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;

  background: rgba(255, 255, 255, 0.025);
}

.customer-modal__balance span {
  display: block;

  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-modal__balance strong {
  display: block;
  margin-top: 5px;

  color: #facc15;
  font-size: 20px;
}

.customer-modal__content .customer-form__field {
  margin-top: 13px;
}

.customer-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  margin-top: 20px;
}

.customer-confirm-button {
  min-height: 42px;
  padding: 0 16px;

  border: 1px solid #eab308;
  border-radius: 11px;

  background:
    linear-gradient(
      180deg,
      #fde047,
      #eab308
    );

  color: #111;
  font-size: 13px;
  font-weight: 900;

  cursor: pointer;

  box-shadow:
    0 10px 26px rgba(234, 179, 8, 0.16);

  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    opacity 0.2s ease;
}

.customer-confirm-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.customer-confirm-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* =========================
   RESPONSIVIDADE
   ========================= */

@media (max-width: 1100px) {
  .customer-form__grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .customer-form__preview {
    grid-column: 1 / -1;
  }

  .admin-card__header--customers {
    align-items: stretch;
    flex-direction: column;
  }

  .customers-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .admin-header__actions {
    align-items: stretch;
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-nav-button {
    flex: 1;
  }

  .customers-stats {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .customer-form {
    padding-left: 18px;
    padding-right: 18px;
  }

  .customer-form__grid {
    grid-template-columns: 1fr;
  }

  .customer-form__preview {
    grid-column: auto;
  }

  .customer-form__actions {
    justify-content: stretch;
  }

  .customer-submit-button {
    width: 100%;
  }

  .customers-filters {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .customers-filters .admin-search {
    min-width: 0;
    width: 100%;
  }

  .customers-filter-select,
  .customers-refresh-button {
    width: 100%;
  }

  .customers-table-wrapper {
    display: none;
  }

  .customers-mobile-list {
    display: grid;
    gap: 12px;
  }

  .customer-modal__balance {
    grid-template-columns: 1fr;
  }

  .customer-modal__actions {
    flex-direction: column-reverse;
  }

  .customer-modal__actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .customers-stats {
    grid-template-columns: 1fr;
  }

  .admin-card__header--customers {
    padding: 18px;
  }

  .customers-message {
    margin-left: 18px;
    margin-right: 18px;
  }

  .customer-email {
    min-width: 0;
  }
}