/* =========================================================
   MUSICPILOT — Global Stylesheet
   Dark / Light mode — Version 1.0
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* =========================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================= */

:root {
  /* Brand */
  --mp-accent:        #2DD4BF;   /* teal vif */
  --mp-accent-dark:   #0F9585;
  --mp-accent-light:  #99F0E8;
  --mp-accent-glow:   rgba(45, 212, 191, 0.15);

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow:   0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.08);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.2),  0 4px 8px rgba(0,0,0,0.1);
  --shadow-accent: 0 0 20px rgba(45, 212, 191, 0.25);

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 60px;
}

/* --------- DARK MODE (défaut) --------- */
[data-theme="dark"] {
  --bg-base:      #0D0F14;
  --bg-surface:   #141720;
  --bg-elevated:  #1C2030;
  --bg-overlay:   #242840;
  --bg-hover:     rgba(255,255,255,0.04);
  --bg-active:    rgba(45, 212, 191, 0.1);

  --text-primary:   #F0F2F8;
  --text-secondary: #8B90A8;
  --text-muted:     #555B76;
  --text-accent:    #2DD4BF;
  --text-inverse:   #0D0F14;

  --border-subtle:  rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.1);
  --border-strong:  rgba(255,255,255,0.18);
  --border-accent:  rgba(45, 212, 191, 0.4);

  --input-bg:      #1C2030;
  --input-border:  rgba(255,255,255,0.12);
  --input-focus:   rgba(45, 212, 191, 0.5);

  --status-success-bg:   rgba(16, 185, 129, 0.12);
  --status-success-text: #34D399;
  --status-warning-bg:   rgba(245, 158, 11, 0.12);
  --status-warning-text: #FCD34D;
  --status-danger-bg:    rgba(239, 68, 68, 0.12);
  --status-danger-text:  #F87171;
  --status-info-bg:      rgba(99, 102, 241, 0.12);
  --status-info-text:    #A5B4FC;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.6);
}

/* --------- LIGHT MODE --------- */
[data-theme="light"] {
  --bg-base:      #F4F5F7;
  --bg-surface:   #FFFFFF;
  --bg-elevated:  #FFFFFF;
  --bg-overlay:   #F9FAFB;
  --bg-hover:     rgba(0,0,0,0.03);
  --bg-active:    rgba(45, 212, 191, 0.08);

  --text-primary:   #111827;
  --text-secondary: #6B7280;
  --text-muted:     #9CA3AF;
  --text-accent:    #0F9585;
  --text-inverse:   #FFFFFF;

  --border-subtle:  rgba(0,0,0,0.05);
  --border-default: rgba(0,0,0,0.1);
  --border-strong:  rgba(0,0,0,0.2);
  --border-accent:  rgba(15, 149, 133, 0.5);

  --input-bg:      #F9FAFB;
  --input-border:  rgba(0,0,0,0.15);
  --input-focus:   rgba(15, 149, 133, 0.4);

  --status-success-bg:   rgba(16, 185, 129, 0.08);
  --status-success-text: #059669;
  --status-warning-bg:   rgba(245, 158, 11, 0.08);
  --status-warning-text: #D97706;
  --status-danger-bg:    rgba(239, 68, 68, 0.08);
  --status-danger-text:  #DC2626;
  --status-info-bg:      rgba(99, 102, 241, 0.08);
  --status-info-text:    #4F46E5;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.12);
}

/* =========================================================
   2. RESET & BASE
   ========================================================= */

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
a:hover { opacity: 0.8; }

img, svg { max-width: 100%; display: block; }

ul, ol { list-style: none; }

/* =========================================================
   3. TYPOGRAPHY
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.9rem; }
h6 { font-size: 0.8rem; }

.text-accent   { color: var(--text-accent); }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-danger   { color: var(--status-danger-text); }
.text-success  { color: var(--status-success-text); }
.text-warning  { color: var(--status-warning-text); }

.font-display  { font-family: var(--font-display); }

/* =========================================================
   4. LAYOUT — SIDEBAR + TOPBAR
   ========================================================= */

.mp-layout {
  display: flex;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.mp-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: width var(--transition-slow), background var(--transition-slow);
  overflow: hidden;
}

.mp-sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.mp-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow: hidden;
}

.mp-sidebar-brand .brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.mp-sidebar-brand .brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.mp-sidebar-brand .brand-name span {
  color: var(--mp-accent);
}

.mp-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
  -webkit-overflow-scrolling: touch;
}
.mp-nav::-webkit-scrollbar {
  width: 4px;
}
.mp-nav::-webkit-scrollbar-track {
  background: transparent;
}
.mp-nav::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}
.mp-nav::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.mp-nav-section {
  padding: 16px 0 4px;
}

.mp-nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 20px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-normal);
}

.mp-sidebar.collapsed .mp-nav-section-label {
  opacity: 0;
}

.mp-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 18px;
  margin: 1px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.mp-nav-item i {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  transition: transform var(--transition-fast);
}

.mp-nav-item.active i {
  transform: scale(1.12);
}

.mp-nav-item .nav-label {
  transition: opacity var(--transition-normal);
}

.mp-sidebar.collapsed .mp-nav-item .nav-label {
  opacity: 0;
  pointer-events: none;
}

.mp-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mp-nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 55%;
  background: var(--mp-accent);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%) scaleY(0);
  transform-origin: center;
}

.mp-nav-item.active {
  background: var(--bg-active);
  color: var(--mp-accent);
  font-weight: 700;
}

.mp-nav-item.active::before {
  animation: sb-bar-in 0.22s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes sb-bar-in {
  from { transform: translateY(-50%) scaleY(0); }
  to   { transform: translateY(-50%) scaleY(1); }
}

[data-theme="light"] .mp-nav-item.active {
  color: var(--mp-accent-dark);
}

.mp-nav-item .nav-badge {
  margin-left: auto;
  background: var(--mp-accent);
  color: var(--bg-base);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
  transition: opacity var(--transition-normal);
}

.mp-sidebar.collapsed .nav-badge {
  opacity: 0;
}

/* Sidebar footer */
.mp-sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 8px;
  flex-shrink: 0;
}

.mp-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  overflow: hidden;
}

.mp-user-card:hover { background: var(--bg-hover); }

.mp-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mp-accent), var(--mp-accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #0D0F14;
  flex-shrink: 0;
}

.mp-user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: opacity var(--transition-normal);
}

.mp-sidebar.collapsed .mp-user-info {
  opacity: 0;
}

.mp-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ----- Main Content ----- */
.mp-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  transition: margin-left var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.mp-main.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}

/* ----- Topbar ----- */
.mp-topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background var(--transition-slow);
}

.mp-topbar-toggle {
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.mp-topbar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mp-topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  flex: 1;
}

.mp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-icon-btn {
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1rem;
  position: relative;
}

.mp-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.mp-icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--mp-accent);
  border-radius: 50%;
  border: 1.5px solid var(--bg-surface);
}

/* Theme toggle */
.mp-theme-toggle {
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.mp-theme-toggle:hover {
  border-color: var(--border-accent);
  color: var(--text-accent);
}

/* ----- Page Content ----- */
.mp-content {
  flex: 1;
  padding: 28px 28px;
}

.mp-page-header {
  margin-bottom: 28px;
}

.mp-page-header h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.mp-page-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* =========================================================
   5. CARDS
   ========================================================= */

.mp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: background var(--transition-slow), border-color var(--transition-fast);
}

.mp-card:hover {
  border-color: var(--border-default);
}

.mp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mp-card-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mp-card-action {
  font-size: 0.75rem;
  color: var(--text-accent);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}
.mp-card-action:hover { opacity: 1; }

/* Stat cards */
.mp-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.mp-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--mp-accent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.mp-stat-card:hover::before { opacity: 1; }

.mp-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--mp-accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--mp-accent);
}

.mp-stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.mp-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.mp-stat-trend {
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 3px;
}

.mp-stat-trend.up   { color: var(--status-success-text); }
.mp-stat-trend.down { color: var(--status-danger-text); }

/* =========================================================
   6. TABLES
   ========================================================= */

.mp-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.mp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.mp-table th {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.mp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.mp-table tr:last-child td {
  border-bottom: none;
}

.mp-table tbody tr {
  transition: background var(--transition-fast);
  cursor: pointer;
}

.mp-table tbody tr:hover {
  background: var(--bg-hover);
}

/* =========================================================
   7. BADGES / STATUS
   ========================================================= */

.mp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.mp-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.mp-badge.success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

.mp-badge.warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}

.mp-badge.danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.mp-badge.info {
  background: var(--status-info-bg);
  color: var(--status-info-text);
}

.mp-badge.accent {
  background: var(--mp-accent-glow);
  color: var(--mp-accent);
}

.mp-badge.neutral {
  background: var(--bg-overlay);
  color: var(--text-secondary);
}

/* =========================================================
   8. FORMS & INPUTS
   ========================================================= */

.mp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.mp-label .required {
  color: var(--status-danger-text);
  margin-left: 3px;
}

.mp-input,
.mp-select,
.mp-textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 10px 14px;
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.mp-input:focus,
.mp-select:focus,
.mp-textarea:focus {
  border-color: var(--mp-accent);
  box-shadow: 0 0 0 3px var(--input-focus);
}

.mp-input::placeholder,
.mp-textarea::placeholder {
  color: var(--text-muted);
}

.mp-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.mp-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B90A8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Input with icon */
.mp-input-wrapper {
  position: relative;
}

.mp-input-wrapper .mp-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.mp-input-wrapper .mp-input {
  padding-left: 38px;
}

/* =========================================================
   9. BUTTONS
   ========================================================= */

.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.mp-btn:active { transform: scale(0.98); }

.mp-btn i { font-size: 1rem; }

/* Primary */
.mp-btn-primary {
  background: var(--mp-accent);
  color: #0D0F14;
  border-color: var(--mp-accent);
  font-weight: 600;
}
.mp-btn-primary:hover {
  background: var(--mp-accent-light);
  border-color: var(--mp-accent-light);
}

/* Secondary */
.mp-btn-secondary {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.mp-btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

/* Ghost */
.mp-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.mp-btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Danger */
.mp-btn-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-color: transparent;
}
.mp-btn-danger:hover {
  background: rgba(239,68,68,0.2);
}

/* Sizes */
.mp-btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.mp-btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
  border-radius: var(--radius-lg);
}

.mp-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================================================
   10. MODALS
   ========================================================= */

.mp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.mp-modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.mp-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-normal);
}

.mp-modal-backdrop.active .mp-modal {
  transform: translateY(0) scale(1);
}

.mp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.mp-modal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.mp-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.mp-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mp-modal-body {
  padding: 20px 24px;
}

.mp-modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =========================================================
   11. ALERTS / NOTIFICATIONS
   ========================================================= */

.mp-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
}

.mp-alert i { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }

.mp-alert.success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-left: 3px solid var(--status-success-text);
}
.mp-alert.warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-left: 3px solid var(--status-warning-text);
}
.mp-alert.danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-left: 3px solid var(--status-danger-text);
}
.mp-alert.info {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border-left: 3px solid var(--status-info-text);
}

/* =========================================================
   12. UTILITIES
   ========================================================= */

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }

.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* =========================================================
   13. SCROLLBAR
   ========================================================= */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* =========================================================
   14. RESPONSIVE
   ========================================================= */

/* Overlay mobile sidebar */
.mp-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
  animation: sbOverlayIn 0.2s ease;
}
.mp-sidebar-overlay.active { display: block; }
@keyframes sbOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 768px) {
  .mp-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    z-index: 100;
  }

  .mp-sidebar.mobile-open {
    transform: translateX(0);
    width: var(--sidebar-width);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
  }

  /* La classe collapsed n'a aucun effet sur mobile */
  .mp-sidebar.collapsed {
    width: var(--sidebar-width);
  }

  .mp-main {
    margin-left: 0 !important;
  }

  .mp-content { padding: 20px 16px; }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .mp-topbar-actions .mp-theme-toggle span { display: none; }
}

@media (max-width: 480px) {
  .mp-topbar { padding: 0 12px; gap: 10px; }
  .mp-topbar-title { font-size: 0.95rem; }
}

/* =========================================================
   15. ANIMATIONS
   ========================================================= */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-accent {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.animate-in {
  animation: fadeInUp 0.4s ease forwards;
}

.animate-stagger > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}
.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.10s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.20s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.30s; }

/* =========================================================
   16. LOGIN PAGE SPECIFIC
   ========================================================= */

.mp-login-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--bg-base);
}

.mp-login-visual {
  flex: 1;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.mp-login-visual::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mp-accent-glow) 0%, transparent 70%);
  top: -100px;
  left: -100px;
  pointer-events: none;
}

.mp-login-visual::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  bottom: -80px;
  right: -80px;
  pointer-events: none;
}

.mp-login-form-panel {
  width: 420px;
  min-width: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 52px;
}

.mp-login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.mp-login-logo .brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.mp-login-logo .brand-name span { color: var(--mp-accent); }

@media (max-width: 700px) {
  .mp-login-visual { display: none; }
  .mp-login-form-panel {
    width: 100%;
    min-width: 0;
    padding: 40px 28px;
    justify-content: center;
  }
}
