/* ==========================================================================
   🎬 NETFLIX ADMIN STUDIO — DESIGN SYSTEM PROFESSIONNEL (ULTRA-MODERNE)
   Obsidian Glassmorphism • Micro-Interactions • Hi-DPI Responsive UI
   ========================================================================== */

:root {
  --admin-bg: #09090c;
  --admin-surface: #121217;
  --admin-surface-card: rgba(20, 20, 26, 0.75);
  --admin-surface-hover: rgba(255, 255, 255, 0.04);
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-focus: #e50914;
  --admin-red: #e50914;
  --admin-red-hover: #b81d24;
  --admin-red-glow: rgba(229, 9, 20, 0.25);
  --admin-text-primary: #f4f4f6;
  --admin-text-secondary: #a1a1aa;
  --admin-text-muted: #71717a;
  --admin-accent-green: #22c55e;
  --admin-accent-blue: #3b82f6;
  --admin-accent-amber: #f59e0b;
  --admin-accent-purple: #a855f7;
}

/* ================= OVERLAY PRINCIPAL ================= */
.admin-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, #151520 0%, var(--admin-bg) 70%);
  z-index: 250;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  color: var(--admin-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  animation: adminFadeIn 0.25s ease-out;
}

.admin-overlay.active {
  display: flex;
}

@keyframes adminFadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* ================= NAVIGATION GLASSMORPHIC ================= */
.admin-navbar {
  height: 72px;
  background: rgba(14, 14, 18, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--admin-border);
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-brand img {
  height: 28px;
  filter: drop-shadow(0 2px 8px rgba(229, 9, 20, 0.3));
}

.admin-badge {
  background: linear-gradient(135deg, var(--admin-red) 0%, #b81d24 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 1.2px;
  box-shadow: 0 2px 10px var(--admin-red-glow);
}

.admin-rust-tag {
  background: rgba(247, 76, 0, 0.12);
  border: 1px solid rgba(247, 76, 0, 0.3);
  color: #ff6a2b;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ================= BOUTONS ADMIN ================= */
.btn-admin {
  background: var(--admin-red);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px var(--admin-red-glow);
}

.btn-admin:hover {
  background: var(--admin-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
}

.btn-admin:active {
  transform: translateY(0);
}

.btn-admin-secondary {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-primary);
  box-shadow: none;
}

.btn-admin-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-admin-outline {
  background: transparent;
  color: var(--admin-text-secondary);
  border: 1px solid var(--admin-border);
  box-shadow: none;
}

.btn-admin-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-admin-red {
  background: var(--admin-red);
  color: #fff;
}

.btn-admin-green {
  background: #16a34a;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.btn-admin-green:hover {
  background: #15803d;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45);
}

.btn-admin-blue {
  background: #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-admin-blue:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

/* ================= CONTENEUR PRINCIPAL ================= */
.admin-container {
  padding: 32px 36px 80px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* ================= GRILLE DES STATISTIQUES ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--admin-surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: background 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.stat-card:hover::before {
  background: linear-gradient(90deg, transparent, var(--admin-red), transparent);
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-icon {
  font-size: 1.1rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--admin-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-highlight {
  color: var(--admin-red);
  text-shadow: 0 0 20px var(--admin-red-glow);
}

.stat-hero-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.stat-uptime-text {
  font-size: 1.35rem;
  color: var(--admin-accent-green);
  font-weight: 800;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.stat-engine-text {
  font-size: 1.15rem;
  color: #ff6a2b;
  font-weight: 800;
}

/* ================= GRILLE DES INTÉGRATIONS XTREAM & GITHUB ================= */
.admin-integrations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1024px) {
  .admin-integrations-grid {
    grid-template-columns: 1fr;
  }
}

.admin-integration-card {
  background: var(--admin-surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.admin-xtream-card {
  border-left: 4px solid var(--admin-red);
}

.admin-github-card {
  border-left: 4px solid var(--admin-accent-green);
}

.admin-integration-card:hover {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.14);
}

.integration-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.integration-icon {
  font-size: 1.35rem;
}

.integration-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.badge-status-active {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--admin-accent-green);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.8px;
}

.badge-status-sync {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--admin-accent-green);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.8px;
  transition: all 0.3s ease;
}

.integration-desc {
  font-size: 0.86rem;
  color: var(--admin-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.integration-credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 14px;
}

.cred-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

.cred-label {
  color: var(--admin-text-muted);
  font-weight: 500;
}

.cred-value {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

.cred-highlight {
  color: #ff5252;
  font-weight: 700;
  border-color: rgba(229, 9, 20, 0.3);
}

.cred-blue {
  color: #60a5fa;
  font-weight: 600;
}

.cred-green {
  color: var(--admin-accent-green);
  font-weight: 600;
}

.integration-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.github-token-drawer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.token-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.token-input {
  flex: 1;
}

.token-feedback {
  font-size: 0.82rem;
  margin-top: 8px;
}

/* ================= TOOLBAR & RECHERCHE ================= */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 500px;
}

.admin-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.admin-search-input {
  width: 100%;
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 11px 40px 11px 40px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.admin-search-input:focus {
  border-color: var(--admin-red);
  box-shadow: 0 0 16px var(--admin-red-glow);
  background: rgba(26, 26, 34, 0.9);
}

.admin-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--admin-text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

.admin-search-clear:hover {
  color: #fff;
}

.admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Onglets filtres modernes */
.admin-filter-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: var(--admin-text-secondary);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-tab-btn span {
  opacity: 0.8;
  font-size: 0.76rem;
}

.admin-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.admin-tab-btn.active {
  background: var(--admin-red);
  color: #fff;
  box-shadow: 0 2px 10px var(--admin-red-glow);
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-secondary);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ================= EN-TÊTE DE SECTION ================= */
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.admin-results-info {
  font-size: 0.84rem;
  color: var(--admin-text-muted);
}

/* ================= TABLEAU DU CATALOGUE ================= */
.catalog-table-container {
  background: var(--admin-surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.catalog-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--admin-text-muted);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
}

.catalog-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  transition: background 0.15s ease;
}

.catalog-table tr:hover td {
  background: var(--admin-surface-hover);
}

.table-poster {
  width: 46px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.table-poster:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
  z-index: 2;
  position: relative;
}

.table-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-main-title {
  font-weight: 700;
  color: #fff;
  font-size: 0.94rem;
}

.table-orig-title {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
}

.table-categories-list {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.category-chip-mini {
  background: rgba(255, 255, 255, 0.06);
  color: var(--admin-text-secondary);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}

/* Badges types */
.badge-type {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-movie {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-series {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-channel {
  background: rgba(229, 9, 20, 0.15);
  color: #ff5252;
  border: 1px solid rgba(229, 9, 20, 0.3);
}

.badge-hero {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.6px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.table-year {
  color: var(--admin-text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
}

.table-score {
  color: var(--admin-accent-green);
  font-weight: 800;
  font-size: 0.88rem;
}

/* Actions rapides sur le tableau */
.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-action-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-secondary);
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-action-sm:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-action-sm.btn-play-test {
  background: rgba(229, 9, 20, 0.15);
  border-color: rgba(229, 9, 20, 0.3);
  color: #ff5252;
}

.btn-action-sm.btn-play-test:hover {
  background: var(--admin-red);
  color: #fff;
  box-shadow: 0 0 12px var(--admin-red-glow);
}

.btn-action-sm.btn-star {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.btn-action-sm.btn-star:hover {
  background: var(--admin-accent-amber);
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.btn-action-sm.btn-clone:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.btn-action-sm.btn-danger {
  padding: 6px 9px;
}

.btn-action-sm.btn-danger:hover {
  background: var(--admin-red);
  border-color: var(--admin-red);
  color: #fff;
  box-shadow: 0 0 10px var(--admin-red-glow);
}

/* ================= MODAL FORMULAIRE D'ÉDITION ================= */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
}

.admin-modal-backdrop.active {
  display: flex;
}

.admin-modal-content {
  background: #15151c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(229, 9, 20, 0.1);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.admin-form-group {
  margin-bottom: 20px;
}

.admin-form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--admin-text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.admin-form-input, .admin-form-textarea, .admin-form-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.admin-form-input:focus, .admin-form-textarea:focus, .admin-form-select:focus {
  border-color: var(--admin-red);
  box-shadow: 0 0 14px var(--admin-red-glow);
  background: rgba(0, 0, 0, 0.6);
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--admin-text-primary);
  margin-top: 10px;
  font-weight: 500;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ================= MODAL SÉCURITÉ ADMIN (PIN 1965) ================= */
.admin-auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 350;
  padding: 24px;
}

.admin-auth-backdrop.active {
  display: flex;
}

.admin-auth-card {
  background: #13131a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 40px 36px 36px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.95), 0 0 50px rgba(229, 9, 20, 0.18);
  animation: authCardPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.admin-auth-icon {
  margin-bottom: 20px;
  display: inline-flex;
  padding: 16px;
  background: rgba(229, 9, 20, 0.12);
  border-radius: 50%;
  border: 1px solid rgba(229, 9, 20, 0.35);
  box-shadow: 0 0 24px var(--admin-red-glow);
}

.admin-auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.admin-auth-desc {
  font-size: 0.88rem;
  color: var(--admin-text-secondary);
  margin-bottom: 26px;
  line-height: 1.5;
}

.admin-auth-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.admin-auth-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 14px 48px 14px 16px;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  outline: none;
  transition: all 0.25s ease;
  font-family: inherit;
}

.admin-auth-input:focus {
  border-color: var(--admin-red);
  box-shadow: 0 0 20px var(--admin-red-glow);
  background: rgba(0, 0, 0, 0.7);
}

.admin-auth-eye-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--admin-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.admin-auth-eye-btn:hover {
  color: #fff;
}

.admin-auth-error {
  color: #ff5252;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  min-height: 20px;
}

.admin-auth-actions {
  display: flex;
  gap: 12px;
}

.admin-auth-actions button {
  flex: 1;
  padding: 12px;
  font-size: 0.95rem;
  justify-content: center;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1c1c24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--admin-red);
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInToast 0.25s ease-out;
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ================= INFRASTRUCTURE CLUSTER MULTI-SERVEURS ================= */
.admin-cluster-container {
  background: var(--admin-surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 26px 28px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.admin-cluster-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #00e676, #ff5252, #2563eb);
  background-size: 300% 100%;
  animation: clusterGradientShift 8s linear infinite;
}

@keyframes clusterGradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cluster-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cluster-icon {
  font-size: 1.6rem;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.25);
}

.cluster-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cluster-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.6px;
  margin: 0;
}

.cluster-subtitle {
  font-size: 0.8rem;
  color: var(--admin-text-secondary);
  margin: 0;
  line-height: 1.4;
}

.cluster-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cluster-live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
  animation: pulseGlow 1.8s ease-in-out infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px #00e676; }
  50% { transform: scale(0.8); opacity: 0.4; box-shadow: 0 0 2px #00e676; }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px #00e676; }
}

.live-text {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #00e676;
  text-transform: uppercase;
}

/* Grille des nœuds */
.cluster-nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin: 22px 0 20px;
}

.cluster-node-card {
  background: #111219;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.cluster-node-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.cluster-node-card.node-current {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06) 0%, #111219 100%);
}

.cluster-node-card.node-offline {
  border-left: 4px solid #ef4444;
  opacity: 0.85;
}

.node-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.node-identity {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.node-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.node-name {
  font-weight: 800;
  font-size: 1.02rem;
  color: #fff;
  letter-spacing: -0.2px;
}

.node-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.node-role-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.node-role-badge.master {
  background: rgba(229, 9, 20, 0.18);
  color: #ff5252;
  border: 1px solid rgba(229, 9, 20, 0.35);
}

.node-role-badge.edge {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.node-role-badge.backup {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.node-current-tag {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  letter-spacing: 0.5px;
}

.node-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.node-status-pill.online {
  background: rgba(0, 230, 118, 0.12);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.node-status-pill.offline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.online {
  background: #00e676;
  box-shadow: 0 0 6px #00e676;
}

.status-dot.offline {
  background: #f87171;
}

.node-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.node-url-text {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--admin-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-latency-pill {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  white-space: nowrap;
}

/* Jauges Métriques CPU & RAM */
.node-metrics-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node-metric-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.metric-title {
  color: var(--admin-text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.metric-value {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-weight: 800;
  color: #fff;
}

.metric-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.35s ease, background 0.2s ease;
}

.metric-bar-fill.normal {
  background: #00e676;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.metric-bar-fill.warn {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.metric-bar-fill.danger {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Statistiques en rangée */
.node-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.node-stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.node-stat-label {
  font-size: 0.68rem;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.node-stat-val {
  font-size: 0.96rem;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.node-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2px;
}

.node-uptime-label {
  font-size: 0.72rem;
  color: var(--admin-text-muted);
}

.btn-delete-node {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #f87171;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-delete-node:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Barre d'enregistrement d'un nœud */
.cluster-add-bar {
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 10px;
}

.add-bar-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--admin-text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cluster-add-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cluster-input-name {
  flex: 1.2;
  min-width: 200px;
}

.cluster-input-url {
  flex: 2;
  min-width: 260px;
}

.cluster-select-role {
  flex: 0.9;
  min-width: 150px;
}

@media (max-width: 768px) {
  .cluster-add-form {
    flex-direction: column;
    align-items: stretch;
  }
  .cluster-input-name, .cluster-input-url, .cluster-select-role {
    width: 100%;
    min-width: 100%;
  }
}

/* ================= SECTION SURVEILLANCE XTREAM SESSIONS EN DIRECT ================= */
.admin-xtream-monitor-container {
  background: var(--admin-surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 26px 28px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.admin-xtream-monitor-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff0055, #f59e0b, #00e676, #ff0055);
  background-size: 300% 100%;
  animation: clusterGradientShift 9s linear infinite;
}

.xtream-monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.monitor-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.monitor-icon {
  font-size: 1.6rem;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(229, 9, 20, 0.25);
}

.monitor-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.monitor-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.6px;
  margin: 0;
}

.monitor-subtitle {
  font-size: 0.8rem;
  color: var(--admin-text-secondary);
  margin: 0;
  line-height: 1.4;
}

.monitor-header-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-sessions-live {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #ff5252;
  letter-spacing: 0.6px;
}

.pulse-dot-red {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5252;
  box-shadow: 0 0 8px #ff5252;
  animation: pulseRed 1.6s ease-in-out infinite;
}

@keyframes pulseRed {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px #ff5252; }
  50% { transform: scale(0.8); opacity: 0.4; box-shadow: 0 0 2px #ff5252; }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px #ff5252; }
}

.badge-sessions-ram {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #c084fc;
}

.xtream-sessions-table-wrap {
  margin-top: 18px;
}

.xtream-sessions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xtream-empty-sessions {
  text-align: center;
  padding: 36px 20px;
  color: var(--admin-text-secondary);
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.xtream-session-card {
  background: #12131b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.xtream-session-card:hover {
  background: #161822;
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateX(2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.session-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1.4;
  min-width: 220px;
}

.session-channel-icon {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
  flex-shrink: 0;
}

.session-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.session-channel-name {
  font-weight: 800;
  font-size: 0.96rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-category {
  font-size: 0.74rem;
  color: var(--admin-text-muted);
}

.session-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 2.2;
  flex-wrap: wrap;
}

.badge-app {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-app.televizo {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-app.tivimate {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-app.smarters {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-app.vlc {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.badge-app.web {
  background: rgba(229, 9, 20, 0.18);
  color: #ff5252;
  border: 1px solid rgba(229, 9, 20, 0.4);
}

.badge-app.other {
  background: rgba(156, 163, 175, 0.18);
  color: #e5e7eb;
  border: 1px solid rgba(156, 163, 175, 0.4);
}

.badge-server-node {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--admin-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.session-stat-pill {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.session-stat-pill.ram {
  color: #38bdf8;
}

.session-stat-pill.duration {
  color: #34d399;
}

.session-stat-pill.ip {
  color: var(--admin-text-muted);
}

.session-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-kill-session {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-kill-session:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

@media (max-width: 900px) {
  .xtream-session-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .session-left, .session-center, .session-right {
    width: 100%;
  }
  .session-right {
    justify-content: flex-end;
  }
}


