/* ===========================================
   e-Navette - Admin Page Styles
   =========================================== */

/* Variables */
:root {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --panel: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --header-height: 56px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* Header - voir header-admin.css pour les styles communs */

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  padding: 0.15rem 0.5rem;
  background: var(--bg);
  border-radius: 4px;
  margin-left: 0.5rem;
}

/* Header Actions (boutons d'import) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.header-action-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.header-action-btn:hover {
  background: var(--border);
  color: var(--text);
}

.header-action-btn i {
  font-size: 0.9rem;
}

.header-action-btn.btn-import {
  border-left: none;
  border-radius: 0 6px 6px 0;
  background: var(--success);
  color: white;
  padding: 0.5rem 0.6rem;
}

.header-action-btn.btn-import:hover {
  background: #16a34a;
}

/* Couleurs discrètes pour les boutons d'action */
.header-action-btn.btn-navette {
  border-color: rgba(34, 197, 94, 0.4);
}
.header-action-btn.btn-navette i {
  color: #22c55e;
}
.header-action-btn.btn-navette:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.6);
}

.header-action-btn.btn-splunk {
  border-color: rgba(168, 85, 247, 0.4);
}
.header-action-btn.btn-splunk i {
  color: #a855f7;
}
.header-action-btn.btn-splunk:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.6);
}

.header-action-btn.btn-siinfos {
  border-color: rgba(59, 130, 246, 0.4);
}
.header-action-btn.btn-siinfos i {
  color: #3b82f6;
}
.header-action-btn.btn-siinfos:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.6);
}

.header-action-btn.btn-sync {
  border-color: rgba(245, 158, 11, 0.4);
}
.header-action-btn.btn-sync i {
  color: #f59e0b;
}
.header-action-btn.btn-sync:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.6);
}

.header-action-group .header-action-btn:first-child {
  border-radius: 6px 0 0 6px;
}

.header-action-group .header-action-btn:first-child:last-child,
.header-action-group .header-action-btn.hidden + .header-action-btn:first-of-type {
  border-radius: 6px;
}

.header-action-btn.btn-kanban {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.header-action-btn.btn-kanban:hover {
  background: var(--accent-hover);
}

/* Barre de statut d'import */
.import-status-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  padding: 0.5rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 99;
  font-size: 0.875rem;
}

.import-status-bar.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--success);
  color: var(--success);
}

.import-status-bar.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.close-status-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.7;
}

.close-status-btn:hover {
  opacity: 1;
}

/* Header Right - styles spécifiques admin */

/* Stats utilisateurs dans le header */
.header-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  min-width: 60px;
}

.header-stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.header-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.header-stat.stat-admin .header-stat-number {
  color: var(--success);
}

.header-stat.stat-user .header-stat-number {
  color: var(--accent);
}

.header-btn-users {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  transition: all 0.2s;
}

.header-btn-users:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.header-btn-users i {
  font-size: 1.1rem;
}

.header-btn-audit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--warning);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  transition: all 0.2s;
}

.header-btn-audit:hover {
  background: #d97706;
  transform: scale(1.05);
}

.header-btn-audit i {
  font-size: 1.1rem;
}

.header-separator {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 0.5rem;
}

/* Main Admin Area */
.admin-main {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Page d'accueil Admin */
.admin-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem;
  max-width: 1100px;
  width: 100%;
}

.welcome-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.welcome-icon i {
  font-size: 2.5rem;
  color: white;
}

.admin-welcome h1 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.admin-welcome p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.admin-welcome .welcome-subtitle {
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Grille des boutons Import sur la page d'accueil */
.admin-import-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.admin-import-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: left;
}

.admin-import-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.import-card-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  flex-shrink: 0;
}

.import-card-icon i {
  font-size: 1.75rem;
}

.import-card-content {
  flex: 1;
  min-width: 0;
}

.import-card-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.import-card-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Variante Nouvel SI (vert émeraude) */
.admin-import-card.import-newsi {
  border-color: rgba(34, 197, 94, 0.3);
}

.admin-import-card.import-newsi:hover {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.05);
}

.admin-import-card.import-newsi .import-card-icon {
  background: rgba(34, 197, 94, 0.15);
}

.admin-import-card.import-newsi .import-card-icon i {
  color: #22c55e;
}

/* Variante SI Infos (bleu) */
.admin-import-card.import-siinfos {
  border-color: rgba(59, 130, 246, 0.3);
}

.admin-import-card.import-siinfos:hover {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.05);
}

.admin-import-card.import-siinfos .import-card-icon {
  background: rgba(59, 130, 246, 0.15);
}

.admin-import-card.import-siinfos .import-card-icon i {
  color: #3b82f6;
}

/* Variante Synchro (orange) */
.admin-import-card.import-sync {
  border-color: rgba(245, 158, 11, 0.3);
}

.admin-import-card.import-sync:hover {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.05);
}

.admin-import-card.import-sync .import-card-icon {
  background: rgba(245, 158, 11, 0.15);
}

.admin-import-card.import-sync .import-card-icon i {
  color: #f59e0b;
}

/* Variante Splunk (violet) */
.admin-import-card.import-splunk {
  border-color: rgba(168, 85, 247, 0.3);
}

.admin-import-card.import-splunk:hover {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(168, 85, 247, 0.05);
}

.admin-import-card.import-splunk .import-card-icon {
  background: rgba(168, 85, 247, 0.15);
}

.admin-import-card.import-splunk .import-card-icon i {
  color: #a855f7;
}

/* Responsive */
@media (max-width: 600px) {
  .admin-import-grid {
    grid-template-columns: 1fr;
  }
}

.welcome-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.welcome-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  min-width: 120px;
}

.welcome-link i {
  font-size: 1.5rem;
  color: var(--accent);
}

.welcome-link span {
  font-size: 0.85rem;
  font-weight: 500;
}

.welcome-link:hover {
  background: var(--panel-lighter);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.welcome-link:hover i {
  color: var(--accent-light);
}

.welcome-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.welcome-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* Liste des SI (ancien, gardé pour compatibilité) */
.admin-si-list {
  width: 100%;
  max-width: 1200px;
}

.si-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.si-list-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  color: var(--text);
}

.si-list-header h2 i {
  color: var(--accent);
}

.si-list-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.si-list-search i {
  color: var(--text-muted);
}

.si-list-search input {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  width: 200px;
}

.si-list-search input::placeholder {
  color: var(--text-muted);
}

.si-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Admin Grid (ancien, gardé pour compatibilité) */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Admin Card */
.admin-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.admin-card-header i {
  font-size: 1.25rem;
  color: var(--accent);
}

.admin-card-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.badge-count {
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

.admin-card-body {
  flex: 1;
  padding: 1.25rem;
}

.admin-card-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

/* Card Import - full width */
.card-import {
  grid-column: span 2;
}

/* Card Messages - full width */
.card-fullwidth {
  grid-column: span 2;
}

/* Stats Row */
.stats-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg);
  border-radius: 10px;
  min-width: 100px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-item.stat-admin .stat-number {
  color: var(--success);
}

.stat-item.stat-user .stat-number {
  color: var(--accent);
}

/* Admin Buttons */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--accent);
}

/* Messages Section */
.no-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}

.no-messages i {
  font-size: 2rem;
  opacity: 0.5;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.message-item:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent);
}

.message-item.unread {
  border-left: 3px solid var(--accent);
}

.message-si {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.8rem;
  background: rgba(59, 130, 246, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-title {
  font-weight: 500;
  color: var(--text);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.message-type {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.message-type.support { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.message-type.evolution { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.message-type.libre { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

/* Messages en 6 colonnes (statuts onboarding) */
.messages-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.messages-columns.messages-columns-6 {
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.messages-column {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
}

/* Headers de colonnes par statut onboarding */
.status-column-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 2px solid var(--status-color, var(--border));
  flex-wrap: wrap;
}

.status-column-header i {
  font-size: 0.85rem;
  color: var(--status-color);
}

.status-name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-unread-badge {
  background: var(--accent);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  animation: pulse 2s infinite;
}

.status-total {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 8px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.status-messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
}

/* Groupes par SI */
.si-group {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid transparent;
}

.si-group.has-unread {
  border-color: rgba(59, 130, 246, 0.3);
}

.si-group-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.15s;
}

.si-group-header:hover {
  background: rgba(59, 130, 246, 0.1);
}

.si-name {
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--accent);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.si-unread-badge {
  background: var(--accent);
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 6px;
  animation: pulse 2s infinite;
}

.si-count {
  font-size: 0.6rem;
  color: var(--text-muted);
  background: var(--border);
  padding: 1px 4px;
  border-radius: 4px;
}

/* Topics dans un SI */
.si-topics {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.25rem;
}

.topic-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  background: var(--panel);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.topic-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

.topic-item.read {
  opacity: 0.55;
}

.topic-item.read:hover {
  opacity: 0.8;
}

.topic-item.unread {
  border-left: 2px solid var(--accent);
}

.topic-content {
  flex: 1;
  min-width: 0;
}

.topic-title {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-item.read .topic-title {
  color: var(--text-muted);
  font-weight: 400;
}

.topic-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.topic-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bouton archiver par statut */
.btn-clear-status {
  margin-left: auto;
  padding: 2px 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.15s;
}

.btn-clear-status:hover {
  opacity: 1;
  background: rgba(139, 92, 246, 0.15);
  border-color: #a78bfa;
  color: #a78bfa;
}

/* Legacy category styles (pour compatibilité) */
.category-column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 2px solid var(--cat-color, var(--border));
}

.category-column-header i {
  font-size: 1rem;
  color: var(--cat-color);
}

.category-name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
  font-size: 0.9rem;
}

.category-unread-badge {
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  animation: pulse 2s infinite;
}

.category-total {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}

.category-messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.no-messages-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.no-messages-col i {
  font-size: 1.5rem;
  opacity: 0.5;
}

/* Message item avec état lu/non lu */
.message-item.read {
  opacity: 0.6;
}

.message-item.read .message-title {
  color: var(--text-muted);
  font-weight: 400;
}

.message-item.read:hover {
  opacity: 0.85;
}

.message-item.unread {
  border-left: 3px solid var(--accent);
}

.unread-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

/* Bouton dismiss notification (croix) */
.btn-dismiss-notification {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 300;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
  border-radius: 50%;
}

.message-item {
  position: relative;
}

.message-item:hover .btn-dismiss-notification {
  opacity: 0.6;
}

.btn-dismiss-notification:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Bouton "Tout masquer" par catégorie */
.btn-clear-category {
  margin-left: auto;
  padding: 2px 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.15s;
}

.btn-clear-category:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}

/* Import Section */
.import-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.import-item:last-child {
  margin-bottom: 0;
}

.import-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 10px;
  flex-shrink: 0;
}

.import-icon i {
  font-size: 1.5rem;
  color: var(--accent);
}

.import-icon.icon-excel {
  background: rgba(34, 197, 94, 0.15);
}

.import-icon.icon-excel i {
  color: var(--success);
}

.import-icon.icon-splunk {
  background: rgba(245, 158, 11, 0.15);
}

.import-icon.icon-splunk i {
  color: var(--warning);
}

.import-icon.icon-sync {
  background: rgba(139, 92, 246, 0.15);
}

.import-icon.icon-sync i {
  color: #a78bfa;
}

.import-info {
  flex: 1;
  min-width: 0;
}

.import-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.import-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-name {
  display: block;
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 0.25rem;
}

.last-sync {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.import-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.file-input-label {
  cursor: pointer;
}

.import-status {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.import-status.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.import-status.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.hidden {
  display: none;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.toast.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.2s ease-out;
}

.modal-box.modal-large {
  max-width: 800px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header i {
  font-size: 1.25rem;
  color: var(--accent);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  flex: 1;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Modales Confirm/Notify */
.modal-confirm,
.modal-notify {
  max-width: 420px;
}

.modal-confirm .modal-body,
.modal-notify .modal-body {
  text-align: center;
  padding: 1.5rem 2rem;
}

.modal-confirm .modal-body p,
.modal-notify .modal-body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-line;
}

.modal-confirm .modal-footer {
  justify-content: center;
  gap: 1rem;
}

.modal-notify .modal-footer {
  justify-content: center;
}

/* Variante Success */
.modal-header.modal-success {
  background: rgba(34, 197, 94, 0.1);
  border-bottom-color: rgba(34, 197, 94, 0.3);
}

.modal-header.modal-success i {
  color: var(--success);
}

.modal-header.modal-success h3 {
  color: var(--success);
}

/* Variante Error */
.modal-header.modal-error {
  background: rgba(239, 68, 68, 0.1);
  border-bottom-color: rgba(239, 68, 68, 0.3);
}

.modal-header.modal-error i {
  color: var(--danger);
}

.modal-header.modal-error h3 {
  color: var(--danger);
}

/* Variante Warning */
.modal-header.modal-warning {
  background: rgba(245, 158, 11, 0.1);
  border-bottom-color: rgba(245, 158, 11, 0.3);
}

.modal-header.modal-warning i {
  color: var(--warning);
}

.modal-header.modal-warning h3 {
  color: var(--warning);
}

/* Variante Info */
.modal-header.modal-info {
  background: rgba(59, 130, 246, 0.1);
  border-bottom-color: rgba(59, 130, 246, 0.3);
}

.modal-header.modal-info i {
  color: var(--accent);
}

.modal-header.modal-info h3 {
  color: var(--accent);
}

/* Form elements in modals */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.form-hint i {
  color: var(--info);
  margin-top: 2px;
}

/* Bouton success */
.admin-btn.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.admin-btn.btn-success:hover {
  background: #16a34a;
  border-color: #16a34a;
}

/* Messages filters */
.messages-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.all-messages-list {
  max-height: 400px;
  overflow-y: auto;
}

.loading-messages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-muted);
}

/* Sync loading */
.sync-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-muted);
}

.sync-loading i {
  font-size: 1.5rem;
  color: var(--accent);
}

/* Sync results */
.sync-results {
  max-height: 400px;
  overflow-y: auto;
}

.sync-section {
  margin-bottom: 1.5rem;
}

.sync-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.sync-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sync-list li {
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.sync-list li strong {
  color: var(--accent);
}

.sync-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sync-diffs {
  margin-top: 0.5rem;
}

.sync-diff-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.diff-field {
  color: var(--text-muted);
  min-width: 100px;
}

.diff-old {
  color: var(--danger);
  text-decoration: line-through;
}

.diff-new {
  color: var(--success);
}

.sync-diff-item i {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 1600px) {
  .messages-columns.messages-columns-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1200px) {
  .messages-columns.messages-columns-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .card-import,
  .card-fullwidth {
    grid-column: span 1;
  }

  .messages-columns {
    grid-template-columns: 1fr;
  }

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

  .header-stats {
    gap: 0.5rem;
  }

  .header-stat {
    padding: 0.2rem 0.5rem;
    min-width: 50px;
  }

  .header-stat-number {
    font-size: 1rem;
  }

  .header-stat-label {
    font-size: 0.55rem;
  }
}

@media (max-width: 900px) {
  .messages-columns.messages-columns-6 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-stats {
    display: none;
  }

  .header-separator {
    display: none;
  }

  .admin-main {
    padding: 1rem;
  }

  .import-item {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .import-actions {
    width: 100%;
    margin-top: 0.75rem;
  }

  .import-actions .admin-btn {
    flex: 1;
    justify-content: center;
  }

  .stats-row {
    flex-wrap: wrap;
  }

  .stat-item {
    flex: 1;
    min-width: 80px;
    padding: 0.75rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .admin-card-footer {
    flex-direction: column;
  }

  .admin-card-footer .admin-btn {
    width: 100%;
    justify-content: center;
  }

  .view-toggle-btn span {
    display: none;
  }

  .messages-filters {
    flex-direction: column;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* ===== SECTION MAINTENANCE (SUPERADMIN) ===== */

.maintenance-section {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.maintenance-section.hidden {
  display: none;
}

.maintenance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.maintenance-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.maintenance-title i {
  font-size: 1.5rem;
  color: var(--warning);
}

.maintenance-title h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.maintenance-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.maintenance-badge.inactive {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.maintenance-badge.active {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  animation: pulse-badge 2s ease-in-out infinite;
}

.maintenance-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.maintenance-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.maintenance-message-group {
  margin-bottom: 1.5rem;
}

.maintenance-message-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.maintenance-message-group textarea {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
  scrollbar-width: none; /* Firefox */
}

.maintenance-message-group textarea::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.maintenance-message-group textarea:focus {
  outline: none;
  border-color: var(--warning);
}

.maintenance-message-group textarea::placeholder {
  color: var(--text-muted);
}

.maintenance-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.maintenance-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.maintenance-btn.btn-enable {
  background: var(--warning);
  color: #000;
}

.maintenance-btn.btn-enable:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.maintenance-btn.btn-disable {
  background: var(--success);
  color: #fff;
}

.maintenance-btn.btn-disable:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.maintenance-btn i {
  font-size: 1.1rem;
}

.maintenance-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  color: var(--warning);
  font-size: 0.9rem;
}

.maintenance-info.hidden {
  display: none;
}

.maintenance-info strong {
  color: var(--text);
}
