/* Recueil de Chants - Admin Dashboard */
:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #1e293b;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-width: 260px;
  --header-height: 60px;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --transition: 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #f1f5f9; color: #334155; line-height: 1.6; overflow-x: hidden; }

/* Layout */
.admin-wrap { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%); color: white; position: fixed; height: 100vh; overflow-y: auto; z-index: 100; transition: transform var(--transition), width var(--transition); }
.sidebar-header { padding: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 0.75rem; }
.sidebar-header h1 { font-size: 1.1rem; font-weight: 700; }
.sidebar-header .icon { width: 40px; height: 40px; background: rgba(255,255,255,0.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.nav { padding: 1rem 0; }
.nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; color: rgba(255,255,255,0.85); text-decoration: none; transition: var(--transition); }
.nav a:hover { background: rgba(255,255,255,0.1); color: white; }
.nav a.active { background: rgba(255,255,255,0.15); color: white; font-weight: 600; border-left: 3px solid var(--accent); }
.nav .nav-icon { width: 22px; text-align: center; font-size: 1.1rem; opacity: 0.9; }
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.header { height: var(--header-height); background: white; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; position: sticky; top: 0; z-index: 50; }
.header h2 { font-size: 1.25rem; color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.content { padding: 1.5rem; flex: 1; }

/* Mobile menu */
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--primary); padding: 0.5rem; }
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
}
@media (max-width: 768px) {
  .content { padding: 1rem; }
  .header { padding: 0 1rem; }
}

/* Cards */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.card-title { font-size: 1.125rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 1rem; transition: transform var(--transition); }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.stat-icon.users { background: #dbeafe; color: var(--primary); }
.stat-icon.subs { background: #d1fae5; color: var(--success); }
.stat-icon.songs { background: #fef3c7; color: var(--warning); }
.stat-icon.carousel { background: #e0e7ff; color: #6366f1; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--primary-dark); }
.stat-label { font-size: 0.875rem; color: #64748b; margin-top: 0.25rem; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap.table-scroll-wide table { width: max-content; min-width: 100%; }
table { width: 100%; border-collapse: collapse; }
.table-wrap.table-scroll-wide td.td-nowrap,
.table-wrap.table-scroll-wide th.th-nowrap { white-space: nowrap; }
/* Texte long : passage à la ligne (toutes les pages admin) */
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #e2e8f0; word-break: break-word; overflow-wrap: break-word; }
td.actions { white-space: nowrap; min-width: 180px; }
th { background: #f8fafc; font-weight: 600; color: var(--primary-dark); font-size: 0.875rem; }
tr:hover td { background: #f8fafc; }
.badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: var(--primary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 8px; font-weight: 600; font-size: 0.875rem; cursor: pointer; border: none; text-decoration: none; transition: var(--transition); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--primary-dark); }
.form-control { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2); }
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%); padding: 1rem; }
.login-card { background: white; border-radius: 16px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); padding: 2.5rem; width: 100%; max-width: 400px; }
.login-card h1 { text-align: center; color: var(--primary); margin-bottom: 0.5rem; }
.login-card .subtitle { text-align: center; color: #64748b; margin-bottom: 1.5rem; }
.login-card .btn { width: 100%; justify-content: center; padding: 0.75rem; margin-top: 0.5rem; }

/* Utilities */
.text-muted { color: #64748b; font-size: 0.875rem; }
.mt-1 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; display: flex; align-items: center; justify-content: center; }
.img-thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #64748b; }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
