/* ═══════════════════════════════════════
   KPI ROW COMPACTA
═══════════════════════════════════════ */
.users-kpi-row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.users-kpi-item {
  background: var(--gradient-card);
  border: 1px solid var(--color-border-default);
  border-radius: 12px;
  padding: var(--space-3) var(--space-5);
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: border-color 0.2s ease;
}

.users-kpi-item:hover {
  border-color: var(--color-border-hover);
}

.users-kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 500;
}

.users-kpi-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}

.users-kpi-value.kpi-success { color: var(--color-success); }
.users-kpi-value.kpi-neon    { color: var(--color-neon); }
.users-kpi-value.kpi-error   { color: var(--color-error); }
.users-kpi-value.kpi-warning { color: var(--color-warning); }

/* ═══════════════════════════════════════
   FILTERS
═══════════════════════════════════════ */
.users-filters {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

.users-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.users-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.users-search-input {
  padding-left: 2.25rem;
}

.users-filters select {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 10px;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 0.625rem 1rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.users-filters select:focus {
  border-color: var(--color-border-active);
}

/* ═══════════════════════════════════════
   FILTER BADGES REMOVÍVEIS
═══════════════════════════════════════ */
.users-filter-badges {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.5rem 0.2rem 0.75rem;
  border-radius: 100px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.20);
  color: var(--color-neon);
  font-size: var(--text-xs);
  font-weight: 500;
}

.filter-badge button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-neon);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.filter-badge button:hover {
  background: rgba(0, 229, 255, 0.15);
}

/* ═══════════════════════════════════════
   PLAN / STATUS BADGE VARIANTS
═══════════════════════════════════════ */
.badge-cyan {
  background: rgba(0, 229, 255, 0.10);
  color: var(--color-neon);
  border: 1px solid rgba(0, 229, 255, 0.20);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ═══════════════════════════════════════
   TABLE CELLS
═══════════════════════════════════════ */
.user-name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  white-space: nowrap;
}

.user-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.email-cell {
  display: block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  cursor: default;
}

.relative-time {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.payment-method-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 24px;
}

.payment-status-note {
  color: var(--color-text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.cancel-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.cancel-summary div {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  padding: var(--space-3);
}

.cancel-summary span {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
}

.cancel-summary strong {
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.spinner-inline {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* ═══════════════════════════════════════
   ACTIONS MENU BUTTON
═══════════════════════════════════════ */
.actions-cell {
  display: flex;
  justify-content: flex-end;
}

.btn-actions-menu {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-actions-menu:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

/* ═══════════════════════════════════════
   ACTIONS DROPDOWN
═══════════════════════════════════════ */
.actions-dropdown {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
  animation: fadeIn 0.12s ease;
}

.actions-dropdown button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.actions-dropdown button:hover {
  background: rgba(0, 229, 255, 0.06);
  color: var(--color-text-primary);
}

.actions-dropdown button.danger {
  color: var(--color-error);
}

.actions-dropdown button.danger:hover {
  background: var(--color-error-dim);
  color: var(--color-error);
}

/* ═══════════════════════════════════════
   SKELETON
═══════════════════════════════════════ */
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--color-bg-elevated) 0%,
    rgba(0, 229, 255, 0.05) 50%,
    var(--color-bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════
   DRAWER OVERLAY
═══════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.drawer-overlay.visible {
  opacity: 1;
}

/* ═══════════════════════════════════════
   DRAWER
═══════════════════════════════════════ */
.user-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: var(--color-bg-surface);
  border-left: 1px solid var(--color-border-default);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.user-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.drawer-body::-webkit-scrollbar {
  width: 4px;
}

.drawer-body::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-body::-webkit-scrollbar-thumb {
  background: var(--color-border-default);
  border-radius: 4px;
}

.drawer-section {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-subtle);
}

.drawer-section:last-child {
  border-bottom: none;
}

.drawer-section-title {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Header section */
.drawer-user-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.drawer-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.drawer-user-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.drawer-user-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
}

.drawer-user-email {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-user-phone {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Fields grid */
.drawer-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.drawer-field label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-1);
  font-weight: 500;
}

.drawer-field span {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

/* Tickets */
.drawer-tickets {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.drawer-ticket-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--color-border-subtle);
}

.drawer-ticket-id {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  flex-shrink: 0;
}

.drawer-ticket-subject {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-link {
  font-size: var(--text-xs);
  color: var(--color-neon);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.drawer-link:hover { opacity: 0.75; }

.drawer-empty {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Footer */
.drawer-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-default);
  display: flex;
  gap: var(--space-3);
  background: var(--color-bg-surface);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   RESET MODAL
═══════════════════════════════════════ */
.reset-impact-list {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  list-style: disc;
}

/* ═══════════════════════════════════════
   MOBILE
═══════════════════════════════════════ */
@media (max-width: 767px) {
  .users-kpi-row {
    gap: var(--space-2);
  }

  .users-kpi-item {
    padding: var(--space-3) var(--space-4);
    min-width: 100px;
  }

  .users-kpi-value {
    font-size: var(--text-xl);
  }

  .users-search-wrap {
    max-width: 100%;
    flex: 1 1 100%;
  }

  .email-cell {
    max-width: 130px;
  }

  .user-drawer {
    width: 100vw;
  }

  .drawer-fields-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .cancel-summary {
    grid-template-columns: 1fr;
  }
}
