﻿/* ===== USUARIOS ADMIN - Estilo Oceanstock ===== */

.container {
  width: 95%;
  margin-left: 2.5%;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Stats Cards */
.statsGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.statCard {
  background-color: #111113;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 28px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.statIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.statInfo {
  display: flex;
  flex-direction: column;
}

.statValue {
  font-size: 22px;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1.2;
}

.statLabel {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

/* Tabla Card */
.tableCard {
  background-color: #111113;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

/* Toolbar (busqueda + filtros) */
.tableToolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.searchBox {
  position: relative;
  flex: 1;
  max-width: 320px;
  min-width: 200px;
}

.searchIcon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
}

.searchInput {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.035);
  color: #f9fafb;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease;
  caret-color: #f9fafb;
}

.searchInput::placeholder {
  color: #6b7280;
}

.searchInput:focus {
  border-color: rgba(255, 255, 255, 0.15);
}

.filterGroup {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Dropdowns */
.dropdownWrapper {
  position: relative;
}

.dropdownTrigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.035);
  color: #f9fafb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease;
  white-space: nowrap;
}

.dropdownTrigger:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.filterDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chevron {
  color: #6b7280;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.chevronOpen {
  transform: rotate(180deg);
}

.dropdownBackdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.dropdownMenu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background-color: #1a1a1d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  z-index: 1000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.dropdownItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.dropdownItem:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #f9fafb;
}

.dropdownItemActive {
  color: #5b9aff;
  background-color: rgba(91, 154, 255, 0.08);
}

.dropdownItemLabel {
  flex: 1;
}

.dropdownCheck {
  color: #5b9aff;
  flex-shrink: 0;
}

/* Tabla */
.tableContainer {
  overflow: visible;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #6b7280;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.th:first-child {
  padding-left: 24px;
}

.th:last-child {
  padding-right: 24px;
  text-align: right;
}

.tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease;
}

.tr:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

.tr:last-child {
  border-bottom: none;
}

.td {
  padding: 14px 16px;
  font-size: 14px;
  color: #9ca3af;
  vertical-align: middle;
  white-space: nowrap;
}

.td:first-child {
  padding-left: 24px;
}

.tdUser {
  min-width: 220px;
}

.tdActions {
  padding-right: 24px;
  text-align: right;
}

/* Celda de usuario */
.userCell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.userMeta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.userName {
  font-size: 14px;
  font-weight: 600;
  color: #f9fafb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userId {
  font-size: 12px;
  color: #6b7280;
}

.email {
  font-size: 14px;
  color: #9ca3af;
  font-weight: 500;
}

/* Estado */
.statusCell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

/* Rol Badge */
.rolBadge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Fecha */
.date {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* IP */
.ip {
  font-size: 13px;
  color: #6b7280;
  font-family: monospace;
  font-variant-numeric: tabular-nums;
}

/* Acciones */
.actionsWrapper {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.menuBtn {
  padding: 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.menuBtn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #f9fafb;
}

.menuBtnActive {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f9fafb;
}

.menuBackdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
}

.actionMenu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 150px;
  background-color: #1a1a1d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.actionMenuItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.actionMenuItem:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.actionMenuDanger {
  color: #ef4444;
}

.actionMenuDanger:hover {
  background-color: rgba(239, 68, 68, 0.08);
}

/* No Results */
.noResults {
  text-align: center;
  padding: 48px 16px;
  color: #6b7280;
  font-size: 14px;
}

/* Paginacion */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.paginationInfo {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.paginationButtons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pageBtn {
  padding: 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #f9fafb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pageBtn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.06);
}

.pageBtn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pageNum {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pageNum:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #f9fafb;
}

.pageNumActive {
  background-color: #5b9aff;
  color: #ffffff;
}

.pageNumActive:hover {
  background-color: #5b9aff;
  color: #ffffff;
}

/* Loading */
.loadingContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 16px;
  color: #9ca3af;
  font-size: 14px;
}

.spinner {
  position: relative;
  width: 40px;
  height: 40px;
}

.spinnerBlade {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background-color: #6b7280;
  border-radius: 2px;
  transform-origin: center 20px;
  animation: spinnerFade 1s linear infinite;
}

.spinnerBlade:nth-child(1) { transform: rotate(0deg); animation-delay: -1.1s; }
.spinnerBlade:nth-child(2) { transform: rotate(30deg); animation-delay: -1s; }
.spinnerBlade:nth-child(3) { transform: rotate(60deg); animation-delay: -0.9s; }
.spinnerBlade:nth-child(4) { transform: rotate(90deg); animation-delay: -0.8s; }
.spinnerBlade:nth-child(5) { transform: rotate(120deg); animation-delay: -0.7s; }
.spinnerBlade:nth-child(6) { transform: rotate(150deg); animation-delay: -0.6s; }
.spinnerBlade:nth-child(7) { transform: rotate(180deg); animation-delay: -0.5s; }
.spinnerBlade:nth-child(8) { transform: rotate(210deg); animation-delay: -0.4s; }
.spinnerBlade:nth-child(9) { transform: rotate(240deg); animation-delay: -0.3s; }
.spinnerBlade:nth-child(10) { transform: rotate(270deg); animation-delay: -0.2s; }
.spinnerBlade:nth-child(11) { transform: rotate(300deg); animation-delay: -0.1s; }
.spinnerBlade:nth-child(12) { transform: rotate(330deg); animation-delay: 0s; }

@keyframes spinnerFade {
  0% { opacity: 1; }
  100% { opacity: 0.15; }
}

/* Error */
.errorContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 12px;
  color: #9ca3af;
  text-align: center;
}

.errorContainer h2 {
  color: #f9fafb;
  font-size: 18px;
  margin: 0;
}

.errorContainer p {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

.reloadButton {
  margin-top: 8px;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #f9fafb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reloadButton:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

/* Modal */
.modalContent {
  padding: 24px;
}

.modalHeader h2 {
  font-size: 18px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0 0 20px;
}

.userDetailContent {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.userDetailAvatar {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, 0.05);
}

.userDetailAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.userDetails {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detailGroup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detailLabel {
  font-size: 13px;
  color: #6b7280;
  min-width: 80px;
  font-weight: 500;
}

.detailValue {
  font-size: 14px;
  color: #f9fafb;
  font-weight: 500;
}

.editForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.formGroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formGroup label {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 500;
}

.selectField {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.035);
  color: #f9fafb;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.selectField option {
  color: #111;
  background: #fff;
}

.modalActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.primaryButton {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background-color: #5b9aff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.primaryButton:hover {
  background-color: #4a89ee;
}

.primaryButton:disabled {
  opacity: 0.5;
  cursor: default;
}

.secondaryButton {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #f9fafb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.secondaryButton:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.dangerButton {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dangerButton:hover {
  background-color: rgba(239, 68, 68, 0.18);
}

.dangerButton:disabled {
  opacity: 0.5;
  cursor: default;
}

.closeButton {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.closeButton:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #f9fafb;
}

.confirmationContent {
  text-align: center;
  padding: 16px 0;
}

.warningIcon {
  color: #f59e0b;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.confirmationMessage {
  font-size: 15px;
  color: #f9fafb;
  margin: 0 0 8px;
}

.warningMessage {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px;
}

.successMessage {
  padding: 10px 14px;
  border-radius: 8px;
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 13px;
  font-weight: 500;
}

.errorMessage {
  padding: 10px 14px;
  border-radius: 8px;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .statsGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    margin-left: 0;
    padding: 16px;
    padding-top: 72px;
  }

  .statsGrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tableToolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
  }

  .searchBox {
    max-width: 100%;
  }

  .filterGroup {
    margin-left: 0;
    justify-content: flex-start;
  }

  .th, .td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .th:first-child, .td:first-child {
    padding-left: 16px;
  }

  .th:last-child, .tdActions {
    padding-right: 16px;
  }

  .pagination {
    padding: 12px 16px;
    flex-direction: column;
    gap: 10px;
  }

  .userDetailContent {
    flex-direction: column;
    align-items: center;
  }
}

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