/* ============================================================
   ADMIN PANEL - ÉTABLISSEMENT ARTS ET CULTURE
   Design: Moderne, sombre avec accents rouge/vert
   ============================================================ */

:root {
  --admin-primary:    #c0392b;
  --admin-secondary:  #27ae60;
  --admin-dark:       #1a1a2e;
  --admin-dark2:      #16213e;
  --admin-sidebar-w:  260px;
  --admin-header-h:   64px;
  --admin-bg:         #f0f2f5;
  --admin-card:       #ffffff;
  --admin-text:       #333;
  --admin-muted:      #6c757d;
  --admin-border:     #e0e0e0;
  --sidebar-text:     rgba(255,255,255,0.85);
  --sidebar-hover:    rgba(255,255,255,0.1);
  --sidebar-active:   rgba(192,57,43,0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body {
  font-family: 'Poppins', sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #000000 0%, #4a148c 100%);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.admin-sidebar.collapsed {
  transform: translateX(-100%);
}

/* Brand */
.sidebar-brand {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-info { display: flex; flex-direction: column; }
.brand-name { color: white; font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand-role { color: var(--admin-primary); font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* Nav */
.sidebar-nav { flex: 1; padding: 12px 8px; }

.nav-divider {
  padding: 14px 12px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  margin: 2px 0;
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: var(--sidebar-active); color: white; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--admin-primary);
  border-radius: 2px;
}
.nav-item i { width: 18px; text-align: center; flex-shrink: 0; font-size: 0.9rem; }
.nav-item span { flex: 1; }

.nav-item-outline {
  border: 1px solid rgba(255,255,255,0.15);
}
.nav-item-danger { color: #ff6b6b !important; }
.nav-item-danger:hover { background: rgba(255,107,107,0.15) !important; }

.nav-badge {
  background: var(--admin-primary);
  color: white;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}
.superadmin-badge {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 700;
}

/* Submenu */
.nav-submenu {
  padding-left: 28px;
  margin-top: 2px;
}
.nav-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.82rem;
  transition: all 0.2s;
  margin: 1px 0;
}
.nav-subitem:hover { color: white; background: rgba(255,255,255,0.06); }
.nav-subitem.active { color: var(--admin-primary); font-weight: 600; }
.nav-subitem i { width: 14px; font-size: 0.75rem; }

/* User bottom */
.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-avatar {
  width: 38px; height: 38px;
  background: var(--admin-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-info strong { display: block; color: white; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { color: rgba(255,255,255,0.5); font-size: 0.72rem; }

/* ============================================================
   MAIN AREA
   ============================================================ */
.admin-main {
  margin-left: var(--admin-sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}
.admin-main.expanded { margin-left: 0; }

/* Header */
.admin-header {
  height: var(--admin-header-h);
  background: linear-gradient(135deg, #000000 0%, #4a148c 50%, #c2185b 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.header-left { display: flex; align-items: center; }
.header-right { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: white;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: white; }

.breadcrumb { font-size: 0.85rem; }
.breadcrumb-item a { color: var(--admin-primary); text-decoration: none; }

.header-date { font-size: 0.82rem; color: rgba(255,255,255,0.7); }

.header-user-btn {
  display: flex !important;
  align-items: center;
  text-decoration: none !important;
  color: var(--admin-text) !important;
  padding: 4px 8px !important;
  border-radius: 8px !important;
  transition: background 0.2s;
}
.header-user-btn:hover { background: var(--admin-bg) !important; }

.header-avatar {
  width: 34px; height: 34px;
  background: var(--admin-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.9rem;
}

/* Content */
.admin-content {
  flex: 1;
  padding: 28px 24px;
}

/* ============================================================
   CARDS & WIDGETS
   ============================================================ */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  border: 1px solid var(--admin-border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.stat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--admin-dark); }
.stat-label { font-size: 0.85rem; color: var(--admin-muted); font-weight: 500; }
.stat-change { font-size: 0.78rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; }

/* Admin Card */
.admin-card {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.admin-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-title { font-size: 1rem; font-weight: 700; color: var(--admin-dark); margin: 0; }
.admin-card-body { padding: 24px; }

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--admin-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title i { color: var(--admin-primary); }
.page-subtitle { font-size: 0.85rem; color: var(--admin-muted); margin-top: 2px; }

/* Tables */
.admin-table {
  width: 100%;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.admin-table .table { margin: 0; }
.admin-table .table th {
  background: var(--admin-bg);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-muted);
  padding: 14px 16px;
  border-bottom: 2px solid var(--admin-border);
}
.admin-table .table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.875rem;
}
.admin-table .table tr:last-child td { border-bottom: none; }
.admin-table .table tbody tr:hover { background: rgba(0,0,0,0.015); }

/* Badges status */
.badge-published { background: #d4edda; color: #155724; }
.badge-draft { background: #fff3cd; color: #856404; }
.badge-archived { background: #f8d7da; color: #721c24; }

/* Action buttons */
.btn-action {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-edit { background: #e8f4fd; color: #2980b9; }
.btn-edit:hover { background: #2980b9; color: white; }
.btn-delete { background: #fde8e8; color: var(--admin-primary); }
.btn-delete:hover { background: var(--admin-primary); color: white; }
.btn-view { background: #e8f8f0; color: var(--admin-secondary); }
.btn-view:hover { background: var(--admin-secondary); color: white; }

/* Forms */
.form-section {
  background: white;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}
.form-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--admin-dark); margin-bottom: 6px; }
.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid var(--admin-border);
  padding: 10px 14px;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
textarea.form-control { min-height: 110px; resize: vertical; }

/* Buttons */
.btn-admin-primary {
  background: var(--admin-primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-admin-primary:hover { background: #a93226; color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(192,57,43,0.3); }

.btn-admin-secondary {
  background: var(--admin-secondary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-admin-secondary:hover { background: #1e8449; color: white; }

.btn-admin-outline {
  background: transparent;
  color: var(--admin-primary);
  border: 1.5px solid var(--admin-primary);
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-admin-outline:hover { background: var(--admin-primary); color: white; }

/* Search bar */
.search-bar {
  position: relative;
  max-width: 320px;
}
.search-bar input {
  padding-left: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--admin-border);
  font-size: 0.875rem;
}
.search-bar i {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--admin-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--admin-muted);
}
.empty-state i { font-size: 3rem; opacity: 0.3; margin-bottom: 16px; }
.empty-state h5 { font-weight: 600; color: var(--admin-dark); }

/* Seance tags */
.seance-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f4fd;
  color: #2980b9;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
  margin: 2px;
}

/* Alert flash */
.alert-flash { border-radius: 12px; border: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-content {
    padding: 16px;
  }
  .admin-header {
    padding: 0 16px;
  }
  .page-header { margin-bottom: 20px; }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #000000 0%, #4a148c 50%, #c2185b 100%);
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo img { height: 70px; margin-bottom: 12px; }
.login-logo h4 { font-weight: 700; color: var(--admin-dark); margin: 0; }
.login-logo small { color: var(--admin-muted); font-size: 0.8rem; }
.login-title { font-size: 1.3rem; font-weight: 700; color: var(--admin-dark); margin-bottom: 6px; }
.login-sub { font-size: 0.85rem; color: var(--admin-muted); margin-bottom: 28px; }

.input-icon-wrap { position: relative; }
.input-icon-wrap i {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--admin-muted);
  font-size: 0.9rem;
}
.input-icon-wrap .form-control, .input-icon-wrap .form-select { padding-left: 40px; }
.input-icon-wrap .toggle-pw {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--admin-muted); cursor: pointer;
}

/* ============================================================
   DASHBOARD STATS COLORS
   ============================================================ */
.stat-events   { background: rgba(192,57,43,0.1);  color: #c0392b; }
.stat-cinema   { background: rgba(52,152,219,0.1); color: #3498db; }
.stat-news     { background: rgba(39,174,96,0.1);  color: #27ae60; }
.stat-admins   { background: rgba(243,156,18,0.1); color: #f39c12; }
