/* ==================== VARIABLES & RESET ==================== */

:root {
  --primary: #9D4EDD;
  --primary-light: #C77DFF;
  --primary-dark: #5A189A;
  --secondary: #3A0CA3;
  --success: #06A77D;
  --danger: #E63946;
  --warning: #F77F00;
  --dark: #1A1A1A;
  --light: #F8F9FA;
  --border: #E0E0E0;
  --text: #2A2A2A;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --transition: 0.3s ease;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: #F8F9FA;
  color: var(--text);
  line-height: 1.6;
}

/* ==================== LAYOUT ==================== */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar {
  background: white;
  border-bottom: 2px solid var(--primary);
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
}

.navbar-brand img {
  height: 30px;
  width: auto;
  display: block;
}

.navbar-menu {
  display: flex;
  gap: 20px;
  align-items: center;
}

.navbar-menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color var(--transition);
}

.navbar-menu a:hover {
  color: var(--primary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-badge {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-logout {
  background: var(--danger);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition);
}

.btn-logout:hover {
  background: #C51230;
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
  min-height: calc(100vh - 80px);
  padding: 40px 20px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ==================== DASHBOARD ANIMATEUR ==================== */

.dashboard-header {
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.welcome-text h1 {
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ==================== FORMULAIRE PROPOSITION ==================== */

.proposal-section {
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.section-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

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

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

/* ==================== BOUTONS ==================== */

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

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

.btn-success:hover {
  background: #048565;
}

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

.btn-danger:hover {
  background: #C51230;
}

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

.btn-warning:hover {
  background: #E67F00;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ==================== CARTES PROPOSITIONS ==================== */

.propositions-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.proposal-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.proposal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.proposal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.proposal-title {
  font-size: 1.25rem;
  font-weight: bold;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.status-badge.pending {
  background: rgba(255, 193, 7, 0.3);
  color: #FFC107;
}

.status-badge.approved {
  background: rgba(76, 175, 80, 0.3);
  color: #4CAF50;
}

.status-badge.rejected {
  background: rgba(244, 67, 54, 0.3);
  color: #F44336;
}

.proposal-body {
  padding: 20px;
}

.proposal-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.info-label {
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
}

.info-value {
  color: #666;
}

.proposal-actions {
  display: flex;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.proposal-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 10px;
}

/* ==================== TABLEAU GÉRANT ==================== */

.table-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 30px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 15px;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: #F8F9FA;
}

.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-indicator.pending {
  background: #FFC107;
}

.status-indicator.approved {
  background: #4CAF50;
}

.status-indicator.rejected {
  background: #F44336;
}

/* ==================== MODALES ==================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: bold;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
}

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

/* ==================== ALERTS ==================== */

.alert {
  margin-inline: auto;
  max-width: 1400px;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

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

.alert-success {
  background: #E8F5E9;
  color: #2E7D32;
  border-left: 4px solid #4CAF50;
}

.alert-danger {
  background: #FFEBEE;
  color: #C62828;
  border-left: 4px solid #F44336;
}

.alert-warning {
  background: #FFF3E0;
  color: #E65100;
  border-left: 4px solid #FFC107;
}

.alert-info {
  background: #E3F2FD;
  color: #1565C0;
  border-left: 4px solid #2196F3;
}

/* ==================== LOADING & EMPTY STATES ==================== */

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  font-size: 1.1rem;
  color: #999;
}

.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

/* ==================== LOGIN PAGE ==================== */

.login-container {
  --l-card: #160d13;
  --l-line: #2e1826;
  --l-muted: #9a8492;
  --l-accent: #b71875;
  --l-accent-hi: #d52d88;
  --l-accent-lo: #882056;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 72px 16px 48px;
  color: #f6eef3;
  font-family: 'Familjen Grotesk', -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 520px at 50% -8%, #8a1d5c 0%, rgba(102, 25, 66, 0.6) 38%, transparent 72%),
    linear-gradient(180deg, #3a0f29 0%, #0b0509 55%, #050205 100%);
  background-color: #0b0509;
}

.login-wrap {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.login-logo {
  width: 190px;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 34px rgba(213, 45, 136, 0.55));
}

.login-brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  color: #f6eef3;
}

.login-card {
  width: 100%;
  background: var(--l-card);
  border: 1px solid var(--l-line);
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
}

.login-card-head {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--l-line);
}

.login-card-head b {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.login-card-head span {
  font-size: 13px;
  color: var(--l-muted);
}

.login-form {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-form label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--l-muted);
  margin-bottom: 10px;
}

.login-form input {
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  padding: 0 16px;
  background: #e9eaf8;
  color: #14111a;
  border: 2px solid transparent;
  border-radius: 6px;
  font: 500 15px 'Familjen Grotesk', system-ui, sans-serif;
}

.login-form input:focus-visible {
  outline: none;
  border-color: var(--l-accent-hi);
  box-shadow: 0 0 0 4px rgba(213, 45, 136, 0.28);
}

.login-btn {
  height: 50px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font: 600 15px 'Familjen Grotesk', system-ui, sans-serif;
  background: linear-gradient(180deg, var(--l-accent-hi), var(--l-accent) 55%, var(--l-accent-lo));
  box-shadow: 0 8px 24px rgba(183, 24, 117, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.15s, box-shadow 0.15s;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(183, 24, 117, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.login-error {
  background: rgba(230, 57, 70, 0.14);
  border: 1px solid rgba(230, 57, 70, 0.5);
  color: #ffb3ba;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
}

.login-foot {
  font-size: 13px;
  color: var(--l-muted);
  text-align: center;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .navbar-menu {
    gap: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .propositions-list {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 20px;
  }

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 10px;
  }
}

/* ==================== UTILITAIRES ==================== */

.mt {
  margin-top: 20px;
}

.mb {
  margin-bottom: 20px;
}

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

.text-muted {
  color: #999;
}

.text-primary {
  color: var(--primary);
}

.d-none {
  display: none;
}

.d-block {
  display: block;
}

.cursor-pointer {
  cursor: pointer;
}

/* ==================== THÈME MAGENTA / NOIR (toute l'app) ==================== */

:root {
  --primary: #d52d88;
  --primary-light: #ee63ac;
  --primary-dark: #882056;
  --secondary: #3a0f29;
  --border: #2e1826;
  --text: #f6eef3;
  --muted: #9a8492;
  --panel: #160d13;
  --btn-grad: linear-gradient(135deg, #d52d88 0%, #8e2a9e 52%, #14070f 100%);
  --btn-grad-hover: linear-gradient(135deg, #e63c99 0%, #a034b3 52%, #1d0a15 100%);
}

html, body {
  background-color: #0b0509;
  background-image:
    radial-gradient(900px 520px at 50% -8%, #8a1d5c 0%, rgba(102, 25, 66, 0.6) 38%, transparent 72%),
    linear-gradient(180deg, #3a0f29 0%, #0b0509 55%, #050205 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: 'Familjen Grotesk', -apple-system, 'Segoe UI', sans-serif;
}

.navbar {
  background: rgba(22, 13, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.navbar-brand { color: #fff; }
.navbar-menu a { color: var(--text); }
.navbar-menu a:hover { color: var(--primary-light); }
.user-badge { background: var(--btn-grad); }

.dashboard-header,
.proposal-section,
.proposal-card,
.table-container,
.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.welcome-text h1,
.section-title,
.modal-title { color: #fff; }
.welcome-text p, .text-muted, .info-value, .empty-state { color: var(--muted); }
.info-label, .form-group label { color: var(--text); }

.stat-card, .proposal-header, thead { background: var(--btn-grad); }

.form-group input,
.form-group textarea,
.form-group select {
  background: #e9eaf8;
  color: #14111a;
  border: 2px solid transparent;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(213, 45, 136, 0.28);
}

td { border-bottom: 1px solid var(--border); color: var(--text); }
tbody tr:hover { background: rgba(213, 45, 136, 0.08); }
.proposal-actions { border-top-color: var(--border); }
.modal-close { color: var(--muted); }
.modal-close:hover { color: #fff; }

/* Boutons : dégradé rose -> mauve -> noir */
.btn-primary,
.btn-secondary,
.btn-warning,
.btn-logout,
.login-btn {
  background: var(--btn-grad);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 22px rgba(183, 24, 117, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover,
.btn-secondary:hover,
.btn-warning:hover,
.btn-logout:hover,
.login-btn:hover {
  background: var(--btn-grad-hover);
  color: #fff;
  transform: translateY(-1px);
}
.btn-success {
  background: linear-gradient(135deg, #06a77d 0%, #0b5f4f 55%, #06130f 100%);
  color: #fff;
}
.btn-success:hover { background: linear-gradient(135deg, #08c093 0%, #0d7460 55%, #081a15 100%); }
.btn-danger {
  background: linear-gradient(135deg, #e63946 0%, #8a1d3c 55%, #14070c 100%);
  color: #fff;
}
.btn-danger:hover { background: linear-gradient(135deg, #f24a57 0%, #a0244a 55%, #1d0a10 100%); }

.alert-success { background: rgba(6, 167, 125, 0.15); color: #7ff0d0; border-left-color: #06a77d; }
.alert-danger  { background: rgba(230, 57, 70, 0.15); color: #ffb3ba; border-left-color: #e63946; }
.alert-warning { background: rgba(247, 127, 0, 0.15); color: #ffcf99; border-left-color: #f77f00; }
.alert-info    { background: rgba(213, 45, 136, 0.15); color: #ffc2e2; border-left-color: #d52d88; }
