/* ============================================================
   Jumping Access v2 — Design system "extension"
   ============================================================ */

* {
  box-sizing: border-box;
}

body.extension {
  background: #f5f7fa;
  font-family:
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    Roboto,
    Arial,
    sans-serif;
  color: #2c3e50;
  margin: 0;
  padding: 0;
  font-size: 14px;
  min-height: 100vh;
}

/* ─── Top nav ─── */
.top-nav {
  background: #2c3e50;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.top-nav-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.top-nav-brand {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-nav-brand .fa {
  color: #f39c12;
}
.top-nav-links {
  flex: 1;
  display: flex;
  gap: 6px;
}
.top-nav-links a {
  color: #ecf0f1;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  transition: background 0.15s;
}
.top-nav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.top-nav-links a.active {
  background: #3498db;
  color: #fff;
}
.top-nav-links .fa {
  margin-right: 4px;
  opacity: 0.85;
}
.top-nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.top-nav-user .user-name {
  color: #fff;
}
.top-nav-user .fa {
  color: #5dade2;
  margin-right: 4px;
}
.badge-role-super_admin {
  background: #e74c3c;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-role-company_admin {
  background: #f39c12;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-role-user {
  background: #95a5a6;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  transition: background 0.15s;
}
.btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ─── Page content ─── */
.page-content {
  padding: 25px 15px;
}

/* ─── Flash messages ─── */
.flash-container {
  max-width: 1600px;
  margin: 0 auto 16px;
}
.flash {
  padding: 12px 18px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 13.5px;
  border-left: 4px solid;
}
.flash-success {
  background: #d4edda;
  color: #155724;
  border-color: #28a745;
}
.flash-error {
  background: #f8d7da;
  color: #721c24;
  border-color: #dc3545;
}
.flash-warning {
  background: #fff3cd;
  color: #856404;
  border-color: #ffc107;
}
.flash-notice {
  background: #d1ecf1;
  color: #0c5460;
  border-color: #17a2b8;
}

/* ─── Main container ─── */
.main-container {
  max-width: 1600px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.header-section {
  background: #2c3e50;
  color: #fff;
  padding: 22px 28px;
}
.header-section h3 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
}
.header-section h3 .fa {
  margin-right: 8px;
  color: #f39c12;
}
.header-section .info-box {
  background: #34495e;
  border-left: 3px solid #3498db;
  padding: 12px 16px;
  border-radius: 4px;
  color: #ecf0f1;
  font-size: 13px;
  line-height: 1.6;
}
.header-section .info-box .fa-info-circle {
  color: #3498db;
  margin-right: 6px;
}
.header-section .info-box a {
  color: #5dade2;
  text-decoration: none;
}
.header-section .info-box a:hover {
  text-decoration: underline;
}
.header-section .info-box code {
  background: rgba(255, 255, 255, 0.15);
  color: #f8c471;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
}

/* ─── Content + sections numérotées ─── */
.content-section {
  padding: 22px 28px;
  background: #fafbfc;
}
.qualification-section {
  background: #fff;
  border: 1px solid #e1e5ea;
  border-radius: 6px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.qualification-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ecf0f1;
  display: flex;
  align-items: center;
}
.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  background: #3498db;
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  margin-right: 12px;
}

/* ─── Form controls ─── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 6px;
}
.form-group label .fa {
  color: #3498db;
  margin-right: 5px;
}

.form-control {
  height: 38px;
  padding: 7px 12px;
  font-size: 13.5px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: #2c3e50;
  width: 100%;
  display: block;
}
.form-control:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}
select.form-control {
  appearance: auto;
  height: 38px;
}

/* ─── Boutons ─── */
.btn {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary {
  background: #3498db;
  color: #fff;
}
.btn-primary:hover {
  background: #2980b9;
  color: #fff;
}
.btn-success {
  background: #27ae60;
  color: #fff;
}
.btn-success:hover {
  background: #229954;
  color: #fff;
}
.btn-warning {
  background: #f39c12;
  color: #fff;
}
.btn-warning:hover {
  background: #d68910;
  color: #fff;
}
.btn-danger {
  background: #e74c3c;
  color: #fff;
}
.btn-danger:hover {
  background: #c0392b;
  color: #fff;
}
.btn-default {
  background: #ecf0f1;
  color: #2c3e50;
  border-color: #bdc3c7;
}
.btn-default:hover {
  background: #d5dbde;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}
.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* ─── Form helpers ─── */
.form-control.has-error {
  border-color: #e74c3c;
  background: #fdedeb;
}
.error-message {
  display: block;
  color: #c0392b;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}
.help-text {
  display: block;
  color: #888;
  font-size: 11.5px;
  margin-top: 5px;
  font-style: italic;
}
.help-text code {
  background: #f4f6f8;
  padding: 1px 5px;
  border-radius: 3px;
  color: #c0392b;
  font-size: 11px;
  font-style: normal;
}
.required {
  color: #e74c3c;
  font-weight: 700;
}
.form-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #ecf0f1;
  display: flex;
  gap: 10px;
}

/* ─── Tables de données ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
.data-table thead {
  background: #2c3e50;
  color: #fff;
}
.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid #2c3e50;
}
.data-table td {
  padding: 10px 12px;
  border: 1px solid #e1e5ea;
  vertical-align: middle;
}
.data-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}
.data-table tbody tr:hover {
  background: #f0f3f7;
}
.data-table tbody tr.row-inactive {
  opacity: 0.55;
  background: #fafafa;
}
.data-table tbody tr.row-inactive:hover {
  opacity: 0.85;
}
.data-table .text-center {
  text-align: center;
}
.data-table .text-right {
  text-align: right;
}
.data-table code {
  background: #f4f6f8;
  color: #c0392b;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11.5px;
}

/* ─── Badges génériques ─── */
.badge-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-state .fa {
  font-size: 7px;
}
.badge-active {
  background: #d4edda;
  color: #155724;
}
.badge-active .fa {
  color: #28a745;
}
.badge-pending {
  background: #fff3cd;
  color: #856404;
}
.badge-pending .fa {
  color: #f39c12;
}
.badge-inactive {
  background: #f8d7da;
  color: #721c24;
}
.badge-inactive .fa {
  color: #dc3545;
}

.badge-country {
  display: inline-block;
  padding: 2px 8px;
  background: #e6f1fb;
  color: #185fa5;
  border: 1px solid #b8d4ed;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ─── Badges source (manual/email/api) ─── */
.badge-source-manual,
.badge-source-email,
.badge-source-api {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-source-manual {
  background: #ecf0f1;
  color: #2c3e50;
  border: 1px solid #bdc3c7;
}
.badge-source-email {
  background: #f4f6f8;
  color: #555;
  border: 1px solid #c0c4c9;
}
.badge-source-api {
  background: #e3edfa;
  color: #1f4e79;
  border: 1px solid #b8c9e0;
}

/* Label pill (catégorie d'épreuve dans la table des semaines) */
.label-pill {
  display: inline-block;
  padding: 3px 10px;
  margin: 2px 3px 2px 0;
  background: #eaf2f9;
  color: #1f4e79;
  border: 1px solid #c8d9e9;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.label-pill small {
  color: #6a8db0;
  font-weight: 500;
}

/* ─── Riders layout (sidebar + tableau) ─── */
.riders-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: flex-start;
  padding: 14px;
  max-width: 100%;
}
.riders-sidebar {
  position: sticky;
  top: 14px;
  background: #fff;
  border: 1px solid #e0e4e9;
  border-radius: 6px;
  padding: 14px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  font-size: 12px;
}
.riders-sidebar h4 {
  font-size: 14px;
  margin: 0 0 6px;
  color: #2c3e50;
  font-weight: 700;
}
.sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
}
.sidebar-section:last-child {
  border-bottom: none;
}
.sidebar-section.sidebar-actions {
  padding-top: 12px;
}
.sidebar-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.sidebar-select {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
}
.sidebar-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.sidebar-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.3;
}
.sidebar-checkbox:hover {
  background: #f5f8fb;
}
.sidebar-checkbox input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}
.sidebar-checkbox .check-label {
  display: flex;
  flex-direction: column;
}
.sidebar-checkbox .check-label small {
  color: #888;
  font-size: 10.5px;
}
.btn-block {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

.riders-main {
  min-width: 0;
}

/* Table récap */
.riders-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid #e0e4e9;
  border-radius: 4px;
}
.riders-recap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  white-space: nowrap;
}
.riders-recap-table th,
.riders-recap-table td {
  padding: 4px 7px;
  border: 1px solid #dfe3e7;
  text-align: center;
}
.riders-recap-table thead th {
  background: #f0f3f6;
  color: #2c3e50;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.riders-recap-table .week-header {
  font-size: 12px;
}
.riders-recap-table .label-header {
  font-weight: 700;
}
.riders-recap-table .subhead {
  font-size: 10px;
  color: #666;
  font-weight: 500;
}
.riders-recap-table .total-header {
  background: #e0e4e9 !important;
}

/* Couleurs alternées par semaine (S1=bleu, S2=vert, S3=jaune, S4=rose, S5=violet) */
.week-color-1 {
  background: #cfe2ff !important;
}
.week-color-2 {
  background: #d1e7dd !important;
}
.week-color-3 {
  background: #fff3cd !important;
}
.week-color-4 {
  background: #f8d7da !important;
}
.week-color-5 {
  background: #e2d6f3 !important;
}
.week-color-6 {
  background: #cfe2ff !important;
}
.week-color-7 {
  background: #d1e7dd !important;
}
.week-color-8 {
  background: #fff3cd !important;
}

/* Lignes alternées */
.rider-row-color-0 {
  background: #ffffff;
}
.rider-row-color-1 {
  background: #f9fbfd;
}
.rider-row:hover {
  background: #fef9e7;
}

/* Cellules tête de ligne (cavalier) */
.cell-nation,
.cell-name,
.cell-firstname,
.cell-label,
.cell-weeks {
  text-align: center !important;
  padding-left: 8px !important;
}
.cell-name {
  font-weight: 700;
  color: #2c3e50;
}
.cell-num {
  width: 38px;
}
.cell-total {
  background: #e9ecef !important;
  font-weight: 700;
}

/* Cellule modifiée (retrait/substitution) */
.has-change {
  background-color: #fff3cd !important;
  color: #856404;
}
.has-change:hover {
  background-color: #ffe69c !important;
}

/* Cellule "ajout NF en attente" (cavalier ajouté mais sans cheval encore) */
.cell-pending {
  background-color: #e0f0ff !important;
  color: #1f4e79;
}
.cell-pending:hover {
  background-color: #c5e0fa !important;
}
.cell-pending-mark {
  font-size: 14px;
  font-weight: 700;
  color: #1f4e79;
  letter-spacing: -1px;
}

/* Notes */
.cell-note {
  font-size: 10.5px !important;
  color: #b35900;
  max-width: 280px;
  white-space: normal !important;
  text-align: left !important;
}
.note-warning {
  font-weight: 700;
  margin-right: 3px;
}

/* Totals row */
.totals-row th {
  background: #2c3e50 !important;
  color: #fff !important;
  font-weight: 700;
}

/* Colonnes fixes */
.col-nation {
  width: 56px;
}
.col-name {
  width: 130px;
}
.col-firstname {
  width: 110px;
}
.col-note {
  width: 220px;
}
.col-label {
  width: 70px;
}
.col-weeks {
  width: 70px;
}

/* Cartes de sélection de show */
.show-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.show-card {
  display: block;
  padding: 16px;
  background: #fff;
  border: 1px solid #d8dde2;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.show-card:hover {
  border-color: #3498db;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.15);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}
.show-card-year {
  font-size: 11px;
  color: #888;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.show-card-name {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin: 4px 0;
}
.show-card-venue {
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}
.show-card-company {
  font-size: 11px;
  color: #888;
  margin-bottom: 8px;
  font-style: italic;
}
.show-card-action {
  font-size: 11px;
  color: #3498db;
  font-weight: 700;
  margin-top: 8px;
}

/* ─── Cellules cliquables ─── */
.cell-clickable {
  cursor: pointer;
  position: relative;
  transition: background 0.1s ease;
}
.cell-clickable:hover {
  background: #e8f4fd !important;
  box-shadow: inset 0 0 0 1px #3498db;
}
.cell-clickable.has-change:hover {
  background: #ffe69c !important;
}

/* Dot rouge sur events non acquittés */
.unacked-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  background: #dc3545;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  padding: 0 3px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ─── Drawer latérale ─── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.rider-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 540px;
  max-width: 100vw;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 9001;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.rider-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px;
  background: #2c3e50;
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.drawer-title-wrap {
  flex: 1;
  min-width: 0;
}
.drawer-header h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-subtitle {
  font-size: 12px;
  color: #bdc3c7;
}
.drawer-close {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
}
.drawer-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
}

.drawer-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #f5f8fb;
  border-radius: 5px;
  margin-bottom: 14px;
  font-size: 12px;
}
.drawer-stat {
  color: #555;
}
.drawer-stat strong {
  color: #2c3e50;
  font-size: 14px;
}
.drawer-stat-pending strong {
  color: #b35900;
}
.drawer-stat-acked strong {
  color: #1f6e2e;
}

.drawer-loading,
.drawer-error,
.drawer-empty {
  padding: 20px;
  text-align: center;
  color: #777;
  font-size: 13px;
}
.drawer-error {
  color: #c0392b;
  background: #fdecea;
  border-radius: 4px;
}

.drawer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e1e5ea;
  margin-bottom: 10px;
  font-size: 12px;
}
.drawer-select-all {
  cursor: pointer;
  color: #555;
}
.drawer-select-all input {
  margin-right: 5px;
  vertical-align: middle;
}
.drawer-selected-count {
  color: #3498db;
  font-weight: 600;
}

.drawer-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-row {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e1e5ea;
  border-radius: 5px;
  font-size: 12.5px;
}
.event-row.event-acked {
  background: #f6faf6;
  border-color: #c8e0c8;
  opacity: 0.85;
}
.event-row:hover:not(.event-acked) {
  border-color: #3498db;
  background: #f5fbff;
}

.event-check {
  flex-shrink: 0;
  padding-top: 2px;
}
.event-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.event-acked-icon {
  color: #28a745;
  font-size: 16px;
}

.event-main {
  flex: 1;
  min-width: 0;
}
.event-line1 {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 11.5px;
}
.event-action {
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
}
.action-accept {
  background: #d4edda;
  color: #155724;
}
.action-withdraw {
  background: #f8d7da;
  color: #721c24;
}
.action-other {
  background: #e2e3e5;
  color: #383d41;
}

.event-date {
  color: #777;
}
.event-perf {
  color: #888;
  font-style: italic;
}
.event-line2 {
  font-size: 13px;
  color: #2c3e50;
}
.event-desc {
  margin-top: 5px;
  color: #666;
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.4;
}
.event-acked-info {
  margin-top: 5px;
  font-size: 10.5px;
  color: #1f6e2e;
}

.drawer-footer {
  padding: 12px 20px;
  border-top: 1px solid #e1e5ea;
  background: #fafbfc;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── Section title avec action à droite ─── */
.section-title {
  display: flex;
  align-items: center;
}

/* ─── Login page ─── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  max-width: 520px;
  width: 100%;
}
.login-footer {
  background: #f8f9fa;
  padding: 14px 20px;
  text-align: center;
  color: #777;
  font-size: 12px;
  border-top: 1px solid #e1e5ea;
}

/* ─── Dashboard ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.stat-card {
  padding: 18px 20px;
  border-radius: 8px;
  border: 1px solid #e1e5ea;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 8px;
}
.stat-card .stat-label {
  font-size: 12px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stat-card .stat-label .fa {
  color: #3498db;
  margin-right: 4px;
}
.stat-purple {
  background: #f3eaff;
  border-color: #d1baf0;
}
.stat-purple .stat-value {
  color: #533397;
}
.stat-blue {
  background: #e3edfa;
  border-color: #b8c9e0;
}
.stat-blue .stat-value {
  color: #1f4e79;
}
.stat-teal {
  background: #e1f0e6;
  border-color: #b4d4be;
}
.stat-teal .stat-value {
  color: #0f6e56;
}
.stat-amber {
  background: #fff3cd;
  border-color: #e0c66a;
}
.stat-amber .stat-value {
  color: #856404;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e1e5ea;
  border-radius: 6px;
  text-decoration: none;
  color: #2c3e50;
  font-size: 13.5px;
  transition: all 0.15s;
}
.quick-action:hover {
  border-color: #3498db;
  background: #f3f9fe;
  color: #1f4e79;
}
.quick-action .fa {
  font-size: 22px;
  color: #3498db;
}
/* Drapeau inline (dans un titre/sous-titre, format réduit) */
.flag-inline {
  display: inline-block;
  width: 18px;
  height: 13.5px;
  background-size: cover;
  background-position: 50%;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  vertical-align: 0px;
  margin-left: 4px;
}
h3 .flag-inline {
  vertical-align: middle;
  margin-bottom: 2px; /* ajuste optique selon la font */
}

/* V5.x : drapeau neutre (codes FEI AIN/NI2/NPA/RPC) — carre blanc bord gris */
.fi.fi-neutral {
  background-color: #fff !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1px #bbb;
}
.header-section h3 .horse-icon {
    width: 1.5em;
    height: 1.5em;
    vertical-align: -0.18em;
    margin-right: .35em;
    color:#e67e22;
}
.horse-icon-top {
    width: 1.5em;
    height: 1.5em;
    vertical-align: -0.50em;
    margin-right: .35em;
}