/* ==========================================================================
   NEXUS SAAS ADMIN — COMPONENTES & MODAIS
   ========================================================================== */

/* Badges de Status */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

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

.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); }

.status-trial {
  background: var(--status-trial-bg);
  color: var(--status-trial-text);
  border: 1px solid var(--status-trial-border);
}
.status-trial::before { background: var(--status-trial-text); }

.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); }

.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); }

.status-pending {
  background: rgba(0, 242, 254, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}
.status-pending::before { background: var(--neon-cyan); }

/* Botões do Admin */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.adm-btn-primary {
  background: var(--neon-cyan);
  color: #000;
}
.adm-btn-primary:hover {
  background: #38f5ff;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.adm-btn-success {
  background: #10b981;
  color: #fff;
}
.adm-btn-success:hover {
  background: #059669;
}

.adm-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.adm-btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.adm-btn-outline {
  background: transparent;
  border-color: var(--admin-border);
  color: var(--text-main);
}
.adm-btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.adm-btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.775rem;
}

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

/* Modais do Admin */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

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

.admin-modal-box {
  background: #111827;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: all 0.2s ease;
}

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

.admin-modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

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

.admin-modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
}

/* WhatsApp Message Preview Box */
.whatsapp-preview-card {
  background: #0b141a;
  border: 1px solid #1f2c34;
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
}

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

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

/* Linha do Tempo / Histórico do Cliente */
.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(--neon-cyan);
  border: 2px solid #111827;
}

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

.timeline-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: #fff;
}

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

/* Toast de Notificação Admin */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid var(--neon-cyan);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s ease;
}

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

/* ==========================================================================
   FORMULÁRIO AVANÇADO DE APPS & SEÇÕES MODAIS
   ========================================================================== */
.admin-modal-box.modal-lg {
  max-width: 860px;
}

.form-section-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

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

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

/* --- DROPZONE E GALERIA DE SCREENSHOTS --- */
.screenshot-dropzone {
  border: 2px dashed rgba(0, 242, 254, 0.3);
  background: rgba(0, 242, 254, 0.03);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.screenshot-dropzone:hover,
.screenshot-dropzone.drag-over {
  border-color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.screenshot-dropzone-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.1);
  color: var(--neon-cyan);
  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: #0d131f;
  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(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

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

.screenshot-thumb-card.drag-target-over {
  border-color: #38f5ff;
  transform: scale(1.04);
  box-shadow: 0 0 15px rgba(0, 242, 254, 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.75);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 242, 254, 0.4);
  font-size: 0.65rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  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.75);
  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(--neon-cyan);
  color: #000;
}

.screenshot-thumb-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), 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;
}

/* --- CARDS DE HTML (APRESENTAÇÃO / GUIA) --- */
.html-dual-input-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.html-dual-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 640px) {
  .html-dual-input-row {
    grid-template-columns: 1fr;
  }
}

.file-upload-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  min-height: 42px;
}

.file-upload-box:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

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

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

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

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

.status-tag.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* --- BADGES INDICADORES NO CARD DO CRUD (LISTAGEM) --- */
.app-card-meta-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--admin-border);
  margin-bottom: 0.5rem;
}

.meta-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--admin-border);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.meta-indicator-badge.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.35);
  color: #fff;
}

.meta-indicator-badge.success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.meta-indicator-badge.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.meta-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
