/* ============================================ */
/* ASBL "Au Champ-Être" - Design Moderne V2 */
/* Palette inspirée du logo vert nature */
/* ============================================ */

/* === VARIABLES DE COULEURS === */
:root {
  /* Couleurs principales (du logo) */
  --primary-green: #6B8E7F;
  --primary-green-dark: #546F63;
  --primary-green-light: #8BA89C;
  --accent-green: #7FA892;
  
  /* Couleurs secondaires */
  --bg: #f8faf9;
  --bg-gradient: linear-gradient(135deg, #f8faf9 0%, #e8f5f0 100%);
  --fg: #1a1a1a;
  --muted: #64748b;
  --card: #ffffff;
  --border: #e0e7e4;
  --border-hover: #b8ccc3;
  
  /* Couleurs d'accentuation */
  --accent: #6B8E7F;
  --accent-hover: #546F63;
  --accent-light: rgba(107, 142, 127, 0.1);
  --accent-lighter: rgba(107, 142, 127, 0.05);
  
  /* États */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  
  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Rayons de bordure */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET ET BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--fg);
  line-height: 1.6;
  font-size: 15px;
}

/* === TYPOGRAPHIE === */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  margin: 0 0 1rem 0;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.875rem;
  color: var(--primary-green-dark);
}

h3 {
  font-size: 1.5rem;
  color: var(--primary-green);
}

p {
  margin: 0 0 1rem 0;
}

.small {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

/* === LIENS === */
a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--accent-hover);
}

a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

a:not(.btn):hover::after {
  width: 100%;
}

/* === CONTENEUR === */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
}

/* === TOPBAR === */
.topbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.3s ease-out;
}

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

.topbar .container {
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* === BRAND (LOGO) === */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-green);
  text-decoration: none;
}

.brand:hover {
  color: var(--primary-green-dark);
  transform: scale(1.02);
}

.brand::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  background: url('/assets/img/logoACE.jpg') center/cover;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

/* === NAVIGATION === */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.nav a {
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  color: var(--fg);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: var(--transition-fast);
  position: relative;
}

.nav a::after {
  display: none; /* Désactiver le soulignement pour le menu */
}

.nav a:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: translateY(-2px);
}

.nav a.active {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.nav .logout {
  margin-left: auto;
  padding: 0.625rem 1.25rem;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius);
  font-weight: 600;
}

.nav .logout:hover {
  background: var(--danger);
  color: white;
}

@media (max-width: 900px) {
  .nav {
    width: 100%;
    justify-content: center;
  }
  
  .nav .logout {
    margin-left: 0;
    width: 100%;
  }
}

/* === CARDS === */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-green), var(--accent-green));
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.card:hover::before {
  opacity: 1;
}

@media (max-width: 768px) {
  .card {
    padding: 1.5rem;
  }
}

/* === GRILLE === */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
  .col-7, .col-8, .col-9, .col-10, .col-11 {
    grid-column: span 12;
  }
  
  .grid {
    gap: 1rem;
  }
}

/* === FORMULAIRES === */

/* Labels */
label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary-green-dark);
  margin: 0 0 0.625rem 0;
  letter-spacing: 0.01em;
}

label .required {
  color: var(--danger);
  margin-left: 0.25rem;
}

/* Champs de base */
input, select, textarea {
  width: 100%;
  padding: 1rem 1.125rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: white;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  transition: var(--transition-fast);
  font-family: inherit;
  min-height: 3.25rem;
}

input::placeholder, textarea::placeholder {
  color: #94a3b8;
  font-style: italic;
}

/* Focus états */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
  background: rgba(107, 142, 127, 0.02);
}

/* Hover états */
input:hover:not(:disabled), 
select:hover:not(:disabled), 
textarea:hover:not(:disabled) {
  border-color: var(--border-hover);
}

/* Champ montant spécial */
input[name="amount"] {
  font-family: 'Courier New', 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 1.375rem;
  font-weight: 700;
  padding: 1.25rem 1.5rem;
  text-align: right;
  letter-spacing: 0.5px;
  min-height: 3.75rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fdf9 100%);
}

input[name="amount"]:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
  background: #f0fdf4;
}

/* Champs date avec calendrier */
input[type="date"] {
  cursor: pointer;
  position: relative;
  font-weight: 500;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.5rem;
  margin-left: 0.5rem;
  opacity: 0.6;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: var(--accent-light);
  transform: scale(1.1);
}

/* Select amélioré */
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B8E7F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
  padding-right: 3rem;
  font-weight: 500;
  height: 3.5rem;
}

select:focus {
  background-color: rgba(107, 142, 127, 0.02);
}

/* Textarea */
textarea {
  min-height: 9rem;
  resize: vertical;
  line-height: 1.7;
}

/* États désactivés */
input:disabled, select:disabled, textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
  color: var(--muted);
}

/* === BOUTONS === */
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: white;
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  min-height: 3.25rem;
  box-shadow: var(--shadow-sm);
}

.btn:hover, button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active, button:active {
  transform: translateY(0);
}

/* Bouton primaire */
.btn.primary, button.primary {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
  color: white;
  border-color: var(--primary-green);
  box-shadow: var(--shadow);
}

.btn.primary:hover, button.primary:hover {
  background: linear-gradient(135deg, var(--primary-green-dark) 0%, var(--primary-green) 100%);
  box-shadow: 0 8px 16px -4px rgba(107, 142, 127, 0.4);
}

/* Bouton danger */
.btn.danger, button.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn.danger:hover, button.danger:hover {
  background: #dc2626;
  box-shadow: 0 8px 16px -4px rgba(239, 68, 68, 0.4);
}

/* Bouton secondaire */
.btn.secondary, button.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.btn.secondary:hover, button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lighter);
}

/* Bouton désactivé */
.btn:disabled, button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === ACTIONS (groupe de boutons) === */
.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .actions {
    flex-direction: column;
  }
  
  .actions .btn,
  .actions button {
    width: 100%;
  }
}

/* === TABLES === */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table thead {
  background: linear-gradient(135deg, var(--primary-green-light) 0%, var(--accent-green) 100%);
}

.table th {
  padding: 1rem 0.875rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--primary-green-dark);
}

.table td {
  padding: 1rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr {
  transition: var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--accent-lighter);
}

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

.table .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: auto;
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid transparent;
  gap: 0.25rem;
}

.badge.ok {
  background: var(--success-bg);
  color: #047857;
  border-color: #6ee7b7;
}

.badge.warn {
  background: var(--warning-bg);
  color: #92400e;
  border-color: #fcd34d;
}

.badge.danger {
  background: var(--danger-bg);
  color: #991b1b;
  border-color: #fca5a5;
}

.badge.info {
  background: var(--info-bg);
  color: #1e40af;
  border-color: #93c5fd;
}

/* === FLASH MESSAGES === */
.flash {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border-left: 4px solid;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.flash.ok {
  background: var(--success-bg);
  border-color: var(--success);
  color: #065f46;
}

.flash.err {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #991b1b;
}

.flash.warn {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: #92400e;
}

/* === FOOTER === */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

/* === UTILITAIRES === */
kbd {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  box-shadow: 0 2px 0 var(--border);
}

.row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* === SECTIONS DE FORMULAIRE === */
.form-section {
  background: linear-gradient(135deg, #f8fdf9 0%, #f0f9f4 100%);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
}

.form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-green), var(--accent-green));
}

.form-section h3 {
  margin: 0 0 1rem 0;
  color: var(--primary-green-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.card, .flash {
  animation: fadeInUp 0.4s ease-out;
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  input, select, textarea {
    font-size: 16px; /* Évite le zoom sur iOS */
  }
  
  input[name="amount"] {
    font-size: 1.5rem;
    min-height: 4rem;
  }
  
  select {
    height: 3.75rem;
  }
  
  input[type="date"]::-webkit-calendar-picker-indicator {
    font-size: 1.75rem;
  }
}

/* === SCROLL BAR === */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

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

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

/* === PRINT STYLES === */
@media print {
  .topbar, .nav, .btn, button, .actions {
    display: none;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* Titres plus grands */
h1 { font-size: 2rem !important; }
h2 { font-size: 1.5rem !important; }

/* Badges plus grands */
.badge {
  padding: 0.5rem 1rem !important;
  font-size: 0.95rem !important;
  white-space: nowrap;
}

/* Cards mieux espacées */
.card { padding: 2rem; }
.grid { gap: 1.5rem !important; }

/* Responsive */
@media (max-width: 1200px) {
  .col-6 { grid-column: span 12 !important; }
}

/* ============================================ */
/* SYSTÈME FLEXBOX - Remplace Grid 12 Colonnes */
/* ============================================ */

/* Container Flex (remplace .grid en CSS Grid) */
.grid {
  display: flex !important;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Colonnes - Système basé sur 12 colonnes */
.col-1 {
  flex: 0 0 calc(8.333% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-2 {
  flex: 0 0 calc(16.666% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-3 {
  flex: 0 0 calc(25% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-4 {
  flex: 0 0 calc(33.333% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-5 {
  flex: 0 0 calc(41.666% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-6 {
  flex: 0 0 calc(50% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-7 {
  flex: 0 0 calc(58.333% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-8 {
  flex: 0 0 calc(66.666% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-9 {
  flex: 0 0 calc(75% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-10 {
  flex: 0 0 calc(83.333% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-11 {
  flex: 0 0 calc(91.666% - 1.5rem);
  min-width: 0;
  max-width: 100%;
}

.col-12 {
  flex: 0 0 100%;
  min-width: 0;
  max-width: 100%;
}

/* === RESPONSIVE TABLETTE === */
@media (max-width: 1200px) {
  .grid {
    gap: 1.25rem;
  }
  
  /* Petites colonnes passent à 50% */
  .col-1, .col-2, .col-3, .col-4, .col-5 {
    flex: 0 0 calc(50% - 1.25rem);
  }
  
  /* Grandes colonnes passent à 100% */
  .col-6, .col-7, .col-8, .col-9, .col-10, .col-11 {
    flex: 0 0 100%;
  }
  
  .col-12 {
    flex: 0 0 100%;
  }
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
  .grid {
    gap: 1rem;
  }
  
  /* TOUTES les colonnes à 100% sur mobile */
  .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
  .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    flex: 0 0 100%;
  }
}

/* === OPTIONS D'ALIGNEMENT === */
.grid.align-center {
  align-items: center;
}

.grid.align-start {
  align-items: flex-start;
}

.grid.align-end {
  align-items: flex-end;
}

.grid.align-stretch {
  align-items: stretch;
}

/* === OPTIONS DE GAP === */
.grid.no-gap {
  gap: 0;
}

.grid.gap-sm {
  gap: 0.75rem;
}

.grid.gap-lg {
  gap: 2rem;
}

/* ============================================ */
/* FIN SYSTÈME FLEXBOX */
/* ============================================ */
