/* ==========================================================================
   NEXUX SAAS ADMIN — COMPONENTES, BOTÕES, MODAIS & DESIGN SYSTEM
   Oficial Dark & Gold (Espacial Luxo)
   ========================================================================== */

/* ==========================================================================
   1. BADGES DE STATUS (ESTILO OFICIAL NEXUX)
   ========================================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: capitalize;
  line-height: 1.2;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Badge Ativo (Esmeralda com Destaque Espacial) */
.status-active {
  background: var(--status-active-bg);
  color: var(--status-active-text);
  border: 1px solid var(--status-active-border);
}
.status-active::before {
  background: var(--status-active-text);
  box-shadow: 0 0 8px var(--status-active-text);
}

/* Badge Trial (Dourado Oficial Nexux) */
.status-trial {
  background: var(--status-trial-bg);
  color: var(--status-trial-text);
  border: 1px solid var(--status-trial-border);
}
.status-trial::before {
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

/* Badge Vencido / Expirado (Vermelho Carmim Refinado) */
.status-expired {
  background: var(--status-expired-bg);
  color: var(--status-expired-text);
  border: 1px solid var(--status-expired-border);
}
.status-expired::before {
  background: var(--status-expired-text);
  box-shadow: 0 0 8px var(--status-expired-text);
}

/* Badge Inativo */
.status-inactive {
  background: var(--status-inactive-bg);
  color: var(--status-inactive-text);
  border: 1px solid var(--status-inactive-border);
}
.status-inactive::before {
  background: var(--status-inactive-text);
}

/* Badge Pendente / Solicitado */
.status-pending {
  background: rgba(216, 180, 90, 0.15);
  color: var(--gold-light);
  border: 1px solid rgba(216, 180, 90, 0.35);
}
.status-pending::before {
  background: var(--gold-light);
  box-shadow: 0 0 8px var(--gold-light);
}

/* ==========================================================================
   2. BOTÕES DO ADMIN (PALETA OFICIAL METÁLICA)
   ========================================================================== */

.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md); /* 14px */
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.adm-btn:active {
  transform: scale(0.97);
}

/* Botão Dourado Principal (CTA Oficial) */
.adm-btn-primary {
  background: var(--grad-gold-metallic);
  color: #06080E;
  border: none;
  box-shadow: 0 4px 18px rgba(229, 181, 79, 0.35);
}

.adm-btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 6px 25px rgba(229, 181, 79, 0.5);
  transform: translateY(-1px);
}

/* Botão Secundário / Ação Escura */
.adm-btn-secondary {
  background: #121A2D;
  color: #ffffff;
  border: 1px solid rgba(216, 180, 90, 0.2);
}

.adm-btn-secondary:hover {
  background: #1A253D;
  border-color: var(--admin-border-gold);
  color: var(--gold-light);
}

/* Botão Outline */
.adm-btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--admin-border);
  color: var(--text-main);
}

.adm-btn-outline:hover {
  background: rgba(216, 180, 90, 0.08);
  border-color: var(--admin-border-gold);
  color: var(--gold-light);
}

/* Botão Sucesso */
.adm-btn-success {
  background: #10b981;
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.adm-btn-success:hover {
  background: #059669;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* Botão Perigo / Excluir */
.adm-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.adm-btn-danger:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Tamanhos & Ícone */
.adm-btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.adm-btn-lg {
  padding: 0.85rem 1.65rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.adm-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.adm-btn-icon:hover {
  color: var(--gold-light);
  border-color: var(--gold-primary);
  background: rgba(216, 180, 90, 0.1);
}

/* ==========================================================================
   3. MODAIS DO ADMIN (SUPERFÍCIE AZUL-NOITE COM BORDAS E GLOW OURO)
   ========================================================================== */

.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 5, 8, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.admin-modal-box {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border-gold);
  border-radius: var(--radius-xl); /* 24px */
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(216, 180, 90, 0.16), inset 0 1px 0 rgba(240, 217, 140, 0.2);
  transform: scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.admin-modal-overlay.open .admin-modal-box {
  transform: scale(1);
}

.admin-modal-header {
  padding: 1.35rem 1.85rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 21, 39, 0.6);
}

.admin-modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.admin-modal-body {
  padding: 1.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.admin-modal-footer {
  padding: 1.25rem 1.85rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  background: rgba(4, 7, 17, 0.6);
}

/* ==========================================================================
   4. WHATSAPP PREVIEW & TIMELINE
   ========================================================================== */

.whatsapp-preview-card {
  background: #0b141a;
  border: 1px solid rgba(216, 180, 90, 0.18);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
}

.whatsapp-chat-bubble {
  background: #005c4b;
  color: #e9edef;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.whatsapp-time {
  text-align: right;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.5rem;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 1.5rem;
}

.timeline-list::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 2px;
  background: var(--admin-border);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold-primary);
  border: 2px solid var(--admin-card-bg);
  box-shadow: 0 0 8px rgba(229, 181, 79, 0.5);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}

.timeline-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   5. TOASTS DE NOTIFICAÇÃO
   ========================================================================== */

.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border-gold);
  color: #fff;
  padding: 0.95rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(216, 180, 90, 0.2);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   6. FORMULÁRIO AVANÇADO DE APPS & CARDS CRUD
   ========================================================================== */

.admin-modal-box.modal-lg {
  max-width: 880px;
}

.form-section-card {
  background: rgba(4, 7, 17, 0.4);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
}

.form-section-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Dropzone de Screenshots */
.screenshot-dropzone {
  border: 2px dashed rgba(216, 180, 90, 0.35);
  background: rgba(216, 180, 90, 0.03);
  border-radius: var(--radius-md);
  padding: 1.6rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.screenshot-dropzone:hover,
.screenshot-dropzone.drag-over {
  border-color: var(--gold-primary);
  background: rgba(216, 180, 90, 0.08);
  box-shadow: 0 0 25px rgba(216, 180, 90, 0.18);
}

.screenshot-dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(216, 180, 90, 0.12);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshot-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.screenshot-thumb-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #040711;
  border: 1px solid var(--admin-border);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.screenshot-thumb-card:hover {
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.screenshot-thumb-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border: 2px dashed var(--gold-primary);
  cursor: grabbing;
}

.screenshot-thumb-card.drag-target-over {
  border-color: var(--gold-light);
  transform: scale(1.04);
  box-shadow: 0 0 18px rgba(229, 181, 79, 0.5);
}

.screenshot-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.screenshot-order-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--gold-light);
  border: 1px solid var(--admin-border-gold);
  font-size: 0.68rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.screenshot-thumb-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.screenshot-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.screenshot-action-btn.delete-btn:hover {
  background: #ef4444;
  color: #fff;
}

.screenshot-action-btn.reorder-btn:hover {
  background: var(--gold-primary);
  color: #06080E;
}

.screenshot-thumb-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 6px 6px 4px;
  font-size: 0.65rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  z-index: 1;
}

/* File Upload Box */
.file-upload-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(4, 7, 17, 0.5);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  min-height: 42px;
}

.file-upload-box:hover {
  border-color: var(--admin-border-gold);
}

.file-upload-info {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.file-upload-info.has-file {
  color: var(--gold-light);
  font-weight: 600;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}

.status-tag.attached {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-tag.pending {
  background: rgba(216, 180, 90, 0.12);
  color: var(--gold-light);
  border: 1px solid rgba(216, 180, 90, 0.3);
}

/* ==========================================================================
   7. CARDS COMPACTOS DE APPS (CRUD)
   ========================================================================== */

.app-compact-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(240, 217, 140, 0.1);
}

.app-compact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-gold-metallic);
  opacity: 0.85;
}

.app-compact-card:hover {
  background: var(--admin-card-hover);
  border-color: var(--admin-border-gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(216, 180, 90, 0.15);
}

.app-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.app-compact-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(216, 180, 90, 0.12);
  border: 1px solid var(--admin-border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  flex-shrink: 0;
}

.app-compact-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.app-compact-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(4, 7, 17, 0.4);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  gap: 0.5rem;
}

.compact-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.compact-metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.compact-metric-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1.2;
}

.app-compact-media-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.compact-media-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--admin-border);
  color: var(--text-muted);
  font-weight: 600;
}

.compact-media-tag.active {
  background: rgba(216, 180, 90, 0.12);
  border-color: var(--admin-border-gold);
  color: var(--gold-light);
}

.compact-media-tag.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.compact-media-tag.muted {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-dark);
}

.media-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ==========================================================================
   8. ABAS DE APLICATIVOS (GESTAO DE CLIENTES)
   ========================================================================== */

.clients-apps-tabs-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.client-app-tab-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.95rem;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.client-app-tab-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: var(--transition);
}

.client-app-tab-card:hover {
  background: var(--admin-card-hover);
  border-color: var(--admin-border-gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.client-app-tab-card.active {
  background: var(--admin-card-elevated);
  border-color: var(--gold-primary);
  box-shadow: 0 0 25px rgba(216, 180, 90, 0.2), inset 0 1px 0 rgba(240, 217, 140, 0.2);
}

.client-app-tab-card.active::before {
  background: var(--grad-gold-metallic);
}

.client-app-tab-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.client-app-tab-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  color: var(--gold-light);
}

.client-app-tab-card.active .client-app-tab-icon {
  background: rgba(216, 180, 90, 0.15);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(216, 180, 90, 0.3);
}

/* ==========================================================================
   9. BANNER PWA FLUTUANTE
   ========================================================================== */

.nexux-pwa-card {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 380px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border-gold);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(216, 180, 90, 0.2);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.3s ease;
}

.nexux-pwa-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.nexux-pwa-close-btn:hover {
  color: #fff;
}

.nexux-pwa-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nexux-pwa-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(216, 180, 90, 0.3);
}

.nexux-pwa-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.nexux-pwa-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.2rem;
}

.nexux-pwa-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nexux-pwa-btn-install {
  background: var(--grad-gold-metallic);
  color: #06080E;
  font-weight: 700;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  justify-content: center;
}

.nexux-pwa-btn-install:hover {
  filter: brightness(1.1);
}

.nexux-pwa-btn-dismiss {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--admin-border);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
}

.nexux-pwa-btn-dismiss:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
