/* ══════════════════════════════════════════════════════════════════
   Evangelizo Fiscal — Design System
   Palette : Navy / Gold — Fond clair
   Typo    : Libre Baskerville (titres) + Source Sans 3 (corps)
   ══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

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

:root {
  --navy:        #1B2A4A;
  --navy-deep:   #111D33;
  --navy-mid:    #243558;
  --navy-soft:   #2E4270;
  --gold:        #C8A84B;
  --gold-light:  #E2C978;
  --gold-pale:   #F9F3E3;
  --gold-border: rgba(200,168,75,0.3);
  --bg:          #F4F6FA;
  --surface:     #FFFFFF;
  --surface2:    #F0F3F9;
  --border:      #E2E8F0;
  --border2:     #CBD5E1;
  --text:        #1B2A4A;
  --text-soft:   #4A5568;
  --muted:       #8A96A8;
  --green:       #2E7D32;
  --green-bg:    #E8F5E9;
  --red:         #C0392B;
  --red-bg:      #FFF0F0;
  --shadow:      0 4px 24px rgba(17,29,51,0.10);
  --shadow-lg:   0 12px 48px rgba(17,29,51,0.16);
  --sidebar-w:   230px;
  --serif:       'Libre Baskerville', serif;
  --sans:        'Source Sans 3', sans-serif;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  display: flex;
}

/* ══ Sidebar ════════════════════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  position: relative;
}

/* Liseré gold en haut */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(200,168,75,0.15);
  margin-bottom: 16px;
}

.logo-text {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: .95rem;
  color: var(--navy);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(200,168,75,0.3);
}

.logo-full {
  font-family: var(--serif);
  font-weight: 700;
  font-size: .8rem;
  color: var(--gold-light);
  letter-spacing: .02em;
}

.logo-sub {
  font-size: .65rem;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  letter-spacing: .08em;
  font-family: var(--sans);
}

.nav-links {
  list-style: none;
  padding: 0 12px;
  flex: 1;
}

.nav-links + .nav-links {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(200,168,75,0.12);
}

.nav-section {
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(200,168,75,0.5);
  padding: 0 8px 8px;
  font-family: var(--sans);
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: .85rem;
  font-family: var(--sans);
  font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.88); }
.nav-link.active {
  background: rgba(200,168,75,0.15);
  color: var(--gold-light);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(200,168,75,0.12);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: .85rem;
  color: var(--navy);
  flex-shrink: 0;
}

.user-name  { font-size: .82rem; font-weight: 600; color: rgba(255,255,255,0.88); }
.user-role  { font-size: .65rem; color: rgba(255,255,255,0.35); margin-top: 1px; }

.logout-btn { margin-left: auto; color: rgba(255,255,255,0.3); transition: color .15s; }
.logout-btn svg { width: 16px; height: 16px; display: block; }
.logout-btn:hover { color: var(--gold); }

/* ══ Main content ═══════════════════════════════════════════════════ */

.main-content {
  flex: 1;
  padding: 32px 36px;
  overflow-y: auto;
}

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

.page-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.01em;
}

/* ══ Boutons ════════════════════════════════════════════════════════ */

.btn-primary {
  background: var(--navy);
  color: #fff;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  border: none;
  border-radius: 6px;
  padding: 9px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(200,168,75,0.18), transparent);
  transform: translateX(-100%);
  transition: transform .5s;
}

.btn-primary:hover { background: var(--navy-deep); box-shadow: 0 4px 16px rgba(17,29,51,0.2); }
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:active { transform: scale(.99); }

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 500;
  border: 1.5px solid var(--border2);
  border-radius: 6px;
  padding: 9px 18px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

.btn-sm {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-sm:hover { opacity: .8; }
.btn-warn { background: var(--red-bg); color: var(--red); }
.btn-ok   { background: var(--green-bg); color: var(--green); }

/* ══ Badges ═════════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--sans);
}
.badge-admin { background: rgba(200,168,75,0.15); color: #8B6914; }
.badge-user  { background: rgba(27,42,74,0.1);    color: var(--navy); }
.badge-ok    { background: var(--green-bg);        color: var(--green); }
.badge-off   { background: var(--surface2);        color: var(--muted); }

/* Badges source */
.badge-source-paypal           { background: #E8F0FB; color: #1A56DB; }
.badge-source-societe_generale { background: #FEF3E2; color: #92400E; }
.badge-source-bank_of_america  { background: #FEE2E2; color: #991B1B; }

/* ══ Tables ══════════════════════════════════════════════════════════ */

.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.data-table th {
  background: var(--surface2);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text);
  font-family: var(--sans);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #F8FAFD; }
.row-inactive td { opacity: .45; }

.mono  { font-family: 'Source Sans 3', monospace; }
.muted { color: var(--muted); }

/* ══ Stat cards ══════════════════════════════════════════════════════ */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  opacity: .4;
}

.stat-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: var(--sans);
}

.stat-value {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.stat-hint {
  font-size: .72rem;
  color: var(--muted);
  font-family: var(--sans);
}

/* ══ Empty state ══════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--muted);
}

.empty-state svg {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  color: var(--border2);
  display: block;
}

.empty-state p { margin-bottom: 20px; font-size: .9rem; color: var(--text-soft); }

/* ══ Modal ════════════════════════════════════════════════════════════ */

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  color: var(--text);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(17,29,51,0.5);
  backdrop-filter: blur(4px);
}

.modal-inner { padding: 32px; }

.modal-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
}

.modal label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 14px;
}

.modal label:first-of-type { margin-top: 0; }

.modal input[type="text"],
.modal input[type="password"] {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--sans);
  font-size: .9rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color .2s;
}
.modal input:focus { border-color: var(--gold); }

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: .85rem !important;
  color: var(--text) !important;
  font-weight: 500 !important;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ══ Dashboard — année ═══════════════════════════════════════════════ */

.year-selector { display: flex; gap: 6px; }

.year-btn {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  padding: 6px 14px;
  border: 1.5px solid var(--border2);
  border-radius: 5px;
  color: var(--text-soft);
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}

.year-btn:hover { border-color: var(--navy); color: var(--navy); }
.year-btn.active {
  border-color: var(--gold);
  color: var(--navy);
  background: var(--gold-pale);
}

/* ══ Graphique ═══════════════════════════════════════════════════════ */

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.chart-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  font-family: var(--sans);
}

/* ══ Source cards ════════════════════════════════════════════════════ */

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.source-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

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

.source-amounts { display: flex; gap: 24px; }

.source-amount {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}

.source-amount.green { color: var(--green); }
.source-amount.red   { color: var(--red); }

.section-title {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ══ Import page ═════════════════════════════════════════════════════ */

.import-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .import-grid { grid-template-columns: 1fr; }
}

.import-card, .import-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.import-card-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}

.import-card label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  font-family: var(--sans);
}

/* Source buttons */
.source-buttons { display: flex; flex-direction: column; gap: 8px; }

.source-btn { cursor: pointer; }
.source-btn input[type="radio"] { display: none; }

.source-btn span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border2);
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: border-color .15s, color .15s, background .15s;
  cursor: pointer;
  font-family: var(--sans);
}

.source-btn span svg { width: 16px; height: 16px; flex-shrink: 0; }

.source-btn input:checked + span {
  border-color: var(--gold);
  color: var(--navy);
  background: var(--gold-pale);
}

.source-btn span:hover { border-color: var(--navy); color: var(--navy); }

/* File drop */
.file-drop {
  position: relative;
  border: 1.5px dashed var(--border2);
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.file-drop input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}

.file-drop-label {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  color: var(--muted); font-size: .82rem;
  pointer-events: none; font-family: var(--sans);
}

.file-drop-label svg { width: 28px; height: 28px; color: var(--border2); }
.file-drop:hover, .file-drop.dragover { border-color: var(--gold); background: var(--gold-pale); }

/* Alert */
.alert {
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: .85rem;
  font-family: var(--sans);
  font-weight: 500;
}

.alert-ok  { background: var(--green-bg); border: 1px solid rgba(46,125,50,.2); color: var(--green); }
.alert-err { background: var(--red-bg);   border: 1px solid rgba(192,57,43,.2); color: var(--red); }

/* ══ Admin users ═════════════════════════════════════════════════════ */

.welcome-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(200,168,75,0.12) 0%, transparent 60%);
}

.welcome-text { font-size: 1rem; color: rgba(255,255,255,0.9); font-weight: 500; margin-bottom: 4px; }
.welcome-sub  { font-size: .8rem; color: rgba(255,255,255,0.45); }

/* ══ Transactions — filtres ══════════════════════════════════════════ */

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
}

.filter-group select {
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: 6px;
  padding: 7px 12px;
  font-family: var(--sans);
  font-size: .85rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
  min-width: 130px;
}

.filter-group select:focus { border-color: var(--gold); }

/* ══ Pagination ══════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.page-btn {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  padding: 7px 16px;
  border: 1.5px solid var(--border2);
  border-radius: 6px;
  transition: border-color .15s, background .15s;
}

.page-btn:hover { border-color: var(--gold); background: var(--gold-pale); }

.page-info {
  font-size: .82rem;
  color: var(--muted);
  font-family: var(--sans);
}

/* ══ Reçus fiscal ════════════════════════════════════════════════════ */

.currency-separator td {
  background: var(--surface2);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.currency-label {
  font-family: var(--serif);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ══ Reçus fiscal v2 ═════════════════════════════════════════════════ */

.recus-count {
  font-size: .8rem;
  color: var(--muted);
  font-family: var(--sans);
  margin-bottom: 12px;
  font-weight: 500;
}

.donateur-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.donateur-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.donateur-nom {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
}

.donateur-table {
  border-radius: 0;
}

.donateur-table th {
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.donateur-adresse {
  padding: 10px 16px;
  font-size: .78rem;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
  background: var(--gold-pale);
  font-family: var(--sans);
}

.adresse-label {
  font-weight: 600;
  color: var(--gold);
  margin-right: 6px;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ══ Traitement des dons ═════════════════════════════════════════════ */

/* Badges statut */
.state-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--sans);
  white-space: nowrap;
}
.state-pending  { background: #FEF3C7; color: #92400E; }
.state-done     { background: #DCFCE7; color: #166534; }
.state-receipt  { background: #DBEAFE; color: #1E40AF; }
.state-printed  { background: #F3E8FF; color: #6B21A8; }

/* Badges template */
.template-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--sans);
  letter-spacing: .04em;
}
.template-f1, .template-f2   { background: rgba(200,168,75,.15); color: #8B6914; }
.template-f11, .template-f12 { background: rgba(200,168,75,.10); color: #A07820; }
.template-e1, .template-e2   { background: rgba(27,42,74,.10);   color: var(--navy); }

/* Actions en lot */
.lot-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.checkbox-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
}

.lot-btns {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.btn-lot {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  padding: 7px 14px;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-lot:hover { opacity: .82; }
.btn-lot-ok    { background: #DCFCE7; color: #166534; }
.btn-lot-warn  { background: #FEF3C7; color: #92400E; }
.btn-lot-navy  { background: var(--navy); color: #fff; }
.btn-lot-muted { background: var(--surface2); color: var(--muted); }

/* Boutons action par ligne */
.don-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border: none;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
  transition: opacity .15s;
  text-decoration: none;
  font-family: var(--sans);
}
.btn-xs:hover   { opacity: .75; }
.btn-xs-ok      { background: #DCFCE7; color: #166534; }
.btn-xs-warn    { background: #FEF3C7; color: #92400E; }
.btn-xs-navy    { background: var(--navy); color: #fff; }
.btn-xs-muted   { background: var(--surface2); color: var(--muted); }
.btn-xs-mail    { background: #DBEAFE; color: #1E40AF; }

.row-archived td { opacity: .4; }

/* ══ Mail preview ════════════════════════════════════════════════════ */

.mail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .mail-grid { grid-template-columns: 1fr; } }

.mail-don-card, .mail-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.info-table { width: 100%; border-collapse: collapse; }
.info-table tr td { padding: 7px 0; font-size: .85rem; border-bottom: 1px solid var(--border); }
.info-table tr:last-child td { border-bottom: none; }
.info-label { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; width: 110px; }

.mail-field { margin-bottom: 14px; }
.mail-field label {
  display: flex; align-items: center; gap: 8px;
  font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px; font-family: var(--sans);
}
.mail-field input[type="text"],
.mail-field input[type="email"],
.mail-field select {
  width: 100%; border: 1.5px solid var(--border2); border-radius: 6px;
  padding: 9px 12px; font-family: var(--sans); font-size: .88rem;
  color: var(--text); background: var(--bg); outline: none;
  transition: border-color .2s;
}
.mail-field input:focus, .mail-field select:focus { border-color: var(--gold); }
.mail-field textarea {
  width: 100%; border: 1.5px solid var(--border2); border-radius: 6px;
  padding: 10px 12px; font-family: var(--sans); font-size: .85rem;
  color: var(--text); background: var(--bg); outline: none;
  resize: vertical; transition: border-color .2s; line-height: 1.6;
}
.mail-field textarea:focus { border-color: var(--gold); }

.mail-actions { display: flex; justify-content: space-between; margin-top: 16px; }

.vars-hint { font-size: .68rem; color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.vars-hint code { background: var(--surface2); padding: 1px 5px; border-radius: 3px; font-size: .72rem; }

/* ══ Templates de mails ══════════════════════════════════════════════ */

.templates-grid { display: flex; flex-direction: column; gap: 20px; }

.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.template-card-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}

.template-label {
  font-family: var(--sans); font-size: .88rem;
  font-weight: 600; color: var(--navy); flex: 1;
}

/* ══ Paramètres ══════════════════════════════════════════════════════ */

.parametres-grid { display: flex; flex-direction: column; gap: 24px; }

.param-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
  max-width: 720px;
}

.param-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 600px) { .param-row { grid-template-columns: 1fr; } }

/* ══ Traitement v2 — tooltip remarque ═══════════════════════════════ */

.remarque-tip {
  cursor: help;
  font-size: .85rem;
  margin-left: 4px;
  opacity: .7;
  transition: opacity .15s;
}
.remarque-tip:hover { opacity: 1; }

.tooltip-box {
  display: none;
  position: fixed;
  background: var(--navy);
  color: #fff;
  font-family: var(--sans);
  font-size: .78rem;
  padding: 6px 10px;
  border-radius: 5px;
  max-width: 280px;
  line-height: 1.5;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  pointer-events: none;
  white-space: pre-wrap;
}

.tooltip-box::before {
  content: '';
  position: absolute;
  top: -5px; left: 12px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--navy);
}

/* ══ Edition inline ══════════════════════════════════════════════════ */

.editable:hover {
  background: var(--gold-pale);
  border-radius: 3px;
  outline: 1px dashed var(--gold);
  outline-offset: 2px;
}

/* ══ Dashboard — sections par source ════════════════════════════════ */

.dash-section-label {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  margin-top: 4px;
}

.stat-card-paypal::before  { background: linear-gradient(90deg, #1A56DB, #60A9E0); opacity: .6; }
.stat-card-sg::before      { background: linear-gradient(90deg, #C0392B, #E74C3C); opacity: .5; }
.stat-card-bofa::before    { background: linear-gradient(90deg, #92400E, #D97706); opacity: .5; }

/* ══ Traitement — double scrollbar & résumé ═════════════════════════ */

.scroll-mirror-wrapper { position: relative; }

.scroll-mirror-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 12px;
  margin-bottom: 2px;
}

.scroll-mirror-inner {
  height: 1px;
}

.traitement-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-family: var(--sans);
  font-size: .85rem;
  margin-bottom: 8px;
}

.summary-sep { color: var(--border2); }

.summary-total  { color: var(--text-soft); }
.summary-pending strong { color: var(--orange-fg, #92400E); }
.summary-done   strong { color: var(--green); }

.summary-item strong { font-weight: 700; }

/* ══ Statuts simplifiés & icônes détails ════════════════════════════ */

/* Suppression des anciens badges devenus inutiles */
.state-receipt, .state-printed { 
  background: var(--green-bg); 
  color: var(--green); 
}

/* Icônes détails */
.detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 4px;
  font-size: .82rem;
  cursor: help;
  margin-right: 2px;
}

.detail-icon-mail    { background: #DBEAFE; }
.detail-icon-receipt { background: var(--navy); color: white; font-size: .7rem; }
.detail-icon-print   { background: #F3E8FF; }

/* ══ Résumé inline dans la barre lot-actions ════════════════════════ */
.traitement-summary-inline {
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  margin-left: 8px;
}
.traitement-summary-inline .summary-sep { color: var(--border2); }
.traitement-summary-inline .summary-pending { color: #92400E; }
.traitement-summary-inline .summary-done    { color: var(--green); }

/* ══ Sous-menu sidebar ══════════════════════════════════════════════ */
.nav-group { list-style: none; }

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: default;
  user-select: none;
}
.nav-group-title svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-submenu {
  list-style: none;
  padding: 0;
  margin: 0 0 4px 0;
}

.nav-sublink {
  padding: 7px 16px 7px 38px !important;
  font-size: .8rem !important;
}


/* ══ Page Login / Reset ═════════════════════════════════════════════ */

body.login-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(200,168,75,0.3);
}

.login-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.login-title em { font-style: italic; color: var(--gold); }

.login-sub {
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .04em;
}

.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(17,29,51,0.12);
  width: 100%;
  max-width: 380px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

